From 3efd3be6dbb10a2e35a38ae403db349af594bfbf Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Wed, 11 Apr 2018 16:46:32 +0200 Subject: [PATCH] Adopt TS 2.8.1 --- package-lock.json | 8 +- package.json | 2 +- src/lib/lib-es6-ts.ts | 2 +- src/lib/lib-ts.ts | 2 +- src/lib/typescriptServices-amd.js | 22309 +++++++++++++++------------- src/lib/typescriptServices.d.ts | 587 +- src/lib/typescriptServices.js | 22309 +++++++++++++++------------- 7 files changed, 24452 insertions(+), 20767 deletions(-) diff --git a/package-lock.json b/package-lock.json index 582acfc6..d1a561b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -138,7 +138,7 @@ "integrity": "sha512-7kUx8dtd5qVNVgUARBRhnM8oftPglYwlINfigC4yGUiuzqtIN22u1tly8umiOCIPR0eFiBLjt6aN23oZh2QJgg==", "dev": true, "requires": { - "typescript": "2.7.2" + "typescript": "2.8.1" } }, "ms": { @@ -178,9 +178,9 @@ "dev": true }, "typescript": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", - "integrity": "sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.1.tgz", + "integrity": "sha512-Ao/f6d/4EPLq0YwzsQz8iXflezpTkQzqAyenTiw4kCUGr1uPiFLC3+fZ+gMZz6eeI/qdRUqvC+HxIJzUAzEFdg==", "dev": true }, "uglify-js": { diff --git a/package.json b/package.json index 6900edaa..591485a9 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "monaco-editor-core": "0.12.0", "monaco-plugin-helpers": "^1.0.2", "requirejs": "^2.3.5", - "typescript": "2.7.2", + "typescript": "2.8.1", "uglify-js": "^3.3.14" } } diff --git a/src/lib/lib-es6-ts.ts b/src/lib/lib-es6-ts.ts index 5d8de71e..02b68e27 100644 --- a/src/lib/lib-es6-ts.ts +++ b/src/lib/lib-es6-ts.ts @@ -3,4 +3,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export const contents = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n\n/////////////////////////////\n/// ECMAScript APIs\n/////////////////////////////\n\ndeclare const NaN: number;\ndeclare const Infinity: number;\n\n/**\n * Evaluates JavaScript code and executes it.\n * @param x A String value that contains valid JavaScript code.\n */\ndeclare function eval(x: string): any;\n\n/**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\ndeclare function parseInt(s: string, radix?: number): number;\n\n/**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\ndeclare function parseFloat(string: string): number;\n\n/**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\n * @param number A numeric value.\n */\ndeclare function isNaN(number: number): boolean;\n\n/**\n * Determines whether a supplied number is finite.\n * @param number Any numeric value.\n */\ndeclare function isFinite(number: number): boolean;\n\n/**\n * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\n * @param encodedURI A value representing an encoded URI.\n */\ndeclare function decodeURI(encodedURI: string): string;\n\n/**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n * @param encodedURIComponent A value representing an encoded URI component.\n */\ndeclare function decodeURIComponent(encodedURIComponent: string): string;\n\n/**\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\n * @param uri A value representing an encoded URI.\n */\ndeclare function encodeURI(uri: string): string;\n\n/**\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\n * @param uriComponent A value representing an encoded URI component.\n */\ndeclare function encodeURIComponent(uriComponent: string): string;\n\n/**\n * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\n * @param string A string value\n */\ndeclare function escape(string: string): string;\n\n/**\n * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\n * @param string A string value\n */\ndeclare function unescape(string: string): string;\n\ninterface PropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n value?: any;\n writable?: boolean;\n get?(): any;\n set?(v: any): void;\n}\n\ninterface PropertyDescriptorMap {\n [s: string]: PropertyDescriptor;\n}\n\ninterface Object {\n /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\n constructor: Function;\n\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns a date converted to a string using the current locale. */\n toLocaleString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): Object;\n\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: string): boolean;\n\n /**\n * Determines whether an object exists in another object's prototype chain.\n * @param v Another object whose prototype chain is to be checked.\n */\n isPrototypeOf(v: Object): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: string): boolean;\n}\n\ninterface ObjectConstructor {\n new(value?: any): Object;\n (): any;\n (value: any): any;\n\n /** A reference to the prototype for a class of objects. */\n readonly prototype: Object;\n\n /**\n * Returns the prototype of an object.\n * @param o The object that references the prototype.\n */\n getPrototypeOf(o: any): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor | undefined;\n\n /**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\n getOwnPropertyNames(o: any): string[];\n\n /**\n * Creates an object that has the specified prototype or that has null prototype.\n * @param o Object to use as a prototype. May be null.\n */\n create(o: object | null): any;\n\n /**\n * Creates an object that has the specified prototype, and that optionally contains specified properties.\n * @param o Object to use as a prototype. May be null\n * @param properties JavaScript object that contains one or more property descriptors.\n */\n create(o: object | null, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\n */\n defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any;\n\n /**\n * Adds one or more properties to an object, and/or modifies attributes of existing properties.\n * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\n * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\n */\n defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n seal(o: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(a: T[]): ReadonlyArray;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(f: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(o: T): Readonly;\n\n /**\n * Prevents the addition of new properties to an object.\n * @param o Object to make non-extensible.\n */\n preventExtensions(o: T): T;\n\n /**\n * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isSealed(o: any): boolean;\n\n /**\n * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isFrozen(o: any): boolean;\n\n /**\n * Returns a value that indicates whether new properties can be added to an object.\n * @param o Object to test.\n */\n isExtensible(o: any): boolean;\n\n /**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n keys(o: {}): string[];\n}\n\n/**\n * Provides functionality common to all JavaScript objects.\n */\ndeclare const Object: ObjectConstructor;\n\n/**\n * Creates a new function.\n */\ninterface Function {\n /**\n * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\n * @param thisArg The object to be used as the this object.\n * @param argArray A set of arguments to be passed to the function.\n */\n apply(this: Function, thisArg: any, argArray?: any): any;\n\n /**\n * Calls a method of an object, substituting another object for the current object.\n * @param thisArg The object to be used as the current object.\n * @param argArray A list of arguments to be passed to the method.\n */\n call(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg An object to which the this keyword can refer inside the new function.\n * @param argArray A list of arguments to be passed to the new function.\n */\n bind(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /** Returns a string representation of a function. */\n toString(): string;\n\n prototype: any;\n readonly length: number;\n\n // Non-standard extensions\n arguments: any;\n caller: Function;\n}\n\ninterface FunctionConstructor {\n /**\n * Creates a new function.\n * @param args A list of arguments the function accepts.\n */\n new(...args: string[]): Function;\n (...args: string[]): Function;\n readonly prototype: Function;\n}\n\ndeclare const Function: FunctionConstructor;\n\ninterface IArguments {\n [index: number]: any;\n length: number;\n callee: Function;\n}\n\ninterface String {\n /** Returns a string representation of a string. */\n toString(): string;\n\n /**\n * Returns the character at the specified index.\n * @param pos The zero-based index of the desired character.\n */\n charAt(pos: number): string;\n\n /**\n * Returns the Unicode value of the character at the specified location.\n * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\n */\n charCodeAt(index: number): number;\n\n /**\n * Returns a string that contains the concatenation of two or more strings.\n * @param strings The strings to append to the end of the string.\n */\n concat(...strings: string[]): string;\n\n /**\n * Returns the position of the first occurrence of a substring.\n * @param searchString The substring to search for in the string\n * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\n */\n indexOf(searchString: string, position?: number): number;\n\n /**\n * Returns the last occurrence of a substring in the string.\n * @param searchString The substring to search for.\n * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\n */\n lastIndexOf(searchString: string, position?: number): number;\n\n /**\n * Determines whether two strings are equivalent in the current locale.\n * @param that String to compare to target string\n */\n localeCompare(that: string): number;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A variable name or string literal containing the regular expression pattern and flags.\n */\n match(regexp: string | RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string | RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param regexp The regular expression pattern and applicable flags.\n */\n search(regexp: string | RegExp): number;\n\n /**\n * Returns a section of a string.\n * @param start The index to the beginning of the specified portion of stringObj.\n * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\n * If this value is not specified, the substring continues to the end of stringObj.\n */\n slice(start?: number, end?: number): string;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(separator: string | RegExp, limit?: number): string[];\n\n /**\n * Returns the substring at the specified location within a String object.\n * @param start The zero-based index number indicating the beginning of the substring.\n * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\n * If end is omitted, the characters from start through the end of the original string are returned.\n */\n substring(start: number, end?: number): string;\n\n /** Converts all the alphabetic characters in a string to lowercase. */\n toLowerCase(): string;\n\n /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\n toLocaleLowerCase(): string;\n\n /** Converts all the alphabetic characters in a string to uppercase. */\n toUpperCase(): string;\n\n /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\n toLocaleUpperCase(): string;\n\n /** Removes the leading and trailing white space and line terminator characters from a string. */\n trim(): string;\n\n /** Returns the length of a String object. */\n readonly length: number;\n\n // IE extensions\n /**\n * Gets a substring beginning at the specified location and having the specified length.\n * @param from The starting position of the desired substring. The index of the first character in the string is zero.\n * @param length The number of characters to include in the returned substring.\n */\n substr(from: number, length?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): string;\n\n readonly [index: number]: string;\n}\n\ninterface StringConstructor {\n new(value?: any): String;\n (value?: any): string;\n readonly prototype: String;\n fromCharCode(...codes: number[]): string;\n}\n\n/**\n * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\n */\ndeclare const String: StringConstructor;\n\ninterface Boolean {\n /** Returns the primitive value of the specified object. */\n valueOf(): boolean;\n}\n\ninterface BooleanConstructor {\n new(value?: any): Boolean;\n (value?: any): boolean;\n readonly prototype: Boolean;\n}\n\ndeclare const Boolean: BooleanConstructor;\n\ninterface Number {\n /**\n * Returns a string representation of an object.\n * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\n */\n toString(radix?: number): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toFixed(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toExponential(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\n */\n toPrecision(precision?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): number;\n}\n\ninterface NumberConstructor {\n new(value?: any): Number;\n (value?: any): number;\n readonly prototype: Number;\n\n /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\n readonly MAX_VALUE: number;\n\n /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\n readonly MIN_VALUE: number;\n\n /**\n * A value that is not a number.\n * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\n */\n readonly NaN: number;\n\n /**\n * A value that is less than the largest negative number that can be represented in JavaScript.\n * JavaScript displays NEGATIVE_INFINITY values as -infinity.\n */\n readonly NEGATIVE_INFINITY: number;\n\n /**\n * A value greater than the largest number that can be represented in JavaScript.\n * JavaScript displays POSITIVE_INFINITY values as infinity.\n */\n readonly POSITIVE_INFINITY: number;\n}\n\n/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\ndeclare const Number: NumberConstructor;\n\ninterface TemplateStringsArray extends ReadonlyArray {\n readonly raw: ReadonlyArray;\n}\n\ninterface Math {\n /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\n readonly E: number;\n /** The natural logarithm of 10. */\n readonly LN10: number;\n /** The natural logarithm of 2. */\n readonly LN2: number;\n /** The base-2 logarithm of e. */\n readonly LOG2E: number;\n /** The base-10 logarithm of e. */\n readonly LOG10E: number;\n /** Pi. This is the ratio of the circumference of a circle to its diameter. */\n readonly PI: number;\n /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\n readonly SQRT1_2: number;\n /** The square root of 2. */\n readonly SQRT2: number;\n /**\n * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\n * For example, the absolute value of -5 is the same as the absolute value of 5.\n * @param x A numeric expression for which the absolute value is needed.\n */\n abs(x: number): number;\n /**\n * Returns the arc cosine (or inverse cosine) of a number.\n * @param x A numeric expression.\n */\n acos(x: number): number;\n /**\n * Returns the arcsine of a number.\n * @param x A numeric expression.\n */\n asin(x: number): number;\n /**\n * Returns the arctangent of a number.\n * @param x A numeric expression for which the arctangent is needed.\n */\n atan(x: number): number;\n /**\n * Returns the angle (in radians) from the X axis to a point.\n * @param y A numeric expression representing the cartesian y-coordinate.\n * @param x A numeric expression representing the cartesian x-coordinate.\n */\n atan2(y: number, x: number): number;\n /**\n * Returns the smallest integer greater than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n ceil(x: number): number;\n /**\n * Returns the cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cos(x: number): number;\n /**\n * Returns e (the base of natural logarithms) raised to a power.\n * @param x A numeric expression representing the power of e.\n */\n exp(x: number): number;\n /**\n * Returns the greatest integer less than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n floor(x: number): number;\n /**\n * Returns the natural logarithm (base e) of a number.\n * @param x A numeric expression.\n */\n log(x: number): number;\n /**\n * Returns the larger of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n max(...values: number[]): number;\n /**\n * Returns the smaller of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n min(...values: number[]): number;\n /**\n * Returns the value of a base expression taken to a specified power.\n * @param x The base value of the expression.\n * @param y The exponent value of the expression.\n */\n pow(x: number, y: number): number;\n /** Returns a pseudorandom number between 0 and 1. */\n random(): number;\n /**\n * Returns a supplied numeric expression rounded to the nearest number.\n * @param x The value to be rounded to the nearest number.\n */\n round(x: number): number;\n /**\n * Returns the sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sin(x: number): number;\n /**\n * Returns the square root of a number.\n * @param x A numeric expression.\n */\n sqrt(x: number): number;\n /**\n * Returns the tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tan(x: number): number;\n}\n/** An intrinsic object that provides basic mathematics functionality and constants. */\ndeclare const Math: Math;\n\n/** Enables basic storage and retrieval of dates and times. */\ninterface Date {\n /** Returns a string representation of a date. The format of the string depends on the locale. */\n toString(): string;\n /** Returns a date as a string value. */\n toDateString(): string;\n /** Returns a time as a string value. */\n toTimeString(): string;\n /** Returns a value as a string value appropriate to the host environment's current locale. */\n toLocaleString(): string;\n /** Returns a date as a string value appropriate to the host environment's current locale. */\n toLocaleDateString(): string;\n /** Returns a time as a string value appropriate to the host environment's current locale. */\n toLocaleTimeString(): string;\n /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\n valueOf(): number;\n /** Gets the time value in milliseconds. */\n getTime(): number;\n /** Gets the year, using local time. */\n getFullYear(): number;\n /** Gets the year using Universal Coordinated Time (UTC). */\n getUTCFullYear(): number;\n /** Gets the month, using local time. */\n getMonth(): number;\n /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\n getUTCMonth(): number;\n /** Gets the day-of-the-month, using local time. */\n getDate(): number;\n /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\n getUTCDate(): number;\n /** Gets the day of the week, using local time. */\n getDay(): number;\n /** Gets the day of the week using Universal Coordinated Time (UTC). */\n getUTCDay(): number;\n /** Gets the hours in a date, using local time. */\n getHours(): number;\n /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\n getUTCHours(): number;\n /** Gets the minutes of a Date object, using local time. */\n getMinutes(): number;\n /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\n getUTCMinutes(): number;\n /** Gets the seconds of a Date object, using local time. */\n getSeconds(): number;\n /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCSeconds(): number;\n /** Gets the milliseconds of a Date, using local time. */\n getMilliseconds(): number;\n /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCMilliseconds(): number;\n /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\n getTimezoneOffset(): number;\n /**\n * Sets the date and time value in the Date object.\n * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\n */\n setTime(time: number): number;\n /**\n * Sets the milliseconds value in the Date object using local time.\n * @param ms A numeric value equal to the millisecond value.\n */\n setMilliseconds(ms: number): number;\n /**\n * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\n * @param ms A numeric value equal to the millisecond value.\n */\n setUTCMilliseconds(ms: number): number;\n\n /**\n * Sets the seconds value in the Date object using local time.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setSeconds(sec: number, ms?: number): number;\n /**\n * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCSeconds(sec: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using local time.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the hour value in the Date object using local time.\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the numeric day-of-the-month value of the Date object using local time.\n * @param date A numeric value equal to the day of the month.\n */\n setDate(date: number): number;\n /**\n * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\n * @param date A numeric value equal to the day of the month.\n */\n setUTCDate(date: number): number;\n /**\n * Sets the month value in the Date object using local time.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\n */\n setMonth(month: number, date?: number): number;\n /**\n * Sets the month value in the Date object using Universal Coordinated Time (UTC).\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\n */\n setUTCMonth(month: number, date?: number): number;\n /**\n * Sets the year of the Date object using local time.\n * @param year A numeric value for the year.\n * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\n * @param date A numeric value equal for the day of the month.\n */\n setFullYear(year: number, month?: number, date?: number): number;\n /**\n * Sets the year value in the Date object using Universal Coordinated Time (UTC).\n * @param year A numeric value equal to the year.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\n * @param date A numeric value equal to the day of the month.\n */\n setUTCFullYear(year: number, month?: number, date?: number): number;\n /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\n toUTCString(): string;\n /** Returns a date as a string value in ISO format. */\n toISOString(): string;\n /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\n toJSON(key?: any): string;\n}\n\ninterface DateConstructor {\n new(): Date;\n new(value: number): Date;\n new(value: string): Date;\n new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\n (): string;\n readonly prototype: Date;\n /**\n * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\n * @param s A date string\n */\n parse(s: string): number;\n /**\n * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\n * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as an number between 0 and 11 (January to December).\n * @param date The date as an number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.\n * @param ms An number from 0 to 999 that specifies the milliseconds.\n */\n UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\n now(): number;\n}\n\ndeclare const Date: DateConstructor;\n\ninterface RegExpMatchArray extends Array {\n index?: number;\n input?: string;\n}\n\ninterface RegExpExecArray extends Array {\n index: number;\n input: string;\n}\n\ninterface RegExp {\n /**\n * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\n * @param string The String object or string literal on which to perform the search.\n */\n exec(string: string): RegExpExecArray | null;\n\n /**\n * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\n * @param string String on which to perform the search.\n */\n test(string: string): boolean;\n\n /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\n readonly source: string;\n\n /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\n readonly global: boolean;\n\n /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\n readonly ignoreCase: boolean;\n\n /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\n readonly multiline: boolean;\n\n lastIndex: number;\n\n // Non-standard extensions\n compile(): this;\n}\n\ninterface RegExpConstructor {\n new(pattern: RegExp | string): RegExp;\n new(pattern: string, flags?: string): RegExp;\n (pattern: RegExp | string): RegExp;\n (pattern: string, flags?: string): RegExp;\n readonly prototype: RegExp;\n\n // Non-standard extensions\n $1: string;\n $2: string;\n $3: string;\n $4: string;\n $5: string;\n $6: string;\n $7: string;\n $8: string;\n $9: string;\n lastMatch: string;\n}\n\ndeclare const RegExp: RegExpConstructor;\n\ninterface Error {\n name: string;\n message: string;\n stack?: string;\n}\n\ninterface ErrorConstructor {\n new(message?: string): Error;\n (message?: string): Error;\n readonly prototype: Error;\n}\n\ndeclare const Error: ErrorConstructor;\n\ninterface EvalError extends Error {\n}\n\ninterface EvalErrorConstructor {\n new(message?: string): EvalError;\n (message?: string): EvalError;\n readonly prototype: EvalError;\n}\n\ndeclare const EvalError: EvalErrorConstructor;\n\ninterface RangeError extends Error {\n}\n\ninterface RangeErrorConstructor {\n new(message?: string): RangeError;\n (message?: string): RangeError;\n readonly prototype: RangeError;\n}\n\ndeclare const RangeError: RangeErrorConstructor;\n\ninterface ReferenceError extends Error {\n}\n\ninterface ReferenceErrorConstructor {\n new(message?: string): ReferenceError;\n (message?: string): ReferenceError;\n readonly prototype: ReferenceError;\n}\n\ndeclare const ReferenceError: ReferenceErrorConstructor;\n\ninterface SyntaxError extends Error {\n}\n\ninterface SyntaxErrorConstructor {\n new(message?: string): SyntaxError;\n (message?: string): SyntaxError;\n readonly prototype: SyntaxError;\n}\n\ndeclare const SyntaxError: SyntaxErrorConstructor;\n\ninterface TypeError extends Error {\n}\n\ninterface TypeErrorConstructor {\n new(message?: string): TypeError;\n (message?: string): TypeError;\n readonly prototype: TypeError;\n}\n\ndeclare const TypeError: TypeErrorConstructor;\n\ninterface URIError extends Error {\n}\n\ninterface URIErrorConstructor {\n new(message?: string): URIError;\n (message?: string): URIError;\n readonly prototype: URIError;\n}\n\ndeclare const URIError: URIErrorConstructor;\n\ninterface JSON {\n /**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n * @param text A valid JSON string.\n * @param reviver A function that transforms the results. This function is called for each member of the object.\n * If a member contains nested objects, the nested objects are transformed before the parent object is.\n */\n parse(text: string, reviver?: (key: any, value: any) => any): any;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\n}\n\n/**\n * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\n */\ndeclare const JSON: JSON;\n\n\n/////////////////////////////\n/// ECMAScript Array API (specially handled by compiler)\n/////////////////////////////\n\ninterface ReadonlyArray {\n /**\n * Gets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n readonly length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n\n readonly [n: number]: T;\n}\n\ninterface ConcatArray {\n readonly length: number;\n readonly [n: number]: T;\n join(separator?: string): string;\n slice(start?: number, end?: number): T[];\n}\n\ninterface Array {\n /**\n * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Appends new elements to an array, and returns the new length of the array.\n * @param items New elements of the Array.\n */\n push(...items: T[]): number;\n /**\n * Removes the last element from an array and returns it.\n */\n pop(): T | undefined;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Reverses the elements in an Array.\n */\n reverse(): T[];\n /**\n * Removes the first element from an array and returns it.\n */\n shift(): T | undefined;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: T, b: T) => number): this;\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n */\n splice(start: number, deleteCount?: number): T[];\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @param items Elements to insert into the array in place of the deleted elements.\n */\n splice(start: number, deleteCount: number, ...items: T[]): T[];\n /**\n * Inserts new elements at the start of an array.\n * @param items Elements to insert at the start of the Array.\n */\n unshift(...items: T[]): number;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n\n [n: number]: T;\n}\n\ninterface ArrayConstructor {\n new(arrayLength?: number): any[];\n new (arrayLength: number): T[];\n new (...items: T[]): T[];\n (arrayLength?: number): any[];\n (arrayLength: number): T[];\n (...items: T[]): T[];\n isArray(arg: any): arg is Array;\n readonly prototype: Array;\n}\n\ndeclare const Array: ArrayConstructor;\n\ninterface TypedPropertyDescriptor {\n enumerable?: boolean;\n configurable?: boolean;\n writable?: boolean;\n value?: T;\n get?: () => T;\n set?: (value: T) => void;\n}\n\ndeclare type ClassDecorator = (target: TFunction) => TFunction | void;\ndeclare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\ndeclare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;\ndeclare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\n\ndeclare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike;\n\ninterface PromiseLike {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike;\n}\n\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}\n\ninterface ArrayLike {\n readonly length: number;\n readonly [n: number]: T;\n}\n\n/**\n * Make all properties in T optional\n */\ntype Partial = {\n [P in keyof T]?: T[P];\n};\n\n/**\n * Make all properties in T readonly\n */\ntype Readonly = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * From T pick a set of properties K\n */\ntype Pick = {\n [P in K]: T[P];\n};\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype Record = {\n [P in K]: T;\n};\n\n/**\n * Marker for contextual 'this' type\n */\ninterface ThisType { }\n\n/**\n * Represents a raw buffer of binary data, which is used to store data for the\n * different typed arrays. ArrayBuffers cannot be read from or written to directly,\n * but can be passed to a typed array or DataView Object to interpret the raw\n * buffer as needed.\n */\ninterface ArrayBuffer {\n /**\n * Read-only. The length of the ArrayBuffer (in bytes).\n */\n readonly byteLength: number;\n\n /**\n * Returns a section of an ArrayBuffer.\n */\n slice(begin: number, end?: number): ArrayBuffer;\n}\n\n/**\n * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\n */\ninterface ArrayBufferTypes {\n ArrayBuffer: ArrayBuffer;\n}\ntype ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\n\ninterface ArrayBufferConstructor {\n readonly prototype: ArrayBuffer;\n new(byteLength: number): ArrayBuffer;\n isView(arg: any): arg is ArrayBufferView;\n}\ndeclare const ArrayBuffer: ArrayBufferConstructor;\n\ninterface ArrayBufferView {\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n byteOffset: number;\n}\n\ninterface DataView {\n readonly buffer: ArrayBuffer;\n readonly byteLength: number;\n readonly byteOffset: number;\n /**\n * Gets the Float32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Float64 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat64(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Int8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt8(byteOffset: number): number;\n\n /**\n * Gets the Int16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt16(byteOffset: number, littleEndian?: boolean): number;\n /**\n * Gets the Int32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint8(byteOffset: number): number;\n\n /**\n * Gets the Uint16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Float64 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setInt8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Int16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setUint8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Uint16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n\ninterface DataViewConstructor {\n new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\n}\ndeclare const DataView: DataViewConstructor;\n\n/**\n * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Int8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\ninterface Int8ArrayConstructor {\n readonly prototype: Int8Array;\n new(length: number): Int8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\n\n\n}\ndeclare const Int8Array: Int8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ArrayConstructor {\n readonly prototype: Uint8Array;\n new(length: number): Uint8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\n\n}\ndeclare const Uint8Array: Uint8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\n * If the requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8ClampedArray {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8ClampedArray;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8ClampedArray;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8ClampedArray;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ClampedArrayConstructor {\n readonly prototype: Uint8ClampedArray;\n new(length: number): Uint8ClampedArray;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8ClampedArray;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\ndeclare const Uint8ClampedArray: Uint8ClampedArrayConstructor;\n\n/**\n * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int16ArrayConstructor {\n readonly prototype: Int16Array;\n new(length: number): Int16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\n\n\n}\ndeclare const Int16Array: Int16ArrayConstructor;\n\n/**\n * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint16ArrayConstructor {\n readonly prototype: Uint16Array;\n new(length: number): Uint16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\n\n\n}\ndeclare const Uint16Array: Uint16ArrayConstructor;\n/**\n * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int32ArrayConstructor {\n readonly prototype: Int32Array;\n new(length: number): Int32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\n\n}\ndeclare const Int32Array: Int32ArrayConstructor;\n\n/**\n * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint32ArrayConstructor {\n readonly prototype: Uint32Array;\n new(length: number): Uint32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\n\n}\ndeclare const Uint32Array: Uint32ArrayConstructor;\n\n/**\n * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float32ArrayConstructor {\n readonly prototype: Float32Array;\n new(length: number): Float32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\n\n\n}\ndeclare const Float32Array: Float32ArrayConstructor;\n\n/**\n * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Float64Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float64Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float64Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float64Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float64ArrayConstructor {\n readonly prototype: Float64Array;\n new(length: number): Float64Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\n\n}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare namespace Intl {\n interface CollatorOptions {\n usage?: string;\n localeMatcher?: string;\n numeric?: boolean;\n caseFirst?: string;\n sensitivity?: string;\n ignorePunctuation?: boolean;\n }\n\n interface ResolvedCollatorOptions {\n locale: string;\n usage: string;\n sensitivity: string;\n ignorePunctuation: boolean;\n collation: string;\n caseFirst: string;\n numeric: boolean;\n }\n\n interface Collator {\n compare(x: string, y: string): number;\n resolvedOptions(): ResolvedCollatorOptions;\n }\n var Collator: {\n new(locales?: string | string[], options?: CollatorOptions): Collator;\n (locales?: string | string[], options?: CollatorOptions): Collator;\n supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\n };\n\n interface NumberFormatOptions {\n localeMatcher?: string;\n style?: string;\n currency?: string;\n currencyDisplay?: string;\n useGrouping?: boolean;\n minimumIntegerDigits?: number;\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n }\n\n interface ResolvedNumberFormatOptions {\n locale: string;\n numberingSystem: string;\n style: string;\n currency?: string;\n currencyDisplay?: string;\n minimumIntegerDigits: number;\n minimumFractionDigits: number;\n maximumFractionDigits: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n useGrouping: boolean;\n }\n\n interface NumberFormat {\n format(value: number): string;\n resolvedOptions(): ResolvedNumberFormatOptions;\n }\n var NumberFormat: {\n new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\n };\n\n interface DateTimeFormatOptions {\n localeMatcher?: string;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n formatMatcher?: string;\n hour12?: boolean;\n timeZone?: string;\n }\n\n interface ResolvedDateTimeFormatOptions {\n locale: string;\n calendar: string;\n numberingSystem: string;\n timeZone: string;\n hour12?: boolean;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n }\n\n interface DateTimeFormat {\n format(date?: Date | number): string;\n resolvedOptions(): ResolvedDateTimeFormatOptions;\n }\n var DateTimeFormat: {\n new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\n };\n}\n\ninterface String {\n /**\n * Determines whether two strings are equivalent in the current or specified locale.\n * @param that String to compare to target string\n * @param locales A locale string or array of locale strings 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. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\n */\n localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\n}\n\ninterface Number {\n /**\n * Converts a number to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n}\n\ninterface Date {\n /**\n * Converts a date and time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n /**\n * Converts a date to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n\n /**\n * Converts a time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n}\n\n\ndeclare type PropertyKey = string | number | symbol;\n\ninterface Array {\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;\n find(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): number;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: T, start?: number, end?: number): this;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n}\n\ninterface ArrayConstructor {\n /**\n * Creates an array from an array-like object.\n * @param arrayLike An array-like object to convert to an array.\n */\n from(arrayLike: ArrayLike): T[];\n\n /**\n * Creates an array from an iterable object.\n * @param arrayLike An array-like object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[];\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: T[]): T[];\n}\n\ninterface DateConstructor {\n new (value: Date): Date;\n}\n\ninterface Function {\n /**\n * Returns the name of the function. Function names are read-only and can not be changed.\n */\n readonly name: string;\n}\n\ninterface Math {\n /**\n * Returns the number of leading zero bits in the 32-bit binary representation of a number.\n * @param x A numeric expression.\n */\n clz32(x: number): number;\n\n /**\n * Returns the result of 32-bit multiplication of two numbers.\n * @param x First number\n * @param y Second number\n */\n imul(x: number, y: number): number;\n\n /**\n * Returns the sign of the x, indicating whether x is positive, negative or zero.\n * @param x The numeric expression to test\n */\n sign(x: number): number;\n\n /**\n * Returns the base 10 logarithm of a number.\n * @param x A numeric expression.\n */\n log10(x: number): number;\n\n /**\n * Returns the base 2 logarithm of a number.\n * @param x A numeric expression.\n */\n log2(x: number): number;\n\n /**\n * Returns the natural logarithm of 1 + x.\n * @param x A numeric expression.\n */\n log1p(x: number): number;\n\n /**\n * Returns the result of (e^x - 1), which is an implementation-dependent approximation to\n * subtracting 1 from the exponential function of x (e raised to the power of x, where e\n * is the base of the natural logarithms).\n * @param x A numeric expression.\n */\n expm1(x: number): number;\n\n /**\n * Returns the hyperbolic cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cosh(x: number): number;\n\n /**\n * Returns the hyperbolic sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sinh(x: number): number;\n\n /**\n * Returns the hyperbolic tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tanh(x: number): number;\n\n /**\n * Returns the inverse hyperbolic cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n acosh(x: number): number;\n\n /**\n * Returns the inverse hyperbolic sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n asinh(x: number): number;\n\n /**\n * Returns the inverse hyperbolic tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n atanh(x: number): number;\n\n /**\n * Returns the square root of the sum of squares of its arguments.\n * @param values Values to compute the square root for.\n * If no arguments are passed, the result is +0.\n * If there is only one argument, the result is the absolute value.\n * If any argument is +Infinity or -Infinity, the result is +Infinity.\n * If any argument is NaN, the result is NaN.\n * If all arguments are either +0 or −0, the result is +0.\n */\n hypot(...values: number[]): number;\n\n /**\n * Returns the integral part of the a numeric expression, x, removing any fractional digits.\n * If x is already an integer, the result is x.\n * @param x A numeric expression.\n */\n trunc(x: number): number;\n\n /**\n * Returns the nearest single precision float representation of a number.\n * @param x A numeric expression.\n */\n fround(x: number): number;\n\n /**\n * Returns an implementation-dependent approximation to the cube root of number.\n * @param x A numeric expression.\n */\n cbrt(x: number): number;\n}\n\ninterface NumberConstructor {\n /**\n * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1\n * that is representable as a Number value, which is approximately:\n * 2.2204460492503130808472633361816 x 10‍−‍16.\n */\n readonly EPSILON: number;\n\n /**\n * Returns true if passed value is finite.\n * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a\n * number. Only finite values of the type number, result in true.\n * @param number A numeric value.\n */\n isFinite(number: number): boolean;\n\n /**\n * Returns true if the value passed is an integer, false otherwise.\n * @param number A numeric value.\n */\n isInteger(number: number): boolean;\n\n /**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a\n * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter\n * to a number. Only values of the type number, that are also NaN, result in true.\n * @param number A numeric value.\n */\n isNaN(number: number): boolean;\n\n /**\n * Returns true if the value passed is a safe integer.\n * @param number A numeric value.\n */\n isSafeInteger(number: number): boolean;\n\n /**\n * The value of the largest integer n such that n and n + 1 are both exactly representable as\n * a Number value.\n * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.\n */\n readonly MAX_SAFE_INTEGER: number;\n\n /**\n * The value of the smallest integer n such that n and n − 1 are both exactly representable as\n * a Number value.\n * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).\n */\n readonly MIN_SAFE_INTEGER: number;\n\n /**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\n parseFloat(string: string): number;\n\n /**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\n parseInt(string: string, radix?: number): number;\n}\n\ninterface Object {\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: PropertyKey): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: PropertyKey): boolean;\n}\n\ninterface ObjectConstructor {\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param source The source object from which to copy properties.\n */\n assign(target: T, source: U): T & U;\n\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param source1 The first source object from which to copy properties.\n * @param source2 The second source object from which to copy properties.\n */\n assign(target: T, source1: U, source2: V): T & U & V;\n\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param source1 The first source object from which to copy properties.\n * @param source2 The second source object from which to copy properties.\n * @param source3 The third source object from which to copy properties.\n */\n assign(target: T, source1: U, source2: V, source3: W): T & U & V & W;\n\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param sources One or more source objects from which to copy properties\n */\n assign(target: object, ...sources: any[]): any;\n\n /**\n * Returns an array of all symbol properties found directly on object o.\n * @param o Object to retrieve the symbols from.\n */\n getOwnPropertySymbols(o: any): symbol[];\n\n /**\n * Returns true if the values are the same value, false otherwise.\n * @param value1 The first value.\n * @param value2 The second value.\n */\n is(value1: any, value2: any): boolean;\n\n /**\n * Sets the prototype of a specified object o to object proto or null. Returns the object o.\n * @param o The object to change its prototype.\n * @param proto The value of the new prototype or null.\n */\n setPrototypeOf(o: any, proto: object | null): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not\n * inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor | undefined;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript\n * object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor\n * property.\n */\n defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;\n}\n\ninterface ReadonlyArray {\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => value is S, thisArg?: any): S | undefined;\n find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): number;\n}\n\ninterface RegExp {\n /**\n * Returns a string indicating the flags of the regular expression in question. This field is read-only.\n * The characters in this string are sequenced and concatenated in the following order:\n *\n * - \"g\" for global\n * - \"i\" for ignoreCase\n * - \"m\" for multiline\n * - \"u\" for unicode\n * - \"y\" for sticky\n *\n * If no flags are set, the value is the empty string.\n */\n readonly flags: string;\n\n /**\n * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular\n * expression. Default is false. Read-only.\n */\n readonly sticky: boolean;\n\n /**\n * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular\n * expression. Default is false. Read-only.\n */\n readonly unicode: boolean;\n}\n\ninterface RegExpConstructor {\n new (pattern: RegExp, flags?: string): RegExp;\n (pattern: RegExp, flags?: string): RegExp;\n}\n\ninterface String {\n /**\n * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\n * value of the UTF-16 encoded code point starting at the string element at position pos in\n * the String resulting from converting this object to a String.\n * If there is no element at that position, the result is undefined.\n * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.\n */\n codePointAt(pos: number): number | undefined;\n\n /**\n * Returns true if searchString appears as a substring of the result of converting this\n * object to a String, at one or more positions that are\n * greater than or equal to position; otherwise, returns false.\n * @param searchString search string\n * @param position If position is undefined, 0 is assumed, so as to search all of the String.\n */\n includes(searchString: string, position?: number): boolean;\n\n /**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * endPosition – length(this). Otherwise returns false.\n */\n endsWith(searchString: string, endPosition?: number): boolean;\n\n /**\n * Returns the String value result of normalizing the string into the normalization form\n * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n * is \"NFC\"\n */\n normalize(form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string;\n\n /**\n * Returns the String value result of normalizing the string into the normalization form\n * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n * is \"NFC\"\n */\n normalize(form?: string): string;\n\n /**\n * Returns a String value that is made from count copies appended together. If count is 0,\n * the empty string is returned.\n * @param count number of copies to append\n */\n repeat(count: number): string;\n\n /**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * position. Otherwise returns false.\n */\n startsWith(searchString: string, position?: number): boolean;\n\n /**\n * Returns an HTML anchor element and sets the name attribute to the text value\n * @param name\n */\n anchor(name: string): string;\n\n /** Returns a HTML element */\n big(): string;\n\n /** Returns a HTML element */\n blink(): string;\n\n /** Returns a HTML element */\n bold(): string;\n\n /** Returns a HTML element */\n fixed(): string;\n\n /** Returns a HTML element and sets the color attribute value */\n fontcolor(color: string): string;\n\n /** Returns a HTML element and sets the size attribute value */\n fontsize(size: number): string;\n\n /** Returns a HTML element and sets the size attribute value */\n fontsize(size: string): string;\n\n /** Returns an HTML element */\n italics(): string;\n\n /** Returns an HTML element and sets the href attribute value */\n link(url: string): string;\n\n /** Returns a HTML element */\n small(): string;\n\n /** Returns a HTML element */\n strike(): string;\n\n /** Returns a HTML element */\n sub(): string;\n\n /** Returns a HTML element */\n sup(): string;\n}\n\ninterface StringConstructor {\n /**\n * Return the String value whose elements are, in order, the elements in the List elements.\n * If length is 0, the empty string is returned.\n */\n fromCodePoint(...codePoints: number[]): string;\n\n /**\n * String.raw is intended for use as a tag function of a Tagged Template String. When called\n * as such the first argument will be a well formed template call site object and the rest\n * parameter will contain the substitution values.\n * @param template A well-formed template string call site representation.\n * @param substitutions A set of substitution values.\n */\n raw(template: TemplateStringsArray, ...substitutions: any[]): string;\n}\n\n\ninterface Map {\n clear(): void;\n delete(key: K): boolean;\n forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void;\n get(key: K): V | undefined;\n has(key: K): boolean;\n set(key: K, value: V): this;\n readonly size: number;\n}\n\ninterface MapConstructor {\n new (): Map;\n new (entries?: ReadonlyArray<[K, V]>): Map;\n readonly prototype: Map;\n}\ndeclare var Map: MapConstructor;\n\ninterface ReadonlyMap {\n forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void;\n get(key: K): V | undefined;\n has(key: K): boolean;\n readonly size: number;\n}\n\ninterface WeakMap {\n delete(key: K): boolean;\n get(key: K): V | undefined;\n has(key: K): boolean;\n set(key: K, value: V): this;\n}\n\ninterface WeakMapConstructor {\n new (): WeakMap;\n new (entries?: ReadonlyArray<[K, V]>): WeakMap;\n readonly prototype: WeakMap;\n}\ndeclare var WeakMap: WeakMapConstructor;\n\ninterface Set {\n add(value: T): this;\n clear(): void;\n delete(value: T): boolean;\n forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void;\n has(value: T): boolean;\n readonly size: number;\n}\n\ninterface SetConstructor {\n new (): Set;\n new (values?: ReadonlyArray): Set;\n readonly prototype: Set;\n}\ndeclare var Set: SetConstructor;\n\ninterface ReadonlySet {\n forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void;\n has(value: T): boolean;\n readonly size: number;\n}\n\ninterface WeakSet {\n add(value: T): this;\n delete(value: T): boolean;\n has(value: T): boolean;\n}\n\ninterface WeakSetConstructor {\n new (): WeakSet;\n new (values?: ReadonlyArray): WeakSet;\n readonly prototype: WeakSet;\n}\ndeclare var WeakSet: WeakSetConstructor;\n\n\ninterface Generator extends Iterator { }\n\ninterface GeneratorFunction {\n /**\n * Creates a new Generator object.\n * @param args A list of arguments the function accepts.\n */\n new (...args: any[]): Generator;\n /**\n * Creates a new Generator object.\n * @param args A list of arguments the function accepts.\n */\n (...args: any[]): Generator;\n /**\n * The length of the arguments.\n */\n readonly length: number;\n /**\n * Returns the name of the function.\n */\n readonly name: string;\n /**\n * A reference to the prototype.\n */\n readonly prototype: Generator;\n}\n\ninterface GeneratorFunctionConstructor {\n /**\n * Creates a new Generator function.\n * @param args A list of arguments the function accepts.\n */\n new (...args: string[]): GeneratorFunction;\n /**\n * Creates a new Generator function.\n * @param args A list of arguments the function accepts.\n */\n (...args: string[]): GeneratorFunction;\n /**\n * The length of the arguments.\n */\n readonly length: number;\n /**\n * Returns the name of the function.\n */\n readonly name: string;\n /**\n * A reference to the prototype.\n */\n readonly prototype: GeneratorFunction;\n}\ndeclare var GeneratorFunction: GeneratorFunctionConstructor;\n\n\n/// \n\ninterface SymbolConstructor {\n /**\n * A method that returns the default iterator for an object. Called by the semantics of the\n * for-of statement.\n */\n readonly iterator: symbol;\n}\n\ninterface IteratorResult {\n done: boolean;\n value: T;\n}\n\ninterface Iterator {\n next(value?: any): IteratorResult;\n return?(value?: any): IteratorResult;\n throw?(e?: any): IteratorResult;\n}\n\ninterface Iterable {\n [Symbol.iterator](): Iterator;\n}\n\ninterface IterableIterator extends Iterator {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Array {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\n\n /**\n * Returns an iterable of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface ArrayConstructor {\n /**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n */\n from(iterable: Iterable | ArrayLike): T[];\n\n /**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[];\n}\n\ninterface ReadonlyArray {\n /** Iterator of values in the array. */\n [Symbol.iterator](): IterableIterator;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\n\n /**\n * Returns an iterable of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface IArguments {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Map {\n /** Returns an iterable of entries in the map. */\n [Symbol.iterator](): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the map.\n */\n entries(): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of keys in the map\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the map\n */\n values(): IterableIterator;\n}\n\ninterface ReadonlyMap {\n /** Returns an iterable of entries in the map. */\n [Symbol.iterator](): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the map.\n */\n entries(): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of keys in the map\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the map\n */\n values(): IterableIterator;\n}\n\ninterface MapConstructor {\n new (iterable: Iterable<[K, V]>): Map;\n}\n\ninterface WeakMap { }\n\ninterface WeakMapConstructor {\n new (iterable: Iterable<[K, V]>): WeakMap;\n}\n\ninterface Set {\n /** Iterates over values in the set. */\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an iterable of [v,v] pairs for every value `v` in the set.\n */\n entries(): IterableIterator<[T, T]>;\n /**\n * Despite its name, returns an iterable of the values in the set,\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the set.\n */\n values(): IterableIterator;\n}\n\ninterface ReadonlySet {\n /** Iterates over values in the set. */\n [Symbol.iterator](): IterableIterator;\n\n /**\n * Returns an iterable of [v,v] pairs for every value `v` in the set.\n */\n entries(): IterableIterator<[T, T]>;\n\n /**\n * Despite its name, returns an iterable of the values in the set,\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the set.\n */\n values(): IterableIterator;\n}\n\ninterface SetConstructor {\n new (iterable: Iterable): Set;\n}\n\ninterface WeakSet { }\n\ninterface WeakSetConstructor {\n new (iterable: Iterable): WeakSet;\n}\n\ninterface Promise { }\n\ninterface PromiseConstructor {\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: Iterable>): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: Iterable>): Promise;\n}\n\ndeclare namespace Reflect {\n function enumerate(target: object): IterableIterator;\n}\n\ninterface String {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Int8Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Int8ArrayConstructor {\n new (elements: Iterable): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\n}\n\ninterface Uint8Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint8ArrayConstructor {\n new (elements: Iterable): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\n}\n\ninterface Uint8ClampedArray {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint8ClampedArrayConstructor {\n new (elements: Iterable): Uint8ClampedArray;\n\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\n\ninterface Int16Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Int16ArrayConstructor {\n new (elements: Iterable): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\n}\n\ninterface Uint16Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint16ArrayConstructor {\n new (elements: Iterable): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\n}\n\ninterface Int32Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Int32ArrayConstructor {\n new (elements: Iterable): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\n}\n\ninterface Uint32Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint32ArrayConstructor {\n new (elements: Iterable): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\n}\n\ninterface Float32Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Float32ArrayConstructor {\n new (elements: Iterable): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\n}\n\ninterface Float64Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Float64ArrayConstructor {\n new (elements: Iterable): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\n}\n\n\ninterface PromiseConstructor {\n /**\n * A reference to the prototype.\n */\n readonly prototype: Promise;\n\n /**\n * Creates a new Promise.\n * @param executor A callback used to initialize the promise. This callback is passed two arguments:\n * a resolve callback used resolve the promise with a value or the result of another promise,\n * and a reject callback used to reject the promise with a provided reason or error.\n */\n new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: (T | PromiseLike)[]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: (T | PromiseLike)[]): Promise;\n\n /**\n * Creates a new rejected promise for the provided reason.\n * @param reason The reason the promise was rejected.\n * @returns A new rejected Promise.\n */\n reject(reason: any): Promise;\n\n /**\n * Creates a new rejected promise for the provided reason.\n * @param reason The reason the promise was rejected.\n * @returns A new rejected Promise.\n */\n reject(reason: any): Promise;\n\n /**\n * Creates a new resolved promise for the provided value.\n * @param value A promise.\n * @returns A promise whose internal state matches the provided promise.\n */\n resolve(value: T | PromiseLike): Promise;\n\n /**\n * Creates a new resolved promise .\n * @returns A resolved promise.\n */\n resolve(): Promise;\n}\n\ndeclare var Promise: PromiseConstructor;\n\ninterface ProxyHandler {\n getPrototypeOf? (target: T): object | null;\n setPrototypeOf? (target: T, v: any): boolean;\n isExtensible? (target: T): boolean;\n preventExtensions? (target: T): boolean;\n getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined;\n has? (target: T, p: PropertyKey): boolean;\n get? (target: T, p: PropertyKey, receiver: any): any;\n set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;\n deleteProperty? (target: T, p: PropertyKey): boolean;\n defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean;\n enumerate? (target: T): PropertyKey[];\n ownKeys? (target: T): PropertyKey[];\n apply? (target: T, thisArg: any, argArray?: any): any;\n construct? (target: T, argArray: any, newTarget?: any): object;\n}\n\ninterface ProxyConstructor {\n revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; };\n new (target: T, handler: ProxyHandler): T;\n}\ndeclare var Proxy: ProxyConstructor;\n\n\ndeclare namespace Reflect {\n function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any;\n function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any;\n function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;\n function deleteProperty(target: object, propertyKey: PropertyKey): boolean;\n function get(target: object, propertyKey: PropertyKey, receiver?: any): any;\n function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;\n function getPrototypeOf(target: object): object;\n function has(target: object, propertyKey: PropertyKey): boolean;\n function isExtensible(target: object): boolean;\n function ownKeys(target: object): PropertyKey[];\n function preventExtensions(target: object): boolean;\n function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;\n function setPrototypeOf(target: object, proto: any): boolean;\n}\n\n\ninterface Symbol {\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): symbol;\n}\n\ninterface SymbolConstructor {\n /**\n * A reference to the prototype.\n */\n readonly prototype: Symbol;\n\n /**\n * Returns a new unique Symbol value.\n * @param description Description of the new Symbol object.\n */\n (description?: string | number): symbol;\n\n /**\n * Returns a Symbol object from the global symbol registry matching the given key if found.\n * Otherwise, returns a new symbol with this key.\n * @param key key to search for.\n */\n for(key: string): symbol;\n\n /**\n * Returns a key from the global symbol registry matching the given Symbol if found.\n * Otherwise, returns a undefined.\n * @param sym Symbol to find the key for.\n */\n keyFor(sym: symbol): string | undefined;\n}\n\ndeclare var Symbol: SymbolConstructor;\n\n/// \n\ninterface SymbolConstructor {\n /**\n * A method that determines if a constructor object recognizes an object as one of the\n * constructor’s instances. Called by the semantics of the instanceof operator.\n */\n readonly hasInstance: symbol;\n\n /**\n * A Boolean value that if true indicates that an object should flatten to its array elements\n * by Array.prototype.concat.\n */\n readonly isConcatSpreadable: symbol;\n\n /**\n * A regular expression method that matches the regular expression against a string. Called\n * by the String.prototype.match method.\n */\n readonly match: symbol;\n\n /**\n * A regular expression method that replaces matched substrings of a string. Called by the\n * String.prototype.replace method.\n */\n readonly replace: symbol;\n\n /**\n * A regular expression method that returns the index within a string that matches the\n * regular expression. Called by the String.prototype.search method.\n */\n readonly search: symbol;\n\n /**\n * A function valued property that is the constructor function that is used to create\n * derived objects.\n */\n readonly species: symbol;\n\n /**\n * A regular expression method that splits a string at the indices that match the regular\n * expression. Called by the String.prototype.split method.\n */\n readonly split: symbol;\n\n /**\n * A method that converts an object to a corresponding primitive value.\n * Called by the ToPrimitive abstract operation.\n */\n readonly toPrimitive: symbol;\n\n /**\n * A String value that is used in the creation of the default string description of an object.\n * Called by the built-in method Object.prototype.toString.\n */\n readonly toStringTag: symbol;\n\n /**\n * An Object whose own property names are property names that are excluded from the 'with'\n * environment bindings of the associated objects.\n */\n readonly unscopables: symbol;\n}\n\ninterface Symbol {\n readonly [Symbol.toStringTag]: \"Symbol\";\n}\n\ninterface Array {\n /**\n * Returns an object whose properties have the value 'true'\n * when they will be absent when used in a 'with' statement.\n */\n [Symbol.unscopables](): {\n copyWithin: boolean;\n entries: boolean;\n fill: boolean;\n find: boolean;\n findIndex: boolean;\n keys: boolean;\n values: boolean;\n };\n}\n\ninterface Date {\n /**\n * Converts a Date object to a string.\n */\n [Symbol.toPrimitive](hint: \"default\"): string;\n /**\n * Converts a Date object to a string.\n */\n [Symbol.toPrimitive](hint: \"string\"): string;\n /**\n * Converts a Date object to a number.\n */\n [Symbol.toPrimitive](hint: \"number\"): number;\n /**\n * Converts a Date object to a string or number.\n *\n * @param hint The strings \"number\", \"string\", or \"default\" to specify what primitive to return.\n *\n * @throws {TypeError} If 'hint' was given something other than \"number\", \"string\", or \"default\".\n * @returns A number if 'hint' was \"number\", a string if 'hint' was \"string\" or \"default\".\n */\n [Symbol.toPrimitive](hint: string): string | number;\n}\n\ninterface Map {\n readonly [Symbol.toStringTag]: \"Map\";\n}\n\ninterface WeakMap {\n readonly [Symbol.toStringTag]: \"WeakMap\";\n}\n\ninterface Set {\n readonly [Symbol.toStringTag]: \"Set\";\n}\n\ninterface WeakSet {\n readonly [Symbol.toStringTag]: \"WeakSet\";\n}\n\ninterface JSON {\n readonly [Symbol.toStringTag]: \"JSON\";\n}\n\ninterface Function {\n /**\n * Determines whether the given value inherits from this function if this function was used\n * as a constructor function.\n *\n * A constructor function can control which objects are recognized as its instances by\n * 'instanceof' by overriding this method.\n */\n [Symbol.hasInstance](value: any): boolean;\n}\n\ninterface GeneratorFunction {\n readonly [Symbol.toStringTag]: \"GeneratorFunction\";\n}\n\ninterface Math {\n readonly [Symbol.toStringTag]: \"Math\";\n}\n\ninterface Promise {\n readonly [Symbol.toStringTag]: \"Promise\";\n}\n\ninterface PromiseConstructor {\n readonly [Symbol.species]: PromiseConstructor;\n}\n\ninterface RegExp {\n /**\n * Matches a string with this regular expression, and returns an array containing the results of\n * that search.\n * @param string A string to search within.\n */\n [Symbol.match](string: string): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using this regular expression.\n * @param string A String object or string literal whose contents matching against\n * this regular expression will be replaced\n * @param replaceValue A String object or string literal containing the text to replace for every\n * successful match of this regular expression.\n */\n [Symbol.replace](string: string, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using this regular expression.\n * @param string A String object or string literal whose contents matching against\n * this regular expression will be replaced\n * @param replacer A function that returns the replacement text.\n */\n [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the position beginning first substring match in a regular expression search\n * using this regular expression.\n *\n * @param string The string to search within.\n */\n [Symbol.search](string: string): number;\n\n /**\n * Returns an array of substrings that were delimited by strings in the original input that\n * match against this regular expression.\n *\n * If the regular expression contains capturing parentheses, then each time this\n * regular expression matches, the results (including any undefined results) of the\n * capturing parentheses are spliced.\n *\n * @param string string value to split\n * @param limit if not undefined, the output array is truncated so that it contains no more\n * than 'limit' elements.\n */\n [Symbol.split](string: string, limit?: number): string[];\n}\n\ninterface RegExpConstructor {\n readonly [Symbol.species]: RegExpConstructor;\n}\n\ninterface String {\n /**\n * Matches a string an object that supports being matched against, and returns an array containing the results of that search.\n * @param matcher An object that supports being matched against.\n */\n match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using an object that supports replacement within a string.\n * @param searchValue A object can search for and replace matches within a string.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using an object that supports replacement within a string.\n * @param searchValue A object can search for and replace matches within a string.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param searcher An object which supports searching within a string.\n */\n search(searcher: { [Symbol.search](string: string): number; }): number;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param splitter An object that can split a string.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];\n}\n\ninterface ArrayBuffer {\n readonly [Symbol.toStringTag]: \"ArrayBuffer\";\n}\n\ninterface DataView {\n readonly [Symbol.toStringTag]: \"DataView\";\n}\n\ninterface Int8Array {\n readonly [Symbol.toStringTag]: \"Int8Array\";\n}\n\ninterface Uint8Array {\n readonly [Symbol.toStringTag]: \"UInt8Array\";\n}\n\ninterface Uint8ClampedArray {\n readonly [Symbol.toStringTag]: \"Uint8ClampedArray\";\n}\n\ninterface Int16Array {\n readonly [Symbol.toStringTag]: \"Int16Array\";\n}\n\ninterface Uint16Array {\n readonly [Symbol.toStringTag]: \"Uint16Array\";\n}\n\ninterface Int32Array {\n readonly [Symbol.toStringTag]: \"Int32Array\";\n}\n\ninterface Uint32Array {\n readonly [Symbol.toStringTag]: \"Uint32Array\";\n}\n\ninterface Float32Array {\n readonly [Symbol.toStringTag]: \"Float32Array\";\n}\n\ninterface Float64Array {\n readonly [Symbol.toStringTag]: \"Float64Array\";\n}\n\ninterface ArrayConstructor {\n readonly [Symbol.species]: ArrayConstructor;\n}\ninterface MapConstructor {\n readonly [Symbol.species]: MapConstructor;\n}\ninterface SetConstructor {\n readonly [Symbol.species]: SetConstructor;\n}\ninterface ArrayBufferConstructor {\n readonly [Symbol.species]: ArrayBufferConstructor;\n}\n\n\n/////////////////////////////\n/// DOM APIs\n/////////////////////////////\n\ninterface Account {\n displayName: string;\n id: string;\n imageURL?: string;\n name?: string;\n rpDisplayName: string;\n}\n\ninterface Algorithm {\n name: string;\n}\n\ninterface AnimationEventInit extends EventInit {\n animationName?: string;\n elapsedTime?: number;\n}\n\ninterface AssertionOptions {\n allowList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: USVString;\n timeoutSeconds?: number;\n}\n\ninterface CacheQueryOptions {\n cacheName?: string;\n ignoreMethod?: boolean;\n ignoreSearch?: boolean;\n ignoreVary?: boolean;\n}\n\ninterface ClientData {\n challenge: string;\n extensions?: WebAuthnExtensions;\n hashAlg: string | Algorithm;\n origin: string;\n rpId: string;\n tokenBinding?: string;\n}\n\ninterface CloseEventInit extends EventInit {\n code?: number;\n reason?: string;\n wasClean?: boolean;\n}\n\ninterface CompositionEventInit extends UIEventInit {\n data?: string;\n}\n\ninterface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface ConstrainBooleanParameters {\n exact?: boolean;\n ideal?: boolean;\n}\n\ninterface ConstrainDOMStringParameters {\n exact?: string | string[];\n ideal?: string | string[];\n}\n\ninterface ConstrainDoubleRange extends DoubleRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainLongRange extends LongRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainVideoFacingModeParameters {\n exact?: VideoFacingModeEnum | VideoFacingModeEnum[];\n ideal?: VideoFacingModeEnum | VideoFacingModeEnum[];\n}\n\ninterface CustomEventInit extends EventInit {\n detail?: T;\n}\n\ninterface DeviceAccelerationDict {\n x?: number | null;\n y?: number | null;\n z?: number | null;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceMotionEventInit extends EventInit {\n acceleration?: DeviceAccelerationDict | null;\n accelerationIncludingGravity?: DeviceAccelerationDict | null;\n interval?: number | null;\n rotationRate?: DeviceRotationRateDict | null;\n}\n\ninterface DeviceOrientationEventInit extends EventInit {\n absolute?: boolean;\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DOMRectInit {\n height?: number;\n width?: number;\n x?: number;\n y?: number;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface ErrorEventInit extends EventInit {\n colno?: number;\n error?: any;\n filename?: string;\n lineno?: number;\n message?: string;\n}\n\ninterface EventInit {\n scoped?: boolean;\n bubbles?: boolean;\n cancelable?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n altKey?: boolean;\n ctrlKey?: boolean;\n metaKey?: boolean;\n modifierAltGraph?: boolean;\n modifierCapsLock?: boolean;\n modifierFn?: boolean;\n modifierFnLock?: boolean;\n modifierHyper?: boolean;\n modifierNumLock?: boolean;\n modifierOS?: boolean;\n modifierScrollLock?: boolean;\n modifierSuper?: boolean;\n modifierSymbol?: boolean;\n modifierSymbolLock?: boolean;\n shiftKey?: boolean;\n}\n\ninterface ExceptionInformation {\n domain?: string | null;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget | null;\n}\n\ninterface FocusNavigationEventInit extends EventInit {\n navigationReason?: string | null;\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface FocusNavigationOrigin {\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface GamepadEventInit extends EventInit {\n gamepad?: Gamepad | null;\n}\n\ninterface GetNotificationOptions {\n tag?: string;\n}\n\ninterface HashChangeEventInit extends EventInit {\n newURL?: string | null;\n oldURL?: string | null;\n}\n\ninterface IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: string | string[];\n}\n\ninterface IntersectionObserverEntryInit {\n isIntersecting: boolean;\n boundingClientRect: DOMRectInit;\n intersectionRect: DOMRectInit;\n rootBounds: DOMRectInit;\n target: Element;\n time: number;\n}\n\ninterface IntersectionObserverInit {\n root?: Element | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface KeyAlgorithm {\n name?: string;\n}\n\ninterface KeyboardEventInit extends EventModifierInit {\n code?: string;\n key?: string;\n location?: number;\n repeat?: boolean;\n}\n\ninterface LongRange {\n max?: number;\n min?: number;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initData?: ArrayBuffer | null;\n initDataType?: string;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n message?: ArrayBuffer | null;\n messageType?: MediaKeyMessageType;\n}\n\ninterface MediaKeySystemConfiguration {\n audioCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: MediaKeysRequirement;\n initDataTypes?: string[];\n persistentState?: MediaKeysRequirement;\n videoCapabilities?: MediaKeySystemMediaCapability[];\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n audio?: boolean | MediaTrackConstraints;\n video?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError | null;\n}\n\ninterface MediaStreamEventInit extends EventInit {\n stream?: MediaStream;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack | null;\n}\n\ninterface MediaTrackCapabilities {\n aspectRatio?: number | DoubleRange;\n deviceId?: string;\n echoCancellation?: boolean[];\n facingMode?: string;\n frameRate?: number | DoubleRange;\n groupId?: string;\n height?: number | LongRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n volume?: number | DoubleRange;\n width?: number | LongRange;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackConstraintSet {\n aspectRatio?: number | ConstrainDoubleRange;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n echoCancelation?: boolean | ConstrainBooleanParameters;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n frameRate?: number | ConstrainDoubleRange;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n height?: number | ConstrainLongRange;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n volume?: number | ConstrainDoubleRange;\n width?: number | ConstrainLongRange;\n}\n\ninterface MediaTrackSettings {\n aspectRatio?: number;\n deviceId?: string;\n echoCancellation?: boolean;\n facingMode?: string;\n frameRate?: number;\n groupId?: string;\n height?: number;\n sampleRate?: number;\n sampleSize?: number;\n volume?: number;\n width?: number;\n}\n\ninterface MediaTrackSupportedConstraints {\n aspectRatio?: boolean;\n deviceId?: boolean;\n echoCancellation?: boolean;\n facingMode?: boolean;\n frameRate?: boolean;\n groupId?: boolean;\n height?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n volume?: boolean;\n width?: boolean;\n}\n\ninterface MessageEventInit extends EventInit {\n lastEventId?: string;\n channel?: string;\n data?: any;\n origin?: string;\n ports?: MessagePort[];\n source?: Window;\n}\n\ninterface MouseEventInit extends EventModifierInit {\n button?: number;\n buttons?: number;\n clientX?: number;\n clientY?: number;\n relatedTarget?: EventTarget | null;\n screenX?: number;\n screenY?: number;\n}\n\ninterface MSAccountInfo {\n accountImageUri?: string;\n accountName?: string;\n rpDisplayName: string;\n userDisplayName: string;\n userId?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n cpuInsufficientEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceHowlingEventCount?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n networkDelayEventRatio?: number;\n networkSendQualityEventRatio?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n burstLossLength1?: number;\n burstLossLength2?: number;\n burstLossLength3?: number;\n burstLossLength4?: number;\n burstLossLength5?: number;\n burstLossLength6?: number;\n burstLossLength7?: number;\n burstLossLength8OrHigher?: number;\n fecRecvDistance1?: number;\n fecRecvDistance2?: number;\n fecRecvDistance3?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\n packetReorderRatio?: number;\n ratioCompressedSamplesAvg?: number;\n ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvNoiseLevelCh1?: number;\n recvSignalLevelCh1?: number;\n renderLoopbackSignalLevel?: number;\n renderNoiseLevel?: number;\n renderSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n audioFECUsed?: boolean;\n samplingRate?: number;\n sendMutePercent?: number;\n signal?: MSAudioSendSignal;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendNoiseLevelCh1?: number;\n sendSignalLevelCh1?: number;\n}\n\ninterface MSConnectivity {\n iceType?: MSIceType;\n iceWarningFlags?: MSIceWarningFlags;\n relayAddress?: MSRelayAddress;\n}\n\ninterface MSCredentialFilter {\n accept?: MSCredentialSpec[];\n}\n\ninterface MSCredentialParameters {\n type?: MSCredentialType;\n}\n\ninterface MSCredentialSpec {\n id?: string;\n type: MSCredentialType;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n deviceDevName?: string;\n localAddr?: MSIPAddressInfo;\n networkconnectivity?: MSNetworkConnectivityInfo;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n transport?: RTCIceProtocol;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: AAGUID[];\n}\n\ninterface MSIceWarningFlags {\n allocationMessageIntegrityFailed?: boolean;\n alternateServerReceived?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n fipsAllocationFailure?: boolean;\n multipleRelayServersAttempted?: boolean;\n noRelayServersConfigured?: boolean;\n portRangeExhausted?: boolean;\n pseudoTLSFailure?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n turnTcpTimedOut?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n manufacturerMacAddrMask?: string;\n port?: number;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkBandwidthLowEventRatio?: number;\n networkReceiveQualityEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n delay?: MSDelay;\n jitter?: MSJitter;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n linkspeed?: number;\n networkConnectionDetails?: string;\n vpn?: boolean;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: boolean;\n interfaceTypeWireless?: boolean;\n interfaceTypeWWAN?: boolean;\n}\n\ninterface MSOutboundNetwork extends MSNetwork {\n appliedBandwidthLimit?: number;\n}\n\ninterface MSPacketLoss {\n lossRate?: number;\n lossRateMax?: number;\n}\n\ninterface MSPayloadBase extends RTCStats {\n payloadDescription?: string;\n}\n\ninterface MSPortRange {\n max?: number;\n min?: number;\n}\n\ninterface MSRelayAddress {\n port?: number;\n relayAddress?: string;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n allocationTimeInMs?: number;\n baseAddress?: string;\n baseInterface?: MSNetworkInterfaceType;\n iceRole?: RTCIceRole;\n iceWarningFlags?: MSIceWarningFlags;\n interfaces?: MSNetworkInterfaceType;\n localAddress?: string;\n localAddrType?: MSIceAddrType;\n localInterface?: MSNetworkInterfaceType;\n localMR?: string;\n localMRTCPPort?: number;\n localSite?: string;\n msRtcEngineVersion?: string;\n networkName?: string;\n numConsentReqReceived?: number;\n numConsentReqSent?: number;\n numConsentRespReceived?: number;\n numConsentRespSent?: number;\n portRangeMax?: number;\n portRangeMin?: number;\n protocol?: RTCIceProtocol;\n remoteAddress?: string;\n remoteAddrType?: MSIceAddrType;\n remoteMR?: string;\n remoteMRTCPPort?: number;\n remoteSite?: string;\n rtpRtcpMux?: boolean;\n stunVer?: number;\n}\n\ninterface MSUtilization {\n bandwidthEstimation?: number;\n bandwidthEstimationAvg?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationStdDev?: number;\n packets?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n durationSeconds?: number;\n resolution?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n recvBitRateAverage?: number;\n recvBitRateMaximum?: number;\n recvCodecType?: string;\n recvFpsHarmonicAverage?: number;\n recvFrameRateAverage?: number;\n recvNumResSwitches?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvReorderBufferReorderedPackets?: number;\n recvResolutionHeight?: number;\n recvResolutionWidth?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n reorderBufferTotalPackets?: number;\n videoFrameLossRate?: number;\n videoPostFECPLR?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n h720Quality?: number;\n vgaQuality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendBitRateAverage?: number;\n sendBitRateMaximum?: number;\n sendFrameRateAverage?: number;\n sendResolutionHeight?: number;\n sendResolutionWidth?: number;\n sendVideoStreamsMax?: number;\n}\n\ninterface MsZoomToOptions {\n animate?: string;\n contentX?: number;\n contentY?: number;\n scaleFactor?: number;\n viewportX?: string | null;\n viewportY?: string | null;\n}\n\ninterface MutationObserverInit {\n attributeFilter?: string[];\n attributeOldValue?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n characterDataOldValue?: boolean;\n childList?: boolean;\n subtree?: boolean;\n}\n\ninterface NotificationOptions {\n body?: string;\n dir?: NotificationDirection;\n icon?: string;\n lang?: string;\n tag?: string;\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface PaymentCurrencyAmount {\n currency: string;\n currencySystem?: string;\n value: string;\n}\n\ninterface PaymentDetails {\n displayItems?: PaymentItem[];\n error?: string;\n modifiers?: PaymentDetailsModifier[];\n shippingOptions?: PaymentShippingOption[];\n total?: PaymentItem;\n}\n\ninterface PaymentDetailsModifier {\n additionalDisplayItems?: PaymentItem[];\n data?: any;\n supportedMethods: string | string[];\n total?: PaymentItem;\n}\n\ninterface PaymentItem {\n amount: PaymentCurrencyAmount;\n label: string;\n pending?: boolean;\n}\n\ninterface PaymentMethodData {\n data?: any;\n supportedMethods: string | string[];\n}\n\ninterface PaymentOptions {\n requestPayerEmail?: boolean;\n requestPayerName?: boolean;\n requestPayerPhone?: boolean;\n requestShipping?: boolean;\n shippingType?: string;\n}\n\ninterface PaymentRequestUpdateEventInit extends EventInit {\n}\n\ninterface PaymentShippingOption {\n amount: PaymentCurrencyAmount;\n id: string;\n label: string;\n selected?: boolean;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PointerEventInit extends MouseEventInit {\n height?: number;\n isPrimary?: boolean;\n pointerId?: number;\n pointerType?: string;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n width?: number;\n}\n\ninterface PopStateEventInit extends EventInit {\n state?: any;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n maximumAge?: number;\n timeout?: number;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface PushSubscriptionOptionsInit {\n applicationServerKey?: BufferSource | null;\n userVisibleOnly?: boolean;\n}\n\ninterface RegistrationOptions {\n scope?: string;\n}\n\ninterface RequestInit {\n signal?: AbortSignal;\n body?: Blob | BufferSource | FormData | string | null;\n cache?: RequestCache;\n credentials?: RequestCredentials;\n headers?: HeadersInit;\n integrity?: string;\n keepalive?: boolean;\n method?: string;\n mode?: RequestMode;\n redirect?: RequestRedirect;\n referrer?: string;\n referrerPolicy?: ReferrerPolicy;\n window?: any;\n}\n\ninterface ResponseInit {\n headers?: HeadersInit;\n status?: number;\n statusText?: string;\n}\n\ninterface RTCConfiguration {\n bundlePolicy?: RTCBundlePolicy;\n iceServers?: RTCIceServer[];\n iceTransportPolicy?: RTCIceTransportPolicy;\n peerIdentity?: string;\n}\n\ninterface RTCDtlsFingerprint {\n algorithm?: string;\n value?: string;\n}\n\ninterface RTCDtlsParameters {\n fingerprints?: RTCDtlsFingerprint[];\n role?: RTCDtlsRole;\n}\n\ninterface RTCDTMFToneChangeEventInit extends EventInit {\n tone?: string;\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n addressSourceUrl?: string;\n candidateType?: RTCStatsIceCandidateType;\n ipAddress?: string;\n portNumber?: number;\n priority?: number;\n transport?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidateDictionary {\n foundation?: string;\n ip?: string;\n msMTurnSessionId?: string;\n port?: number;\n priority?: number;\n protocol?: RTCIceProtocol;\n relatedAddress?: string;\n relatedPort?: number;\n tcpType?: RTCIceTcpCandidateType;\n type?: RTCIceCandidateType;\n}\n\ninterface RTCIceCandidateInit {\n candidate?: string;\n sdpMid?: string;\n sdpMLineIndex?: number;\n}\n\ninterface RTCIceCandidatePair {\n local?: RTCIceCandidateDictionary;\n remote?: RTCIceCandidateDictionary;\n}\n\ninterface RTCIceCandidatePairStats extends RTCStats {\n availableIncomingBitrate?: number;\n availableOutgoingBitrate?: number;\n bytesReceived?: number;\n bytesSent?: number;\n localCandidateId?: string;\n nominated?: boolean;\n priority?: number;\n readable?: boolean;\n remoteCandidateId?: string;\n roundTripTime?: number;\n state?: RTCStatsIceCandidatePairState;\n transportId?: string;\n writable?: boolean;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: RTCIceGatherPolicy;\n iceservers?: RTCIceServer[];\n portRange?: MSPortRange;\n}\n\ninterface RTCIceParameters {\n iceLite?: boolean | null;\n password?: string;\n usernameFragment?: string;\n}\n\ninterface RTCIceServer {\n credential?: string | null;\n urls?: any;\n username?: string | null;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n bytesReceived?: number;\n fractionLost?: number;\n jitter?: number;\n packetsLost?: number;\n packetsReceived?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n frameHeight?: number;\n framesCorrupted?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesPerSecond?: number;\n framesReceived?: number;\n framesSent?: number;\n frameWidth?: number;\n remoteSource?: boolean;\n ssrcIds?: string[];\n trackIdentifier?: string;\n}\n\ninterface RTCOfferOptions {\n iceRestart?: boolean;\n offerToReceiveAudio?: number;\n offerToReceiveVideo?: number;\n voiceActivityDetection?: boolean;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n bytesSent?: number;\n packetsSent?: number;\n roundTripTime?: number;\n targetBitrate?: number;\n}\n\ninterface RTCPeerConnectionIceEventInit extends EventInit {\n candidate?: RTCIceCandidate;\n}\n\ninterface RTCRtcpFeedback {\n parameter?: string;\n type?: string;\n}\n\ninterface RTCRtcpParameters {\n cname?: string;\n mux?: boolean;\n reducedSize?: boolean;\n ssrc?: number;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n fecMechanisms?: string[];\n headerExtensions?: RTCRtpHeaderExtension[];\n}\n\ninterface RTCRtpCodecCapability {\n clockRate?: number;\n kind?: string;\n maxptime?: number;\n maxSpatialLayers?: number;\n maxTemporalLayers?: number;\n name?: string;\n numChannels?: number;\n options?: any;\n parameters?: any;\n preferredPayloadType?: number;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n clockRate?: number;\n maxptime?: number;\n name?: string;\n numChannels?: number;\n parameters?: any;\n payloadType?: any;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n}\n\ninterface RTCRtpContributingSource {\n audioLevel?: number;\n csrc?: number;\n timestamp?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n active?: boolean;\n codecPayloadType?: number;\n dependencyEncodingIds?: string[];\n encodingId?: string;\n fec?: RTCRtpFecParameters;\n framerateScale?: number;\n maxBitrate?: number;\n maxFramerate?: number;\n minQuality?: number;\n priority?: number;\n resolutionScale?: number;\n rtx?: RTCRtpRtxParameters;\n ssrc?: number;\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n mechanism?: string;\n ssrc?: number;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n preferredEncrypt?: boolean;\n preferredId?: number;\n uri?: string;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n encrypt?: boolean;\n id?: number;\n uri?: string;\n}\n\ninterface RTCRtpParameters {\n codecs?: RTCRtpCodecParameters[];\n degradationPreference?: RTCDegradationPreference;\n encodings?: RTCRtpEncodingParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n muxId?: string;\n rtcp?: RTCRtcpParameters;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n associateStatsId?: string;\n codecId?: string;\n firCount?: number;\n isRemote?: boolean;\n mediaTrackId?: string;\n nackCount?: number;\n pliCount?: number;\n sliCount?: number;\n ssrc?: string;\n transportId?: string;\n}\n\ninterface RTCRtpUnhandled {\n muxId?: string;\n payloadType?: number;\n ssrc?: number;\n}\n\ninterface RTCSessionDescriptionInit {\n sdp?: string;\n type?: RTCSdpType;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiLength?: number;\n mkiValue?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n tag?: number;\n}\n\ninterface RTCSsrcRange {\n max?: number;\n min?: number;\n}\n\ninterface RTCStats {\n id?: string;\n msType?: MSStatsType;\n timestamp?: number;\n type?: RTCStatsType;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n activeConnection?: boolean;\n bytesReceived?: number;\n bytesSent?: number;\n localCertificateId?: string;\n remoteCertificateId?: string;\n rtcpTransportStatsId?: string;\n selectedCandidatePairId?: string;\n}\n\ninterface ScopedCredentialDescriptor {\n id: BufferSource;\n transports?: Transport[];\n type: ScopedCredentialType;\n}\n\ninterface ScopedCredentialOptions {\n excludeList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: USVString;\n timeoutSeconds?: number;\n}\n\ninterface ScopedCredentialParameters {\n algorithm: string | Algorithm;\n type: ScopedCredentialType;\n}\n\ninterface ServiceWorkerMessageEventInit extends EventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[] | null;\n source?: ServiceWorker | MessagePort | null;\n}\n\ninterface SpeechSynthesisEventInit extends EventInit {\n charIndex?: number;\n elapsedTime?: number;\n name?: string;\n utterance?: SpeechSynthesisUtterance | null;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n detailURI?: string | null;\n explanationString?: string | null;\n siteName?: string | null;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface TrackEventInit extends EventInit {\n track?: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ninterface TransitionEventInit extends EventInit {\n elapsedTime?: number;\n propertyName?: string;\n}\n\ninterface UIEventInit extends EventInit {\n detail?: number;\n view?: Window | null;\n}\n\ninterface WebAuthnExtensions {\n}\n\ninterface WebGLContextAttributes {\n failIfMajorPerformanceCaveat?: boolean;\n alpha?: boolean;\n antialias?: boolean;\n depth?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n stencil?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaMode?: number;\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n}\n\ninterface EventListener {\n (evt: Event): void;\n}\n\ninterface WebKitEntriesCallback {\n (evt: Event): void;\n}\n\ninterface WebKitErrorCallback {\n (evt: Event): void;\n}\n\ninterface WebKitFileCallback {\n (evt: Event): void;\n}\n\ninterface AnalyserNode extends AudioNode {\n fftSize: number;\n readonly frequencyBinCount: number;\n maxDecibels: number;\n minDecibels: number;\n smoothingTimeConstant: number;\n getByteFrequencyData(array: Uint8Array): void;\n getByteTimeDomainData(array: Uint8Array): void;\n getFloatFrequencyData(array: Float32Array): void;\n getFloatTimeDomainData(array: Float32Array): void;\n}\n\ndeclare var AnalyserNode: {\n prototype: AnalyserNode;\n new(): AnalyserNode;\n};\n\ninterface ANGLE_instanced_arrays {\n drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;\n drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;\n vertexAttribDivisorANGLE(index: number, divisor: number): void;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n}\n\ndeclare var ANGLE_instanced_arrays: {\n prototype: ANGLE_instanced_arrays;\n new(): ANGLE_instanced_arrays;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n};\n\ninterface AnimationEvent extends Event {\n readonly animationName: string;\n readonly elapsedTime: number;\n initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void;\n}\n\ndeclare var AnimationEvent: {\n prototype: AnimationEvent;\n new(typeArg: string, eventInitDict?: AnimationEventInit): AnimationEvent;\n};\n\ninterface ApplicationCacheEventMap {\n \"cached\": Event;\n \"checking\": Event;\n \"downloading\": Event;\n \"error\": Event;\n \"noupdate\": Event;\n \"obsolete\": Event;\n \"progress\": ProgressEvent;\n \"updateready\": Event;\n}\n\ninterface ApplicationCache extends EventTarget {\n oncached: (this: ApplicationCache, ev: Event) => any;\n onchecking: (this: ApplicationCache, ev: Event) => any;\n ondownloading: (this: ApplicationCache, ev: Event) => any;\n onerror: (this: ApplicationCache, ev: Event) => any;\n onnoupdate: (this: ApplicationCache, ev: Event) => any;\n onobsolete: (this: ApplicationCache, ev: Event) => any;\n onprogress: (this: ApplicationCache, ev: ProgressEvent) => any;\n onupdateready: (this: ApplicationCache, ev: Event) => any;\n readonly status: number;\n abort(): void;\n swapCache(): void;\n update(): void;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ApplicationCache: {\n prototype: ApplicationCache;\n new(): ApplicationCache;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n};\n\ninterface Attr extends Node {\n readonly name: string;\n readonly ownerElement: Element;\n readonly prefix: string | null;\n readonly specified: boolean;\n value: string;\n}\n\ndeclare var Attr: {\n prototype: Attr;\n new(): Attr;\n};\n\ninterface AudioBuffer {\n readonly duration: number;\n readonly length: number;\n readonly numberOfChannels: number;\n readonly sampleRate: number;\n copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;\n copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;\n getChannelData(channel: number): Float32Array;\n}\n\ndeclare var AudioBuffer: {\n prototype: AudioBuffer;\n new(): AudioBuffer;\n};\n\ninterface AudioBufferSourceNodeEventMap {\n \"ended\": MediaStreamErrorEvent;\n}\n\ninterface AudioBufferSourceNode extends AudioNode {\n buffer: AudioBuffer | null;\n readonly detune: AudioParam;\n loop: boolean;\n loopEnd: number;\n loopStart: number;\n onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any;\n readonly playbackRate: AudioParam;\n start(when?: number, offset?: number, duration?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioBufferSourceNode: {\n prototype: AudioBufferSourceNode;\n new(): AudioBufferSourceNode;\n};\n\ninterface AudioContextEventMap {\n \"statechange\": Event;\n}\n\ninterface AudioContextBase extends EventTarget {\n readonly currentTime: number;\n readonly destination: AudioDestinationNode;\n readonly listener: AudioListener;\n onstatechange: (this: AudioContext, ev: Event) => any;\n readonly sampleRate: number;\n readonly state: AudioContextState;\n close(): Promise;\n createAnalyser(): AnalyserNode;\n createBiquadFilter(): BiquadFilterNode;\n createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;\n createBufferSource(): AudioBufferSourceNode;\n createChannelMerger(numberOfInputs?: number): ChannelMergerNode;\n createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;\n createConvolver(): ConvolverNode;\n createDelay(maxDelayTime?: number): DelayNode;\n createDynamicsCompressor(): DynamicsCompressorNode;\n createGain(): GainNode;\n createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode;\n createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;\n createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;\n createOscillator(): OscillatorNode;\n createPanner(): PannerNode;\n createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave;\n createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;\n createStereoPanner(): StereoPannerNode;\n createWaveShaper(): WaveShaperNode;\n decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise;\n resume(): Promise;\n addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface AudioContext extends AudioContextBase {\n suspend(): Promise;\n}\n\ndeclare var AudioContext: {\n prototype: AudioContext;\n new(): AudioContext;\n};\n\ninterface AudioDestinationNode extends AudioNode {\n readonly maxChannelCount: number;\n}\n\ndeclare var AudioDestinationNode: {\n prototype: AudioDestinationNode;\n new(): AudioDestinationNode;\n};\n\ninterface AudioListener {\n dopplerFactor: number;\n speedOfSound: number;\n setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;\n setPosition(x: number, y: number, z: number): void;\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var AudioListener: {\n prototype: AudioListener;\n new(): AudioListener;\n};\n\ninterface AudioNode extends EventTarget {\n channelCount: number;\n channelCountMode: ChannelCountMode;\n channelInterpretation: ChannelInterpretation;\n readonly context: AudioContext;\n readonly numberOfInputs: number;\n readonly numberOfOutputs: number;\n connect(destination: AudioNode, output?: number, input?: number): AudioNode;\n connect(destination: AudioParam, output?: number): void;\n disconnect(output?: number): void;\n disconnect(destination: AudioNode, output?: number, input?: number): void;\n disconnect(destination: AudioParam, output?: number): void;\n}\n\ndeclare var AudioNode: {\n prototype: AudioNode;\n new(): AudioNode;\n};\n\ninterface AudioParam {\n readonly defaultValue: number;\n value: number;\n cancelScheduledValues(startTime: number): AudioParam;\n exponentialRampToValueAtTime(value: number, endTime: number): AudioParam;\n linearRampToValueAtTime(value: number, endTime: number): AudioParam;\n setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam;\n setValueAtTime(value: number, startTime: number): AudioParam;\n setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): AudioParam;\n}\n\ndeclare var AudioParam: {\n prototype: AudioParam;\n new(): AudioParam;\n};\n\ninterface AudioProcessingEvent extends Event {\n readonly inputBuffer: AudioBuffer;\n readonly outputBuffer: AudioBuffer;\n readonly playbackTime: number;\n}\n\ndeclare var AudioProcessingEvent: {\n prototype: AudioProcessingEvent;\n new(): AudioProcessingEvent;\n};\n\ninterface AudioTrack {\n enabled: boolean;\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var AudioTrack: {\n prototype: AudioTrack;\n new(): AudioTrack;\n};\n\ninterface AudioTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface AudioTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any;\n onchange: (this: AudioTrackList, ev: Event) => any;\n onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any;\n getTrackById(id: string): AudioTrack | null;\n item(index: number): AudioTrack;\n addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: AudioTrack;\n}\n\ndeclare var AudioTrackList: {\n prototype: AudioTrackList;\n new(): AudioTrackList;\n};\n\ninterface BarProp {\n readonly visible: boolean;\n}\n\ndeclare var BarProp: {\n prototype: BarProp;\n new(): BarProp;\n};\n\ninterface BeforeUnloadEvent extends Event {\n returnValue: any;\n}\n\ndeclare var BeforeUnloadEvent: {\n prototype: BeforeUnloadEvent;\n new(): BeforeUnloadEvent;\n};\n\ninterface BiquadFilterNode extends AudioNode {\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n readonly gain: AudioParam;\n readonly Q: AudioParam;\n type: BiquadFilterType;\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var BiquadFilterNode: {\n prototype: BiquadFilterNode;\n new(): BiquadFilterNode;\n};\n\ninterface Blob {\n readonly size: number;\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n slice(start?: number, end?: number, contentType?: string): Blob;\n}\n\ndeclare var Blob: {\n prototype: Blob;\n new (blobParts?: any[], options?: BlobPropertyBag): Blob;\n};\n\ninterface Cache {\n add(request: RequestInfo): Promise;\n addAll(requests: RequestInfo[]): Promise;\n delete(request: RequestInfo, options?: CacheQueryOptions): Promise;\n keys(request?: RequestInfo, options?: CacheQueryOptions): Promise;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise;\n put(request: RequestInfo, response: Response): Promise;\n}\n\ndeclare var Cache: {\n prototype: Cache;\n new(): Cache;\n};\n\ninterface CacheStorage {\n delete(cacheName: string): Promise;\n has(cacheName: string): Promise;\n keys(): Promise;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n open(cacheName: string): Promise;\n}\n\ndeclare var CacheStorage: {\n prototype: CacheStorage;\n new(): CacheStorage;\n};\n\ninterface CanvasGradient {\n addColorStop(offset: number, color: string): void;\n}\n\ndeclare var CanvasGradient: {\n prototype: CanvasGradient;\n new(): CanvasGradient;\n};\n\ninterface CanvasPattern {\n setTransform(matrix: SVGMatrix): void;\n}\n\ndeclare var CanvasPattern: {\n prototype: CanvasPattern;\n new(): CanvasPattern;\n};\n\ninterface CanvasRenderingContext2D extends Object, CanvasPathMethods {\n readonly canvas: HTMLCanvasElement;\n fillStyle: string | CanvasGradient | CanvasPattern;\n font: string;\n globalAlpha: number;\n globalCompositeOperation: string;\n imageSmoothingEnabled: boolean;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n msFillRule: CanvasFillRule;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n textAlign: string;\n textBaseline: string;\n mozImageSmoothingEnabled: boolean;\n webkitImageSmoothingEnabled: boolean;\n oImageSmoothingEnabled: boolean;\n beginPath(): void;\n clearRect(x: number, y: number, w: number, h: number): void;\n clip(fillRule?: CanvasFillRule): void;\n clip(path: Path2D, fillRule?: CanvasFillRule): void;\n createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;\n createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;\n drawFocusIfNeeded(element: Element): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void;\n fill(fillRule?: CanvasFillRule): void;\n fill(path: Path2D, fillRule?: CanvasFillRule): void;\n fillRect(x: number, y: number, w: number, h: number): void;\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\n getLineDash(): number[];\n isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\n measureText(text: string): TextMetrics;\n putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;\n restore(): void;\n rotate(angle: number): void;\n save(): void;\n scale(x: number, y: number): void;\n setLineDash(segments: number[]): void;\n setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n stroke(path?: Path2D): void;\n strokeRect(x: number, y: number, w: number, h: number): void;\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\n transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n translate(x: number, y: number): void;\n}\n\ndeclare var CanvasRenderingContext2D: {\n prototype: CanvasRenderingContext2D;\n new(): CanvasRenderingContext2D;\n};\n\ninterface CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\n};\n\ninterface ChannelMergerNode extends AudioNode {\n}\n\ndeclare var ChannelMergerNode: {\n prototype: ChannelMergerNode;\n new(): ChannelMergerNode;\n};\n\ninterface ChannelSplitterNode extends AudioNode {\n}\n\ndeclare var ChannelSplitterNode: {\n prototype: ChannelSplitterNode;\n new(): ChannelSplitterNode;\n};\n\ninterface CharacterData extends Node, ChildNode {\n data: string;\n readonly length: number;\n appendData(arg: string): void;\n deleteData(offset: number, count: number): void;\n insertData(offset: number, arg: string): void;\n replaceData(offset: number, count: number, arg: string): void;\n substringData(offset: number, count: number): string;\n}\n\ndeclare var CharacterData: {\n prototype: CharacterData;\n new(): CharacterData;\n};\n\ninterface ClientRect {\n bottom: number;\n readonly height: number;\n left: number;\n right: number;\n top: number;\n readonly width: number;\n}\n\ndeclare var ClientRect: {\n prototype: ClientRect;\n new(): ClientRect;\n};\n\ninterface ClientRectList {\n readonly length: number;\n item(index: number): ClientRect;\n [index: number]: ClientRect;\n}\n\ndeclare var ClientRectList: {\n prototype: ClientRectList;\n new(): ClientRectList;\n};\n\ninterface ClipboardEvent extends Event {\n readonly clipboardData: DataTransfer;\n}\n\ndeclare var ClipboardEvent: {\n prototype: ClipboardEvent;\n new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;\n};\n\ninterface CloseEvent extends Event {\n readonly code: number;\n readonly reason: string;\n readonly wasClean: boolean;\n initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;\n}\n\ndeclare var CloseEvent: {\n prototype: CloseEvent;\n new(typeArg: string, eventInitDict?: CloseEventInit): CloseEvent;\n};\n\ninterface Comment extends CharacterData {\n text: string;\n}\n\ndeclare var Comment: {\n prototype: Comment;\n new(): Comment;\n};\n\ninterface CompositionEvent extends UIEvent {\n readonly data: string;\n readonly locale: string;\n initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;\n}\n\ndeclare var CompositionEvent: {\n prototype: CompositionEvent;\n new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;\n};\n\ninterface Console {\n assert(test?: boolean, message?: string, ...optionalParams: any[]): void;\n clear(): void;\n count(countTitle?: string): void;\n debug(message?: any, ...optionalParams: any[]): void;\n dir(value?: any, ...optionalParams: any[]): void;\n dirxml(value: any): void;\n error(message?: any, ...optionalParams: any[]): void;\n exception(message?: string, ...optionalParams: any[]): void;\n group(groupTitle?: string, ...optionalParams: any[]): void;\n groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;\n groupEnd(): void;\n info(message?: any, ...optionalParams: any[]): void;\n log(message?: any, ...optionalParams: any[]): void;\n msIsIndependentlyComposed(element: Element): boolean;\n profile(reportName?: string): void;\n profileEnd(): void;\n select(element: Element): void;\n table(...data: any[]): void;\n time(timerName?: string): void;\n timeEnd(timerName?: string): void;\n trace(message?: any, ...optionalParams: any[]): void;\n warn(message?: any, ...optionalParams: any[]): void;\n}\n\ndeclare var Console: {\n prototype: Console;\n new(): Console;\n};\n\ninterface ConvolverNode extends AudioNode {\n buffer: AudioBuffer | null;\n normalize: boolean;\n}\n\ndeclare var ConvolverNode: {\n prototype: ConvolverNode;\n new(): ConvolverNode;\n};\n\ninterface Coordinates {\n readonly accuracy: number;\n readonly altitude: number | null;\n readonly altitudeAccuracy: number | null;\n readonly heading: number | null;\n readonly latitude: number;\n readonly longitude: number;\n readonly speed: number | null;\n}\n\ndeclare var Coordinates: {\n prototype: Coordinates;\n new(): Coordinates;\n};\n\ninterface Crypto extends Object, RandomSource {\n readonly subtle: SubtleCrypto;\n}\n\ndeclare var Crypto: {\n prototype: Crypto;\n new(): Crypto;\n};\n\ninterface CryptoKey {\n readonly algorithm: KeyAlgorithm;\n readonly extractable: boolean;\n readonly type: string;\n readonly usages: string[];\n}\n\ndeclare var CryptoKey: {\n prototype: CryptoKey;\n new(): CryptoKey;\n};\n\ninterface CryptoKeyPair {\n privateKey: CryptoKey;\n publicKey: CryptoKey;\n}\n\ndeclare var CryptoKeyPair: {\n prototype: CryptoKeyPair;\n new(): CryptoKeyPair;\n};\n\ninterface CSS {\n supports(property: string, value?: string): boolean;\n}\ndeclare var CSS: CSS;\n\ninterface CSSConditionRule extends CSSGroupingRule {\n conditionText: string;\n}\n\ndeclare var CSSConditionRule: {\n prototype: CSSConditionRule;\n new(): CSSConditionRule;\n};\n\ninterface CSSFontFaceRule extends CSSRule {\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSFontFaceRule: {\n prototype: CSSFontFaceRule;\n new(): CSSFontFaceRule;\n};\n\ninterface CSSGroupingRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n deleteRule(index: number): void;\n insertRule(rule: string, index: number): number;\n}\n\ndeclare var CSSGroupingRule: {\n prototype: CSSGroupingRule;\n new(): CSSGroupingRule;\n};\n\ninterface CSSImportRule extends CSSRule {\n readonly href: string;\n readonly media: MediaList;\n readonly styleSheet: CSSStyleSheet;\n}\n\ndeclare var CSSImportRule: {\n prototype: CSSImportRule;\n new(): CSSImportRule;\n};\n\ninterface CSSKeyframeRule extends CSSRule {\n keyText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSKeyframeRule: {\n prototype: CSSKeyframeRule;\n new(): CSSKeyframeRule;\n};\n\ninterface CSSKeyframesRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n name: string;\n appendRule(rule: string): void;\n deleteRule(rule: string): void;\n findRule(rule: string): CSSKeyframeRule;\n}\n\ndeclare var CSSKeyframesRule: {\n prototype: CSSKeyframesRule;\n new(): CSSKeyframesRule;\n};\n\ninterface CSSMediaRule extends CSSConditionRule {\n readonly media: MediaList;\n}\n\ndeclare var CSSMediaRule: {\n prototype: CSSMediaRule;\n new(): CSSMediaRule;\n};\n\ninterface CSSNamespaceRule extends CSSRule {\n readonly namespaceURI: string;\n readonly prefix: string;\n}\n\ndeclare var CSSNamespaceRule: {\n prototype: CSSNamespaceRule;\n new(): CSSNamespaceRule;\n};\n\ninterface CSSPageRule extends CSSRule {\n readonly pseudoClass: string;\n readonly selector: string;\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSPageRule: {\n prototype: CSSPageRule;\n new(): CSSPageRule;\n};\n\ninterface CSSRule {\n cssText: string;\n readonly parentRule: CSSRule;\n readonly parentStyleSheet: CSSStyleSheet;\n readonly type: number;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n}\n\ndeclare var CSSRule: {\n prototype: CSSRule;\n new(): CSSRule;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n};\n\ninterface CSSRuleList {\n readonly length: number;\n item(index: number): CSSRule;\n [index: number]: CSSRule;\n}\n\ndeclare var CSSRuleList: {\n prototype: CSSRuleList;\n new(): CSSRuleList;\n};\n\ninterface CSSStyleDeclaration {\n alignContent: string | null;\n alignItems: string | null;\n alignmentBaseline: string | null;\n alignSelf: string | null;\n animation: string | null;\n animationDelay: string | null;\n animationDirection: string | null;\n animationDuration: string | null;\n animationFillMode: string | null;\n animationIterationCount: string | null;\n animationName: string | null;\n animationPlayState: string | null;\n animationTimingFunction: string | null;\n backfaceVisibility: string | null;\n background: string | null;\n backgroundAttachment: string | null;\n backgroundClip: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n backgroundOrigin: string | null;\n backgroundPosition: string | null;\n backgroundPositionX: string | null;\n backgroundPositionY: string | null;\n backgroundRepeat: string | null;\n backgroundSize: string | null;\n baselineShift: string | null;\n border: string | null;\n borderBottom: string | null;\n borderBottomColor: string | null;\n borderBottomLeftRadius: string | null;\n borderBottomRightRadius: string | null;\n borderBottomStyle: string | null;\n borderBottomWidth: string | null;\n borderCollapse: string | null;\n borderColor: string | null;\n borderImage: string | null;\n borderImageOutset: string | null;\n borderImageRepeat: string | null;\n borderImageSlice: string | null;\n borderImageSource: string | null;\n borderImageWidth: string | null;\n borderLeft: string | null;\n borderLeftColor: string | null;\n borderLeftStyle: string | null;\n borderLeftWidth: string | null;\n borderRadius: string | null;\n borderRight: string | null;\n borderRightColor: string | null;\n borderRightStyle: string | null;\n borderRightWidth: string | null;\n borderSpacing: string | null;\n borderStyle: string | null;\n borderTop: string | null;\n borderTopColor: string | null;\n borderTopLeftRadius: string | null;\n borderTopRightRadius: string | null;\n borderTopStyle: string | null;\n borderTopWidth: string | null;\n borderWidth: string | null;\n bottom: string | null;\n boxShadow: string | null;\n boxSizing: string | null;\n breakAfter: string | null;\n breakBefore: string | null;\n breakInside: string | null;\n captionSide: string | null;\n clear: string | null;\n clip: string | null;\n clipPath: string | null;\n clipRule: string | null;\n color: string | null;\n colorInterpolationFilters: string | null;\n columnCount: any;\n columnFill: string | null;\n columnGap: any;\n columnRule: string | null;\n columnRuleColor: any;\n columnRuleStyle: string | null;\n columnRuleWidth: any;\n columns: string | null;\n columnSpan: string | null;\n columnWidth: any;\n content: string | null;\n counterIncrement: string | null;\n counterReset: string | null;\n cssFloat: string | null;\n cssText: string;\n cursor: string | null;\n direction: string | null;\n display: string | null;\n dominantBaseline: string | null;\n emptyCells: string | null;\n enableBackground: string | null;\n fill: string | null;\n fillOpacity: string | null;\n fillRule: string | null;\n filter: string | null;\n flex: string | null;\n flexBasis: string | null;\n flexDirection: string | null;\n flexFlow: string | null;\n flexGrow: string | null;\n flexShrink: string | null;\n flexWrap: string | null;\n floodColor: string | null;\n floodOpacity: string | null;\n font: string | null;\n fontFamily: string | null;\n fontFeatureSettings: string | null;\n fontSize: string | null;\n fontSizeAdjust: string | null;\n fontStretch: string | null;\n fontStyle: string | null;\n fontVariant: string | null;\n fontWeight: string | null;\n glyphOrientationHorizontal: string | null;\n glyphOrientationVertical: string | null;\n height: string | null;\n imeMode: string | null;\n justifyContent: string | null;\n kerning: string | null;\n layoutGrid: string | null;\n layoutGridChar: string | null;\n layoutGridLine: string | null;\n layoutGridMode: string | null;\n layoutGridType: string | null;\n left: string | null;\n readonly length: number;\n letterSpacing: string | null;\n lightingColor: string | null;\n lineBreak: string | null;\n lineHeight: string | null;\n listStyle: string | null;\n listStyleImage: string | null;\n listStylePosition: string | null;\n listStyleType: string | null;\n margin: string | null;\n marginBottom: string | null;\n marginLeft: string | null;\n marginRight: string | null;\n marginTop: string | null;\n marker: string | null;\n markerEnd: string | null;\n markerMid: string | null;\n markerStart: string | null;\n mask: string | null;\n maxHeight: string | null;\n maxWidth: string | null;\n minHeight: string | null;\n minWidth: string | null;\n msContentZoomChaining: string | null;\n msContentZooming: string | null;\n msContentZoomLimit: string | null;\n msContentZoomLimitMax: any;\n msContentZoomLimitMin: any;\n msContentZoomSnap: string | null;\n msContentZoomSnapPoints: string | null;\n msContentZoomSnapType: string | null;\n msFlowFrom: string | null;\n msFlowInto: string | null;\n msFontFeatureSettings: string | null;\n msGridColumn: any;\n msGridColumnAlign: string | null;\n msGridColumns: string | null;\n msGridColumnSpan: any;\n msGridRow: any;\n msGridRowAlign: string | null;\n msGridRows: string | null;\n msGridRowSpan: any;\n msHighContrastAdjust: string | null;\n msHyphenateLimitChars: string | null;\n msHyphenateLimitLines: any;\n msHyphenateLimitZone: any;\n msHyphens: string | null;\n msImeAlign: string | null;\n msOverflowStyle: string | null;\n msScrollChaining: string | null;\n msScrollLimit: string | null;\n msScrollLimitXMax: any;\n msScrollLimitXMin: any;\n msScrollLimitYMax: any;\n msScrollLimitYMin: any;\n msScrollRails: string | null;\n msScrollSnapPointsX: string | null;\n msScrollSnapPointsY: string | null;\n msScrollSnapType: string | null;\n msScrollSnapX: string | null;\n msScrollSnapY: string | null;\n msScrollTranslation: string | null;\n msTextCombineHorizontal: string | null;\n msTextSizeAdjust: any;\n msTouchAction: string | null;\n msTouchSelect: string | null;\n msUserSelect: string | null;\n msWrapFlow: string;\n msWrapMargin: any;\n msWrapThrough: string;\n opacity: string | null;\n order: string | null;\n orphans: string | null;\n outline: string | null;\n outlineColor: string | null;\n outlineOffset: string | null;\n outlineStyle: string | null;\n outlineWidth: string | null;\n overflow: string | null;\n overflowX: string | null;\n overflowY: string | null;\n padding: string | null;\n paddingBottom: string | null;\n paddingLeft: string | null;\n paddingRight: string | null;\n paddingTop: string | null;\n pageBreakAfter: string | null;\n pageBreakBefore: string | null;\n pageBreakInside: string | null;\n readonly parentRule: CSSRule;\n perspective: string | null;\n perspectiveOrigin: string | null;\n pointerEvents: string | null;\n position: string | null;\n quotes: string | null;\n right: string | null;\n rotate: string | null;\n rubyAlign: string | null;\n rubyOverhang: string | null;\n rubyPosition: string | null;\n scale: string | null;\n stopColor: string | null;\n stopOpacity: string | null;\n stroke: string | null;\n strokeDasharray: string | null;\n strokeDashoffset: string | null;\n strokeLinecap: string | null;\n strokeLinejoin: string | null;\n strokeMiterlimit: string | null;\n strokeOpacity: string | null;\n strokeWidth: string | null;\n tableLayout: string | null;\n textAlign: string | null;\n textAlignLast: string | null;\n textAnchor: string | null;\n textDecoration: string | null;\n textIndent: string | null;\n textJustify: string | null;\n textKashida: string | null;\n textKashidaSpace: string | null;\n textOverflow: string | null;\n textShadow: string | null;\n textTransform: string | null;\n textUnderlinePosition: string | null;\n top: string | null;\n touchAction: string | null;\n transform: string | null;\n transformOrigin: string | null;\n transformStyle: string | null;\n transition: string | null;\n transitionDelay: string | null;\n transitionDuration: string | null;\n transitionProperty: string | null;\n transitionTimingFunction: string | null;\n translate: string | null;\n unicodeBidi: string | null;\n verticalAlign: string | null;\n visibility: string | null;\n webkitAlignContent: string | null;\n webkitAlignItems: string | null;\n webkitAlignSelf: string | null;\n webkitAnimation: string | null;\n webkitAnimationDelay: string | null;\n webkitAnimationDirection: string | null;\n webkitAnimationDuration: string | null;\n webkitAnimationFillMode: string | null;\n webkitAnimationIterationCount: string | null;\n webkitAnimationName: string | null;\n webkitAnimationPlayState: string | null;\n webkitAnimationTimingFunction: string | null;\n webkitAppearance: string | null;\n webkitBackfaceVisibility: string | null;\n webkitBackgroundClip: string | null;\n webkitBackgroundOrigin: string | null;\n webkitBackgroundSize: string | null;\n webkitBorderBottomLeftRadius: string | null;\n webkitBorderBottomRightRadius: string | null;\n webkitBorderImage: string | null;\n webkitBorderRadius: string | null;\n webkitBorderTopLeftRadius: string | null;\n webkitBorderTopRightRadius: string | null;\n webkitBoxAlign: string | null;\n webkitBoxDirection: string | null;\n webkitBoxFlex: string | null;\n webkitBoxOrdinalGroup: string | null;\n webkitBoxOrient: string | null;\n webkitBoxPack: string | null;\n webkitBoxSizing: string | null;\n webkitColumnBreakAfter: string | null;\n webkitColumnBreakBefore: string | null;\n webkitColumnBreakInside: string | null;\n webkitColumnCount: any;\n webkitColumnGap: any;\n webkitColumnRule: string | null;\n webkitColumnRuleColor: any;\n webkitColumnRuleStyle: string | null;\n webkitColumnRuleWidth: any;\n webkitColumns: string | null;\n webkitColumnSpan: string | null;\n webkitColumnWidth: any;\n webkitFilter: string | null;\n webkitFlex: string | null;\n webkitFlexBasis: string | null;\n webkitFlexDirection: string | null;\n webkitFlexFlow: string | null;\n webkitFlexGrow: string | null;\n webkitFlexShrink: string | null;\n webkitFlexWrap: string | null;\n webkitJustifyContent: string | null;\n webkitOrder: string | null;\n webkitPerspective: string | null;\n webkitPerspectiveOrigin: string | null;\n webkitTapHighlightColor: string | null;\n webkitTextFillColor: string | null;\n webkitTextSizeAdjust: any;\n webkitTextStroke: string | null;\n webkitTextStrokeColor: string | null;\n webkitTextStrokeWidth: string | null;\n webkitTransform: string | null;\n webkitTransformOrigin: string | null;\n webkitTransformStyle: string | null;\n webkitTransition: string | null;\n webkitTransitionDelay: string | null;\n webkitTransitionDuration: string | null;\n webkitTransitionProperty: string | null;\n webkitTransitionTimingFunction: string | null;\n webkitUserModify: string | null;\n webkitUserSelect: string | null;\n webkitWritingMode: string | null;\n whiteSpace: string | null;\n widows: string | null;\n width: string | null;\n wordBreak: string | null;\n wordSpacing: string | null;\n wordWrap: string | null;\n writingMode: string | null;\n zIndex: string | null;\n zoom: string | null;\n resize: string | null;\n userSelect: string | null;\n getPropertyPriority(propertyName: string): string;\n getPropertyValue(propertyName: string): string;\n item(index: number): string;\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string | null, priority?: string): void;\n [index: number]: string;\n}\n\ndeclare var CSSStyleDeclaration: {\n prototype: CSSStyleDeclaration;\n new(): CSSStyleDeclaration;\n};\n\ninterface CSSStyleRule extends CSSRule {\n readonly readOnly: boolean;\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSStyleRule: {\n prototype: CSSStyleRule;\n new(): CSSStyleRule;\n};\n\ninterface CSSStyleSheet extends StyleSheet {\n readonly cssRules: CSSRuleList;\n cssText: string;\n readonly id: string;\n readonly imports: StyleSheetList;\n readonly isAlternate: boolean;\n readonly isPrefAlternate: boolean;\n readonly ownerRule: CSSRule;\n readonly owningElement: Element;\n readonly pages: StyleSheetPageList;\n readonly readOnly: boolean;\n readonly rules: CSSRuleList;\n addImport(bstrURL: string, lIndex?: number): number;\n addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;\n addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;\n deleteRule(index?: number): void;\n insertRule(rule: string, index?: number): number;\n removeImport(lIndex: number): void;\n removeRule(lIndex: number): void;\n}\n\ndeclare var CSSStyleSheet: {\n prototype: CSSStyleSheet;\n new(): CSSStyleSheet;\n};\n\ninterface CSSSupportsRule extends CSSConditionRule {\n}\n\ndeclare var CSSSupportsRule: {\n prototype: CSSSupportsRule;\n new(): CSSSupportsRule;\n};\n\ninterface CustomEvent extends Event {\n readonly detail: T;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;\n}\n\ndeclare var CustomEvent: {\n prototype: CustomEvent;\n new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;\n};\n\ninterface DataCue extends TextTrackCue {\n data: ArrayBuffer;\n addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var DataCue: {\n prototype: DataCue;\n new(): DataCue;\n};\n\ninterface DataTransfer {\n dropEffect: string;\n effectAllowed: string;\n readonly files: FileList;\n readonly items: DataTransferItemList;\n readonly types: string[];\n clearData(format?: string): boolean;\n getData(format: string): string;\n setData(format: string, data: string): boolean;\n setDragImage(image: Element, x: number, y: number): void;\n}\n\ndeclare var DataTransfer: {\n prototype: DataTransfer;\n new(): DataTransfer;\n};\n\ninterface DataTransferItem {\n readonly kind: string;\n readonly type: string;\n getAsFile(): File | null;\n getAsString(_callback: FunctionStringCallback | null): void;\n webkitGetAsEntry(): any;\n}\n\ndeclare var DataTransferItem: {\n prototype: DataTransferItem;\n new(): DataTransferItem;\n};\n\ninterface DataTransferItemList {\n readonly length: number;\n add(data: File): DataTransferItem | null;\n clear(): void;\n item(index: number): DataTransferItem;\n remove(index: number): void;\n [index: number]: DataTransferItem;\n}\n\ndeclare var DataTransferItemList: {\n prototype: DataTransferItemList;\n new(): DataTransferItemList;\n};\n\ninterface DeferredPermissionRequest {\n readonly id: number;\n readonly type: MSWebViewPermissionType;\n readonly uri: string;\n allow(): void;\n deny(): void;\n}\n\ndeclare var DeferredPermissionRequest: {\n prototype: DeferredPermissionRequest;\n new(): DeferredPermissionRequest;\n};\n\ninterface DelayNode extends AudioNode {\n readonly delayTime: AudioParam;\n}\n\ndeclare var DelayNode: {\n prototype: DelayNode;\n new(): DelayNode;\n};\n\ninterface DeviceAcceleration {\n readonly x: number | null;\n readonly y: number | null;\n readonly z: number | null;\n}\n\ndeclare var DeviceAcceleration: {\n prototype: DeviceAcceleration;\n new(): DeviceAcceleration;\n};\n\ninterface DeviceLightEvent extends Event {\n readonly value: number;\n}\n\ndeclare var DeviceLightEvent: {\n prototype: DeviceLightEvent;\n new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;\n};\n\ninterface DeviceMotionEvent extends Event {\n readonly acceleration: DeviceAcceleration | null;\n readonly accelerationIncludingGravity: DeviceAcceleration | null;\n readonly interval: number | null;\n readonly rotationRate: DeviceRotationRate | null;\n initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void;\n}\n\ndeclare var DeviceMotionEvent: {\n prototype: DeviceMotionEvent;\n new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent;\n};\n\ninterface DeviceOrientationEvent extends Event {\n readonly absolute: boolean;\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void;\n}\n\ndeclare var DeviceOrientationEvent: {\n prototype: DeviceOrientationEvent;\n new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent;\n};\n\ninterface DeviceRotationRate {\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n}\n\ndeclare var DeviceRotationRate: {\n prototype: DeviceRotationRate;\n new(): DeviceRotationRate;\n};\n\ninterface DocumentEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"activate\": UIEvent;\n \"beforeactivate\": UIEvent;\n \"beforedeactivate\": UIEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": UIEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": MediaStreamErrorEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"fullscreenchange\": Event;\n \"fullscreenerror\": Event;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": UIEvent;\n \"MSGestureChange\": MSGestureEvent;\n \"MSGestureDoubleTap\": MSGestureEvent;\n \"MSGestureEnd\": MSGestureEvent;\n \"MSGestureHold\": MSGestureEvent;\n \"MSGestureStart\": MSGestureEvent;\n \"MSGestureTap\": MSGestureEvent;\n \"MSInertiaStart\": MSGestureEvent;\n \"MSManipulationStateChanged\": MSManipulationEvent;\n \"MSPointerCancel\": MSPointerEvent;\n \"MSPointerDown\": MSPointerEvent;\n \"MSPointerEnter\": MSPointerEvent;\n \"MSPointerLeave\": MSPointerEvent;\n \"MSPointerMove\": MSPointerEvent;\n \"MSPointerOut\": MSPointerEvent;\n \"MSPointerOver\": MSPointerEvent;\n \"MSPointerUp\": MSPointerEvent;\n \"mssitemodejumplistitemremoved\": MSSiteModeEvent;\n \"msthumbnailclick\": MSSiteModeEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"pointerlockchange\": Event;\n \"pointerlockerror\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectionchange\": Event;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"stop\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": TouchEvent;\n \"touchend\": TouchEvent;\n \"touchmove\": TouchEvent;\n \"touchstart\": TouchEvent;\n \"volumechange\": Event;\n \"waiting\": Event;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot {\n /**\n * Gets the object that has the focus when the parent document has focus.\n */\n readonly activeElement: Element;\n /**\n * Sets or gets the color of all active links in the document.\n */\n alinkColor: string;\n /**\n * Returns a reference to the collection of elements contained by the object.\n */\n readonly all: HTMLAllCollection;\n /**\n * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.\n */\n anchors: HTMLCollectionOf;\n /**\n * Retrieves a collection of all applet objects in the document.\n */\n applets: HTMLCollectionOf;\n /**\n * Deprecated. Sets or retrieves a value that indicates the background color behind the object.\n */\n bgColor: string;\n /**\n * Specifies the beginning and end of the document body.\n */\n body: HTMLElement;\n readonly characterSet: string;\n /**\n * Gets or sets the character set used to encode the object.\n */\n charset: string;\n /**\n * Gets a value that indicates whether standards-compliant mode is switched on for the object.\n */\n readonly compatMode: string;\n cookie: string;\n readonly currentScript: HTMLScriptElement | SVGScriptElement | null;\n readonly defaultView: Window;\n /**\n * Sets or gets a value that indicates whether the document can be edited.\n */\n designMode: string;\n /**\n * Sets or retrieves a value that indicates the reading order of the object.\n */\n dir: string;\n /**\n * Gets an object representing the document type declaration associated with the current document.\n */\n readonly doctype: DocumentType;\n /**\n * Gets a reference to the root node of the document.\n */\n documentElement: HTMLElement;\n /**\n * Sets or gets the security domain of the document.\n */\n domain: string;\n /**\n * Retrieves a collection of all embed objects in the document.\n */\n embeds: HTMLCollectionOf;\n /**\n * Sets or gets the foreground (text) color of the document.\n */\n fgColor: string;\n /**\n * Retrieves a collection, in source order, of all form objects in the document.\n */\n forms: HTMLCollectionOf;\n readonly fullscreenElement: Element | null;\n readonly fullscreenEnabled: boolean;\n readonly head: HTMLHeadElement;\n readonly hidden: boolean;\n /**\n * Retrieves a collection, in source order, of img objects in the document.\n */\n images: HTMLCollectionOf;\n /**\n * Gets the implementation object of the current document.\n */\n readonly implementation: DOMImplementation;\n /**\n * Returns the character encoding used to create the webpage that is loaded into the document object.\n */\n readonly inputEncoding: string | null;\n /**\n * Gets the date that the page was last modified, if the page supplies one.\n */\n readonly lastModified: string;\n /**\n * Sets or gets the color of the document links.\n */\n linkColor: string;\n /**\n * Retrieves a collection of all a objects that specify the href property and all area objects in the document.\n */\n links: HTMLCollectionOf;\n /**\n * Contains information about the current URL.\n */\n readonly location: Location;\n msCapsLockWarningOff: boolean;\n msCSSOMElementFloatMetrics: boolean;\n /**\n * Fires when the user aborts the download.\n * @param ev The event.\n */\n onabort: (this: Document, ev: UIEvent) => any;\n /**\n * Fires when the object is set as the active element.\n * @param ev The event.\n */\n onactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires immediately before the object is set as the active element.\n * @param ev The event.\n */\n onbeforeactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires immediately before the activeElement is changed from the current object to another object in the parent document.\n * @param ev The event.\n */\n onbeforedeactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires when the object loses the input focus.\n * @param ev The focus event.\n */\n onblur: (this: Document, ev: FocusEvent) => any;\n /**\n * Occurs when playback is possible, but would require further buffering.\n * @param ev The event.\n */\n oncanplay: (this: Document, ev: Event) => any;\n oncanplaythrough: (this: Document, ev: Event) => any;\n /**\n * Fires when the contents of the object or selection have changed.\n * @param ev The event.\n */\n onchange: (this: Document, ev: Event) => any;\n /**\n * Fires when the user clicks the left mouse button on the object\n * @param ev The mouse event.\n */\n onclick: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user clicks the right mouse button in the client area, opening the context menu.\n * @param ev The mouse event.\n */\n oncontextmenu: (this: Document, ev: PointerEvent) => any;\n /**\n * Fires when the user double-clicks the object.\n * @param ev The mouse event.\n */\n ondblclick: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the activeElement is changed from the current object to another object in the parent document.\n * @param ev The UI Event\n */\n ondeactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires on the source object continuously during a drag operation.\n * @param ev The event.\n */\n ondrag: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the source object when the user releases the mouse at the close of a drag operation.\n * @param ev The event.\n */\n ondragend: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the target element when the user drags the object to a valid drop target.\n * @param ev The drag event.\n */\n ondragenter: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\n * @param ev The drag event.\n */\n ondragleave: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the target element continuously while the user drags the object over a valid drop target.\n * @param ev The event.\n */\n ondragover: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the source object when the user starts to drag a text selection or selected object.\n * @param ev The event.\n */\n ondragstart: (this: Document, ev: DragEvent) => any;\n ondrop: (this: Document, ev: DragEvent) => any;\n /**\n * Occurs when the duration attribute is updated.\n * @param ev The event.\n */\n ondurationchange: (this: Document, ev: Event) => any;\n /**\n * Occurs when the media element is reset to its initial state.\n * @param ev The event.\n */\n onemptied: (this: Document, ev: Event) => any;\n /**\n * Occurs when the end of playback is reached.\n * @param ev The event\n */\n onended: (this: Document, ev: MediaStreamErrorEvent) => any;\n /**\n * Fires when an error occurs during object loading.\n * @param ev The event.\n */\n onerror: (this: Document, ev: ErrorEvent) => any;\n /**\n * Fires when the object receives focus.\n * @param ev The event.\n */\n onfocus: (this: Document, ev: FocusEvent) => any;\n onfullscreenchange: (this: Document, ev: Event) => any;\n onfullscreenerror: (this: Document, ev: Event) => any;\n oninput: (this: Document, ev: Event) => any;\n oninvalid: (this: Document, ev: Event) => any;\n /**\n * Fires when the user presses a key.\n * @param ev The keyboard event\n */\n onkeydown: (this: Document, ev: KeyboardEvent) => any;\n /**\n * Fires when the user presses an alphanumeric key.\n * @param ev The event.\n */\n onkeypress: (this: Document, ev: KeyboardEvent) => any;\n /**\n * Fires when the user releases a key.\n * @param ev The keyboard event\n */\n onkeyup: (this: Document, ev: KeyboardEvent) => any;\n /**\n * Fires immediately after the browser loads the object.\n * @param ev The event.\n */\n onload: (this: Document, ev: Event) => any;\n /**\n * Occurs when media data is loaded at the current playback position.\n * @param ev The event.\n */\n onloadeddata: (this: Document, ev: Event) => any;\n /**\n * Occurs when the duration and dimensions of the media have been determined.\n * @param ev The event.\n */\n onloadedmetadata: (this: Document, ev: Event) => any;\n /**\n * Occurs when Internet Explorer begins looking for media data.\n * @param ev The event.\n */\n onloadstart: (this: Document, ev: Event) => any;\n /**\n * Fires when the user clicks the object with either mouse button.\n * @param ev The mouse event.\n */\n onmousedown: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user moves the mouse over the object.\n * @param ev The mouse event.\n */\n onmousemove: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user moves the mouse pointer outside the boundaries of the object.\n * @param ev The mouse event.\n */\n onmouseout: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user moves the mouse pointer into the object.\n * @param ev The mouse event.\n */\n onmouseover: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user releases a mouse button while the mouse is over the object.\n * @param ev The mouse event.\n */\n onmouseup: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the wheel button is rotated.\n * @param ev The mouse event\n */\n onmousewheel: (this: Document, ev: WheelEvent) => any;\n onmscontentzoom: (this: Document, ev: UIEvent) => any;\n onmsgesturechange: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any;\n onmsgestureend: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturehold: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturestart: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturetap: (this: Document, ev: MSGestureEvent) => any;\n onmsinertiastart: (this: Document, ev: MSGestureEvent) => any;\n onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any;\n onmspointercancel: (this: Document, ev: MSPointerEvent) => any;\n onmspointerdown: (this: Document, ev: MSPointerEvent) => any;\n onmspointerenter: (this: Document, ev: MSPointerEvent) => any;\n onmspointerleave: (this: Document, ev: MSPointerEvent) => any;\n onmspointermove: (this: Document, ev: MSPointerEvent) => any;\n onmspointerout: (this: Document, ev: MSPointerEvent) => any;\n onmspointerover: (this: Document, ev: MSPointerEvent) => any;\n onmspointerup: (this: Document, ev: MSPointerEvent) => any;\n /**\n * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any;\n /**\n * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any;\n /**\n * Occurs when playback is paused.\n * @param ev The event.\n */\n onpause: (this: Document, ev: Event) => any;\n /**\n * Occurs when the play method is requested.\n * @param ev The event.\n */\n onplay: (this: Document, ev: Event) => any;\n /**\n * Occurs when the audio or video has started playing.\n * @param ev The event.\n */\n onplaying: (this: Document, ev: Event) => any;\n onpointerlockchange: (this: Document, ev: Event) => any;\n onpointerlockerror: (this: Document, ev: Event) => any;\n /**\n * Occurs to indicate progress while downloading media data.\n * @param ev The event.\n */\n onprogress: (this: Document, ev: ProgressEvent) => any;\n /**\n * Occurs when the playback rate is increased or decreased.\n * @param ev The event.\n */\n onratechange: (this: Document, ev: Event) => any;\n /**\n * Fires when the state of the object has changed.\n * @param ev The event\n */\n onreadystatechange: (this: Document, ev: Event) => any;\n /**\n * Fires when the user resets a form.\n * @param ev The event.\n */\n onreset: (this: Document, ev: Event) => any;\n /**\n * Fires when the user repositions the scroll box in the scroll bar on the object.\n * @param ev The event.\n */\n onscroll: (this: Document, ev: UIEvent) => any;\n /**\n * Occurs when the seek operation ends.\n * @param ev The event.\n */\n onseeked: (this: Document, ev: Event) => any;\n /**\n * Occurs when the current playback position is moved.\n * @param ev The event.\n */\n onseeking: (this: Document, ev: Event) => any;\n /**\n * Fires when the current selection changes.\n * @param ev The event.\n */\n onselect: (this: Document, ev: UIEvent) => any;\n /**\n * Fires when the selection state of a document changes.\n * @param ev The event.\n */\n onselectionchange: (this: Document, ev: Event) => any;\n onselectstart: (this: Document, ev: Event) => any;\n /**\n * Occurs when the download has stopped.\n * @param ev The event.\n */\n onstalled: (this: Document, ev: Event) => any;\n /**\n * Fires when the user clicks the Stop button or leaves the Web page.\n * @param ev The event.\n */\n onstop: (this: Document, ev: Event) => any;\n onsubmit: (this: Document, ev: Event) => any;\n /**\n * Occurs if the load operation has been intentionally halted.\n * @param ev The event.\n */\n onsuspend: (this: Document, ev: Event) => any;\n /**\n * Occurs to indicate the current playback position.\n * @param ev The event.\n */\n ontimeupdate: (this: Document, ev: Event) => any;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n /**\n * Occurs when the volume is changed, or playback is muted or unmuted.\n * @param ev The event.\n */\n onvolumechange: (this: Document, ev: Event) => any;\n /**\n * Occurs when playback stops because the next frame of a video resource is not available.\n * @param ev The event.\n */\n onwaiting: (this: Document, ev: Event) => any;\n onwebkitfullscreenchange: (this: Document, ev: Event) => any;\n onwebkitfullscreenerror: (this: Document, ev: Event) => any;\n plugins: HTMLCollectionOf;\n readonly pointerLockElement: Element;\n /**\n * Retrieves a value that indicates the current state of the object.\n */\n readonly readyState: string;\n /**\n * Gets the URL of the location that referred the user to the current page.\n */\n readonly referrer: string;\n /**\n * Gets the root svg element in the document hierarchy.\n */\n readonly rootElement: SVGSVGElement;\n /**\n * Retrieves a collection of all script objects in the document.\n */\n scripts: HTMLCollectionOf;\n readonly scrollingElement: Element | null;\n /**\n * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\n */\n readonly styleSheets: StyleSheetList;\n /**\n * Contains the title of the document.\n */\n title: string;\n /**\n * Sets or gets the URL for the current document.\n */\n readonly URL: string;\n /**\n * Gets the URL for the document, stripped of any character encoding.\n */\n readonly URLUnencoded: string;\n readonly visibilityState: VisibilityState;\n /**\n * Sets or gets the color of the links that the user has visited.\n */\n vlinkColor: string;\n readonly webkitCurrentFullScreenElement: Element | null;\n readonly webkitFullscreenElement: Element | null;\n readonly webkitFullscreenEnabled: boolean;\n readonly webkitIsFullScreen: boolean;\n readonly xmlEncoding: string | null;\n xmlStandalone: boolean;\n /**\n * Gets or sets the version attribute specified in the declaration of an XML document.\n */\n xmlVersion: string | null;\n adoptNode(source: T): T;\n captureEvents(): void;\n caretRangeFromPoint(x: number, y: number): Range;\n clear(): void;\n /**\n * Closes an output stream and forces the sent data to display.\n */\n close(): void;\n /**\n * Creates an attribute object with a specified name.\n * @param name String that sets the attribute object's name.\n */\n createAttribute(name: string): Attr;\n createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr;\n createCDATASection(data: string): CDATASection;\n /**\n * Creates a comment object with the specified data.\n * @param data Sets the comment object's data.\n */\n createComment(data: string): Comment;\n /**\n * Creates a new document.\n */\n createDocumentFragment(): DocumentFragment;\n /**\n * Creates an instance of the element for the specified tag.\n * @param tagName The name of an element.\n */\n createElement(tagName: K): HTMLElementTagNameMap[K];\n createElement(tagName: string): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"a\"): SVGAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"circle\"): SVGCircleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"clipPath\"): SVGClipPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"componentTransferFunction\"): SVGComponentTransferFunctionElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"defs\"): SVGDefsElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"desc\"): SVGDescElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"ellipse\"): SVGEllipseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feBlend\"): SVGFEBlendElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feColorMatrix\"): SVGFEColorMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComponentTransfer\"): SVGFEComponentTransferElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComposite\"): SVGFECompositeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feConvolveMatrix\"): SVGFEConvolveMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDiffuseLighting\"): SVGFEDiffuseLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDisplacementMap\"): SVGFEDisplacementMapElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDistantLight\"): SVGFEDistantLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFlood\"): SVGFEFloodElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncA\"): SVGFEFuncAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncB\"): SVGFEFuncBElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncG\"): SVGFEFuncGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncR\"): SVGFEFuncRElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feGaussianBlur\"): SVGFEGaussianBlurElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feImage\"): SVGFEImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMerge\"): SVGFEMergeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMergeNode\"): SVGFEMergeNodeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMorphology\"): SVGFEMorphologyElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feOffset\"): SVGFEOffsetElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"fePointLight\"): SVGFEPointLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpecularLighting\"): SVGFESpecularLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpotLight\"): SVGFESpotLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTile\"): SVGFETileElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTurbulence\"): SVGFETurbulenceElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"filter\"): SVGFilterElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"foreignObject\"): SVGForeignObjectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"g\"): SVGGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"image\"): SVGImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"gradient\"): SVGGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"line\"): SVGLineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"linearGradient\"): SVGLinearGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"marker\"): SVGMarkerElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"mask\"): SVGMaskElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"path\"): SVGPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"metadata\"): SVGMetadataElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"pattern\"): SVGPatternElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polygon\"): SVGPolygonElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polyline\"): SVGPolylineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"radialGradient\"): SVGRadialGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"rect\"): SVGRectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"svg\"): SVGSVGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"script\"): SVGScriptElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"stop\"): SVGStopElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"style\"): SVGStyleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"switch\"): SVGSwitchElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"symbol\"): SVGSymbolElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"tspan\"): SVGTSpanElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textContent\"): SVGTextContentElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"text\"): SVGTextElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPath\"): SVGTextPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPositioning\"): SVGTextPositioningElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"title\"): SVGTitleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"use\"): SVGUseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"view\"): SVGViewElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: string): SVGElement;\n createElementNS(namespaceURI: string | null, qualifiedName: string): Element;\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list\n * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;\n createNSResolver(nodeResolver: Node): XPathNSResolver;\n createProcessingInstruction(target: string, data: string): ProcessingInstruction;\n /**\n * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.\n */\n createRange(): Range;\n /**\n * Creates a text string from the specified value.\n * @param data String that specifies the nodeValue property of the text node.\n */\n createTextNode(data: string): Text;\n createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;\n createTouchList(...touches: Touch[]): TouchList;\n /**\n * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.\n * @param filter A custom NodeFilter function to use.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;\n /**\n * Returns the element for the specified x coordinate and the specified y coordinate.\n * @param x The x-offset\n * @param y The y-offset\n */\n elementFromPoint(x: number, y: number): Element;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n /**\n * Executes a command on the current document, current selection, or the given range.\n * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.\n * @param showUI Display the user interface, defaults to false.\n * @param value Value to assign.\n */\n execCommand(commandId: string, showUI?: boolean, value?: any): boolean;\n /**\n * Displays help information for the given command identifier.\n * @param commandId Displays help information for the given command identifier.\n */\n execCommandShowHelp(commandId: string): boolean;\n exitFullscreen(): void;\n exitPointerLock(): void;\n /**\n * Causes the element to receive the focus and executes the code specified by the onfocus event.\n */\n focus(): void;\n /**\n * Returns a reference to the first object with the specified value of the ID or NAME attribute.\n * @param elementId String that specifies the ID value. Case-insensitive.\n */\n getElementById(elementId: string): HTMLElement | null;\n getElementsByClassName(classNames: string): HTMLCollectionOf;\n /**\n * Gets a collection of objects based on the value of the NAME or ID attribute.\n * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.\n */\n getElementsByName(elementName: string): NodeListOf;\n /**\n * Retrieves a collection of objects based on the specified element name.\n * @param name Specifies the name of an element.\n */\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n /**\n * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.\n */\n getSelection(): Selection;\n /**\n * Gets a value indicating whether the object currently has focus.\n */\n hasFocus(): boolean;\n importNode(importedNode: T, deep: boolean): T;\n msElementsFromPoint(x: number, y: number): NodeListOf;\n msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf;\n /**\n * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.\n * @param url Specifies a MIME type for the document.\n * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.\n * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, \"fullscreen=yes, toolbar=yes\"). The following values are supported.\n * @param replace Specifies whether the existing entry for the document is replaced in the history list.\n */\n open(url?: string, name?: string, features?: string, replace?: boolean): Document;\n /**\n * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.\n * @param commandId Specifies a command identifier.\n */\n queryCommandEnabled(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandIndeterm(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates the current state of the command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandState(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the current command is supported on the current range.\n * @param commandId Specifies a command identifier.\n */\n queryCommandSupported(commandId: string): boolean;\n /**\n * Retrieves the string associated with a command.\n * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.\n */\n queryCommandText(commandId: string): string;\n /**\n * Returns the current value of the document, range, or current selection for the given command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandValue(commandId: string): string;\n releaseEvents(): void;\n /**\n * Allows updating the print settings for the page.\n */\n updateSettings(): void;\n webkitCancelFullScreen(): void;\n webkitExitFullscreen(): void;\n /**\n * Writes one or more HTML expressions to a document in the specified window.\n * @param content Specifies the text and HTML tags to write.\n */\n write(...content: string[]): void;\n /**\n * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.\n * @param content The text and HTML tags to write.\n */\n writeln(...content: string[]): void;\n addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Document: {\n prototype: Document;\n new(): Document;\n};\n\ninterface DocumentFragment extends Node, NodeSelector, ParentNode {\n getElementById(elementId: string): HTMLElement | null;\n}\n\ndeclare var DocumentFragment: {\n prototype: DocumentFragment;\n new(): DocumentFragment;\n};\n\ninterface DocumentType extends Node, ChildNode {\n readonly entities: NamedNodeMap;\n readonly internalSubset: string | null;\n readonly name: string;\n readonly notations: NamedNodeMap;\n readonly publicId: string;\n readonly systemId: string;\n}\n\ndeclare var DocumentType: {\n prototype: DocumentType;\n new(): DocumentType;\n};\n\ninterface DOMError {\n readonly name: string;\n toString(): string;\n}\n\ndeclare var DOMError: {\n prototype: DOMError;\n new(): DOMError;\n};\n\ninterface DOMException {\n readonly code: number;\n readonly message: string;\n readonly name: string;\n toString(): string;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n}\n\ndeclare var DOMException: {\n prototype: DOMException;\n new(message?: string, name?: string): DOMException;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n};\n\ninterface DOMImplementation {\n createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document;\n createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;\n createHTMLDocument(title: string): Document;\n hasFeature(feature: string | null, version: string | null): boolean;\n}\n\ndeclare var DOMImplementation: {\n prototype: DOMImplementation;\n new(): DOMImplementation;\n};\n\ninterface DOMParser {\n parseFromString(source: string, mimeType: string): Document;\n}\n\ndeclare var DOMParser: {\n prototype: DOMParser;\n new(): DOMParser;\n};\n\ninterface DOMSettableTokenList extends DOMTokenList {\n value: string;\n}\n\ndeclare var DOMSettableTokenList: {\n prototype: DOMSettableTokenList;\n new(): DOMSettableTokenList;\n};\n\ninterface DOMStringList {\n readonly length: number;\n contains(str: string): boolean;\n item(index: number): string | null;\n [index: number]: string;\n}\n\ndeclare var DOMStringList: {\n prototype: DOMStringList;\n new(): DOMStringList;\n};\n\ninterface DOMStringMap {\n [name: string]: string | undefined;\n}\n\ndeclare var DOMStringMap: {\n prototype: DOMStringMap;\n new(): DOMStringMap;\n};\n\ninterface DOMTokenList {\n readonly length: number;\n add(...token: string[]): void;\n contains(token: string): boolean;\n item(index: number): string;\n remove(...token: string[]): void;\n toggle(token: string, force?: boolean): boolean;\n toString(): string;\n [index: number]: string;\n}\n\ndeclare var DOMTokenList: {\n prototype: DOMTokenList;\n new(): DOMTokenList;\n};\n\ninterface DragEvent extends MouseEvent {\n readonly dataTransfer: DataTransfer;\n initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void;\n msConvertURL(file: File, targetType: string, targetURL?: string): void;\n}\n\ndeclare var DragEvent: {\n prototype: DragEvent;\n new(type: \"drag\" | \"dragend\" | \"dragenter\" | \"dragexit\" | \"dragleave\" | \"dragover\" | \"dragstart\" | \"drop\", dragEventInit?: { dataTransfer?: DataTransfer }): DragEvent;\n};\n\ninterface DynamicsCompressorNode extends AudioNode {\n readonly attack: AudioParam;\n readonly knee: AudioParam;\n readonly ratio: AudioParam;\n readonly reduction: number;\n readonly release: AudioParam;\n readonly threshold: AudioParam;\n}\n\ndeclare var DynamicsCompressorNode: {\n prototype: DynamicsCompressorNode;\n new(): DynamicsCompressorNode;\n};\n\ninterface ElementEventMap extends GlobalEventHandlersEventMap {\n \"ariarequest\": Event;\n \"command\": Event;\n \"gotpointercapture\": PointerEvent;\n \"lostpointercapture\": PointerEvent;\n \"MSGestureChange\": MSGestureEvent;\n \"MSGestureDoubleTap\": MSGestureEvent;\n \"MSGestureEnd\": MSGestureEvent;\n \"MSGestureHold\": MSGestureEvent;\n \"MSGestureStart\": MSGestureEvent;\n \"MSGestureTap\": MSGestureEvent;\n \"MSGotPointerCapture\": MSPointerEvent;\n \"MSInertiaStart\": MSGestureEvent;\n \"MSLostPointerCapture\": MSPointerEvent;\n \"MSPointerCancel\": MSPointerEvent;\n \"MSPointerDown\": MSPointerEvent;\n \"MSPointerEnter\": MSPointerEvent;\n \"MSPointerLeave\": MSPointerEvent;\n \"MSPointerMove\": MSPointerEvent;\n \"MSPointerOut\": MSPointerEvent;\n \"MSPointerOver\": MSPointerEvent;\n \"MSPointerUp\": MSPointerEvent;\n \"touchcancel\": TouchEvent;\n \"touchend\": TouchEvent;\n \"touchmove\": TouchEvent;\n \"touchstart\": TouchEvent;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode {\n readonly classList: DOMTokenList;\n className: string;\n readonly clientHeight: number;\n readonly clientLeft: number;\n readonly clientTop: number;\n readonly clientWidth: number;\n id: string;\n innerHTML: string;\n msContentZoomFactor: number;\n readonly msRegionOverflow: string;\n onariarequest: (this: Element, ev: Event) => any;\n oncommand: (this: Element, ev: Event) => any;\n ongotpointercapture: (this: Element, ev: PointerEvent) => any;\n onlostpointercapture: (this: Element, ev: PointerEvent) => any;\n onmsgesturechange: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any;\n onmsgestureend: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturehold: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturestart: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturetap: (this: Element, ev: MSGestureEvent) => any;\n onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any;\n onmsinertiastart: (this: Element, ev: MSGestureEvent) => any;\n onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any;\n onmspointercancel: (this: Element, ev: MSPointerEvent) => any;\n onmspointerdown: (this: Element, ev: MSPointerEvent) => any;\n onmspointerenter: (this: Element, ev: MSPointerEvent) => any;\n onmspointerleave: (this: Element, ev: MSPointerEvent) => any;\n onmspointermove: (this: Element, ev: MSPointerEvent) => any;\n onmspointerout: (this: Element, ev: MSPointerEvent) => any;\n onmspointerover: (this: Element, ev: MSPointerEvent) => any;\n onmspointerup: (this: Element, ev: MSPointerEvent) => any;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n onwebkitfullscreenchange: (this: Element, ev: Event) => any;\n onwebkitfullscreenerror: (this: Element, ev: Event) => any;\n outerHTML: string;\n readonly prefix: string | null;\n readonly scrollHeight: number;\n scrollLeft: number;\n scrollTop: number;\n readonly scrollWidth: number;\n readonly tagName: string;\n readonly assignedSlot: HTMLSlotElement | null;\n slot: string;\n readonly shadowRoot: ShadowRoot | null;\n getAttribute(name: string): string | null;\n getAttributeNode(name: string): Attr | null;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null;\n getAttributeNS(namespaceURI: string, localName: string): string;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n hasAttribute(name: string): boolean;\n hasAttributeNS(namespaceURI: string, localName: string): boolean;\n msGetRegionContent(): MSRangeCollection;\n msGetUntransformedBounds(): ClientRect;\n msMatchesSelector(selectors: string): boolean;\n msReleasePointerCapture(pointerId: number): void;\n msSetPointerCapture(pointerId: number): void;\n msZoomTo(args: MsZoomToOptions): void;\n releasePointerCapture(pointerId: number): void;\n removeAttribute(qualifiedName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n removeAttributeNS(namespaceURI: string, localName: string): void;\n requestFullscreen(): void;\n requestPointerLock(): void;\n setAttribute(name: string, value: string): void;\n setAttributeNode(newAttr: Attr): Attr;\n setAttributeNodeNS(newAttr: Attr): Attr;\n setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;\n setPointerCapture(pointerId: number): void;\n webkitMatchesSelector(selectors: string): boolean;\n webkitRequestFullscreen(): void;\n webkitRequestFullScreen(): void;\n getElementsByClassName(classNames: string): NodeListOf;\n matches(selector: string): boolean;\n closest(selector: K): HTMLElementTagNameMap[K] | null;\n closest(selector: K): SVGElementTagNameMap[K] | null;\n closest(selector: string): Element | null;\n scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;\n scroll(options?: ScrollToOptions): void;\n scroll(x: number, y: number): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x: number, y: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x: number, y: number): void;\n insertAdjacentElement(position: InsertPosition, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: InsertPosition, html: string): void;\n insertAdjacentText(where: InsertPosition, text: string): void;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Element: {\n prototype: Element;\n new(): Element;\n};\n\ninterface ErrorEvent extends Event {\n readonly colno: number;\n readonly error: any;\n readonly filename: string;\n readonly lineno: number;\n readonly message: string;\n initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void;\n}\n\ndeclare var ErrorEvent: {\n prototype: ErrorEvent;\n new(type: string, errorEventInitDict?: ErrorEventInit): ErrorEvent;\n};\n\ninterface Event {\n readonly bubbles: boolean;\n readonly cancelable: boolean;\n cancelBubble: boolean;\n readonly currentTarget: EventTarget;\n readonly defaultPrevented: boolean;\n readonly eventPhase: number;\n readonly isTrusted: boolean;\n returnValue: boolean;\n readonly srcElement: Element | null;\n readonly target: EventTarget;\n readonly timeStamp: number;\n readonly type: string;\n readonly scoped: boolean;\n initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void;\n preventDefault(): void;\n stopImmediatePropagation(): void;\n stopPropagation(): void;\n deepPath(): EventTarget[];\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n}\n\ndeclare var Event: {\n prototype: Event;\n new(typeArg: string, eventInitDict?: EventInit): Event;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n};\n\ninterface EventTarget {\n addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n dispatchEvent(evt: Event): boolean;\n removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var EventTarget: {\n prototype: EventTarget;\n new(): EventTarget;\n};\n\ninterface EXT_frag_depth {\n}\n\ndeclare var EXT_frag_depth: {\n prototype: EXT_frag_depth;\n new(): EXT_frag_depth;\n};\n\ninterface EXT_texture_filter_anisotropic {\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n}\n\ndeclare var EXT_texture_filter_anisotropic: {\n prototype: EXT_texture_filter_anisotropic;\n new(): EXT_texture_filter_anisotropic;\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n};\n\ninterface ExtensionScriptApis {\n extensionIdToShortId(extensionId: string): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean): void;\n genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n getExtensionId(): string;\n registerGenericFunctionCallbackHandler(callbackHandler: any): void;\n registerGenericPersistentCallbackHandler(callbackHandler: any): void;\n}\n\ndeclare var ExtensionScriptApis: {\n prototype: ExtensionScriptApis;\n new(): ExtensionScriptApis;\n};\n\ninterface External {\n}\n\ndeclare var External: {\n prototype: External;\n new(): External;\n};\n\ninterface File extends Blob {\n readonly lastModifiedDate: Date;\n readonly name: string;\n readonly webkitRelativePath: string;\n readonly lastModified: number;\n}\n\ndeclare var File: {\n prototype: File;\n new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;\n};\n\ninterface FileList {\n readonly length: number;\n item(index: number): File;\n [index: number]: File;\n}\n\ndeclare var FileList: {\n prototype: FileList;\n new(): FileList;\n};\n\ninterface FileReader extends EventTarget, MSBaseReader {\n readonly error: DOMError;\n readAsArrayBuffer(blob: Blob): void;\n readAsBinaryString(blob: Blob): void;\n readAsDataURL(blob: Blob): void;\n readAsText(blob: Blob, encoding?: string): void;\n addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var FileReader: {\n prototype: FileReader;\n new(): FileReader;\n};\n\ninterface FocusEvent extends UIEvent {\n readonly relatedTarget: EventTarget;\n initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;\n}\n\ndeclare var FocusEvent: {\n prototype: FocusEvent;\n new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent;\n};\n\ninterface FocusNavigationEvent extends Event {\n readonly navigationReason: NavigationReason;\n readonly originHeight: number;\n readonly originLeft: number;\n readonly originTop: number;\n readonly originWidth: number;\n requestFocus(): void;\n}\n\ndeclare var FocusNavigationEvent: {\n prototype: FocusNavigationEvent;\n new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent;\n};\n\ninterface FormData {\n append(name: string, value: string | Blob, fileName?: string): void;\n delete(name: string): void;\n get(name: string): FormDataEntryValue | null;\n getAll(name: string): FormDataEntryValue[];\n has(name: string): boolean;\n set(name: string, value: string | Blob, fileName?: string): void;\n}\n\ndeclare var FormData: {\n prototype: FormData;\n new (form?: HTMLFormElement): FormData;\n};\n\ninterface GainNode extends AudioNode {\n readonly gain: AudioParam;\n}\n\ndeclare var GainNode: {\n prototype: GainNode;\n new(): GainNode;\n};\n\ninterface Gamepad {\n readonly axes: number[];\n readonly buttons: GamepadButton[];\n readonly connected: boolean;\n readonly id: string;\n readonly index: number;\n readonly mapping: string;\n readonly timestamp: number;\n}\n\ndeclare var Gamepad: {\n prototype: Gamepad;\n new(): Gamepad;\n};\n\ninterface GamepadButton {\n readonly pressed: boolean;\n readonly value: number;\n}\n\ndeclare var GamepadButton: {\n prototype: GamepadButton;\n new(): GamepadButton;\n};\n\ninterface GamepadEvent extends Event {\n readonly gamepad: Gamepad;\n}\n\ndeclare var GamepadEvent: {\n prototype: GamepadEvent;\n new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent;\n};\n\ninterface Geolocation {\n clearWatch(watchId: number): void;\n getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;\n watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;\n}\n\ndeclare var Geolocation: {\n prototype: Geolocation;\n new(): Geolocation;\n};\n\ninterface HashChangeEvent extends Event {\n readonly newURL: string | null;\n readonly oldURL: string | null;\n}\n\ndeclare var HashChangeEvent: {\n prototype: HashChangeEvent;\n new(typeArg: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\n};\n\ninterface Headers {\n append(name: string, value: string): void;\n delete(name: string): void;\n forEach(callback: ForEachCallback): void;\n get(name: string): string | null;\n has(name: string): boolean;\n set(name: string, value: string): void;\n}\n\ndeclare var Headers: {\n prototype: Headers;\n new(init?: HeadersInit): Headers;\n};\n\ninterface History {\n readonly length: number;\n readonly state: any;\n scrollRestoration: ScrollRestoration;\n back(): void;\n forward(): void;\n go(delta?: number): void;\n pushState(data: any, title: string, url?: string | null): void;\n replaceState(data: any, title: string, url?: string | null): void;\n}\n\ndeclare var History: {\n prototype: History;\n new(): History;\n};\n\ninterface HTMLAllCollection {\n readonly length: number;\n item(nameOrIndex?: string): HTMLCollection | Element | null;\n namedItem(name: string): HTMLCollection | Element | null;\n [index: number]: Element;\n}\n\ndeclare var HTMLAllCollection: {\n prototype: HTMLAllCollection;\n new(): HTMLAllCollection;\n};\n\ninterface HTMLAnchorElement extends HTMLElement {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n coords: string;\n download: string;\n /**\n * Contains the anchor portion of the URL including the hash sign (#).\n */\n hash: string;\n /**\n * Contains the hostname and port values of the URL.\n */\n host: string;\n /**\n * Contains the hostname of a URL.\n */\n hostname: string;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n Methods: string;\n readonly mimeType: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n name: string;\n readonly nameProp: string;\n /**\n * Contains the pathname of the URL.\n */\n pathname: string;\n /**\n * Sets or retrieves the port number associated with a URL.\n */\n port: string;\n /**\n * Contains the protocol of the URL.\n */\n protocol: string;\n readonly protocolLong: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rev: string;\n /**\n * Sets or retrieves the substring of the href property that follows the question mark.\n */\n search: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n type: string;\n urn: string;\n /**\n * Returns a string representation of an object.\n */\n toString(): string;\n addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n};\n\ninterface HTMLAppletElement extends HTMLElement {\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Gets or sets the optional alternative HTML script to execute if the object fails to load.\n */\n altHtml: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n archive: string;\n /**\n * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.\n */\n readonly BaseHref: string;\n border: string;\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n codeBase: string;\n /**\n * Sets or retrieves the Internet media type for the code associated with the object.\n */\n codeType: string;\n /**\n * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned.\n */\n readonly contentDocument: Document;\n /**\n * Sets or retrieves the URL that references the data of the object.\n */\n data: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own declare functionality for the object.\n */\n declare: boolean;\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hspace: number;\n /**\n * Sets or retrieves the shape of the object.\n */\n name: string;\n object: string | null;\n /**\n * Sets or retrieves a message to be displayed while an object is loading.\n */\n standby: string;\n /**\n * Returns the content type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n vspace: number;\n width: number;\n addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAppletElement: {\n prototype: HTMLAppletElement;\n new(): HTMLAppletElement;\n};\n\ninterface HTMLAreaElement extends HTMLElement {\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n coords: string;\n download: string;\n /**\n * Sets or retrieves the subsection of the href property that follows the number sign (#).\n */\n hash: string;\n /**\n * Sets or retrieves the hostname and port number of the location or URL.\n */\n host: string;\n /**\n * Sets or retrieves the host name part of the location or URL.\n */\n hostname: string;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or gets whether clicks in this region cause action.\n */\n noHref: boolean;\n /**\n * Sets or retrieves the file name or path specified by the object.\n */\n pathname: string;\n /**\n * Sets or retrieves the port number associated with a URL.\n */\n port: string;\n /**\n * Sets or retrieves the protocol portion of a URL.\n */\n protocol: string;\n rel: string;\n /**\n * Sets or retrieves the substring of the href property that follows the question mark.\n */\n search: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Returns a string representation of an object.\n */\n toString(): string;\n addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAreaElement: {\n prototype: HTMLAreaElement;\n new(): HTMLAreaElement;\n};\n\ninterface HTMLAreasCollection extends HTMLCollectionBase {\n}\n\ndeclare var HTMLAreasCollection: {\n prototype: HTMLAreasCollection;\n new(): HTMLAreasCollection;\n};\n\ninterface HTMLAudioElement extends HTMLMediaElement {\n addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAudioElement: {\n prototype: HTMLAudioElement;\n new(): HTMLAudioElement;\n};\n\ninterface HTMLBaseElement extends HTMLElement {\n /**\n * Gets or sets the baseline URL on which relative links are based.\n */\n href: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseElement: {\n prototype: HTMLBaseElement;\n new(): HTMLBaseElement;\n};\n\ninterface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n face: string;\n /**\n * Sets or retrieves the font size of the object.\n */\n size: number;\n addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseFontElement: {\n prototype: HTMLBaseFontElement;\n new(): HTMLBaseFontElement;\n};\n\ninterface HTMLBodyElementEventMap extends HTMLElementEventMap {\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"load\": Event;\n \"message\": MessageEvent;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"popstate\": PopStateEvent;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"storage\": StorageEvent;\n \"unload\": Event;\n}\n\ninterface HTMLBodyElement extends HTMLElement {\n aLink: any;\n background: string;\n bgColor: any;\n bgProperties: string;\n link: any;\n noWrap: boolean;\n onafterprint: (this: HTMLBodyElement, ev: Event) => any;\n onbeforeprint: (this: HTMLBodyElement, ev: Event) => any;\n onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any;\n onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any;\n onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any;\n onoffline: (this: HTMLBodyElement, ev: Event) => any;\n ononline: (this: HTMLBodyElement, ev: Event) => any;\n onorientationchange: (this: HTMLBodyElement, ev: Event) => any;\n onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any;\n onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any;\n onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any;\n onresize: (this: HTMLBodyElement, ev: UIEvent) => any;\n onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any;\n onunload: (this: HTMLBodyElement, ev: Event) => any;\n text: any;\n vLink: any;\n addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBodyElement: {\n prototype: HTMLBodyElement;\n new(): HTMLBodyElement;\n};\n\ninterface HTMLBRElement extends HTMLElement {\n /**\n * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.\n */\n clear: string;\n addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBRElement: {\n prototype: HTMLBRElement;\n new(): HTMLBRElement;\n};\n\ninterface HTMLButtonElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: string;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n status: any;\n /**\n * Gets the classification and default behavior of the button.\n */\n type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the default or selected value of the control.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLButtonElement: {\n prototype: HTMLButtonElement;\n new(): HTMLButtonElement;\n};\n\ninterface HTMLCanvasElement extends HTMLElement {\n /**\n * Gets or sets the height of a canvas element on a document.\n */\n height: number;\n /**\n * Gets or sets the width of a canvas element on a document.\n */\n width: number;\n /**\n * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.\n * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext(\"2d\"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext(\"experimental-webgl\");\n */\n getContext(contextId: \"2d\", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null;\n getContext(contextId: \"webgl\" | \"experimental-webgl\", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;\n getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;\n /**\n * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.\n */\n msToBlob(): Blob;\n /**\n * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.\n * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.\n */\n toDataURL(type?: string, ...args: any[]): string;\n toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void;\n addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLCanvasElement: {\n prototype: HTMLCanvasElement;\n new(): HTMLCanvasElement;\n};\n\ninterface HTMLCollectionBase {\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Retrieves an object from various collections.\n */\n item(index: number): Element;\n [index: number]: Element;\n}\n\ninterface HTMLCollection extends HTMLCollectionBase {\n /**\n * Retrieves a select object or an object from an options collection.\n */\n namedItem(name: string): Element | null;\n}\n\ndeclare var HTMLCollection: {\n prototype: HTMLCollection;\n new(): HTMLCollection;\n};\n\ninterface HTMLDataElement extends HTMLElement {\n value: string;\n addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataElement: {\n prototype: HTMLDataElement;\n new(): HTMLDataElement;\n};\n\ninterface HTMLDataListElement extends HTMLElement {\n options: HTMLCollectionOf;\n addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataListElement: {\n prototype: HTMLDataListElement;\n new(): HTMLDataListElement;\n};\n\ninterface HTMLDirectoryElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDirectoryElement: {\n prototype: HTMLDirectoryElement;\n new(): HTMLDirectoryElement;\n};\n\ninterface HTMLDivElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n noWrap: boolean;\n addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDivElement: {\n prototype: HTMLDivElement;\n new(): HTMLDivElement;\n};\n\ninterface HTMLDListElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDListElement: {\n prototype: HTMLDListElement;\n new(): HTMLDListElement;\n};\n\ninterface HTMLDocument extends Document {\n addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDocument: {\n prototype: HTMLDocument;\n new(): HTMLDocument;\n};\n\ninterface HTMLElementEventMap extends ElementEventMap {\n \"abort\": UIEvent;\n \"activate\": UIEvent;\n \"beforeactivate\": UIEvent;\n \"beforecopy\": ClipboardEvent;\n \"beforecut\": ClipboardEvent;\n \"beforedeactivate\": UIEvent;\n \"beforepaste\": ClipboardEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"copy\": ClipboardEvent;\n \"cuechange\": Event;\n \"cut\": ClipboardEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": UIEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": MediaStreamErrorEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": UIEvent;\n \"MSManipulationStateChanged\": MSManipulationEvent;\n \"paste\": ClipboardEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface HTMLElement extends Element {\n accessKey: string;\n readonly children: HTMLCollection;\n contentEditable: string;\n readonly dataset: DOMStringMap;\n dir: string;\n draggable: boolean;\n hidden: boolean;\n hideFocus: boolean;\n innerText: string;\n readonly isContentEditable: boolean;\n lang: string;\n readonly offsetHeight: number;\n readonly offsetLeft: number;\n readonly offsetParent: Element;\n readonly offsetTop: number;\n readonly offsetWidth: number;\n onabort: (this: HTMLElement, ev: UIEvent) => any;\n onactivate: (this: HTMLElement, ev: UIEvent) => any;\n onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any;\n onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any;\n onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any;\n onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any;\n onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any;\n onblur: (this: HTMLElement, ev: FocusEvent) => any;\n oncanplay: (this: HTMLElement, ev: Event) => any;\n oncanplaythrough: (this: HTMLElement, ev: Event) => any;\n onchange: (this: HTMLElement, ev: Event) => any;\n onclick: (this: HTMLElement, ev: MouseEvent) => any;\n oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any;\n oncopy: (this: HTMLElement, ev: ClipboardEvent) => any;\n oncuechange: (this: HTMLElement, ev: Event) => any;\n oncut: (this: HTMLElement, ev: ClipboardEvent) => any;\n ondblclick: (this: HTMLElement, ev: MouseEvent) => any;\n ondeactivate: (this: HTMLElement, ev: UIEvent) => any;\n ondrag: (this: HTMLElement, ev: DragEvent) => any;\n ondragend: (this: HTMLElement, ev: DragEvent) => any;\n ondragenter: (this: HTMLElement, ev: DragEvent) => any;\n ondragleave: (this: HTMLElement, ev: DragEvent) => any;\n ondragover: (this: HTMLElement, ev: DragEvent) => any;\n ondragstart: (this: HTMLElement, ev: DragEvent) => any;\n ondrop: (this: HTMLElement, ev: DragEvent) => any;\n ondurationchange: (this: HTMLElement, ev: Event) => any;\n onemptied: (this: HTMLElement, ev: Event) => any;\n onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any;\n onerror: (this: HTMLElement, ev: ErrorEvent) => any;\n onfocus: (this: HTMLElement, ev: FocusEvent) => any;\n oninput: (this: HTMLElement, ev: Event) => any;\n oninvalid: (this: HTMLElement, ev: Event) => any;\n onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any;\n onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any;\n onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any;\n onload: (this: HTMLElement, ev: Event) => any;\n onloadeddata: (this: HTMLElement, ev: Event) => any;\n onloadedmetadata: (this: HTMLElement, ev: Event) => any;\n onloadstart: (this: HTMLElement, ev: Event) => any;\n onmousedown: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseenter: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseleave: (this: HTMLElement, ev: MouseEvent) => any;\n onmousemove: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseout: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseover: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseup: (this: HTMLElement, ev: MouseEvent) => any;\n onmousewheel: (this: HTMLElement, ev: WheelEvent) => any;\n onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any;\n onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any;\n onpaste: (this: HTMLElement, ev: ClipboardEvent) => any;\n onpause: (this: HTMLElement, ev: Event) => any;\n onplay: (this: HTMLElement, ev: Event) => any;\n onplaying: (this: HTMLElement, ev: Event) => any;\n onprogress: (this: HTMLElement, ev: ProgressEvent) => any;\n onratechange: (this: HTMLElement, ev: Event) => any;\n onreset: (this: HTMLElement, ev: Event) => any;\n onscroll: (this: HTMLElement, ev: UIEvent) => any;\n onseeked: (this: HTMLElement, ev: Event) => any;\n onseeking: (this: HTMLElement, ev: Event) => any;\n onselect: (this: HTMLElement, ev: UIEvent) => any;\n onselectstart: (this: HTMLElement, ev: Event) => any;\n onstalled: (this: HTMLElement, ev: Event) => any;\n onsubmit: (this: HTMLElement, ev: Event) => any;\n onsuspend: (this: HTMLElement, ev: Event) => any;\n ontimeupdate: (this: HTMLElement, ev: Event) => any;\n onvolumechange: (this: HTMLElement, ev: Event) => any;\n onwaiting: (this: HTMLElement, ev: Event) => any;\n outerText: string;\n spellcheck: boolean;\n readonly style: CSSStyleDeclaration;\n tabIndex: number;\n title: string;\n blur(): void;\n click(): void;\n dragDrop(): boolean;\n focus(): void;\n msGetInputContext(): MSInputMethodContext;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLElement: {\n prototype: HTMLElement;\n new(): HTMLElement;\n};\n\ninterface HTMLEmbedElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hidden: any;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Retrieves the palette used for the embedded document.\n */\n readonly palette: string;\n /**\n * Retrieves the URL of the plug-in used to view an embedded document.\n */\n readonly pluginspage: string;\n readonly readyState: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the height and width units of the embed object.\n */\n units: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLEmbedElement: {\n prototype: HTMLEmbedElement;\n new(): HTMLEmbedElement;\n};\n\ninterface HTMLFieldSetElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n name: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFieldSetElement: {\n prototype: HTMLFieldSetElement;\n new(): HTMLFieldSetElement;\n};\n\ninterface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n face: string;\n addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFontElement: {\n prototype: HTMLFontElement;\n new(): HTMLFontElement;\n};\n\ninterface HTMLFormControlsCollection extends HTMLCollectionBase {\n namedItem(name: string): HTMLCollection | Element | null;\n}\n\ndeclare var HTMLFormControlsCollection: {\n prototype: HTMLFormControlsCollection;\n new(): HTMLFormControlsCollection;\n};\n\ninterface HTMLFormElement extends HTMLElement {\n /**\n * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.\n */\n acceptCharset: string;\n /**\n * Sets or retrieves the URL to which the form content is sent for processing.\n */\n action: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Retrieves a collection, in source order, of all controls in a given form.\n */\n readonly elements: HTMLFormControlsCollection;\n /**\n * Sets or retrieves the MIME encoding for the form.\n */\n encoding: string;\n /**\n * Sets or retrieves the encoding type for the form.\n */\n enctype: string;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Sets or retrieves how to send the form data to the server.\n */\n method: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Designates a form that is not validated when submitted.\n */\n noValidate: boolean;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a form object or an object from an elements collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): any;\n /**\n * Retrieves a form object or an object from an elements collection.\n */\n namedItem(name: string): any;\n /**\n * Fires when the user resets a form.\n */\n reset(): void;\n /**\n * Fires when a FORM is about to be submitted.\n */\n submit(): void;\n reportValidity(): boolean;\n reportValidity(): boolean;\n addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLFormElement: {\n prototype: HTMLFormElement;\n new(): HTMLFormElement;\n};\n\ninterface HTMLFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document;\n /**\n * Retrieves the object of the specified.\n */\n readonly contentWindow: Window;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string | number;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n name: string;\n /**\n * Sets or retrieves whether the user can resize the frame.\n */\n noResize: boolean;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string | number;\n addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameElement: {\n prototype: HTMLFrameElement;\n new(): HTMLFrameElement;\n};\n\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap {\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"load\": Event;\n \"message\": MessageEvent;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"popstate\": PopStateEvent;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"storage\": StorageEvent;\n \"unload\": Event;\n}\n\ninterface HTMLFrameSetElement extends HTMLElement {\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Sets or retrieves the frame widths of the object.\n */\n cols: string;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n name: string;\n onafterprint: (this: HTMLFrameSetElement, ev: Event) => any;\n onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any;\n onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any;\n onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any;\n onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any;\n onoffline: (this: HTMLFrameSetElement, ev: Event) => any;\n ononline: (this: HTMLFrameSetElement, ev: Event) => any;\n onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any;\n onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any;\n onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any;\n onpopstate: (this: HTMLFrameSetElement, ev: PopStateEvent) => any;\n onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any;\n onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any;\n onunload: (this: HTMLFrameSetElement, ev: Event) => any;\n /**\n * Sets or retrieves the frame heights of the object.\n */\n rows: string;\n addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameSetElement: {\n prototype: HTMLFrameSetElement;\n new(): HTMLFrameSetElement;\n};\n\ninterface HTMLHeadElement extends HTMLElement {\n profile: string;\n addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadElement: {\n prototype: HTMLHeadElement;\n new(): HTMLHeadElement;\n};\n\ninterface HTMLHeadingElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n align: string;\n addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadingElement: {\n prototype: HTMLHeadingElement;\n new(): HTMLHeadingElement;\n};\n\ninterface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.\n */\n noShade: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n};\n\ninterface HTMLHtmlElement extends HTMLElement {\n /**\n * Sets or retrieves the DTD version that governs the current document.\n */\n version: string;\n addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHtmlElement: {\n prototype: HTMLHtmlElement;\n new(): HTMLHtmlElement;\n};\n\ninterface HTMLIFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLIFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n allowFullscreen: boolean;\n allowPaymentRequest: boolean;\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document;\n /**\n * Retrieves the object of the specified.\n */\n readonly contentWindow: Window;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /**\n * Sets or retrieves the horizontal margin for the object.\n */\n hspace: number;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n name: string;\n /**\n * Sets or retrieves whether the user can resize the frame.\n */\n noResize: boolean;\n readonly sandbox: DOMSettableTokenList;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Sets or retrives the content of the page that is to contain.\n */\n srcdoc: string;\n addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLIFrameElement: {\n prototype: HTMLIFrameElement;\n new(): HTMLIFrameElement;\n};\n\ninterface HTMLImageElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Retrieves whether the object is fully loaded.\n */\n readonly complete: boolean;\n crossOrigin: string | null;\n readonly currentSrc: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n hspace: number;\n /**\n * Sets or retrieves whether the image is a server-side image map.\n */\n isMap: boolean;\n /**\n * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.\n */\n longDesc: string;\n lowsrc: string;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * The original height of the image resource before sizing.\n */\n readonly naturalHeight: number;\n /**\n * The original width of the image resource before sizing.\n */\n readonly naturalWidth: number;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n readonly x: number;\n readonly y: number;\n msGetAsCastingSource(): any;\n addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLImageElement: {\n prototype: HTMLImageElement;\n new(): HTMLImageElement;\n};\n\ninterface HTMLInputElement extends HTMLElement {\n /**\n * Sets or retrieves a comma-separated list of content types.\n */\n accept: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n border: string;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n checked: boolean;\n /**\n * Retrieves whether the object is fully loaded.\n */\n readonly complete: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n defaultChecked: boolean;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Returns a FileList object on a file type input object.\n */\n readonly files: FileList | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: string;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n hspace: number;\n indeterminate: boolean;\n /**\n * Specifies the ID of a pre-defined datalist of options for an input element.\n */\n readonly list: HTMLElement;\n /**\n * Defines the maximum acceptable value for an input element with type=\"number\".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.\n */\n max: string;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n /**\n * Defines the minimum acceptable value for an input element with type=\"number\". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.\n */\n min: string;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a string containing a regular expression that the user's input must match.\n */\n pattern: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n selectionDirection: string;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number;\n size: number;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n status: boolean;\n /**\n * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.\n */\n step: string;\n /**\n * Returns the content type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns the value of the data at the cursor's current position.\n */\n value: string;\n valueAsDate: Date;\n /**\n * Returns the input field value as a number.\n */\n valueAsNumber: number;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n vspace: number;\n webkitdirectory: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n minLength: number;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Makes the selection equal to the current object.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n /**\n * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.\n * @param n Value to decrement the value by.\n */\n stepDown(n?: number): void;\n /**\n * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.\n * @param n Value to increment the value by.\n */\n stepUp(n?: number): void;\n addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\n};\n\ninterface HTMLLabelElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the object to which the given label object is assigned.\n */\n htmlFor: string;\n readonly control: HTMLInputElement | null;\n addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLabelElement: {\n prototype: HTMLLabelElement;\n new(): HTMLLabelElement;\n};\n\ninterface HTMLLegendElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n align: string;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLegendElement: {\n prototype: HTMLLegendElement;\n new(): HTMLLegendElement;\n};\n\ninterface HTMLLIElement extends HTMLElement {\n type: string;\n /**\n * Sets or retrieves the value of a list item.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\n};\n\ninterface HTMLLinkElement extends HTMLElement, LinkStyle {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n disabled: boolean;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rev: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n import?: Document;\n integrity: string;\n addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLinkElement: {\n prototype: HTMLLinkElement;\n new(): HTMLLinkElement;\n};\n\ninterface HTMLMapElement extends HTMLElement {\n /**\n * Retrieves a collection of the area objects defined for the given map object.\n */\n readonly areas: HTMLAreasCollection;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMapElement: {\n prototype: HTMLMapElement;\n new(): HTMLMapElement;\n};\n\ninterface HTMLMarqueeElementEventMap extends HTMLElementEventMap {\n \"bounce\": Event;\n \"finish\": Event;\n \"start\": Event;\n}\n\ninterface HTMLMarqueeElement extends HTMLElement {\n behavior: string;\n bgColor: any;\n direction: string;\n height: string;\n hspace: number;\n loop: number;\n onbounce: (this: HTMLMarqueeElement, ev: Event) => any;\n onfinish: (this: HTMLMarqueeElement, ev: Event) => any;\n onstart: (this: HTMLMarqueeElement, ev: Event) => any;\n scrollAmount: number;\n scrollDelay: number;\n trueSpeed: boolean;\n vspace: number;\n width: string;\n start(): void;\n stop(): void;\n addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMarqueeElement: {\n prototype: HTMLMarqueeElement;\n new(): HTMLMarqueeElement;\n};\n\ninterface HTMLMediaElementEventMap extends HTMLElementEventMap {\n \"encrypted\": MediaEncryptedEvent;\n \"msneedkey\": MSMediaKeyNeededEvent;\n}\n\ninterface HTMLMediaElement extends HTMLElement {\n /**\n * Returns an AudioTrackList object with the audio tracks for a given video element.\n */\n readonly audioTracks: AudioTrackList;\n /**\n * Gets or sets a value that indicates whether to start playing the media automatically.\n */\n autoplay: boolean;\n /**\n * Gets a collection of buffered time ranges.\n */\n readonly buffered: TimeRanges;\n /**\n * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).\n */\n controls: boolean;\n crossOrigin: string | null;\n /**\n * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.\n */\n readonly currentSrc: string;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n currentTime: number;\n defaultMuted: boolean;\n /**\n * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.\n */\n defaultPlaybackRate: number;\n /**\n * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.\n */\n readonly duration: number;\n /**\n * Gets information about whether the playback has ended or not.\n */\n readonly ended: boolean;\n /**\n * Returns an object representing the current error state of the audio or video element.\n */\n readonly error: MediaError;\n /**\n * Gets or sets a flag to specify whether playback should restart after it completes.\n */\n loop: boolean;\n readonly mediaKeys: MediaKeys | null;\n /**\n * Specifies the purpose of the audio or video media, such as background audio or alerts.\n */\n msAudioCategory: string;\n /**\n * Specifies the output device id that the audio will be sent to.\n */\n msAudioDeviceType: string;\n readonly msGraphicsTrustStatus: MSGraphicsTrust;\n /**\n * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element.\n */\n readonly msKeys: MSMediaKeys;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Specifies whether or not to enable low-latency playback on the media element.\n */\n msRealTime: boolean;\n /**\n * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.\n */\n muted: boolean;\n /**\n * Gets the current network activity for the element.\n */\n readonly networkState: number;\n onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any;\n onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any;\n /**\n * Gets a flag that specifies whether playback is paused.\n */\n readonly paused: boolean;\n /**\n * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.\n */\n playbackRate: number;\n /**\n * Gets TimeRanges for the current media resource that has been played.\n */\n readonly played: TimeRanges;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n preload: string;\n readyState: number;\n /**\n * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.\n */\n readonly seekable: TimeRanges;\n /**\n * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource.\n */\n readonly seeking: boolean;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcObject: MediaStream | null;\n readonly textTracks: TextTrackList;\n readonly videoTracks: VideoTrackList;\n /**\n * Gets or sets the volume level for audio portions of the media element.\n */\n volume: number;\n addTextTrack(kind: string, label?: string, language?: string): TextTrack;\n /**\n * Returns a string that specifies whether the client can play a given media resource type.\n */\n canPlayType(type: string): string;\n /**\n * Resets the audio or video object and loads a new media resource.\n */\n load(): void;\n /**\n * Clears all effects from the media pipeline.\n */\n msClearEffects(): void;\n msGetAsCastingSource(): any;\n /**\n * Inserts the specified audio effect into media pipeline.\n */\n msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n msSetMediaKeys(mediaKeys: MSMediaKeys): void;\n /**\n * Specifies the media protection manager for a given media pipeline.\n */\n msSetMediaProtectionManager(mediaProtectionManager?: any): void;\n /**\n * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.\n */\n pause(): void;\n /**\n * Loads and starts playback of a media resource.\n */\n play(): Promise;\n setMediaKeys(mediaKeys: MediaKeys | null): Promise;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMediaElement: {\n prototype: HTMLMediaElement;\n new(): HTMLMediaElement;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n};\n\ninterface HTMLMenuElement extends HTMLElement {\n compact: boolean;\n type: string;\n addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMenuElement: {\n prototype: HTMLMenuElement;\n new(): HTMLMenuElement;\n};\n\ninterface HTMLMetaElement extends HTMLElement {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n /**\n * Gets or sets meta-information to associate with httpEquiv or name.\n */\n content: string;\n /**\n * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.\n */\n httpEquiv: string;\n /**\n * Sets or retrieves the value specified in the content attribute of the meta object.\n */\n name: string;\n /**\n * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.\n */\n scheme: string;\n /**\n * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.\n */\n url: string;\n addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMetaElement: {\n prototype: HTMLMetaElement;\n new(): HTMLMetaElement;\n};\n\ninterface HTMLMeterElement extends HTMLElement {\n high: number;\n low: number;\n max: number;\n min: number;\n optimum: number;\n value: number;\n addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMeterElement: {\n prototype: HTMLMeterElement;\n new(): HTMLMeterElement;\n};\n\ninterface HTMLModElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n /**\n * Sets or retrieves the date and time of a modification to the object.\n */\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\n};\n\ninterface HTMLObjectElement extends HTMLElement, GetSVGDocument {\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Gets or sets the optional alternative HTML script to execute if the object fails to load.\n */\n altHtml: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n archive: string;\n /**\n * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.\n */\n readonly BaseHref: string;\n border: string;\n /**\n * Sets or retrieves the URL of the file containing the compiled Java class.\n */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n codeBase: string;\n /**\n * Sets or retrieves the Internet media type for the code associated with the object.\n */\n codeType: string;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document;\n /**\n * Sets or retrieves the URL that references the data of the object.\n */\n data: string;\n declare: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hspace: number;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly readyState: number;\n /**\n * Sets or retrieves a message to be displayed while an object is loading.\n */\n standby: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n typemustmatch: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\n};\n\ninterface HTMLOListElement extends HTMLElement {\n compact: boolean;\n /**\n * The starting number.\n */\n start: number;\n type: string;\n addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOListElement: {\n prototype: HTMLOListElement;\n new(): HTMLOListElement;\n};\n\ninterface HTMLOptGroupElement extends HTMLElement {\n /**\n * Sets or retrieves the status of an option.\n */\n defaultSelected: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the ordinal position of an option in a list box.\n */\n readonly index: number;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n /**\n * Sets or retrieves whether the option in the list box is the default item.\n */\n selected: boolean;\n /**\n * Sets or retrieves the text string specified by the option tag.\n */\n readonly text: string;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptGroupElement: {\n prototype: HTMLOptGroupElement;\n new(): HTMLOptGroupElement;\n};\n\ninterface HTMLOptionElement extends HTMLElement {\n /**\n * Sets or retrieves the status of an option.\n */\n defaultSelected: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the ordinal position of an option in a list box.\n */\n readonly index: number;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n /**\n * Sets or retrieves whether the option in the list box is the default item.\n */\n selected: boolean;\n /**\n * Sets or retrieves the text string specified by the option tag.\n */\n text: string;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptionElement: {\n prototype: HTMLOptionElement;\n new(): HTMLOptionElement;\n};\n\ninterface HTMLOptionsCollection extends HTMLCollectionOf {\n length: number;\n selectedIndex: number;\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;\n remove(index: number): void;\n}\n\ndeclare var HTMLOptionsCollection: {\n prototype: HTMLOptionsCollection;\n new(): HTMLOptionsCollection;\n};\n\ninterface HTMLOutputElement extends HTMLElement {\n defaultValue: string;\n readonly form: HTMLFormElement | null;\n readonly htmlFor: DOMSettableTokenList;\n name: string;\n readonly type: string;\n readonly validationMessage: string;\n readonly validity: ValidityState;\n value: string;\n readonly willValidate: boolean;\n checkValidity(): boolean;\n reportValidity(): boolean;\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOutputElement: {\n prototype: HTMLOutputElement;\n new(): HTMLOutputElement;\n};\n\ninterface HTMLParagraphElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n clear: string;\n addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParagraphElement: {\n prototype: HTMLParagraphElement;\n new(): HTMLParagraphElement;\n};\n\ninterface HTMLParamElement extends HTMLElement {\n /**\n * Sets or retrieves the name of an input parameter for an element.\n */\n name: string;\n /**\n * Sets or retrieves the content type of the resource designated by the value attribute.\n */\n type: string;\n /**\n * Sets or retrieves the value of an input parameter for an element.\n */\n value: string;\n /**\n * Sets or retrieves the data type of the value attribute.\n */\n valueType: string;\n addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParamElement: {\n prototype: HTMLParamElement;\n new(): HTMLParamElement;\n};\n\ninterface HTMLPictureElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPictureElement: {\n prototype: HTMLPictureElement;\n new(): HTMLPictureElement;\n};\n\ninterface HTMLPreElement extends HTMLElement {\n /**\n * Sets or gets a value that you can use to implement your own width functionality for the object.\n */\n width: number;\n addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPreElement: {\n prototype: HTMLPreElement;\n new(): HTMLPreElement;\n};\n\ninterface HTMLProgressElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Defines the maximum, or \"done\" value for a progress element.\n */\n max: number;\n /**\n * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).\n */\n readonly position: number;\n /**\n * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLProgressElement: {\n prototype: HTMLProgressElement;\n new(): HTMLProgressElement;\n};\n\ninterface HTMLQuoteElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLQuoteElement: {\n prototype: HTMLQuoteElement;\n new(): HTMLQuoteElement;\n};\n\ninterface HTMLScriptElement extends HTMLElement {\n async: boolean;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n crossOrigin: string | null;\n /**\n * Sets or retrieves the status of the script.\n */\n defer: boolean;\n /**\n * Sets or retrieves the event for which the script is written.\n */\n event: string;\n /**\n * Sets or retrieves the object that is bound to the event script.\n */\n htmlFor: string;\n /**\n * Retrieves the URL to an external file that contains the source code or data.\n */\n src: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n /**\n * Sets or retrieves the MIME type for the associated scripting engine.\n */\n type: string;\n integrity: string;\n addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLScriptElement: {\n prototype: HTMLScriptElement;\n new(): HTMLScriptElement;\n};\n\ninterface HTMLSelectElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n length: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly options: HTMLOptionsCollection;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the index of the selected option in a select object.\n */\n selectedIndex: number;\n selectedOptions: HTMLCollectionOf;\n /**\n * Sets or retrieves the number of rows in the list box.\n */\n size: number;\n /**\n * Retrieves the type of select control based on the value of the MULTIPLE attribute.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Adds an element to the areas, controlRange, or options collection.\n * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.\n * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.\n */\n add(element: HTMLElement, before?: HTMLElement | number): void;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): any;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.\n */\n namedItem(name: string): any;\n /**\n * Removes an element from the collection.\n * @param index Number that specifies the zero-based index of the element to remove from the collection.\n */\n remove(index?: number): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLSelectElement: {\n prototype: HTMLSelectElement;\n new(): HTMLSelectElement;\n};\n\ninterface HTMLSourceElement extends HTMLElement {\n /**\n * Gets or sets the intended media type of the media source.\n */\n media: string;\n msKeySystem: string;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Gets or sets the MIME type of a media resource.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSourceElement: {\n prototype: HTMLSourceElement;\n new(): HTMLSourceElement;\n};\n\ninterface HTMLSpanElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSpanElement: {\n prototype: HTMLSpanElement;\n new(): HTMLSpanElement;\n};\n\ninterface HTMLStyleElement extends HTMLElement, LinkStyle {\n disabled: boolean;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Retrieves the CSS language in which the style sheet is written.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLStyleElement: {\n prototype: HTMLStyleElement;\n new(): HTMLStyleElement;\n};\n\ninterface HTMLTableCaptionElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the caption or legend.\n */\n align: string;\n /**\n * Sets or retrieves whether the caption appears at the top or bottom of the table.\n */\n vAlign: string;\n addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCaptionElement: {\n prototype: HTMLTableCaptionElement;\n new(): HTMLTableCaptionElement;\n};\n\ninterface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves abbreviated text for the object.\n */\n abbr: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.\n */\n axis: string;\n bgColor: any;\n /**\n * Retrieves the position of the object in the cells collection of a row.\n */\n readonly cellIndex: number;\n /**\n * Sets or retrieves the number columns in the table that the object should span.\n */\n colSpan: number;\n /**\n * Sets or retrieves a list of header cells that provide information for the object.\n */\n headers: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: any;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n noWrap: boolean;\n /**\n * Sets or retrieves how many rows in a table the cell should span.\n */\n rowSpan: number;\n /**\n * Sets or retrieves the group of cells in a table to which the object's information applies.\n */\n scope: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCellElement: {\n prototype: HTMLTableCellElement;\n new(): HTMLTableCellElement;\n};\n\ninterface HTMLTableColElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves the alignment of the object relative to the display or table.\n */\n align: string;\n /**\n * Sets or retrieves the number of columns in the group.\n */\n span: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: any;\n addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableColElement: {\n prototype: HTMLTableColElement;\n new(): HTMLTableColElement;\n};\n\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\n addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableDataCellElement: {\n prototype: HTMLTableDataCellElement;\n new(): HTMLTableDataCellElement;\n};\n\ninterface HTMLTableElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n align: string;\n bgColor: any;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Retrieves the caption object of a table.\n */\n caption: HTMLTableCaptionElement;\n /**\n * Sets or retrieves the amount of space between the border of the cell and the content of the cell.\n */\n cellPadding: string;\n /**\n * Sets or retrieves the amount of space between cells in a table.\n */\n cellSpacing: string;\n /**\n * Sets or retrieves the number of columns in the table.\n */\n cols: number;\n /**\n * Sets or retrieves the way the border frame around the table is displayed.\n */\n frame: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: any;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: HTMLCollectionOf;\n /**\n * Sets or retrieves which dividing lines (inner borders) are displayed.\n */\n rules: string;\n /**\n * Sets or retrieves a description and/or structure of the object.\n */\n summary: string;\n /**\n * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.\n */\n tBodies: HTMLCollectionOf;\n /**\n * Retrieves the tFoot object of the table.\n */\n tFoot: HTMLTableSectionElement;\n /**\n * Retrieves the tHead object of the table.\n */\n tHead: HTMLTableSectionElement;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Creates an empty caption element in the table.\n */\n createCaption(): HTMLTableCaptionElement;\n /**\n * Creates an empty tBody element in the table.\n */\n createTBody(): HTMLTableSectionElement;\n /**\n * Creates an empty tFoot element in the table.\n */\n createTFoot(): HTMLTableSectionElement;\n /**\n * Returns the tHead element object if successful, or null otherwise.\n */\n createTHead(): HTMLTableSectionElement;\n /**\n * Deletes the caption element and its contents from the table.\n */\n deleteCaption(): void;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Deletes the tFoot element and its contents from the table.\n */\n deleteTFoot(): void;\n /**\n * Deletes the tHead element and its contents from the table.\n */\n deleteTHead(): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableElement: {\n prototype: HTMLTableElement;\n new(): HTMLTableElement;\n};\n\ninterface HTMLTableHeaderCellElement extends HTMLTableCellElement {\n /**\n * Sets or retrieves the group of cells in a table to which the object's information applies.\n */\n scope: string;\n addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableHeaderCellElement: {\n prototype: HTMLTableHeaderCellElement;\n new(): HTMLTableHeaderCellElement;\n};\n\ninterface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n bgColor: any;\n /**\n * Retrieves a collection of all cells in the table row.\n */\n cells: HTMLCollectionOf;\n /**\n * Sets or retrieves the height of the object.\n */\n height: any;\n /**\n * Retrieves the position of the object in the rows collection for the table.\n */\n readonly rowIndex: number;\n /**\n * Retrieves the position of the object in the collection.\n */\n readonly sectionRowIndex: number;\n /**\n * Removes the specified cell from the table row, as well as from the cells collection.\n * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.\n */\n deleteCell(index?: number): void;\n /**\n * Creates a new cell in the table row, and adds the cell to the cells collection.\n * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.\n */\n insertCell(index?: number): HTMLTableDataCellElement;\n addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableRowElement: {\n prototype: HTMLTableRowElement;\n new(): HTMLTableRowElement;\n};\n\ninterface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n align: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: HTMLCollectionOf;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableSectionElement: {\n prototype: HTMLTableSectionElement;\n new(): HTMLTableSectionElement;\n};\n\ninterface HTMLTemplateElement extends HTMLElement {\n readonly content: DocumentFragment;\n addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTemplateElement: {\n prototype: HTMLTemplateElement;\n new(): HTMLTemplateElement;\n};\n\ninterface HTMLTextAreaElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n cols: number;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n /**\n * Sets or retrieves the value indicated whether the content of the object is read-only.\n */\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: number;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number;\n /**\n * Sets or retrieves the value indicating whether the control is selected.\n */\n status: any;\n /**\n * Retrieves the type of control.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Retrieves or sets the text in the entry field of the textArea element.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Sets or retrieves how to handle wordwrapping in the object.\n */\n wrap: string;\n minLength: number;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Highlights the input area of a form element.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTextAreaElement: {\n prototype: HTMLTextAreaElement;\n new(): HTMLTextAreaElement;\n};\n\ninterface HTMLTimeElement extends HTMLElement {\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTimeElement: {\n prototype: HTMLTimeElement;\n new(): HTMLTimeElement;\n};\n\ninterface HTMLTitleElement extends HTMLElement {\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTitleElement: {\n prototype: HTMLTitleElement;\n new(): HTMLTitleElement;\n};\n\ninterface HTMLTrackElement extends HTMLElement {\n default: boolean;\n kind: string;\n label: string;\n readonly readyState: number;\n src: string;\n srclang: string;\n readonly track: TextTrack;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTrackElement: {\n prototype: HTMLTrackElement;\n new(): HTMLTrackElement;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n};\n\ninterface HTMLUListElement extends HTMLElement {\n compact: boolean;\n type: string;\n addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUListElement: {\n prototype: HTMLUListElement;\n new(): HTMLUListElement;\n};\n\ninterface HTMLUnknownElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUnknownElement: {\n prototype: HTMLUnknownElement;\n new(): HTMLUnknownElement;\n};\n\ninterface HTMLVideoElementEventMap extends HTMLMediaElementEventMap {\n \"MSVideoFormatChanged\": Event;\n \"MSVideoFrameStepCompleted\": Event;\n \"MSVideoOptimalLayoutChanged\": Event;\n}\n\ninterface HTMLVideoElement extends HTMLMediaElement {\n /**\n * Gets or sets the height of the video element.\n */\n height: number;\n msHorizontalMirror: boolean;\n readonly msIsLayoutOptimalForPlayback: boolean;\n readonly msIsStereo3D: boolean;\n msStereo3DPackingMode: string;\n msStereo3DRenderMode: string;\n msZoom: boolean;\n onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any;\n onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any;\n onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any;\n /**\n * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.\n */\n poster: string;\n /**\n * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoHeight: number;\n /**\n * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoWidth: number;\n readonly webkitDisplayingFullscreen: boolean;\n readonly webkitSupportsFullscreen: boolean;\n /**\n * Gets or sets the width of the video element.\n */\n width: number;\n getVideoPlaybackQuality(): VideoPlaybackQuality;\n msFrameStep(forward: boolean): void;\n msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void;\n webkitEnterFullscreen(): void;\n webkitEnterFullScreen(): void;\n webkitExitFullscreen(): void;\n webkitExitFullScreen(): void;\n addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\n};\n\ninterface IDBCursor {\n readonly direction: IDBCursorDirection;\n key: IDBKeyRange | IDBValidKey;\n readonly primaryKey: any;\n source: IDBObjectStore | IDBIndex;\n advance(count: number): void;\n continue(key?: IDBKeyRange | IDBValidKey): void;\n delete(): IDBRequest;\n update(value: any): IDBRequest;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n}\n\ndeclare var IDBCursor: {\n prototype: IDBCursor;\n new(): IDBCursor;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n};\n\ninterface IDBCursorWithValue extends IDBCursor {\n readonly value: any;\n}\n\ndeclare var IDBCursorWithValue: {\n prototype: IDBCursorWithValue;\n new(): IDBCursorWithValue;\n};\n\ninterface IDBDatabaseEventMap {\n \"abort\": Event;\n \"error\": Event;\n}\n\ninterface IDBDatabase extends EventTarget {\n readonly name: string;\n readonly objectStoreNames: DOMStringList;\n onabort: (this: IDBDatabase, ev: Event) => any;\n onerror: (this: IDBDatabase, ev: Event) => any;\n version: number;\n onversionchange: (ev: IDBVersionChangeEvent) => any;\n close(): void;\n createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;\n deleteObjectStore(name: string): void;\n transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;\n addEventListener(type: \"versionchange\", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: \"versionchange\", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | EventListenerOptions): void;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBDatabase: {\n prototype: IDBDatabase;\n new(): IDBDatabase;\n};\n\ninterface IDBFactory {\n cmp(first: any, second: any): number;\n deleteDatabase(name: string): IDBOpenDBRequest;\n open(name: string, version?: number): IDBOpenDBRequest;\n}\n\ndeclare var IDBFactory: {\n prototype: IDBFactory;\n new(): IDBFactory;\n};\n\ninterface IDBIndex {\n keyPath: string | string[];\n readonly name: string;\n readonly objectStore: IDBObjectStore;\n readonly unique: boolean;\n multiEntry: boolean;\n count(key?: IDBKeyRange | IDBValidKey): IDBRequest;\n get(key: IDBKeyRange | IDBValidKey): IDBRequest;\n getKey(key: IDBKeyRange | IDBValidKey): IDBRequest;\n openCursor(range?: IDBKeyRange | IDBValidKey, direction?: IDBCursorDirection): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: IDBCursorDirection): IDBRequest;\n}\n\ndeclare var IDBIndex: {\n prototype: IDBIndex;\n new(): IDBIndex;\n};\n\ninterface IDBKeyRange {\n readonly lower: any;\n readonly lowerOpen: boolean;\n readonly upper: any;\n readonly upperOpen: boolean;\n}\n\ndeclare var IDBKeyRange: {\n prototype: IDBKeyRange;\n new(): IDBKeyRange;\n bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;\n lowerBound(lower: any, open?: boolean): IDBKeyRange;\n only(value: any): IDBKeyRange;\n upperBound(upper: any, open?: boolean): IDBKeyRange;\n};\n\ninterface IDBObjectStore {\n readonly indexNames: DOMStringList;\n keyPath: string | string[];\n readonly name: string;\n readonly transaction: IDBTransaction;\n autoIncrement: boolean;\n add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest;\n clear(): IDBRequest;\n count(key?: IDBKeyRange | IDBValidKey): IDBRequest;\n createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;\n delete(key: IDBKeyRange | IDBValidKey): IDBRequest;\n deleteIndex(indexName: string): void;\n get(key: any): IDBRequest;\n index(name: string): IDBIndex;\n openCursor(range?: IDBKeyRange | IDBValidKey, direction?: IDBCursorDirection): IDBRequest;\n put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest;\n}\n\ndeclare var IDBObjectStore: {\n prototype: IDBObjectStore;\n new(): IDBObjectStore;\n};\n\ninterface IDBOpenDBRequestEventMap extends IDBRequestEventMap {\n \"blocked\": Event;\n \"upgradeneeded\": IDBVersionChangeEvent;\n}\n\ninterface IDBOpenDBRequest extends IDBRequest {\n onblocked: (this: IDBOpenDBRequest, ev: Event) => any;\n onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any;\n addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBOpenDBRequest: {\n prototype: IDBOpenDBRequest;\n new(): IDBOpenDBRequest;\n};\n\ninterface IDBRequestEventMap {\n \"error\": Event;\n \"success\": Event;\n}\n\ninterface IDBRequest extends EventTarget {\n readonly error: DOMException;\n onerror: (this: IDBRequest, ev: Event) => any;\n onsuccess: (this: IDBRequest, ev: Event) => any;\n readonly readyState: IDBRequestReadyState;\n readonly result: any;\n source: IDBObjectStore | IDBIndex | IDBCursor;\n readonly transaction: IDBTransaction;\n addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBRequest: {\n prototype: IDBRequest;\n new(): IDBRequest;\n};\n\ninterface IDBTransactionEventMap {\n \"abort\": Event;\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface IDBTransaction extends EventTarget {\n readonly db: IDBDatabase;\n readonly error: DOMException;\n readonly mode: IDBTransactionMode;\n onabort: (this: IDBTransaction, ev: Event) => any;\n oncomplete: (this: IDBTransaction, ev: Event) => any;\n onerror: (this: IDBTransaction, ev: Event) => any;\n abort(): void;\n objectStore(name: string): IDBObjectStore;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBTransaction: {\n prototype: IDBTransaction;\n new(): IDBTransaction;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n};\n\ninterface IDBVersionChangeEvent extends Event {\n readonly newVersion: number | null;\n readonly oldVersion: number;\n}\n\ndeclare var IDBVersionChangeEvent: {\n prototype: IDBVersionChangeEvent;\n new(): IDBVersionChangeEvent;\n};\n\ninterface IIRFilterNode extends AudioNode {\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var IIRFilterNode: {\n prototype: IIRFilterNode;\n new(): IIRFilterNode;\n};\n\ninterface ImageData {\n data: Uint8ClampedArray;\n readonly height: number;\n readonly width: number;\n}\n\ndeclare var ImageData: {\n prototype: ImageData;\n new(width: number, height: number): ImageData;\n new(array: Uint8ClampedArray, width: number, height: number): ImageData;\n};\n\ninterface IntersectionObserver {\n readonly root: Element | null;\n readonly rootMargin: string;\n readonly thresholds: number[];\n disconnect(): void;\n observe(target: Element): void;\n takeRecords(): IntersectionObserverEntry[];\n unobserve(target: Element): void;\n}\n\ndeclare var IntersectionObserver: {\n prototype: IntersectionObserver;\n new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;\n};\n\ninterface IntersectionObserverEntry {\n readonly boundingClientRect: ClientRect | DOMRect;\n readonly intersectionRatio: number;\n readonly intersectionRect: ClientRect | DOMRect;\n readonly rootBounds: ClientRect | DOMRect;\n readonly target: Element;\n readonly time: number;\n readonly isIntersecting: boolean;\n}\n\ndeclare var IntersectionObserverEntry: {\n prototype: IntersectionObserverEntry;\n new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;\n};\n\ninterface KeyboardEvent extends UIEvent {\n readonly altKey: boolean;\n readonly char: string | null;\n readonly charCode: number;\n readonly ctrlKey: boolean;\n readonly key: string;\n readonly keyCode: number;\n readonly locale: string;\n readonly location: number;\n readonly metaKey: boolean;\n readonly repeat: boolean;\n readonly shiftKey: boolean;\n readonly which: number;\n readonly code: string;\n getModifierState(keyArg: string): boolean;\n initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n}\n\ndeclare var KeyboardEvent: {\n prototype: KeyboardEvent;\n new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n};\n\ninterface ListeningStateChangedEvent extends Event {\n readonly label: string;\n readonly state: ListeningState;\n}\n\ndeclare var ListeningStateChangedEvent: {\n prototype: ListeningStateChangedEvent;\n new(): ListeningStateChangedEvent;\n};\n\ninterface Location {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n assign(url: string): void;\n reload(forcedReload?: boolean): void;\n replace(url: string): void;\n toString(): string;\n}\n\ndeclare var Location: {\n prototype: Location;\n new(): Location;\n};\n\ninterface LongRunningScriptDetectedEvent extends Event {\n readonly executionTime: number;\n stopPageScriptExecution: boolean;\n}\n\ndeclare var LongRunningScriptDetectedEvent: {\n prototype: LongRunningScriptDetectedEvent;\n new(): LongRunningScriptDetectedEvent;\n};\n\ninterface MediaDeviceInfo {\n readonly deviceId: string;\n readonly groupId: string;\n readonly kind: MediaDeviceKind;\n readonly label: string;\n}\n\ndeclare var MediaDeviceInfo: {\n prototype: MediaDeviceInfo;\n new(): MediaDeviceInfo;\n};\n\ninterface MediaDevicesEventMap {\n \"devicechange\": Event;\n}\n\ninterface MediaDevices extends EventTarget {\n ondevicechange: (this: MediaDevices, ev: Event) => any;\n enumerateDevices(): Promise;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): Promise;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaDevices: {\n prototype: MediaDevices;\n new(): MediaDevices;\n};\n\ninterface MediaElementAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaElementAudioSourceNode: {\n prototype: MediaElementAudioSourceNode;\n new(): MediaElementAudioSourceNode;\n};\n\ninterface MediaEncryptedEvent extends Event {\n readonly initData: ArrayBuffer | null;\n readonly initDataType: string;\n}\n\ndeclare var MediaEncryptedEvent: {\n prototype: MediaEncryptedEvent;\n new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;\n};\n\ninterface MediaError {\n readonly code: number;\n readonly msExtendedCode: number;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n}\n\ndeclare var MediaError: {\n prototype: MediaError;\n new(): MediaError;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n};\n\ninterface MediaKeyMessageEvent extends Event {\n readonly message: ArrayBuffer;\n readonly messageType: MediaKeyMessageType;\n}\n\ndeclare var MediaKeyMessageEvent: {\n prototype: MediaKeyMessageEvent;\n new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;\n};\n\ninterface MediaKeys {\n createSession(sessionType?: MediaKeySessionType): MediaKeySession;\n setServerCertificate(serverCertificate: BufferSource): Promise;\n}\n\ndeclare var MediaKeys: {\n prototype: MediaKeys;\n new(): MediaKeys;\n};\n\ninterface MediaKeySession extends EventTarget {\n readonly closed: Promise;\n readonly expiration: number;\n readonly keyStatuses: MediaKeyStatusMap;\n readonly sessionId: string;\n close(): Promise;\n generateRequest(initDataType: string, initData: BufferSource): Promise;\n load(sessionId: string): Promise;\n remove(): Promise;\n update(response: BufferSource): Promise;\n}\n\ndeclare var MediaKeySession: {\n prototype: MediaKeySession;\n new(): MediaKeySession;\n};\n\ninterface MediaKeyStatusMap {\n readonly size: number;\n forEach(callback: ForEachCallback): void;\n get(keyId: BufferSource): MediaKeyStatus;\n has(keyId: BufferSource): boolean;\n}\n\ndeclare var MediaKeyStatusMap: {\n prototype: MediaKeyStatusMap;\n new(): MediaKeyStatusMap;\n};\n\ninterface MediaKeySystemAccess {\n readonly keySystem: string;\n createMediaKeys(): Promise;\n getConfiguration(): MediaKeySystemConfiguration;\n}\n\ndeclare var MediaKeySystemAccess: {\n prototype: MediaKeySystemAccess;\n new(): MediaKeySystemAccess;\n};\n\ninterface MediaList {\n readonly length: number;\n mediaText: string;\n appendMedium(newMedium: string): void;\n deleteMedium(oldMedium: string): void;\n item(index: number): string;\n toString(): string;\n [index: number]: string;\n}\n\ndeclare var MediaList: {\n prototype: MediaList;\n new(): MediaList;\n};\n\ninterface MediaQueryList {\n readonly matches: boolean;\n readonly media: string;\n addListener(listener: MediaQueryListListener): void;\n removeListener(listener: MediaQueryListListener): void;\n}\n\ndeclare var MediaQueryList: {\n prototype: MediaQueryList;\n new(): MediaQueryList;\n};\n\ninterface MediaSource extends EventTarget {\n readonly activeSourceBuffers: SourceBufferList;\n duration: number;\n readonly readyState: string;\n readonly sourceBuffers: SourceBufferList;\n addSourceBuffer(type: string): SourceBuffer;\n endOfStream(error?: number): void;\n removeSourceBuffer(sourceBuffer: SourceBuffer): void;\n}\n\ndeclare var MediaSource: {\n prototype: MediaSource;\n new(): MediaSource;\n isTypeSupported(type: string): boolean;\n};\n\ninterface MediaStreamEventMap {\n \"active\": Event;\n \"addtrack\": MediaStreamTrackEvent;\n \"inactive\": Event;\n \"removetrack\": MediaStreamTrackEvent;\n}\n\ninterface MediaStream extends EventTarget {\n readonly active: boolean;\n readonly id: string;\n onactive: (this: MediaStream, ev: Event) => any;\n onaddtrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any;\n oninactive: (this: MediaStream, ev: Event) => any;\n onremovetrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any;\n addTrack(track: MediaStreamTrack): void;\n clone(): MediaStream;\n getAudioTracks(): MediaStreamTrack[];\n getTrackById(trackId: string): MediaStreamTrack | null;\n getTracks(): MediaStreamTrack[];\n getVideoTracks(): MediaStreamTrack[];\n removeTrack(track: MediaStreamTrack): void;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStream: {\n prototype: MediaStream;\n new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream;\n};\n\ninterface MediaStreamAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaStreamAudioSourceNode: {\n prototype: MediaStreamAudioSourceNode;\n new(): MediaStreamAudioSourceNode;\n};\n\ninterface MediaStreamError {\n readonly constraintName: string | null;\n readonly message: string | null;\n readonly name: string;\n}\n\ndeclare var MediaStreamError: {\n prototype: MediaStreamError;\n new(): MediaStreamError;\n};\n\ninterface MediaStreamErrorEvent extends Event {\n readonly error: MediaStreamError | null;\n}\n\ndeclare var MediaStreamErrorEvent: {\n prototype: MediaStreamErrorEvent;\n new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\n};\n\ninterface MediaStreamEvent extends Event {\n readonly stream: MediaStream | null;\n}\n\ndeclare var MediaStreamEvent: {\n prototype: MediaStreamEvent;\n new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent;\n};\n\ninterface MediaStreamTrackEventMap {\n \"ended\": MediaStreamErrorEvent;\n \"mute\": Event;\n \"overconstrained\": MediaStreamErrorEvent;\n \"unmute\": Event;\n}\n\ninterface MediaStreamTrack extends EventTarget {\n enabled: boolean;\n readonly id: string;\n readonly kind: string;\n readonly label: string;\n readonly muted: boolean;\n onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any;\n onmute: (this: MediaStreamTrack, ev: Event) => any;\n onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any;\n onunmute: (this: MediaStreamTrack, ev: Event) => any;\n readonly readonly: boolean;\n readonly readyState: MediaStreamTrackState;\n readonly remote: boolean;\n applyConstraints(constraints: MediaTrackConstraints): Promise;\n clone(): MediaStreamTrack;\n getCapabilities(): MediaTrackCapabilities;\n getConstraints(): MediaTrackConstraints;\n getSettings(): MediaTrackSettings;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStreamTrack: {\n prototype: MediaStreamTrack;\n new(): MediaStreamTrack;\n};\n\ninterface MediaStreamTrackEvent extends Event {\n readonly track: MediaStreamTrack;\n}\n\ndeclare var MediaStreamTrackEvent: {\n prototype: MediaStreamTrackEvent;\n new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent;\n};\n\ninterface MessageChannel {\n readonly port1: MessagePort;\n readonly port2: MessagePort;\n}\n\ndeclare var MessageChannel: {\n prototype: MessageChannel;\n new(): MessageChannel;\n};\n\ninterface MessageEvent extends Event {\n readonly data: any;\n readonly origin: string;\n readonly ports: any;\n readonly source: Window;\n initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void;\n}\n\ndeclare var MessageEvent: {\n prototype: MessageEvent;\n new(type: string, eventInitDict?: MessageEventInit): MessageEvent;\n};\n\ninterface MessagePortEventMap {\n \"message\": MessageEvent;\n}\n\ninterface MessagePort extends EventTarget {\n onmessage: (this: MessagePort, ev: MessageEvent) => any;\n close(): void;\n postMessage(message?: any, transfer?: any[]): void;\n start(): void;\n addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MessagePort: {\n prototype: MessagePort;\n new(): MessagePort;\n};\n\ninterface MimeType {\n readonly description: string;\n readonly enabledPlugin: Plugin;\n readonly suffixes: string;\n readonly type: string;\n}\n\ndeclare var MimeType: {\n prototype: MimeType;\n new(): MimeType;\n};\n\ninterface MimeTypeArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(type: string): Plugin;\n [index: number]: Plugin;\n}\n\ndeclare var MimeTypeArray: {\n prototype: MimeTypeArray;\n new(): MimeTypeArray;\n};\n\ninterface MouseEvent extends UIEvent {\n readonly altKey: boolean;\n readonly button: number;\n readonly buttons: number;\n readonly clientX: number;\n readonly clientY: number;\n readonly ctrlKey: boolean;\n readonly fromElement: Element;\n readonly layerX: number;\n readonly layerY: number;\n readonly metaKey: boolean;\n readonly movementX: number;\n readonly movementY: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly relatedTarget: EventTarget;\n readonly screenX: number;\n readonly screenY: number;\n readonly shiftKey: boolean;\n readonly toElement: Element;\n readonly which: number;\n readonly x: number;\n readonly y: number;\n getModifierState(keyArg: string): boolean;\n initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void;\n}\n\ndeclare var MouseEvent: {\n prototype: MouseEvent;\n new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;\n};\n\ninterface MSApp {\n clearTemporaryWebDataAsync(): MSAppAsyncOperation;\n createBlobFromRandomAccessStream(type: string, seeker: any): Blob;\n createDataPackage(object: any): any;\n createDataPackageFromSelection(): any;\n createFileFromStorageFile(storageFile: any): File;\n createStreamFromInputStream(type: string, inputStream: any): MSStream;\n execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void;\n execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any;\n getCurrentPriority(): string;\n getHtmlPrintDocumentSourceAsync(htmlDoc: any): Promise;\n getViewId(view: any): any;\n isTaskScheduledAtPriorityOrHigher(priority: string): boolean;\n pageHandlesAllApplicationActivations(enabled: boolean): void;\n suppressSubdownloadCredentialPrompts(suppress: boolean): void;\n terminateApp(exceptionObject: any): void;\n readonly CURRENT: string;\n readonly HIGH: string;\n readonly IDLE: string;\n readonly NORMAL: string;\n}\ndeclare var MSApp: MSApp;\n\ninterface MSAppAsyncOperationEventMap {\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface MSAppAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSAppAsyncOperation, ev: Event) => any;\n onerror: (this: MSAppAsyncOperation, ev: Event) => any;\n readonly readyState: number;\n readonly result: any;\n start(): void;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSAppAsyncOperation: {\n prototype: MSAppAsyncOperation;\n new(): MSAppAsyncOperation;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n};\n\ninterface MSAssertion {\n readonly id: string;\n readonly type: MSCredentialType;\n}\n\ndeclare var MSAssertion: {\n prototype: MSAssertion;\n new(): MSAssertion;\n};\n\ninterface MSBlobBuilder {\n append(data: any, endings?: string): void;\n getBlob(contentType?: string): Blob;\n}\n\ndeclare var MSBlobBuilder: {\n prototype: MSBlobBuilder;\n new(): MSBlobBuilder;\n};\n\ninterface MSCredentials {\n getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise;\n makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise;\n}\n\ndeclare var MSCredentials: {\n prototype: MSCredentials;\n new(): MSCredentials;\n};\n\ninterface MSFIDOCredentialAssertion extends MSAssertion {\n readonly algorithm: string | Algorithm;\n readonly attestation: any;\n readonly publicKey: string;\n readonly transportHints: MSTransportType[];\n}\n\ndeclare var MSFIDOCredentialAssertion: {\n prototype: MSFIDOCredentialAssertion;\n new(): MSFIDOCredentialAssertion;\n};\n\ninterface MSFIDOSignature {\n readonly authnrData: string;\n readonly clientData: string;\n readonly signature: string;\n}\n\ndeclare var MSFIDOSignature: {\n prototype: MSFIDOSignature;\n new(): MSFIDOSignature;\n};\n\ninterface MSFIDOSignatureAssertion extends MSAssertion {\n readonly signature: MSFIDOSignature;\n}\n\ndeclare var MSFIDOSignatureAssertion: {\n prototype: MSFIDOSignatureAssertion;\n new(): MSFIDOSignatureAssertion;\n};\n\ninterface MSGesture {\n target: Element;\n addPointer(pointerId: number): void;\n stop(): void;\n}\n\ndeclare var MSGesture: {\n prototype: MSGesture;\n new(): MSGesture;\n};\n\ninterface MSGestureEvent extends UIEvent {\n readonly clientX: number;\n readonly clientY: number;\n readonly expansion: number;\n readonly gestureObject: any;\n readonly hwTimestamp: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly rotation: number;\n readonly scale: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly translationX: number;\n readonly translationY: number;\n readonly velocityAngular: number;\n readonly velocityExpansion: number;\n readonly velocityX: number;\n readonly velocityY: number;\n initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n}\n\ndeclare var MSGestureEvent: {\n prototype: MSGestureEvent;\n new(): MSGestureEvent;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n};\n\ninterface MSGraphicsTrust {\n readonly constrictionActive: boolean;\n readonly status: string;\n}\n\ndeclare var MSGraphicsTrust: {\n prototype: MSGraphicsTrust;\n new(): MSGraphicsTrust;\n};\n\ninterface MSHTMLWebViewElement extends HTMLElement {\n readonly canGoBack: boolean;\n readonly canGoForward: boolean;\n readonly containsFullScreenElement: boolean;\n readonly documentTitle: string;\n height: number;\n readonly settings: MSWebViewSettings;\n src: string;\n width: number;\n addWebAllowedObject(name: string, applicationObject: any): void;\n buildLocalStreamUri(contentIdentifier: string, relativePath: string): string;\n capturePreviewToBlobAsync(): MSWebViewAsyncOperation;\n captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation;\n getDeferredPermissionRequestById(id: number): DeferredPermissionRequest;\n getDeferredPermissionRequests(): DeferredPermissionRequest[];\n goBack(): void;\n goForward(): void;\n invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation;\n navigate(uri: string): void;\n navigateFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\n navigateToLocalStreamUri(source: string, streamResolver: any): void;\n navigateToString(contents: string): void;\n navigateWithHttpRequestMessage(requestMessage: any): void;\n refresh(): void;\n stop(): void;\n addEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSHTMLWebViewElement: {\n prototype: MSHTMLWebViewElement;\n new(): MSHTMLWebViewElement;\n};\n\ninterface MSInputMethodContextEventMap {\n \"MSCandidateWindowHide\": Event;\n \"MSCandidateWindowShow\": Event;\n \"MSCandidateWindowUpdate\": Event;\n}\n\ninterface MSInputMethodContext extends EventTarget {\n readonly compositionEndOffset: number;\n readonly compositionStartOffset: number;\n oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any;\n oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any;\n oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any;\n readonly target: HTMLElement;\n getCandidateWindowClientRect(): ClientRect;\n getCompositionAlternatives(): string[];\n hasComposition(): boolean;\n isCandidateWindowVisible(): boolean;\n addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSInputMethodContext: {\n prototype: MSInputMethodContext;\n new(): MSInputMethodContext;\n};\n\ninterface MSManipulationEvent extends UIEvent {\n readonly currentState: number;\n readonly inertiaDestinationX: number;\n readonly inertiaDestinationY: number;\n readonly lastState: number;\n initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void;\n readonly MS_MANIPULATION_STATE_ACTIVE: number;\n readonly MS_MANIPULATION_STATE_CANCELLED: number;\n readonly MS_MANIPULATION_STATE_COMMITTED: number;\n readonly MS_MANIPULATION_STATE_DRAGGING: number;\n readonly MS_MANIPULATION_STATE_INERTIA: number;\n readonly MS_MANIPULATION_STATE_PRESELECT: number;\n readonly MS_MANIPULATION_STATE_SELECTING: number;\n readonly MS_MANIPULATION_STATE_STOPPED: number;\n}\n\ndeclare var MSManipulationEvent: {\n prototype: MSManipulationEvent;\n new(): MSManipulationEvent;\n readonly MS_MANIPULATION_STATE_ACTIVE: number;\n readonly MS_MANIPULATION_STATE_CANCELLED: number;\n readonly MS_MANIPULATION_STATE_COMMITTED: number;\n readonly MS_MANIPULATION_STATE_DRAGGING: number;\n readonly MS_MANIPULATION_STATE_INERTIA: number;\n readonly MS_MANIPULATION_STATE_PRESELECT: number;\n readonly MS_MANIPULATION_STATE_SELECTING: number;\n readonly MS_MANIPULATION_STATE_STOPPED: number;\n};\n\ninterface MSMediaKeyError {\n readonly code: number;\n readonly systemCode: number;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n}\n\ndeclare var MSMediaKeyError: {\n prototype: MSMediaKeyError;\n new(): MSMediaKeyError;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n};\n\ninterface MSMediaKeyMessageEvent extends Event {\n readonly destinationURL: string | null;\n readonly message: Uint8Array;\n}\n\ndeclare var MSMediaKeyMessageEvent: {\n prototype: MSMediaKeyMessageEvent;\n new(): MSMediaKeyMessageEvent;\n};\n\ninterface MSMediaKeyNeededEvent extends Event {\n readonly initData: Uint8Array | null;\n}\n\ndeclare var MSMediaKeyNeededEvent: {\n prototype: MSMediaKeyNeededEvent;\n new(): MSMediaKeyNeededEvent;\n};\n\ninterface MSMediaKeys {\n readonly keySystem: string;\n createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession;\n}\n\ndeclare var MSMediaKeys: {\n prototype: MSMediaKeys;\n new(keySystem: string): MSMediaKeys;\n isTypeSupported(keySystem: string, type?: string): boolean;\n isTypeSupportedWithFeatures(keySystem: string, type?: string): string;\n};\n\ninterface MSMediaKeySession extends EventTarget {\n readonly error: MSMediaKeyError | null;\n readonly keySystem: string;\n readonly sessionId: string;\n close(): void;\n update(key: Uint8Array): void;\n}\n\ndeclare var MSMediaKeySession: {\n prototype: MSMediaKeySession;\n new(): MSMediaKeySession;\n};\n\ninterface MSPointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var MSPointerEvent: {\n prototype: MSPointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;\n};\n\ninterface MSRangeCollection {\n readonly length: number;\n item(index: number): Range;\n [index: number]: Range;\n}\n\ndeclare var MSRangeCollection: {\n prototype: MSRangeCollection;\n new(): MSRangeCollection;\n};\n\ninterface MSSiteModeEvent extends Event {\n readonly actionURL: string;\n readonly buttonID: number;\n}\n\ndeclare var MSSiteModeEvent: {\n prototype: MSSiteModeEvent;\n new(): MSSiteModeEvent;\n};\n\ninterface MSStream {\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n}\n\ndeclare var MSStream: {\n prototype: MSStream;\n new(): MSStream;\n};\n\ninterface MSStreamReader extends EventTarget, MSBaseReader {\n readonly error: DOMError;\n readAsArrayBuffer(stream: MSStream, size?: number): void;\n readAsBinaryString(stream: MSStream, size?: number): void;\n readAsBlob(stream: MSStream, size?: number): void;\n readAsDataURL(stream: MSStream, size?: number): void;\n readAsText(stream: MSStream, encoding?: string, size?: number): void;\n addEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSStreamReader: {\n prototype: MSStreamReader;\n new(): MSStreamReader;\n};\n\ninterface MSWebViewAsyncOperationEventMap {\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface MSWebViewAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any;\n onerror: (this: MSWebViewAsyncOperation, ev: Event) => any;\n readonly readyState: number;\n readonly result: any;\n readonly target: MSHTMLWebViewElement;\n readonly type: number;\n start(): void;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;\n readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;\n readonly TYPE_INVOKE_SCRIPT: number;\n addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSWebViewAsyncOperation: {\n prototype: MSWebViewAsyncOperation;\n new(): MSWebViewAsyncOperation;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;\n readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;\n readonly TYPE_INVOKE_SCRIPT: number;\n};\n\ninterface MSWebViewSettings {\n isIndexedDBEnabled: boolean;\n isJavaScriptEnabled: boolean;\n}\n\ndeclare var MSWebViewSettings: {\n prototype: MSWebViewSettings;\n new(): MSWebViewSettings;\n};\n\ninterface MutationEvent extends Event {\n readonly attrChange: number;\n readonly attrName: string;\n readonly newValue: string;\n readonly prevValue: string;\n readonly relatedNode: Node;\n initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n}\n\ndeclare var MutationEvent: {\n prototype: MutationEvent;\n new(): MutationEvent;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n};\n\ninterface MutationObserver {\n disconnect(): void;\n observe(target: Node, options: MutationObserverInit): void;\n takeRecords(): MutationRecord[];\n}\n\ndeclare var MutationObserver: {\n prototype: MutationObserver;\n new(callback: MutationCallback): MutationObserver;\n};\n\ninterface MutationRecord {\n readonly addedNodes: NodeList;\n readonly attributeName: string | null;\n readonly attributeNamespace: string | null;\n readonly nextSibling: Node | null;\n readonly oldValue: string | null;\n readonly previousSibling: Node | null;\n readonly removedNodes: NodeList;\n readonly target: Node;\n readonly type: string;\n}\n\ndeclare var MutationRecord: {\n prototype: MutationRecord;\n new(): MutationRecord;\n};\n\ninterface NamedNodeMap {\n readonly length: number;\n getNamedItem(name: string): Attr;\n getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr;\n item(index: number): Attr;\n removeNamedItem(name: string): Attr;\n removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr;\n setNamedItem(arg: Attr): Attr;\n setNamedItemNS(arg: Attr): Attr;\n [index: number]: Attr;\n}\n\ndeclare var NamedNodeMap: {\n prototype: NamedNodeMap;\n new(): NamedNodeMap;\n};\n\ninterface NavigationCompletedEvent extends NavigationEvent {\n readonly isSuccess: boolean;\n readonly webErrorStatus: number;\n}\n\ndeclare var NavigationCompletedEvent: {\n prototype: NavigationCompletedEvent;\n new(): NavigationCompletedEvent;\n};\n\ninterface NavigationEvent extends Event {\n readonly uri: string;\n}\n\ndeclare var NavigationEvent: {\n prototype: NavigationEvent;\n new(): NavigationEvent;\n};\n\ninterface NavigationEventWithReferrer extends NavigationEvent {\n readonly referer: string;\n}\n\ndeclare var NavigationEventWithReferrer: {\n prototype: NavigationEventWithReferrer;\n new(): NavigationEventWithReferrer;\n};\n\ninterface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia {\n readonly authentication: WebAuthentication;\n readonly cookieEnabled: boolean;\n gamepadInputEmulation: GamepadInputEmulationType;\n readonly language: string;\n readonly maxTouchPoints: number;\n readonly mimeTypes: MimeTypeArray;\n readonly msManipulationViewsEnabled: boolean;\n readonly msMaxTouchPoints: number;\n readonly msPointerEnabled: boolean;\n readonly plugins: PluginArray;\n readonly pointerEnabled: boolean;\n readonly serviceWorker: ServiceWorkerContainer;\n readonly webdriver: boolean;\n readonly doNotTrack: string | null;\n readonly hardwareConcurrency: number;\n readonly languages: string[];\n getGamepads(): Gamepad[];\n javaEnabled(): boolean;\n msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\n requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise;\n vibrate(pattern: number | number[]): boolean;\n}\n\ndeclare var Navigator: {\n prototype: Navigator;\n new(): Navigator;\n};\n\ninterface Node extends EventTarget {\n readonly attributes: NamedNodeMap;\n readonly baseURI: string | null;\n readonly childNodes: NodeList;\n readonly firstChild: Node | null;\n readonly lastChild: Node | null;\n readonly localName: string | null;\n readonly namespaceURI: string | null;\n readonly nextSibling: Node | null;\n readonly nodeName: string;\n readonly nodeType: number;\n nodeValue: string | null;\n readonly ownerDocument: Document;\n readonly parentElement: HTMLElement | null;\n readonly parentNode: Node | null;\n readonly previousSibling: Node | null;\n textContent: string | null;\n appendChild(newChild: T): T;\n cloneNode(deep?: boolean): Node;\n compareDocumentPosition(other: Node): number;\n contains(child: Node): boolean;\n hasAttributes(): boolean;\n hasChildNodes(): boolean;\n insertBefore(newChild: T, refChild: Node | null): T;\n isDefaultNamespace(namespaceURI: string | null): boolean;\n isEqualNode(arg: Node): boolean;\n isSameNode(other: Node): boolean;\n lookupNamespaceURI(prefix: string | null): string | null;\n lookupPrefix(namespaceURI: string | null): string | null;\n normalize(): void;\n removeChild(oldChild: T): T;\n replaceChild(newChild: Node, oldChild: T): T;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n}\n\ndeclare var Node: {\n prototype: Node;\n new(): Node;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n};\n\ninterface NodeFilter {\n acceptNode(n: Node): number;\n}\n\ndeclare var NodeFilter: {\n readonly FILTER_ACCEPT: number;\n readonly FILTER_REJECT: number;\n readonly FILTER_SKIP: number;\n readonly SHOW_ALL: number;\n readonly SHOW_ATTRIBUTE: number;\n readonly SHOW_CDATA_SECTION: number;\n readonly SHOW_COMMENT: number;\n readonly SHOW_DOCUMENT: number;\n readonly SHOW_DOCUMENT_FRAGMENT: number;\n readonly SHOW_DOCUMENT_TYPE: number;\n readonly SHOW_ELEMENT: number;\n readonly SHOW_ENTITY: number;\n readonly SHOW_ENTITY_REFERENCE: number;\n readonly SHOW_NOTATION: number;\n readonly SHOW_PROCESSING_INSTRUCTION: number;\n readonly SHOW_TEXT: number;\n};\n\ninterface NodeIterator {\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter;\n readonly root: Node;\n readonly whatToShow: number;\n detach(): void;\n nextNode(): Node;\n previousNode(): Node;\n}\n\ndeclare var NodeIterator: {\n prototype: NodeIterator;\n new(): NodeIterator;\n};\n\ninterface NodeList {\n readonly length: number;\n item(index: number): Node;\n [index: number]: Node;\n}\n\ndeclare var NodeList: {\n prototype: NodeList;\n new(): NodeList;\n};\n\ninterface NotificationEventMap {\n \"click\": Event;\n \"close\": Event;\n \"error\": Event;\n \"show\": Event;\n}\n\ninterface Notification extends EventTarget {\n readonly body: string;\n readonly dir: NotificationDirection;\n readonly icon: string;\n readonly lang: string;\n onclick: (this: Notification, ev: Event) => any;\n onclose: (this: Notification, ev: Event) => any;\n onerror: (this: Notification, ev: Event) => any;\n onshow: (this: Notification, ev: Event) => any;\n readonly permission: NotificationPermission;\n readonly tag: string;\n readonly title: string;\n close(): void;\n addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Notification: {\n prototype: Notification;\n new(title: string, options?: NotificationOptions): Notification;\n requestPermission(callback?: NotificationPermissionCallback): Promise;\n};\n\ninterface OES_element_index_uint {\n}\n\ndeclare var OES_element_index_uint: {\n prototype: OES_element_index_uint;\n new(): OES_element_index_uint;\n};\n\ninterface OES_standard_derivatives {\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n}\n\ndeclare var OES_standard_derivatives: {\n prototype: OES_standard_derivatives;\n new(): OES_standard_derivatives;\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n};\n\ninterface OES_texture_float {\n}\n\ndeclare var OES_texture_float: {\n prototype: OES_texture_float;\n new(): OES_texture_float;\n};\n\ninterface OES_texture_float_linear {\n}\n\ndeclare var OES_texture_float_linear: {\n prototype: OES_texture_float_linear;\n new(): OES_texture_float_linear;\n};\n\ninterface OES_texture_half_float {\n readonly HALF_FLOAT_OES: number;\n}\n\ndeclare var OES_texture_half_float: {\n prototype: OES_texture_half_float;\n new(): OES_texture_half_float;\n readonly HALF_FLOAT_OES: number;\n};\n\ninterface OES_texture_half_float_linear {\n}\n\ndeclare var OES_texture_half_float_linear: {\n prototype: OES_texture_half_float_linear;\n new(): OES_texture_half_float_linear;\n};\n\ninterface OfflineAudioCompletionEvent extends Event {\n readonly renderedBuffer: AudioBuffer;\n}\n\ndeclare var OfflineAudioCompletionEvent: {\n prototype: OfflineAudioCompletionEvent;\n new(): OfflineAudioCompletionEvent;\n};\n\ninterface OfflineAudioContextEventMap extends AudioContextEventMap {\n \"complete\": OfflineAudioCompletionEvent;\n}\n\ninterface OfflineAudioContext extends AudioContextBase {\n readonly length: number;\n oncomplete: (this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any;\n startRendering(): Promise;\n suspend(suspendTime: number): Promise;\n addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OfflineAudioContext: {\n prototype: OfflineAudioContext;\n new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;\n};\n\ninterface OscillatorNodeEventMap {\n \"ended\": MediaStreamErrorEvent;\n}\n\ninterface OscillatorNode extends AudioNode {\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any;\n type: OscillatorType;\n setPeriodicWave(periodicWave: PeriodicWave): void;\n start(when?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OscillatorNode: {\n prototype: OscillatorNode;\n new(): OscillatorNode;\n};\n\ninterface OverflowEvent extends UIEvent {\n readonly horizontalOverflow: boolean;\n readonly orient: number;\n readonly verticalOverflow: boolean;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n}\n\ndeclare var OverflowEvent: {\n prototype: OverflowEvent;\n new(): OverflowEvent;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n};\n\ninterface PageTransitionEvent extends Event {\n readonly persisted: boolean;\n}\n\ndeclare var PageTransitionEvent: {\n prototype: PageTransitionEvent;\n new(): PageTransitionEvent;\n};\n\ninterface PannerNode extends AudioNode {\n coneInnerAngle: number;\n coneOuterAngle: number;\n coneOuterGain: number;\n distanceModel: DistanceModelType;\n maxDistance: number;\n panningModel: PanningModelType;\n refDistance: number;\n rolloffFactor: number;\n setOrientation(x: number, y: number, z: number): void;\n setPosition(x: number, y: number, z: number): void;\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var PannerNode: {\n prototype: PannerNode;\n new(): PannerNode;\n};\n\ninterface Path2D extends Object, CanvasPathMethods {\n}\n\ndeclare var Path2D: {\n prototype: Path2D;\n new(path?: Path2D): Path2D;\n};\n\ninterface PaymentAddress {\n readonly addressLine: string[];\n readonly city: string;\n readonly country: string;\n readonly dependentLocality: string;\n readonly languageCode: string;\n readonly organization: string;\n readonly phone: string;\n readonly postalCode: string;\n readonly recipient: string;\n readonly region: string;\n readonly sortingCode: string;\n toJSON(): any;\n}\n\ndeclare var PaymentAddress: {\n prototype: PaymentAddress;\n new(): PaymentAddress;\n};\n\ninterface PaymentRequestEventMap {\n \"shippingaddresschange\": Event;\n \"shippingoptionchange\": Event;\n}\n\ninterface PaymentRequest extends EventTarget {\n onshippingaddresschange: (this: PaymentRequest, ev: Event) => any;\n onshippingoptionchange: (this: PaymentRequest, ev: Event) => any;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n readonly shippingType: PaymentShippingType | null;\n abort(): Promise;\n show(): Promise;\n addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var PaymentRequest: {\n prototype: PaymentRequest;\n new(methodData: PaymentMethodData[], details: PaymentDetails, options?: PaymentOptions): PaymentRequest;\n};\n\ninterface PaymentRequestUpdateEvent extends Event {\n updateWith(d: Promise): void;\n}\n\ndeclare var PaymentRequestUpdateEvent: {\n prototype: PaymentRequestUpdateEvent;\n new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;\n};\n\ninterface PaymentResponse {\n readonly details: any;\n readonly methodName: string;\n readonly payerEmail: string | null;\n readonly payerName: string | null;\n readonly payerPhone: string | null;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n complete(result?: PaymentComplete): Promise;\n toJSON(): any;\n}\n\ndeclare var PaymentResponse: {\n prototype: PaymentResponse;\n new(): PaymentResponse;\n};\n\ninterface Performance {\n readonly navigation: PerformanceNavigation;\n readonly timing: PerformanceTiming;\n clearMarks(markName?: string): void;\n clearMeasures(measureName?: string): void;\n clearResourceTimings(): void;\n getEntries(): any;\n getEntriesByName(name: string, entryType?: string): any;\n getEntriesByType(entryType: string): any;\n getMarks(markName?: string): any;\n getMeasures(measureName?: string): any;\n mark(markName: string): void;\n measure(measureName: string, startMarkName?: string, endMarkName?: string): void;\n now(): number;\n setResourceTimingBufferSize(maxSize: number): void;\n toJSON(): any;\n}\n\ndeclare var Performance: {\n prototype: Performance;\n new(): Performance;\n};\n\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n}\n\ndeclare var PerformanceEntry: {\n prototype: PerformanceEntry;\n new(): PerformanceEntry;\n};\n\ninterface PerformanceMark extends PerformanceEntry {\n}\n\ndeclare var PerformanceMark: {\n prototype: PerformanceMark;\n new(): PerformanceMark;\n};\n\ninterface PerformanceMeasure extends PerformanceEntry {\n}\n\ndeclare var PerformanceMeasure: {\n prototype: PerformanceMeasure;\n new(): PerformanceMeasure;\n};\n\ninterface PerformanceNavigation {\n readonly redirectCount: number;\n readonly type: number;\n toJSON(): any;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n}\n\ndeclare var PerformanceNavigation: {\n prototype: PerformanceNavigation;\n new(): PerformanceNavigation;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n};\n\ninterface PerformanceNavigationTiming extends PerformanceEntry {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly domLoading: number;\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly navigationStart: number;\n readonly redirectCount: number;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly type: NavigationType;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n}\n\ndeclare var PerformanceNavigationTiming: {\n prototype: PerformanceNavigationTiming;\n new(): PerformanceNavigationTiming;\n};\n\ninterface PerformanceResourceTiming extends PerformanceEntry {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly fetchStart: number;\n readonly initiatorType: string;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n}\n\ndeclare var PerformanceResourceTiming: {\n prototype: PerformanceResourceTiming;\n new(): PerformanceResourceTiming;\n};\n\ninterface PerformanceTiming {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly domLoading: number;\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly msFirstPaint: number;\n readonly navigationStart: number;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n readonly secureConnectionStart: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceTiming: {\n prototype: PerformanceTiming;\n new(): PerformanceTiming;\n};\n\ninterface PerfWidgetExternal {\n readonly activeNetworkRequestCount: number;\n readonly averageFrameTime: number;\n readonly averagePaintTime: number;\n readonly extraInformationEnabled: boolean;\n readonly independentRenderingEnabled: boolean;\n readonly irDisablingContentString: string;\n readonly irStatusAvailable: boolean;\n readonly maxCpuSpeed: number;\n readonly paintRequestsPerSecond: number;\n readonly performanceCounter: number;\n readonly performanceCounterFrequency: number;\n addEventListener(eventType: string, callback: Function): void;\n getMemoryUsage(): number;\n getProcessCpuUsage(): number;\n getRecentCpuUsage(last: number | null): any;\n getRecentFrames(last: number | null): any;\n getRecentMemoryUsage(last: number | null): any;\n getRecentPaintRequests(last: number | null): any;\n removeEventListener(eventType: string, callback: Function): void;\n repositionWindow(x: number, y: number): void;\n resizeWindow(width: number, height: number): void;\n}\n\ndeclare var PerfWidgetExternal: {\n prototype: PerfWidgetExternal;\n new(): PerfWidgetExternal;\n};\n\ninterface PeriodicWave {\n}\n\ndeclare var PeriodicWave: {\n prototype: PeriodicWave;\n new(): PeriodicWave;\n};\n\ninterface PermissionRequest extends DeferredPermissionRequest {\n readonly state: MSWebViewPermissionState;\n defer(): void;\n}\n\ndeclare var PermissionRequest: {\n prototype: PermissionRequest;\n new(): PermissionRequest;\n};\n\ninterface PermissionRequestedEvent extends Event {\n readonly permissionRequest: PermissionRequest;\n}\n\ndeclare var PermissionRequestedEvent: {\n prototype: PermissionRequestedEvent;\n new(): PermissionRequestedEvent;\n};\n\ninterface Plugin {\n readonly description: string;\n readonly filename: string;\n readonly length: number;\n readonly name: string;\n readonly version: string;\n item(index: number): MimeType;\n namedItem(type: string): MimeType;\n [index: number]: MimeType;\n}\n\ndeclare var Plugin: {\n prototype: Plugin;\n new(): Plugin;\n};\n\ninterface PluginArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(name: string): Plugin;\n refresh(reload?: boolean): void;\n [index: number]: Plugin;\n}\n\ndeclare var PluginArray: {\n prototype: PluginArray;\n new(): PluginArray;\n};\n\ninterface PointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var PointerEvent: {\n prototype: PointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent;\n};\n\ninterface PopStateEvent extends Event {\n readonly state: any;\n initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void;\n}\n\ndeclare var PopStateEvent: {\n prototype: PopStateEvent;\n new(typeArg: string, eventInitDict?: PopStateEventInit): PopStateEvent;\n};\n\ninterface Position {\n readonly coords: Coordinates;\n readonly timestamp: number;\n}\n\ndeclare var Position: {\n prototype: Position;\n new(): Position;\n};\n\ninterface PositionError {\n readonly code: number;\n readonly message: string;\n toString(): string;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n}\n\ndeclare var PositionError: {\n prototype: PositionError;\n new(): PositionError;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n};\n\ninterface ProcessingInstruction extends CharacterData {\n readonly target: string;\n}\n\ndeclare var ProcessingInstruction: {\n prototype: ProcessingInstruction;\n new(): ProcessingInstruction;\n};\n\ninterface ProgressEvent extends Event {\n readonly lengthComputable: boolean;\n readonly loaded: number;\n readonly total: number;\n initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void;\n}\n\ndeclare var ProgressEvent: {\n prototype: ProgressEvent;\n new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;\n};\n\ninterface PushManager {\n getSubscription(): Promise;\n permissionState(options?: PushSubscriptionOptionsInit): Promise;\n subscribe(options?: PushSubscriptionOptionsInit): Promise;\n}\n\ndeclare var PushManager: {\n prototype: PushManager;\n new(): PushManager;\n};\n\ninterface PushSubscription {\n readonly endpoint: USVString;\n readonly options: PushSubscriptionOptions;\n getKey(name: PushEncryptionKeyName): ArrayBuffer | null;\n toJSON(): any;\n unsubscribe(): Promise;\n}\n\ndeclare var PushSubscription: {\n prototype: PushSubscription;\n new(): PushSubscription;\n};\n\ninterface PushSubscriptionOptions {\n readonly applicationServerKey: ArrayBuffer | null;\n readonly userVisibleOnly: boolean;\n}\n\ndeclare var PushSubscriptionOptions: {\n prototype: PushSubscriptionOptions;\n new(): PushSubscriptionOptions;\n};\n\ninterface Range {\n readonly collapsed: boolean;\n readonly commonAncestorContainer: Node;\n readonly endContainer: Node;\n readonly endOffset: number;\n readonly startContainer: Node;\n readonly startOffset: number;\n cloneContents(): DocumentFragment;\n cloneRange(): Range;\n collapse(toStart: boolean): void;\n compareBoundaryPoints(how: number, sourceRange: Range): number;\n createContextualFragment(fragment: string): DocumentFragment;\n deleteContents(): void;\n detach(): void;\n expand(Unit: ExpandGranularity): boolean;\n extractContents(): DocumentFragment;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n insertNode(newNode: Node): void;\n selectNode(refNode: Node): void;\n selectNodeContents(refNode: Node): void;\n setEnd(refNode: Node, offset: number): void;\n setEndAfter(refNode: Node): void;\n setEndBefore(refNode: Node): void;\n setStart(refNode: Node, offset: number): void;\n setStartAfter(refNode: Node): void;\n setStartBefore(refNode: Node): void;\n surroundContents(newParent: Node): void;\n toString(): string;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n}\n\ndeclare var Range: {\n prototype: Range;\n new(): Range;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n};\n\ninterface ReadableStream {\n readonly locked: boolean;\n cancel(): Promise;\n getReader(): ReadableStreamReader;\n}\n\ndeclare var ReadableStream: {\n prototype: ReadableStream;\n new(): ReadableStream;\n};\n\ninterface ReadableStreamReader {\n cancel(): Promise;\n read(): Promise;\n releaseLock(): void;\n}\n\ndeclare var ReadableStreamReader: {\n prototype: ReadableStreamReader;\n new(): ReadableStreamReader;\n};\n\ninterface Request extends Object, Body {\n readonly cache: RequestCache;\n readonly credentials: RequestCredentials;\n readonly destination: RequestDestination;\n readonly headers: Headers;\n readonly integrity: string;\n readonly keepalive: boolean;\n readonly method: string;\n readonly mode: RequestMode;\n readonly redirect: RequestRedirect;\n readonly referrer: string;\n readonly referrerPolicy: ReferrerPolicy;\n readonly type: RequestType;\n readonly url: string;\n readonly signal: AbortSignal;\n clone(): Request;\n}\n\ndeclare var Request: {\n prototype: Request;\n new(input: Request | string, init?: RequestInit): Request;\n};\n\ninterface Response extends Object, Body {\n readonly body: ReadableStream | null;\n readonly headers: Headers;\n readonly ok: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly type: ResponseType;\n readonly url: string;\n readonly redirected: boolean;\n clone(): Response;\n}\n\ndeclare var Response: {\n prototype: Response;\n new(body?: any, init?: ResponseInit): Response;\n error: () => Response;\n redirect: (url: string, status?: number) => Response;\n};\n\ninterface RTCDtlsTransportEventMap {\n \"dtlsstatechange\": RTCDtlsTransportStateChangedEvent;\n \"error\": Event;\n}\n\ninterface RTCDtlsTransport extends RTCStatsProvider {\n ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null;\n onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null;\n readonly state: RTCDtlsTransportState;\n readonly transport: RTCIceTransport;\n getLocalParameters(): RTCDtlsParameters;\n getRemoteCertificates(): ArrayBuffer[];\n getRemoteParameters(): RTCDtlsParameters | null;\n start(remoteParameters: RTCDtlsParameters): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtlsTransport: {\n prototype: RTCDtlsTransport;\n new(transport: RTCIceTransport): RTCDtlsTransport;\n};\n\ninterface RTCDtlsTransportStateChangedEvent extends Event {\n readonly state: RTCDtlsTransportState;\n}\n\ndeclare var RTCDtlsTransportStateChangedEvent: {\n prototype: RTCDtlsTransportStateChangedEvent;\n new(): RTCDtlsTransportStateChangedEvent;\n};\n\ninterface RTCDtmfSenderEventMap {\n \"tonechange\": RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDtmfSender extends EventTarget {\n readonly canInsertDTMF: boolean;\n readonly duration: number;\n readonly interToneGap: number;\n ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any;\n readonly sender: RTCRtpSender;\n readonly toneBuffer: string;\n insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\n addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtmfSender: {\n prototype: RTCDtmfSender;\n new(sender: RTCRtpSender): RTCDtmfSender;\n};\n\ninterface RTCDTMFToneChangeEvent extends Event {\n readonly tone: string;\n}\n\ndeclare var RTCDTMFToneChangeEvent: {\n prototype: RTCDTMFToneChangeEvent;\n new(typeArg: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\n};\n\ninterface RTCIceCandidate {\n candidate: string | null;\n sdpMid: string | null;\n sdpMLineIndex: number | null;\n toJSON(): any;\n}\n\ndeclare var RTCIceCandidate: {\n prototype: RTCIceCandidate;\n new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate;\n};\n\ninterface RTCIceCandidatePairChangedEvent extends Event {\n readonly pair: RTCIceCandidatePair;\n}\n\ndeclare var RTCIceCandidatePairChangedEvent: {\n prototype: RTCIceCandidatePairChangedEvent;\n new(): RTCIceCandidatePairChangedEvent;\n};\n\ninterface RTCIceGathererEventMap {\n \"error\": Event;\n \"localcandidate\": RTCIceGathererEvent;\n}\n\ninterface RTCIceGatherer extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n onerror: ((this: RTCIceGatherer, ev: Event) => any) | null;\n onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\n createAssociatedGatherer(): RTCIceGatherer;\n getLocalCandidates(): RTCIceCandidateDictionary[];\n getLocalParameters(): RTCIceParameters;\n addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceGatherer: {\n prototype: RTCIceGatherer;\n new(options: RTCIceGatherOptions): RTCIceGatherer;\n};\n\ninterface RTCIceGathererEvent extends Event {\n readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete;\n}\n\ndeclare var RTCIceGathererEvent: {\n prototype: RTCIceGathererEvent;\n new(): RTCIceGathererEvent;\n};\n\ninterface RTCIceTransportEventMap {\n \"candidatepairchange\": RTCIceCandidatePairChangedEvent;\n \"icestatechange\": RTCIceTransportStateChangedEvent;\n}\n\ninterface RTCIceTransport extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n readonly iceGatherer: RTCIceGatherer | null;\n oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null;\n onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null;\n readonly role: RTCIceRole;\n readonly state: RTCIceTransportState;\n addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void;\n createAssociatedTransport(): RTCIceTransport;\n getNominatedCandidatePair(): RTCIceCandidatePair | null;\n getRemoteCandidates(): RTCIceCandidateDictionary[];\n getRemoteParameters(): RTCIceParameters | null;\n setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void;\n start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceTransport: {\n prototype: RTCIceTransport;\n new(): RTCIceTransport;\n};\n\ninterface RTCIceTransportStateChangedEvent extends Event {\n readonly state: RTCIceTransportState;\n}\n\ndeclare var RTCIceTransportStateChangedEvent: {\n prototype: RTCIceTransportStateChangedEvent;\n new(): RTCIceTransportStateChangedEvent;\n};\n\ninterface RTCPeerConnectionEventMap {\n \"addstream\": MediaStreamEvent;\n \"icecandidate\": RTCPeerConnectionIceEvent;\n \"iceconnectionstatechange\": Event;\n \"icegatheringstatechange\": Event;\n \"negotiationneeded\": Event;\n \"removestream\": MediaStreamEvent;\n \"signalingstatechange\": Event;\n}\n\ninterface RTCPeerConnection extends EventTarget {\n readonly canTrickleIceCandidates: boolean | null;\n readonly iceConnectionState: RTCIceConnectionState;\n readonly iceGatheringState: RTCIceGatheringState;\n readonly localDescription: RTCSessionDescription | null;\n onaddstream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any;\n onicecandidate: (this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any;\n oniceconnectionstatechange: (this: RTCPeerConnection, ev: Event) => any;\n onicegatheringstatechange: (this: RTCPeerConnection, ev: Event) => any;\n onnegotiationneeded: (this: RTCPeerConnection, ev: Event) => any;\n onremovestream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any;\n onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any;\n readonly remoteDescription: RTCSessionDescription | null;\n readonly signalingState: RTCSignalingState;\n addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n addStream(stream: MediaStream): void;\n close(): void;\n createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise;\n getConfiguration(): RTCConfiguration;\n getLocalStreams(): MediaStream[];\n getRemoteStreams(): MediaStream[];\n getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n getStreamById(streamId: string): MediaStream | null;\n removeStream(stream: MediaStream): void;\n setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCPeerConnection: {\n prototype: RTCPeerConnection;\n new(configuration: RTCConfiguration): RTCPeerConnection;\n};\n\ninterface RTCPeerConnectionIceEvent extends Event {\n readonly candidate: RTCIceCandidate;\n}\n\ndeclare var RTCPeerConnectionIceEvent: {\n prototype: RTCPeerConnectionIceEvent;\n new(type: string, eventInitDict: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent;\n};\n\ninterface RTCRtpReceiverEventMap {\n \"error\": Event;\n}\n\ninterface RTCRtpReceiver extends RTCStatsProvider {\n onerror: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack | null;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n getContributingSources(): RTCRtpContributingSource[];\n receive(parameters: RTCRtpParameters): void;\n requestSendCSRC(csrc: number): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpReceiver: {\n prototype: RTCRtpReceiver;\n new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCRtpSenderEventMap {\n \"error\": Event;\n \"ssrcconflict\": RTCSsrcConflictEvent;\n}\n\ninterface RTCRtpSender extends RTCStatsProvider {\n onerror: ((this: RTCRtpSender, ev: Event) => any) | null;\n onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n send(parameters: RTCRtpParameters): void;\n setTrack(track: MediaStreamTrack): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpSender: {\n prototype: RTCRtpSender;\n new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCSessionDescription {\n sdp: string | null;\n type: RTCSdpType | null;\n toJSON(): any;\n}\n\ndeclare var RTCSessionDescription: {\n prototype: RTCSessionDescription;\n new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;\n};\n\ninterface RTCSrtpSdesTransportEventMap {\n \"error\": Event;\n}\n\ninterface RTCSrtpSdesTransport extends EventTarget {\n onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null;\n readonly transport: RTCIceTransport;\n addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCSrtpSdesTransport: {\n prototype: RTCSrtpSdesTransport;\n new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport;\n getLocalParameters(): RTCSrtpSdesParameters[];\n};\n\ninterface RTCSsrcConflictEvent extends Event {\n readonly ssrc: number;\n}\n\ndeclare var RTCSsrcConflictEvent: {\n prototype: RTCSsrcConflictEvent;\n new(): RTCSsrcConflictEvent;\n};\n\ninterface RTCStatsProvider extends EventTarget {\n getStats(): Promise;\n msGetStats(): Promise;\n}\n\ndeclare var RTCStatsProvider: {\n prototype: RTCStatsProvider;\n new(): RTCStatsProvider;\n};\n\ninterface ScopedCredential {\n readonly id: ArrayBuffer;\n readonly type: ScopedCredentialType;\n}\n\ndeclare var ScopedCredential: {\n prototype: ScopedCredential;\n new(): ScopedCredential;\n};\n\ninterface ScopedCredentialInfo {\n readonly credential: ScopedCredential;\n readonly publicKey: CryptoKey;\n}\n\ndeclare var ScopedCredentialInfo: {\n prototype: ScopedCredentialInfo;\n new(): ScopedCredentialInfo;\n};\n\ninterface ScreenEventMap {\n \"MSOrientationChange\": Event;\n}\n\ninterface Screen extends EventTarget {\n readonly availHeight: number;\n readonly availWidth: number;\n bufferDepth: number;\n readonly colorDepth: number;\n readonly deviceXDPI: number;\n readonly deviceYDPI: number;\n readonly fontSmoothingEnabled: boolean;\n readonly height: number;\n readonly logicalXDPI: number;\n readonly logicalYDPI: number;\n readonly msOrientation: string;\n onmsorientationchange: (this: Screen, ev: Event) => any;\n readonly pixelDepth: number;\n readonly systemXDPI: number;\n readonly systemYDPI: number;\n readonly width: number;\n msLockOrientation(orientations: string | string[]): boolean;\n msUnlockOrientation(): void;\n addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Screen: {\n prototype: Screen;\n new(): Screen;\n};\n\ninterface ScriptNotifyEvent extends Event {\n readonly callingUri: string;\n readonly value: string;\n}\n\ndeclare var ScriptNotifyEvent: {\n prototype: ScriptNotifyEvent;\n new(): ScriptNotifyEvent;\n};\n\ninterface ScriptProcessorNodeEventMap {\n \"audioprocess\": AudioProcessingEvent;\n}\n\ninterface ScriptProcessorNode extends AudioNode {\n readonly bufferSize: number;\n onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any;\n addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ScriptProcessorNode: {\n prototype: ScriptProcessorNode;\n new(): ScriptProcessorNode;\n};\n\ninterface Selection {\n readonly anchorNode: Node;\n readonly anchorOffset: number;\n readonly baseNode: Node;\n readonly baseOffset: number;\n readonly extentNode: Node;\n readonly extentOffset: number;\n readonly focusNode: Node;\n readonly focusOffset: number;\n readonly isCollapsed: boolean;\n readonly rangeCount: number;\n readonly type: string;\n addRange(range: Range): void;\n collapse(parentNode: Node, offset: number): void;\n collapseToEnd(): void;\n collapseToStart(): void;\n containsNode(node: Node, partlyContained: boolean): boolean;\n deleteFromDocument(): void;\n empty(): void;\n extend(newNode: Node, offset: number): void;\n getRangeAt(index: number): Range;\n removeAllRanges(): void;\n removeRange(range: Range): void;\n selectAllChildren(parentNode: Node): void;\n setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;\n setPosition(parentNode: Node, offset: number): void;\n toString(): string;\n}\n\ndeclare var Selection: {\n prototype: Selection;\n new(): Selection;\n};\n\ninterface ServiceWorkerEventMap extends AbstractWorkerEventMap {\n \"statechange\": Event;\n}\n\ninterface ServiceWorker extends EventTarget, AbstractWorker {\n onstatechange: (this: ServiceWorker, ev: Event) => any;\n readonly scriptURL: USVString;\n readonly state: ServiceWorkerState;\n postMessage(message: any, transfer?: any[]): void;\n addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorker: {\n prototype: ServiceWorker;\n new(): ServiceWorker;\n};\n\ninterface ServiceWorkerContainerEventMap {\n \"controllerchange\": Event;\n \"message\": ServiceWorkerMessageEvent;\n}\n\ninterface ServiceWorkerContainer extends EventTarget {\n readonly controller: ServiceWorker | null;\n oncontrollerchange: (this: ServiceWorkerContainer, ev: Event) => any;\n onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any;\n readonly ready: Promise;\n getRegistration(clientURL?: USVString): Promise;\n getRegistrations(): Promise;\n register(scriptURL: USVString, options?: RegistrationOptions): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerContainer: {\n prototype: ServiceWorkerContainer;\n new(): ServiceWorkerContainer;\n};\n\ninterface ServiceWorkerMessageEvent extends Event {\n readonly data: any;\n readonly lastEventId: string;\n readonly origin: string;\n readonly ports: MessagePort[] | null;\n readonly source: ServiceWorker | MessagePort | null;\n}\n\ndeclare var ServiceWorkerMessageEvent: {\n prototype: ServiceWorkerMessageEvent;\n new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent;\n};\n\ninterface ServiceWorkerRegistrationEventMap {\n \"updatefound\": Event;\n}\n\ninterface ServiceWorkerRegistration extends EventTarget {\n readonly active: ServiceWorker | null;\n readonly installing: ServiceWorker | null;\n onupdatefound: (this: ServiceWorkerRegistration, ev: Event) => any;\n readonly pushManager: PushManager;\n readonly scope: USVString;\n readonly sync: SyncManager;\n readonly waiting: ServiceWorker | null;\n getNotifications(filter?: GetNotificationOptions): Promise;\n showNotification(title: string, options?: NotificationOptions): Promise;\n unregister(): Promise;\n update(): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerRegistration: {\n prototype: ServiceWorkerRegistration;\n new(): ServiceWorkerRegistration;\n};\n\ninterface SourceBuffer extends EventTarget {\n appendWindowEnd: number;\n appendWindowStart: number;\n readonly audioTracks: AudioTrackList;\n readonly buffered: TimeRanges;\n mode: AppendMode;\n timestampOffset: number;\n readonly updating: boolean;\n readonly videoTracks: VideoTrackList;\n abort(): void;\n appendBuffer(data: ArrayBuffer | ArrayBufferView): void;\n appendStream(stream: MSStream, maxSize?: number): void;\n remove(start: number, end: number): void;\n}\n\ndeclare var SourceBuffer: {\n prototype: SourceBuffer;\n new(): SourceBuffer;\n};\n\ninterface SourceBufferList extends EventTarget {\n readonly length: number;\n item(index: number): SourceBuffer;\n [index: number]: SourceBuffer;\n}\n\ndeclare var SourceBufferList: {\n prototype: SourceBufferList;\n new(): SourceBufferList;\n};\n\ninterface SpeechSynthesisEventMap {\n \"voiceschanged\": Event;\n}\n\ninterface SpeechSynthesis extends EventTarget {\n onvoiceschanged: (this: SpeechSynthesis, ev: Event) => any;\n readonly paused: boolean;\n readonly pending: boolean;\n readonly speaking: boolean;\n cancel(): void;\n getVoices(): SpeechSynthesisVoice[];\n pause(): void;\n resume(): void;\n speak(utterance: SpeechSynthesisUtterance): void;\n addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesis: {\n prototype: SpeechSynthesis;\n new(): SpeechSynthesis;\n};\n\ninterface SpeechSynthesisEvent extends Event {\n readonly charIndex: number;\n readonly elapsedTime: number;\n readonly name: string;\n readonly utterance: SpeechSynthesisUtterance | null;\n}\n\ndeclare var SpeechSynthesisEvent: {\n prototype: SpeechSynthesisEvent;\n new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent;\n};\n\ninterface SpeechSynthesisUtteranceEventMap {\n \"boundary\": Event;\n \"end\": Event;\n \"error\": Event;\n \"mark\": Event;\n \"pause\": Event;\n \"resume\": Event;\n \"start\": Event;\n}\n\ninterface SpeechSynthesisUtterance extends EventTarget {\n lang: string;\n onboundary: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onend: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onerror: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onmark: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onpause: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onresume: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onstart: (this: SpeechSynthesisUtterance, ev: Event) => any;\n pitch: number;\n rate: number;\n text: string;\n voice: SpeechSynthesisVoice;\n volume: number;\n addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesisUtterance: {\n prototype: SpeechSynthesisUtterance;\n new(text?: string): SpeechSynthesisUtterance;\n};\n\ninterface SpeechSynthesisVoice {\n readonly default: boolean;\n readonly lang: string;\n readonly localService: boolean;\n readonly name: string;\n readonly voiceURI: string;\n}\n\ndeclare var SpeechSynthesisVoice: {\n prototype: SpeechSynthesisVoice;\n new(): SpeechSynthesisVoice;\n};\n\ninterface StereoPannerNode extends AudioNode {\n readonly pan: AudioParam;\n}\n\ndeclare var StereoPannerNode: {\n prototype: StereoPannerNode;\n new(): StereoPannerNode;\n};\n\ninterface Storage {\n readonly length: number;\n clear(): void;\n getItem(key: string): string | null;\n key(index: number): string | null;\n removeItem(key: string): void;\n setItem(key: string, data: string): void;\n [key: string]: any;\n [index: number]: string;\n}\n\ndeclare var Storage: {\n prototype: Storage;\n new(): Storage;\n};\n\ninterface StorageEvent extends Event {\n readonly url: string;\n key?: string;\n oldValue?: string;\n newValue?: string;\n storageArea?: Storage;\n}\n\ndeclare var StorageEvent: {\n prototype: StorageEvent;\n new (type: string, eventInitDict?: StorageEventInit): StorageEvent;\n};\n\ninterface StyleMedia {\n readonly type: string;\n matchMedium(mediaquery: string): boolean;\n}\n\ndeclare var StyleMedia: {\n prototype: StyleMedia;\n new(): StyleMedia;\n};\n\ninterface StyleSheet {\n disabled: boolean;\n readonly href: string;\n readonly media: MediaList;\n readonly ownerNode: Node;\n readonly parentStyleSheet: StyleSheet;\n readonly title: string;\n readonly type: string;\n}\n\ndeclare var StyleSheet: {\n prototype: StyleSheet;\n new(): StyleSheet;\n};\n\ninterface StyleSheetList {\n readonly length: number;\n item(index?: number): StyleSheet;\n [index: number]: StyleSheet;\n}\n\ndeclare var StyleSheetList: {\n prototype: StyleSheetList;\n new(): StyleSheetList;\n};\n\ninterface StyleSheetPageList {\n readonly length: number;\n item(index: number): CSSPageRule;\n [index: number]: CSSPageRule;\n}\n\ndeclare var StyleSheetPageList: {\n prototype: StyleSheetPageList;\n new(): StyleSheetPageList;\n};\n\ninterface SubtleCrypto {\n decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike;\n deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike;\n deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike;\n encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike;\n exportKey(format: \"jwk\", key: CryptoKey): PromiseLike;\n exportKey(format: \"raw\" | \"pkcs8\" | \"spki\", key: CryptoKey): PromiseLike;\n exportKey(format: string, key: CryptoKey): PromiseLike;\n generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"jwk\", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"raw\" | \"pkcs8\" | \"spki\", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike;\n unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike;\n verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike;\n wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike;\n}\n\ndeclare var SubtleCrypto: {\n prototype: SubtleCrypto;\n new(): SubtleCrypto;\n};\n\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAElement: {\n prototype: SVGAElement;\n new(): SVGAElement;\n};\n\ninterface SVGAngle {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n}\n\ndeclare var SVGAngle: {\n prototype: SVGAngle;\n new(): SVGAngle;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n};\n\ninterface SVGAnimatedAngle {\n readonly animVal: SVGAngle;\n readonly baseVal: SVGAngle;\n}\n\ndeclare var SVGAnimatedAngle: {\n prototype: SVGAnimatedAngle;\n new(): SVGAnimatedAngle;\n};\n\ninterface SVGAnimatedBoolean {\n readonly animVal: boolean;\n baseVal: boolean;\n}\n\ndeclare var SVGAnimatedBoolean: {\n prototype: SVGAnimatedBoolean;\n new(): SVGAnimatedBoolean;\n};\n\ninterface SVGAnimatedEnumeration {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedEnumeration: {\n prototype: SVGAnimatedEnumeration;\n new(): SVGAnimatedEnumeration;\n};\n\ninterface SVGAnimatedInteger {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedInteger: {\n prototype: SVGAnimatedInteger;\n new(): SVGAnimatedInteger;\n};\n\ninterface SVGAnimatedLength {\n readonly animVal: SVGLength;\n readonly baseVal: SVGLength;\n}\n\ndeclare var SVGAnimatedLength: {\n prototype: SVGAnimatedLength;\n new(): SVGAnimatedLength;\n};\n\ninterface SVGAnimatedLengthList {\n readonly animVal: SVGLengthList;\n readonly baseVal: SVGLengthList;\n}\n\ndeclare var SVGAnimatedLengthList: {\n prototype: SVGAnimatedLengthList;\n new(): SVGAnimatedLengthList;\n};\n\ninterface SVGAnimatedNumber {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedNumber: {\n prototype: SVGAnimatedNumber;\n new(): SVGAnimatedNumber;\n};\n\ninterface SVGAnimatedNumberList {\n readonly animVal: SVGNumberList;\n readonly baseVal: SVGNumberList;\n}\n\ndeclare var SVGAnimatedNumberList: {\n prototype: SVGAnimatedNumberList;\n new(): SVGAnimatedNumberList;\n};\n\ninterface SVGAnimatedPreserveAspectRatio {\n readonly animVal: SVGPreserveAspectRatio;\n readonly baseVal: SVGPreserveAspectRatio;\n}\n\ndeclare var SVGAnimatedPreserveAspectRatio: {\n prototype: SVGAnimatedPreserveAspectRatio;\n new(): SVGAnimatedPreserveAspectRatio;\n};\n\ninterface SVGAnimatedRect {\n readonly animVal: SVGRect;\n readonly baseVal: SVGRect;\n}\n\ndeclare var SVGAnimatedRect: {\n prototype: SVGAnimatedRect;\n new(): SVGAnimatedRect;\n};\n\ninterface SVGAnimatedString {\n readonly animVal: string;\n baseVal: string;\n}\n\ndeclare var SVGAnimatedString: {\n prototype: SVGAnimatedString;\n new(): SVGAnimatedString;\n};\n\ninterface SVGAnimatedTransformList {\n readonly animVal: SVGTransformList;\n readonly baseVal: SVGTransformList;\n}\n\ndeclare var SVGAnimatedTransformList: {\n prototype: SVGAnimatedTransformList;\n new(): SVGAnimatedTransformList;\n};\n\ninterface SVGCircleElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGCircleElement: {\n prototype: SVGCircleElement;\n new(): SVGCircleElement;\n};\n\ninterface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes {\n readonly clipPathUnits: SVGAnimatedEnumeration;\n addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGClipPathElement: {\n prototype: SVGClipPathElement;\n new(): SVGClipPathElement;\n};\n\ninterface SVGComponentTransferFunctionElement extends SVGElement {\n readonly amplitude: SVGAnimatedNumber;\n readonly exponent: SVGAnimatedNumber;\n readonly intercept: SVGAnimatedNumber;\n readonly offset: SVGAnimatedNumber;\n readonly slope: SVGAnimatedNumber;\n readonly tableValues: SVGAnimatedNumberList;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGComponentTransferFunctionElement: {\n prototype: SVGComponentTransferFunctionElement;\n new(): SVGComponentTransferFunctionElement;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n};\n\ninterface SVGDefsElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDefsElement: {\n prototype: SVGDefsElement;\n new(): SVGDefsElement;\n};\n\ninterface SVGDescElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDescElement: {\n prototype: SVGDescElement;\n new(): SVGDescElement;\n};\n\ninterface SVGElementEventMap extends ElementEventMap {\n \"click\": MouseEvent;\n \"dblclick\": MouseEvent;\n \"focusin\": FocusEvent;\n \"focusout\": FocusEvent;\n \"load\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n}\n\ninterface SVGElement extends Element {\n className: any;\n onclick: (this: SVGElement, ev: MouseEvent) => any;\n ondblclick: (this: SVGElement, ev: MouseEvent) => any;\n onfocusin: (this: SVGElement, ev: FocusEvent) => any;\n onfocusout: (this: SVGElement, ev: FocusEvent) => any;\n onload: (this: SVGElement, ev: Event) => any;\n onmousedown: (this: SVGElement, ev: MouseEvent) => any;\n onmousemove: (this: SVGElement, ev: MouseEvent) => any;\n onmouseout: (this: SVGElement, ev: MouseEvent) => any;\n onmouseover: (this: SVGElement, ev: MouseEvent) => any;\n onmouseup: (this: SVGElement, ev: MouseEvent) => any;\n readonly ownerSVGElement: SVGSVGElement;\n readonly style: CSSStyleDeclaration;\n readonly viewportElement: SVGElement;\n xmlbase: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGElement: {\n prototype: SVGElement;\n new(): SVGElement;\n};\n\ninterface SVGElementInstance extends EventTarget {\n readonly childNodes: SVGElementInstanceList;\n readonly correspondingElement: SVGElement;\n readonly correspondingUseElement: SVGUseElement;\n readonly firstChild: SVGElementInstance;\n readonly lastChild: SVGElementInstance;\n readonly nextSibling: SVGElementInstance;\n readonly parentNode: SVGElementInstance;\n readonly previousSibling: SVGElementInstance;\n}\n\ndeclare var SVGElementInstance: {\n prototype: SVGElementInstance;\n new(): SVGElementInstance;\n};\n\ninterface SVGElementInstanceList {\n readonly length: number;\n item(index: number): SVGElementInstance;\n}\n\ndeclare var SVGElementInstanceList: {\n prototype: SVGElementInstanceList;\n new(): SVGElementInstanceList;\n};\n\ninterface SVGEllipseElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGEllipseElement: {\n prototype: SVGEllipseElement;\n new(): SVGEllipseElement;\n};\n\ninterface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly mode: SVGAnimatedEnumeration;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEBlendElement: {\n prototype: SVGFEBlendElement;\n new(): SVGFEBlendElement;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n};\n\ninterface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly type: SVGAnimatedEnumeration;\n readonly values: SVGAnimatedNumberList;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEColorMatrixElement: {\n prototype: SVGFEColorMatrixElement;\n new(): SVGFEColorMatrixElement;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEComponentTransferElement: {\n prototype: SVGFEComponentTransferElement;\n new(): SVGFEComponentTransferElement;\n};\n\ninterface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly k1: SVGAnimatedNumber;\n readonly k2: SVGAnimatedNumber;\n readonly k3: SVGAnimatedNumber;\n readonly k4: SVGAnimatedNumber;\n readonly operator: SVGAnimatedEnumeration;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFECompositeElement: {\n prototype: SVGFECompositeElement;\n new(): SVGFECompositeElement;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n};\n\ninterface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly bias: SVGAnimatedNumber;\n readonly divisor: SVGAnimatedNumber;\n readonly edgeMode: SVGAnimatedEnumeration;\n readonly in1: SVGAnimatedString;\n readonly kernelMatrix: SVGAnimatedNumberList;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly orderX: SVGAnimatedInteger;\n readonly orderY: SVGAnimatedInteger;\n readonly preserveAlpha: SVGAnimatedBoolean;\n readonly targetX: SVGAnimatedInteger;\n readonly targetY: SVGAnimatedInteger;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEConvolveMatrixElement: {\n prototype: SVGFEConvolveMatrixElement;\n new(): SVGFEConvolveMatrixElement;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n};\n\ninterface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly diffuseConstant: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDiffuseLightingElement: {\n prototype: SVGFEDiffuseLightingElement;\n new(): SVGFEDiffuseLightingElement;\n};\n\ninterface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly scale: SVGAnimatedNumber;\n readonly xChannelSelector: SVGAnimatedEnumeration;\n readonly yChannelSelector: SVGAnimatedEnumeration;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDisplacementMapElement: {\n prototype: SVGFEDisplacementMapElement;\n new(): SVGFEDisplacementMapElement;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n};\n\ninterface SVGFEDistantLightElement extends SVGElement {\n readonly azimuth: SVGAnimatedNumber;\n readonly elevation: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDistantLightElement: {\n prototype: SVGFEDistantLightElement;\n new(): SVGFEDistantLightElement;\n};\n\ninterface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFloodElement: {\n prototype: SVGFEFloodElement;\n new(): SVGFEFloodElement;\n};\n\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncAElement: {\n prototype: SVGFEFuncAElement;\n new(): SVGFEFuncAElement;\n};\n\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncBElement: {\n prototype: SVGFEFuncBElement;\n new(): SVGFEFuncBElement;\n};\n\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncGElement: {\n prototype: SVGFEFuncGElement;\n new(): SVGFEFuncGElement;\n};\n\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncRElement: {\n prototype: SVGFEFuncRElement;\n new(): SVGFEFuncRElement;\n};\n\ninterface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly stdDeviationX: SVGAnimatedNumber;\n readonly stdDeviationY: SVGAnimatedNumber;\n setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;\n addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEGaussianBlurElement: {\n prototype: SVGFEGaussianBlurElement;\n new(): SVGFEGaussianBlurElement;\n};\n\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEImageElement: {\n prototype: SVGFEImageElement;\n new(): SVGFEImageElement;\n};\n\ninterface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeElement: {\n prototype: SVGFEMergeElement;\n new(): SVGFEMergeElement;\n};\n\ninterface SVGFEMergeNodeElement extends SVGElement {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeNodeElement: {\n prototype: SVGFEMergeNodeElement;\n new(): SVGFEMergeNodeElement;\n};\n\ninterface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly operator: SVGAnimatedEnumeration;\n readonly radiusX: SVGAnimatedNumber;\n readonly radiusY: SVGAnimatedNumber;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMorphologyElement: {\n prototype: SVGFEMorphologyElement;\n new(): SVGFEMorphologyElement;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n};\n\ninterface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly dx: SVGAnimatedNumber;\n readonly dy: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEOffsetElement: {\n prototype: SVGFEOffsetElement;\n new(): SVGFEOffsetElement;\n};\n\ninterface SVGFEPointLightElement extends SVGElement {\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEPointLightElement: {\n prototype: SVGFEPointLightElement;\n new(): SVGFEPointLightElement;\n};\n\ninterface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly specularConstant: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpecularLightingElement: {\n prototype: SVGFESpecularLightingElement;\n new(): SVGFESpecularLightingElement;\n};\n\ninterface SVGFESpotLightElement extends SVGElement {\n readonly limitingConeAngle: SVGAnimatedNumber;\n readonly pointsAtX: SVGAnimatedNumber;\n readonly pointsAtY: SVGAnimatedNumber;\n readonly pointsAtZ: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpotLightElement: {\n prototype: SVGFESpotLightElement;\n new(): SVGFESpotLightElement;\n};\n\ninterface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETileElement: {\n prototype: SVGFETileElement;\n new(): SVGFETileElement;\n};\n\ninterface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly baseFrequencyX: SVGAnimatedNumber;\n readonly baseFrequencyY: SVGAnimatedNumber;\n readonly numOctaves: SVGAnimatedInteger;\n readonly seed: SVGAnimatedNumber;\n readonly stitchTiles: SVGAnimatedEnumeration;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETurbulenceElement: {\n prototype: SVGFETurbulenceElement;\n new(): SVGFETurbulenceElement;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n readonly filterResX: SVGAnimatedInteger;\n readonly filterResY: SVGAnimatedInteger;\n readonly filterUnits: SVGAnimatedEnumeration;\n readonly height: SVGAnimatedLength;\n readonly primitiveUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n setFilterRes(filterResX: number, filterResY: number): void;\n addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFilterElement: {\n prototype: SVGFilterElement;\n new(): SVGFilterElement;\n};\n\ninterface SVGForeignObjectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGForeignObjectElement: {\n prototype: SVGForeignObjectElement;\n new(): SVGForeignObjectElement;\n};\n\ninterface SVGGElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGElement: {\n prototype: SVGGElement;\n new(): SVGGElement;\n};\n\ninterface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n readonly gradientTransform: SVGAnimatedTransformList;\n readonly gradientUnits: SVGAnimatedEnumeration;\n readonly spreadMethod: SVGAnimatedEnumeration;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGradientElement: {\n prototype: SVGGradientElement;\n new(): SVGGradientElement;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n};\n\ninterface SVGGraphicsElement extends SVGElement, SVGTests {\n readonly farthestViewportElement: SVGElement;\n readonly nearestViewportElement: SVGElement;\n readonly transform: SVGAnimatedTransformList;\n getBBox(): SVGRect;\n getCTM(): SVGMatrix;\n getScreenCTM(): SVGMatrix;\n getTransformToElement(element: SVGElement): SVGMatrix;\n addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGraphicsElement: {\n prototype: SVGGraphicsElement;\n new(): SVGGraphicsElement;\n};\n\ninterface SVGImageElement extends SVGGraphicsElement, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGImageElement: {\n prototype: SVGImageElement;\n new(): SVGImageElement;\n};\n\ninterface SVGLength {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n}\n\ndeclare var SVGLength: {\n prototype: SVGLength;\n new(): SVGLength;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n};\n\ninterface SVGLengthList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGLength): SVGLength;\n clear(): void;\n getItem(index: number): SVGLength;\n initialize(newItem: SVGLength): SVGLength;\n insertItemBefore(newItem: SVGLength, index: number): SVGLength;\n removeItem(index: number): SVGLength;\n replaceItem(newItem: SVGLength, index: number): SVGLength;\n}\n\ndeclare var SVGLengthList: {\n prototype: SVGLengthList;\n new(): SVGLengthList;\n};\n\ninterface SVGLinearGradientElement extends SVGGradientElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLinearGradientElement: {\n prototype: SVGLinearGradientElement;\n new(): SVGLinearGradientElement;\n};\n\ninterface SVGLineElement extends SVGGraphicsElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLineElement: {\n prototype: SVGLineElement;\n new(): SVGLineElement;\n};\n\ninterface SVGMarkerElement extends SVGElement, SVGFitToViewBox {\n readonly markerHeight: SVGAnimatedLength;\n readonly markerUnits: SVGAnimatedEnumeration;\n readonly markerWidth: SVGAnimatedLength;\n readonly orientAngle: SVGAnimatedAngle;\n readonly orientType: SVGAnimatedEnumeration;\n readonly refX: SVGAnimatedLength;\n readonly refY: SVGAnimatedLength;\n setOrientToAngle(angle: SVGAngle): void;\n setOrientToAuto(): void;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMarkerElement: {\n prototype: SVGMarkerElement;\n new(): SVGMarkerElement;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n};\n\ninterface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes {\n readonly height: SVGAnimatedLength;\n readonly maskContentUnits: SVGAnimatedEnumeration;\n readonly maskUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMaskElement: {\n prototype: SVGMaskElement;\n new(): SVGMaskElement;\n};\n\ninterface SVGMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n flipX(): SVGMatrix;\n flipY(): SVGMatrix;\n inverse(): SVGMatrix;\n multiply(secondMatrix: SVGMatrix): SVGMatrix;\n rotate(angle: number): SVGMatrix;\n rotateFromVector(x: number, y: number): SVGMatrix;\n scale(scaleFactor: number): SVGMatrix;\n scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix;\n skewX(angle: number): SVGMatrix;\n skewY(angle: number): SVGMatrix;\n translate(x: number, y: number): SVGMatrix;\n}\n\ndeclare var SVGMatrix: {\n prototype: SVGMatrix;\n new(): SVGMatrix;\n};\n\ninterface SVGMetadataElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMetadataElement: {\n prototype: SVGMetadataElement;\n new(): SVGMetadataElement;\n};\n\ninterface SVGNumber {\n value: number;\n}\n\ndeclare var SVGNumber: {\n prototype: SVGNumber;\n new(): SVGNumber;\n};\n\ninterface SVGNumberList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGNumber): SVGNumber;\n clear(): void;\n getItem(index: number): SVGNumber;\n initialize(newItem: SVGNumber): SVGNumber;\n insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;\n removeItem(index: number): SVGNumber;\n replaceItem(newItem: SVGNumber, index: number): SVGNumber;\n}\n\ndeclare var SVGNumberList: {\n prototype: SVGNumberList;\n new(): SVGNumberList;\n};\n\ninterface SVGPathElement extends SVGGraphicsElement {\n readonly pathSegList: SVGPathSegList;\n createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;\n createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;\n createSVGPathSegClosePath(): SVGPathSegClosePath;\n createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;\n createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;\n createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;\n createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;\n createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;\n createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;\n createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;\n createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;\n createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;\n createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;\n createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;\n createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;\n createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;\n createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;\n createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;\n createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;\n getPathSegAtLength(distance: number): number;\n getPointAtLength(distance: number): SVGPoint;\n getTotalLength(): number;\n addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPathElement: {\n prototype: SVGPathElement;\n new(): SVGPathElement;\n};\n\ninterface SVGPathSeg {\n readonly pathSegType: number;\n readonly pathSegTypeAsLetter: string;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n}\n\ndeclare var SVGPathSeg: {\n prototype: SVGPathSeg;\n new(): SVGPathSeg;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n};\n\ninterface SVGPathSegArcAbs extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcAbs: {\n prototype: SVGPathSegArcAbs;\n new(): SVGPathSegArcAbs;\n};\n\ninterface SVGPathSegArcRel extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcRel: {\n prototype: SVGPathSegArcRel;\n new(): SVGPathSegArcRel;\n};\n\ninterface SVGPathSegClosePath extends SVGPathSeg {\n}\n\ndeclare var SVGPathSegClosePath: {\n prototype: SVGPathSegClosePath;\n new(): SVGPathSegClosePath;\n};\n\ninterface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicAbs: {\n prototype: SVGPathSegCurvetoCubicAbs;\n new(): SVGPathSegCurvetoCubicAbs;\n};\n\ninterface SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicRel: {\n prototype: SVGPathSegCurvetoCubicRel;\n new(): SVGPathSegCurvetoCubicRel;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothAbs: {\n prototype: SVGPathSegCurvetoCubicSmoothAbs;\n new(): SVGPathSegCurvetoCubicSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothRel: {\n prototype: SVGPathSegCurvetoCubicSmoothRel;\n new(): SVGPathSegCurvetoCubicSmoothRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticAbs: {\n prototype: SVGPathSegCurvetoQuadraticAbs;\n new(): SVGPathSegCurvetoQuadraticAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticRel: {\n prototype: SVGPathSegCurvetoQuadraticRel;\n new(): SVGPathSegCurvetoQuadraticRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothAbs: {\n prototype: SVGPathSegCurvetoQuadraticSmoothAbs;\n new(): SVGPathSegCurvetoQuadraticSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothRel: {\n prototype: SVGPathSegCurvetoQuadraticSmoothRel;\n new(): SVGPathSegCurvetoQuadraticSmoothRel;\n};\n\ninterface SVGPathSegLinetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoAbs: {\n prototype: SVGPathSegLinetoAbs;\n new(): SVGPathSegLinetoAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalAbs: {\n prototype: SVGPathSegLinetoHorizontalAbs;\n new(): SVGPathSegLinetoHorizontalAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalRel: {\n prototype: SVGPathSegLinetoHorizontalRel;\n new(): SVGPathSegLinetoHorizontalRel;\n};\n\ninterface SVGPathSegLinetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoRel: {\n prototype: SVGPathSegLinetoRel;\n new(): SVGPathSegLinetoRel;\n};\n\ninterface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalAbs: {\n prototype: SVGPathSegLinetoVerticalAbs;\n new(): SVGPathSegLinetoVerticalAbs;\n};\n\ninterface SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalRel: {\n prototype: SVGPathSegLinetoVerticalRel;\n new(): SVGPathSegLinetoVerticalRel;\n};\n\ninterface SVGPathSegList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPathSeg): SVGPathSeg;\n clear(): void;\n getItem(index: number): SVGPathSeg;\n initialize(newItem: SVGPathSeg): SVGPathSeg;\n insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;\n removeItem(index: number): SVGPathSeg;\n replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;\n}\n\ndeclare var SVGPathSegList: {\n prototype: SVGPathSegList;\n new(): SVGPathSegList;\n};\n\ninterface SVGPathSegMovetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoAbs: {\n prototype: SVGPathSegMovetoAbs;\n new(): SVGPathSegMovetoAbs;\n};\n\ninterface SVGPathSegMovetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoRel: {\n prototype: SVGPathSegMovetoRel;\n new(): SVGPathSegMovetoRel;\n};\n\ninterface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly patternContentUnits: SVGAnimatedEnumeration;\n readonly patternTransform: SVGAnimatedTransformList;\n readonly patternUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPatternElement: {\n prototype: SVGPatternElement;\n new(): SVGPatternElement;\n};\n\ninterface SVGPoint {\n x: number;\n y: number;\n matrixTransform(matrix: SVGMatrix): SVGPoint;\n}\n\ndeclare var SVGPoint: {\n prototype: SVGPoint;\n new(): SVGPoint;\n};\n\ninterface SVGPointList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPoint): SVGPoint;\n clear(): void;\n getItem(index: number): SVGPoint;\n initialize(newItem: SVGPoint): SVGPoint;\n insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;\n removeItem(index: number): SVGPoint;\n replaceItem(newItem: SVGPoint, index: number): SVGPoint;\n}\n\ndeclare var SVGPointList: {\n prototype: SVGPointList;\n new(): SVGPointList;\n};\n\ninterface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolygonElement: {\n prototype: SVGPolygonElement;\n new(): SVGPolygonElement;\n};\n\ninterface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolylineElement: {\n prototype: SVGPolylineElement;\n new(): SVGPolylineElement;\n};\n\ninterface SVGPreserveAspectRatio {\n align: number;\n meetOrSlice: number;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n}\n\ndeclare var SVGPreserveAspectRatio: {\n prototype: SVGPreserveAspectRatio;\n new(): SVGPreserveAspectRatio;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n};\n\ninterface SVGRadialGradientElement extends SVGGradientElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly fx: SVGAnimatedLength;\n readonly fy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRadialGradientElement: {\n prototype: SVGRadialGradientElement;\n new(): SVGRadialGradientElement;\n};\n\ninterface SVGRect {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var SVGRect: {\n prototype: SVGRect;\n new(): SVGRect;\n};\n\ninterface SVGRectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRectElement: {\n prototype: SVGRectElement;\n new(): SVGRectElement;\n};\n\ninterface SVGScriptElement extends SVGElement, SVGURIReference {\n type: string;\n addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGScriptElement: {\n prototype: SVGScriptElement;\n new(): SVGScriptElement;\n};\n\ninterface SVGStopElement extends SVGElement {\n readonly offset: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStopElement: {\n prototype: SVGStopElement;\n new(): SVGStopElement;\n};\n\ninterface SVGStringList {\n readonly numberOfItems: number;\n appendItem(newItem: string): string;\n clear(): void;\n getItem(index: number): string;\n initialize(newItem: string): string;\n insertItemBefore(newItem: string, index: number): string;\n removeItem(index: number): string;\n replaceItem(newItem: string, index: number): string;\n}\n\ndeclare var SVGStringList: {\n prototype: SVGStringList;\n new(): SVGStringList;\n};\n\ninterface SVGStyleElement extends SVGElement {\n disabled: boolean;\n media: string;\n title: string;\n type: string;\n addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStyleElement: {\n prototype: SVGStyleElement;\n new(): SVGStyleElement;\n};\n\ninterface SVGSVGElementEventMap extends SVGElementEventMap {\n \"SVGAbort\": Event;\n \"SVGError\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"SVGUnload\": Event;\n \"SVGZoom\": SVGZoomEvent;\n}\n\ninterface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan {\n contentScriptType: string;\n contentStyleType: string;\n currentScale: number;\n readonly currentTranslate: SVGPoint;\n readonly height: SVGAnimatedLength;\n onabort: (this: SVGSVGElement, ev: Event) => any;\n onerror: (this: SVGSVGElement, ev: Event) => any;\n onresize: (this: SVGSVGElement, ev: UIEvent) => any;\n onscroll: (this: SVGSVGElement, ev: UIEvent) => any;\n onunload: (this: SVGSVGElement, ev: Event) => any;\n onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any;\n readonly pixelUnitToMillimeterX: number;\n readonly pixelUnitToMillimeterY: number;\n readonly screenPixelToMillimeterX: number;\n readonly screenPixelToMillimeterY: number;\n readonly viewport: SVGRect;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n checkEnclosure(element: SVGElement, rect: SVGRect): boolean;\n checkIntersection(element: SVGElement, rect: SVGRect): boolean;\n createSVGAngle(): SVGAngle;\n createSVGLength(): SVGLength;\n createSVGMatrix(): SVGMatrix;\n createSVGNumber(): SVGNumber;\n createSVGPoint(): SVGPoint;\n createSVGRect(): SVGRect;\n createSVGTransform(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n deselectAll(): void;\n forceRedraw(): void;\n getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;\n getCurrentTime(): number;\n getElementById(elementId: string): Element;\n getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n pauseAnimations(): void;\n setCurrentTime(seconds: number): void;\n suspendRedraw(maxWaitMilliseconds: number): number;\n unpauseAnimations(): void;\n unsuspendRedraw(suspendHandleID: number): void;\n unsuspendRedrawAll(): void;\n addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSVGElement: {\n prototype: SVGSVGElement;\n new(): SVGSVGElement;\n};\n\ninterface SVGSwitchElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSwitchElement: {\n prototype: SVGSwitchElement;\n new(): SVGSwitchElement;\n};\n\ninterface SVGSymbolElement extends SVGElement, SVGFitToViewBox {\n addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSymbolElement: {\n prototype: SVGSymbolElement;\n new(): SVGSymbolElement;\n};\n\ninterface SVGTextContentElement extends SVGGraphicsElement {\n readonly lengthAdjust: SVGAnimatedEnumeration;\n readonly textLength: SVGAnimatedLength;\n getCharNumAtPosition(point: SVGPoint): number;\n getComputedTextLength(): number;\n getEndPositionOfChar(charnum: number): SVGPoint;\n getExtentOfChar(charnum: number): SVGRect;\n getNumberOfChars(): number;\n getRotationOfChar(charnum: number): number;\n getStartPositionOfChar(charnum: number): SVGPoint;\n getSubStringLength(charnum: number, nchars: number): number;\n selectSubString(charnum: number, nchars: number): void;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextContentElement: {\n prototype: SVGTextContentElement;\n new(): SVGTextContentElement;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n};\n\ninterface SVGTextElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextElement: {\n prototype: SVGTextElement;\n new(): SVGTextElement;\n};\n\ninterface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {\n readonly method: SVGAnimatedEnumeration;\n readonly spacing: SVGAnimatedEnumeration;\n readonly startOffset: SVGAnimatedLength;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPathElement: {\n prototype: SVGTextPathElement;\n new(): SVGTextPathElement;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n};\n\ninterface SVGTextPositioningElement extends SVGTextContentElement {\n readonly dx: SVGAnimatedLengthList;\n readonly dy: SVGAnimatedLengthList;\n readonly rotate: SVGAnimatedNumberList;\n readonly x: SVGAnimatedLengthList;\n readonly y: SVGAnimatedLengthList;\n addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPositioningElement: {\n prototype: SVGTextPositioningElement;\n new(): SVGTextPositioningElement;\n};\n\ninterface SVGTitleElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTitleElement: {\n prototype: SVGTitleElement;\n new(): SVGTitleElement;\n};\n\ninterface SVGTransform {\n readonly angle: number;\n readonly matrix: SVGMatrix;\n readonly type: number;\n setMatrix(matrix: SVGMatrix): void;\n setRotate(angle: number, cx: number, cy: number): void;\n setScale(sx: number, sy: number): void;\n setSkewX(angle: number): void;\n setSkewY(angle: number): void;\n setTranslate(tx: number, ty: number): void;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n}\n\ndeclare var SVGTransform: {\n prototype: SVGTransform;\n new(): SVGTransform;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n};\n\ninterface SVGTransformList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGTransform): SVGTransform;\n clear(): void;\n consolidate(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n getItem(index: number): SVGTransform;\n initialize(newItem: SVGTransform): SVGTransform;\n insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;\n removeItem(index: number): SVGTransform;\n replaceItem(newItem: SVGTransform, index: number): SVGTransform;\n}\n\ndeclare var SVGTransformList: {\n prototype: SVGTransformList;\n new(): SVGTransformList;\n};\n\ninterface SVGTSpanElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\n};\n\ninterface SVGUnitTypes {\n readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\n readonly SVG_UNIT_TYPE_UNKNOWN: number;\n readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\n}\ndeclare var SVGUnitTypes: SVGUnitTypes;\n\ninterface SVGUseElement extends SVGGraphicsElement, SVGURIReference {\n readonly animatedInstanceRoot: SVGElementInstance;\n readonly height: SVGAnimatedLength;\n readonly instanceRoot: SVGElementInstance;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGUseElement: {\n prototype: SVGUseElement;\n new(): SVGUseElement;\n};\n\ninterface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox {\n readonly viewTarget: SVGStringList;\n addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGViewElement: {\n prototype: SVGViewElement;\n new(): SVGViewElement;\n};\n\ninterface SVGZoomAndPan {\n readonly zoomAndPan: number;\n}\n\ndeclare var SVGZoomAndPan: {\n readonly SVG_ZOOMANDPAN_DISABLE: number;\n readonly SVG_ZOOMANDPAN_MAGNIFY: number;\n readonly SVG_ZOOMANDPAN_UNKNOWN: number;\n};\n\ninterface SVGZoomEvent extends UIEvent {\n readonly newScale: number;\n readonly newTranslate: SVGPoint;\n readonly previousScale: number;\n readonly previousTranslate: SVGPoint;\n readonly zoomRectScreen: SVGRect;\n}\n\ndeclare var SVGZoomEvent: {\n prototype: SVGZoomEvent;\n new(): SVGZoomEvent;\n};\n\ninterface SyncManager {\n getTags(): Promise;\n register(tag: string): Promise;\n}\n\ndeclare var SyncManager: {\n prototype: SyncManager;\n new(): SyncManager;\n};\n\ninterface Text extends CharacterData {\n readonly wholeText: string;\n readonly assignedSlot: HTMLSlotElement | null;\n splitText(offset: number): Text;\n}\n\ndeclare var Text: {\n prototype: Text;\n new(data?: string): Text;\n};\n\ninterface TextEvent extends UIEvent {\n readonly data: string;\n readonly inputMethod: number;\n readonly locale: string;\n initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n}\n\ndeclare var TextEvent: {\n prototype: TextEvent;\n new(): TextEvent;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n};\n\ninterface TextMetrics {\n readonly width: number;\n}\n\ndeclare var TextMetrics: {\n prototype: TextMetrics;\n new(): TextMetrics;\n};\n\ninterface TextTrackEventMap {\n \"cuechange\": Event;\n \"error\": Event;\n \"load\": Event;\n}\n\ninterface TextTrack extends EventTarget {\n readonly activeCues: TextTrackCueList;\n readonly cues: TextTrackCueList;\n readonly inBandMetadataTrackDispatchType: string;\n readonly kind: string;\n readonly label: string;\n readonly language: string;\n mode: any;\n oncuechange: (this: TextTrack, ev: Event) => any;\n onerror: (this: TextTrack, ev: Event) => any;\n onload: (this: TextTrack, ev: Event) => any;\n readonly readyState: number;\n addCue(cue: TextTrackCue): void;\n removeCue(cue: TextTrackCue): void;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrack: {\n prototype: TextTrack;\n new(): TextTrack;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n};\n\ninterface TextTrackCueEventMap {\n \"enter\": Event;\n \"exit\": Event;\n}\n\ninterface TextTrackCue extends EventTarget {\n endTime: number;\n id: string;\n onenter: (this: TextTrackCue, ev: Event) => any;\n onexit: (this: TextTrackCue, ev: Event) => any;\n pauseOnExit: boolean;\n startTime: number;\n text: string;\n readonly track: TextTrack;\n getCueAsHTML(): DocumentFragment;\n addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrackCue: {\n prototype: TextTrackCue;\n new(startTime: number, endTime: number, text: string): TextTrackCue;\n};\n\ninterface TextTrackCueList {\n readonly length: number;\n getCueById(id: string): TextTrackCue;\n item(index: number): TextTrackCue;\n [index: number]: TextTrackCue;\n}\n\ndeclare var TextTrackCueList: {\n prototype: TextTrackCueList;\n new(): TextTrackCueList;\n};\n\ninterface TextTrackListEventMap {\n \"addtrack\": TrackEvent;\n}\n\ninterface TextTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null;\n item(index: number): TextTrack;\n addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: TextTrack;\n}\n\ndeclare var TextTrackList: {\n prototype: TextTrackList;\n new(): TextTrackList;\n};\n\ninterface TimeRanges {\n readonly length: number;\n end(index: number): number;\n start(index: number): number;\n}\n\ndeclare var TimeRanges: {\n prototype: TimeRanges;\n new(): TimeRanges;\n};\n\ninterface Touch {\n readonly clientX: number;\n readonly clientY: number;\n readonly identifier: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly target: EventTarget;\n}\n\ndeclare var Touch: {\n prototype: Touch;\n new(): Touch;\n};\n\ninterface TouchEvent extends UIEvent {\n readonly altKey: boolean;\n readonly changedTouches: TouchList;\n readonly charCode: number;\n readonly ctrlKey: boolean;\n readonly keyCode: number;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly targetTouches: TouchList;\n readonly touches: TouchList;\n readonly which: number;\n}\n\ndeclare var TouchEvent: {\n prototype: TouchEvent;\n new(type: string, touchEventInit?: TouchEventInit): TouchEvent;\n};\n\ninterface TouchList {\n readonly length: number;\n item(index: number): Touch | null;\n [index: number]: Touch;\n}\n\ndeclare var TouchList: {\n prototype: TouchList;\n new(): TouchList;\n};\n\ninterface TrackEvent extends Event {\n readonly track: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ndeclare var TrackEvent: {\n prototype: TrackEvent;\n new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent;\n};\n\ninterface TransitionEvent extends Event {\n readonly elapsedTime: number;\n readonly propertyName: string;\n initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void;\n}\n\ndeclare var TransitionEvent: {\n prototype: TransitionEvent;\n new(typeArg: string, eventInitDict?: TransitionEventInit): TransitionEvent;\n};\n\ninterface TreeWalker {\n currentNode: Node;\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter;\n readonly root: Node;\n readonly whatToShow: number;\n firstChild(): Node;\n lastChild(): Node;\n nextNode(): Node;\n nextSibling(): Node;\n parentNode(): Node;\n previousNode(): Node;\n previousSibling(): Node;\n}\n\ndeclare var TreeWalker: {\n prototype: TreeWalker;\n new(): TreeWalker;\n};\n\ninterface UIEvent extends Event {\n readonly detail: number;\n readonly view: Window;\n initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void;\n}\n\ndeclare var UIEvent: {\n prototype: UIEvent;\n new(typeArg: string, eventInitDict?: UIEventInit): UIEvent;\n};\n\ninterface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {\n readonly mediaType: string;\n}\n\ndeclare var UnviewableContentIdentifiedEvent: {\n prototype: UnviewableContentIdentifiedEvent;\n new(): UnviewableContentIdentifiedEvent;\n};\n\ninterface URL {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n password: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n username: string;\n readonly searchParams: URLSearchParams;\n toString(): string;\n}\n\ndeclare var URL: {\n prototype: URL;\n new(url: string, base?: string | URL): URL;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n};\n\ninterface ValidityState {\n readonly badInput: boolean;\n readonly customError: boolean;\n readonly patternMismatch: boolean;\n readonly rangeOverflow: boolean;\n readonly rangeUnderflow: boolean;\n readonly stepMismatch: boolean;\n readonly tooLong: boolean;\n readonly typeMismatch: boolean;\n readonly valid: boolean;\n readonly valueMissing: boolean;\n readonly tooShort: boolean;\n}\n\ndeclare var ValidityState: {\n prototype: ValidityState;\n new(): ValidityState;\n};\n\ninterface VideoPlaybackQuality {\n readonly corruptedVideoFrames: number;\n readonly creationTime: number;\n readonly droppedVideoFrames: number;\n readonly totalFrameDelay: number;\n readonly totalVideoFrames: number;\n}\n\ndeclare var VideoPlaybackQuality: {\n prototype: VideoPlaybackQuality;\n new(): VideoPlaybackQuality;\n};\n\ninterface VideoTrack {\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n selected: boolean;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var VideoTrack: {\n prototype: VideoTrack;\n new(): VideoTrack;\n};\n\ninterface VideoTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface VideoTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any;\n onchange: (this: VideoTrackList, ev: Event) => any;\n onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any;\n readonly selectedIndex: number;\n getTrackById(id: string): VideoTrack | null;\n item(index: number): VideoTrack;\n addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\n};\n\ninterface WaveShaperNode extends AudioNode {\n curve: Float32Array | null;\n oversample: OverSampleType;\n}\n\ndeclare var WaveShaperNode: {\n prototype: WaveShaperNode;\n new(): WaveShaperNode;\n};\n\ninterface WebAuthentication {\n getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise;\n makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise;\n}\n\ndeclare var WebAuthentication: {\n prototype: WebAuthentication;\n new(): WebAuthentication;\n};\n\ninterface WebAuthnAssertion {\n readonly authenticatorData: ArrayBuffer;\n readonly clientData: ArrayBuffer;\n readonly credential: ScopedCredential;\n readonly signature: ArrayBuffer;\n}\n\ndeclare var WebAuthnAssertion: {\n prototype: WebAuthnAssertion;\n new(): WebAuthnAssertion;\n};\n\ninterface WEBGL_compressed_texture_s3tc {\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n}\n\ndeclare var WEBGL_compressed_texture_s3tc: {\n prototype: WEBGL_compressed_texture_s3tc;\n new(): WEBGL_compressed_texture_s3tc;\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n};\n\ninterface WEBGL_debug_renderer_info {\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n}\n\ndeclare var WEBGL_debug_renderer_info: {\n prototype: WEBGL_debug_renderer_info;\n new(): WEBGL_debug_renderer_info;\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n};\n\ninterface WEBGL_depth_texture {\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n}\n\ndeclare var WEBGL_depth_texture: {\n prototype: WEBGL_depth_texture;\n new(): WEBGL_depth_texture;\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n};\n\ninterface WebGLActiveInfo {\n readonly name: string;\n readonly size: number;\n readonly type: number;\n}\n\ndeclare var WebGLActiveInfo: {\n prototype: WebGLActiveInfo;\n new(): WebGLActiveInfo;\n};\n\ninterface WebGLBuffer extends WebGLObject {\n}\n\ndeclare var WebGLBuffer: {\n prototype: WebGLBuffer;\n new(): WebGLBuffer;\n};\n\ninterface WebGLContextEvent extends Event {\n readonly statusMessage: string;\n}\n\ndeclare var WebGLContextEvent: {\n prototype: WebGLContextEvent;\n new(typeArg: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent;\n};\n\ninterface WebGLFramebuffer extends WebGLObject {\n}\n\ndeclare var WebGLFramebuffer: {\n prototype: WebGLFramebuffer;\n new(): WebGLFramebuffer;\n};\n\ninterface WebGLObject {\n}\n\ndeclare var WebGLObject: {\n prototype: WebGLObject;\n new(): WebGLObject;\n};\n\ninterface WebGLProgram extends WebGLObject {\n}\n\ndeclare var WebGLProgram: {\n prototype: WebGLProgram;\n new(): WebGLProgram;\n};\n\ninterface WebGLRenderbuffer extends WebGLObject {\n}\n\ndeclare var WebGLRenderbuffer: {\n prototype: WebGLRenderbuffer;\n new(): WebGLRenderbuffer;\n};\n\ninterface WebGLRenderingContext {\n readonly canvas: HTMLCanvasElement;\n readonly drawingBufferHeight: number;\n readonly drawingBufferWidth: number;\n activeTexture(texture: number): void;\n attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void;\n bindBuffer(target: number, buffer: WebGLBuffer | null): void;\n bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void;\n bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void;\n bindTexture(target: number, texture: WebGLTexture | null): void;\n blendColor(red: number, green: number, blue: number, alpha: number): void;\n blendEquation(mode: number): void;\n blendEquationSeparate(modeRGB: number, modeAlpha: number): void;\n blendFunc(sfactor: number, dfactor: number): void;\n blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;\n bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void;\n bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void;\n checkFramebufferStatus(target: number): number;\n clear(mask: number): void;\n clearColor(red: number, green: number, blue: number, alpha: number): void;\n clearDepth(depth: number): void;\n clearStencil(s: number): void;\n colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;\n compileShader(shader: WebGLShader | null): void;\n compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void;\n compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void;\n copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;\n copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;\n createBuffer(): WebGLBuffer | null;\n createFramebuffer(): WebGLFramebuffer | null;\n createProgram(): WebGLProgram | null;\n createRenderbuffer(): WebGLRenderbuffer | null;\n createShader(type: number): WebGLShader | null;\n createTexture(): WebGLTexture | null;\n cullFace(mode: number): void;\n deleteBuffer(buffer: WebGLBuffer | null): void;\n deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;\n deleteProgram(program: WebGLProgram | null): void;\n deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;\n deleteShader(shader: WebGLShader | null): void;\n deleteTexture(texture: WebGLTexture | null): void;\n depthFunc(func: number): void;\n depthMask(flag: boolean): void;\n depthRange(zNear: number, zFar: number): void;\n detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n disable(cap: number): void;\n disableVertexAttribArray(index: number): void;\n drawArrays(mode: number, first: number, count: number): void;\n drawElements(mode: number, count: number, type: number, offset: number): void;\n enable(cap: number): void;\n enableVertexAttribArray(index: number): void;\n finish(): void;\n flush(): void;\n framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void;\n framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void;\n frontFace(mode: number): void;\n generateMipmap(target: number): void;\n getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null;\n getAttribLocation(program: WebGLProgram | null, name: string): number;\n getBufferParameter(target: number, pname: number): any;\n getContextAttributes(): WebGLContextAttributes;\n getError(): number;\n getExtension(extensionName: \"EXT_blend_minmax\"): EXT_blend_minmax | null;\n getExtension(extensionName: \"EXT_texture_filter_anisotropic\"): EXT_texture_filter_anisotropic | null;\n getExtension(extensionName: \"EXT_frag_depth\"): EXT_frag_depth | null;\n getExtension(extensionName: \"EXT_shader_texture_lod\"): EXT_shader_texture_lod | null;\n getExtension(extensionName: \"EXT_sRGB\"): EXT_sRGB | null;\n getExtension(extensionName: \"OES_vertex_array_object\"): OES_vertex_array_object | null;\n getExtension(extensionName: \"WEBGL_color_buffer_float\"): WEBGL_color_buffer_float | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_astc\"): WEBGL_compressed_texture_astc | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc_srgb\"): WEBGL_compressed_texture_s3tc_srgb | null;\n getExtension(extensionName: \"WEBGL_debug_shaders\"): WEBGL_debug_shaders | null;\n getExtension(extensionName: \"WEBGL_draw_buffers\"): WEBGL_draw_buffers | null;\n getExtension(extensionName: \"WEBGL_lose_context\"): WEBGL_lose_context | null;\n getExtension(extensionName: \"WEBGL_depth_texture\"): WEBGL_depth_texture | null;\n getExtension(extensionName: \"WEBGL_debug_renderer_info\"): WEBGL_debug_renderer_info | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc\"): WEBGL_compressed_texture_s3tc | null;\n getExtension(extensionName: \"OES_texture_half_float_linear\"): OES_texture_half_float_linear | null;\n getExtension(extensionName: \"OES_texture_half_float\"): OES_texture_half_float | null;\n getExtension(extensionName: \"OES_texture_float_linear\"): OES_texture_float_linear | null;\n getExtension(extensionName: \"OES_texture_float\"): OES_texture_float | null;\n getExtension(extensionName: \"OES_standard_derivatives\"): OES_standard_derivatives | null;\n getExtension(extensionName: \"OES_element_index_uint\"): OES_element_index_uint | null;\n getExtension(extensionName: \"ANGLE_instanced_arrays\"): ANGLE_instanced_arrays | null;\n getExtension(extensionName: string): any;\n getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any;\n getParameter(pname: number): any;\n getProgramInfoLog(program: WebGLProgram | null): string | null;\n getProgramParameter(program: WebGLProgram | null, pname: number): any;\n getRenderbufferParameter(target: number, pname: number): any;\n getShaderInfoLog(shader: WebGLShader | null): string | null;\n getShaderParameter(shader: WebGLShader | null, pname: number): any;\n getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null;\n getShaderSource(shader: WebGLShader | null): string | null;\n getSupportedExtensions(): string[] | null;\n getTexParameter(target: number, pname: number): any;\n getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any;\n getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null;\n getVertexAttrib(index: number, pname: number): any;\n getVertexAttribOffset(index: number, pname: number): number;\n hint(target: number, mode: number): void;\n isBuffer(buffer: WebGLBuffer | null): boolean;\n isContextLost(): boolean;\n isEnabled(cap: number): boolean;\n isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean;\n isProgram(program: WebGLProgram | null): boolean;\n isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean;\n isShader(shader: WebGLShader | null): boolean;\n isTexture(texture: WebGLTexture | null): boolean;\n lineWidth(width: number): void;\n linkProgram(program: WebGLProgram | null): void;\n pixelStorei(pname: number, param: number | boolean): void;\n polygonOffset(factor: number, units: number): void;\n readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;\n sampleCoverage(value: number, invert: boolean): void;\n scissor(x: number, y: number, width: number, height: number): void;\n shaderSource(shader: WebGLShader | null, source: string): void;\n stencilFunc(func: number, ref: number, mask: number): void;\n stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void;\n stencilMask(mask: number): void;\n stencilMaskSeparate(face: number, mask: number): void;\n stencilOp(fail: number, zfail: number, zpass: number): void;\n stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;\n texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n texParameterf(target: number, pname: number, param: number): void;\n texParameteri(target: number, pname: number, param: number): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n uniform1f(location: WebGLUniformLocation | null, x: number): void;\n uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform1i(location: WebGLUniformLocation | null, x: number): void;\n uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;\n uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;\n uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;\n useProgram(program: WebGLProgram | null): void;\n validateProgram(program: WebGLProgram | null): void;\n vertexAttrib1f(indx: number, x: number): void;\n vertexAttrib1fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib2f(indx: number, x: number, y: number): void;\n vertexAttrib2fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib3f(indx: number, x: number, y: number, z: number): void;\n vertexAttrib3fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;\n vertexAttrib4fv(indx: number, values: Float32Array | number[]): void;\n vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;\n viewport(x: number, y: number, width: number, height: number): void;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NO_ERROR: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB5_A1: number;\n readonly RGB565: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly TRIANGLES: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n}\n\ndeclare var WebGLRenderingContext: {\n prototype: WebGLRenderingContext;\n new(): WebGLRenderingContext;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NO_ERROR: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB5_A1: number;\n readonly RGB565: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly TRIANGLES: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n};\n\ninterface WebGLShader extends WebGLObject {\n}\n\ndeclare var WebGLShader: {\n prototype: WebGLShader;\n new(): WebGLShader;\n};\n\ninterface WebGLShaderPrecisionFormat {\n readonly precision: number;\n readonly rangeMax: number;\n readonly rangeMin: number;\n}\n\ndeclare var WebGLShaderPrecisionFormat: {\n prototype: WebGLShaderPrecisionFormat;\n new(): WebGLShaderPrecisionFormat;\n};\n\ninterface WebGLTexture extends WebGLObject {\n}\n\ndeclare var WebGLTexture: {\n prototype: WebGLTexture;\n new(): WebGLTexture;\n};\n\ninterface WebGLUniformLocation {\n}\n\ndeclare var WebGLUniformLocation: {\n prototype: WebGLUniformLocation;\n new(): WebGLUniformLocation;\n};\n\ninterface WebKitCSSMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n m11: number;\n m12: number;\n m13: number;\n m14: number;\n m21: number;\n m22: number;\n m23: number;\n m24: number;\n m31: number;\n m32: number;\n m33: number;\n m34: number;\n m41: number;\n m42: number;\n m43: number;\n m44: number;\n inverse(): WebKitCSSMatrix;\n multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix;\n rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix;\n rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix;\n scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix;\n setMatrixValue(value: string): void;\n skewX(angle: number): WebKitCSSMatrix;\n skewY(angle: number): WebKitCSSMatrix;\n toString(): string;\n translate(x: number, y: number, z?: number): WebKitCSSMatrix;\n}\n\ndeclare var WebKitCSSMatrix: {\n prototype: WebKitCSSMatrix;\n new(text?: string): WebKitCSSMatrix;\n};\n\ninterface WebKitDirectoryEntry extends WebKitEntry {\n createReader(): WebKitDirectoryReader;\n}\n\ndeclare var WebKitDirectoryEntry: {\n prototype: WebKitDirectoryEntry;\n new(): WebKitDirectoryEntry;\n};\n\ninterface WebKitDirectoryReader {\n readEntries(successCallback: WebKitEntriesCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitDirectoryReader: {\n prototype: WebKitDirectoryReader;\n new(): WebKitDirectoryReader;\n};\n\ninterface WebKitEntry {\n readonly filesystem: WebKitFileSystem;\n readonly fullPath: string;\n readonly isDirectory: boolean;\n readonly isFile: boolean;\n readonly name: string;\n}\n\ndeclare var WebKitEntry: {\n prototype: WebKitEntry;\n new(): WebKitEntry;\n};\n\ninterface WebKitFileEntry extends WebKitEntry {\n file(successCallback: WebKitFileCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitFileEntry: {\n prototype: WebKitFileEntry;\n new(): WebKitFileEntry;\n};\n\ninterface WebKitFileSystem {\n readonly name: string;\n readonly root: WebKitDirectoryEntry;\n}\n\ndeclare var WebKitFileSystem: {\n prototype: WebKitFileSystem;\n new(): WebKitFileSystem;\n};\n\ninterface WebKitPoint {\n x: number;\n y: number;\n}\n\ndeclare var WebKitPoint: {\n prototype: WebKitPoint;\n new(x?: number, y?: number): WebKitPoint;\n};\n\ninterface webkitRTCPeerConnection extends RTCPeerConnection {\n addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var webkitRTCPeerConnection: {\n prototype: webkitRTCPeerConnection;\n new(configuration: RTCConfiguration): webkitRTCPeerConnection;\n};\n\ninterface WebSocketEventMap {\n \"close\": CloseEvent;\n \"error\": Event;\n \"message\": MessageEvent;\n \"open\": Event;\n}\n\ninterface WebSocket extends EventTarget {\n binaryType: string;\n readonly bufferedAmount: number;\n readonly extensions: string;\n onclose: (this: WebSocket, ev: CloseEvent) => any;\n onerror: (this: WebSocket, ev: Event) => any;\n onmessage: (this: WebSocket, ev: MessageEvent) => any;\n onopen: (this: WebSocket, ev: Event) => any;\n readonly protocol: string;\n readonly readyState: number;\n readonly url: string;\n close(code?: number, reason?: string): void;\n send(data: any): void;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var WebSocket: {\n prototype: WebSocket;\n new(url: string, protocols?: string | string[]): WebSocket;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n};\n\ninterface WheelEvent extends MouseEvent {\n readonly deltaMode: number;\n readonly deltaX: number;\n readonly deltaY: number;\n readonly deltaZ: number;\n readonly wheelDelta: number;\n readonly wheelDeltaX: number;\n readonly wheelDeltaY: number;\n getCurrentPoint(element: Element): void;\n initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n}\n\ndeclare var WheelEvent: {\n prototype: WheelEvent;\n new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n};\n\ninterface WindowEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"compassneedscalibration\": Event;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"devicelight\": DeviceLightEvent;\n \"devicemotion\": DeviceMotionEvent;\n \"deviceorientation\": DeviceOrientationEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": MediaStreamErrorEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"message\": MessageEvent;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSGestureChange\": MSGestureEvent;\n \"MSGestureDoubleTap\": MSGestureEvent;\n \"MSGestureEnd\": MSGestureEvent;\n \"MSGestureHold\": MSGestureEvent;\n \"MSGestureStart\": MSGestureEvent;\n \"MSGestureTap\": MSGestureEvent;\n \"MSInertiaStart\": MSGestureEvent;\n \"MSPointerCancel\": MSPointerEvent;\n \"MSPointerDown\": MSPointerEvent;\n \"MSPointerEnter\": MSPointerEvent;\n \"MSPointerLeave\": MSPointerEvent;\n \"MSPointerMove\": MSPointerEvent;\n \"MSPointerOut\": MSPointerEvent;\n \"MSPointerOver\": MSPointerEvent;\n \"MSPointerUp\": MSPointerEvent;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"popstate\": PopStateEvent;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": ProgressEvent;\n \"reset\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"stalled\": Event;\n \"storage\": StorageEvent;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": TouchEvent;\n \"touchend\": TouchEvent;\n \"touchmove\": TouchEvent;\n \"touchstart\": TouchEvent;\n \"unload\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch {\n readonly applicationCache: ApplicationCache;\n readonly caches: CacheStorage;\n readonly clientInformation: Navigator;\n readonly closed: boolean;\n readonly crypto: Crypto;\n defaultStatus: string;\n readonly devicePixelRatio: number;\n readonly document: Document;\n readonly doNotTrack: string;\n event: Event | undefined;\n readonly external: External;\n readonly frameElement: Element;\n readonly frames: Window;\n readonly history: History;\n readonly innerHeight: number;\n readonly innerWidth: number;\n readonly isSecureContext: boolean;\n readonly length: number;\n readonly location: Location;\n readonly locationbar: BarProp;\n readonly menubar: BarProp;\n readonly msContentScript: ExtensionScriptApis;\n readonly msCredentials: MSCredentials;\n name: string;\n readonly navigator: Navigator;\n offscreenBuffering: string | boolean;\n onabort: (this: Window, ev: UIEvent) => any;\n onafterprint: (this: Window, ev: Event) => any;\n onbeforeprint: (this: Window, ev: Event) => any;\n onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any;\n onblur: (this: Window, ev: FocusEvent) => any;\n oncanplay: (this: Window, ev: Event) => any;\n oncanplaythrough: (this: Window, ev: Event) => any;\n onchange: (this: Window, ev: Event) => any;\n onclick: (this: Window, ev: MouseEvent) => any;\n oncompassneedscalibration: (this: Window, ev: Event) => any;\n oncontextmenu: (this: Window, ev: PointerEvent) => any;\n ondblclick: (this: Window, ev: MouseEvent) => any;\n ondevicelight: (this: Window, ev: DeviceLightEvent) => any;\n ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any;\n ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any;\n ondrag: (this: Window, ev: DragEvent) => any;\n ondragend: (this: Window, ev: DragEvent) => any;\n ondragenter: (this: Window, ev: DragEvent) => any;\n ondragleave: (this: Window, ev: DragEvent) => any;\n ondragover: (this: Window, ev: DragEvent) => any;\n ondragstart: (this: Window, ev: DragEvent) => any;\n ondrop: (this: Window, ev: DragEvent) => any;\n ondurationchange: (this: Window, ev: Event) => any;\n onemptied: (this: Window, ev: Event) => any;\n onended: (this: Window, ev: MediaStreamErrorEvent) => any;\n onerror: ErrorEventHandler;\n onfocus: (this: Window, ev: FocusEvent) => any;\n onhashchange: (this: Window, ev: HashChangeEvent) => any;\n oninput: (this: Window, ev: Event) => any;\n oninvalid: (this: Window, ev: Event) => any;\n onkeydown: (this: Window, ev: KeyboardEvent) => any;\n onkeypress: (this: Window, ev: KeyboardEvent) => any;\n onkeyup: (this: Window, ev: KeyboardEvent) => any;\n onload: (this: Window, ev: Event) => any;\n onloadeddata: (this: Window, ev: Event) => any;\n onloadedmetadata: (this: Window, ev: Event) => any;\n onloadstart: (this: Window, ev: Event) => any;\n onmessage: (this: Window, ev: MessageEvent) => any;\n onmousedown: (this: Window, ev: MouseEvent) => any;\n onmouseenter: (this: Window, ev: MouseEvent) => any;\n onmouseleave: (this: Window, ev: MouseEvent) => any;\n onmousemove: (this: Window, ev: MouseEvent) => any;\n onmouseout: (this: Window, ev: MouseEvent) => any;\n onmouseover: (this: Window, ev: MouseEvent) => any;\n onmouseup: (this: Window, ev: MouseEvent) => any;\n onmousewheel: (this: Window, ev: WheelEvent) => any;\n onmsgesturechange: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any;\n onmsgestureend: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturehold: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturestart: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturetap: (this: Window, ev: MSGestureEvent) => any;\n onmsinertiastart: (this: Window, ev: MSGestureEvent) => any;\n onmspointercancel: (this: Window, ev: MSPointerEvent) => any;\n onmspointerdown: (this: Window, ev: MSPointerEvent) => any;\n onmspointerenter: (this: Window, ev: MSPointerEvent) => any;\n onmspointerleave: (this: Window, ev: MSPointerEvent) => any;\n onmspointermove: (this: Window, ev: MSPointerEvent) => any;\n onmspointerout: (this: Window, ev: MSPointerEvent) => any;\n onmspointerover: (this: Window, ev: MSPointerEvent) => any;\n onmspointerup: (this: Window, ev: MSPointerEvent) => any;\n onoffline: (this: Window, ev: Event) => any;\n ononline: (this: Window, ev: Event) => any;\n onorientationchange: (this: Window, ev: Event) => any;\n onpagehide: (this: Window, ev: PageTransitionEvent) => any;\n onpageshow: (this: Window, ev: PageTransitionEvent) => any;\n onpause: (this: Window, ev: Event) => any;\n onplay: (this: Window, ev: Event) => any;\n onplaying: (this: Window, ev: Event) => any;\n onpopstate: (this: Window, ev: PopStateEvent) => any;\n onprogress: (this: Window, ev: ProgressEvent) => any;\n onratechange: (this: Window, ev: Event) => any;\n onreadystatechange: (this: Window, ev: ProgressEvent) => any;\n onreset: (this: Window, ev: Event) => any;\n onresize: (this: Window, ev: UIEvent) => any;\n onscroll: (this: Window, ev: UIEvent) => any;\n onseeked: (this: Window, ev: Event) => any;\n onseeking: (this: Window, ev: Event) => any;\n onselect: (this: Window, ev: UIEvent) => any;\n onstalled: (this: Window, ev: Event) => any;\n onstorage: (this: Window, ev: StorageEvent) => any;\n onsubmit: (this: Window, ev: Event) => any;\n onsuspend: (this: Window, ev: Event) => any;\n ontimeupdate: (this: Window, ev: Event) => any;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n onunload: (this: Window, ev: Event) => any;\n onvolumechange: (this: Window, ev: Event) => any;\n onwaiting: (this: Window, ev: Event) => any;\n opener: any;\n orientation: string | number;\n readonly outerHeight: number;\n readonly outerWidth: number;\n readonly pageXOffset: number;\n readonly pageYOffset: number;\n readonly parent: Window;\n readonly performance: Performance;\n readonly personalbar: BarProp;\n readonly screen: Screen;\n readonly screenLeft: number;\n readonly screenTop: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly scrollbars: BarProp;\n readonly scrollX: number;\n readonly scrollY: number;\n readonly self: Window;\n readonly speechSynthesis: SpeechSynthesis;\n status: string;\n readonly statusbar: BarProp;\n readonly styleMedia: StyleMedia;\n readonly toolbar: BarProp;\n readonly top: Window;\n readonly window: Window;\n URL: typeof URL;\n URLSearchParams: typeof URLSearchParams;\n Blob: typeof Blob;\n customElements: CustomElementRegistry;\n alert(message?: any): void;\n blur(): void;\n cancelAnimationFrame(handle: number): void;\n captureEvents(): void;\n close(): void;\n confirm(message?: string): boolean;\n departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\n focus(): void;\n getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;\n getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;\n getSelection(): Selection;\n matchMedia(mediaQuery: string): MediaQueryList;\n moveBy(x?: number, y?: number): void;\n moveTo(x?: number, y?: number): void;\n msWriteProfilerMark(profilerMarkName: string): void;\n open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\n postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\n print(): void;\n prompt(message?: string, _default?: string): string | null;\n releaseEvents(): void;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n resizeBy(x?: number, y?: number): void;\n resizeTo(x?: number, y?: number): void;\n scroll(x?: number, y?: number): void;\n scrollBy(x?: number, y?: number): void;\n scrollTo(x?: number, y?: number): void;\n stop(): void;\n webkitCancelAnimationFrame(handle: number): void;\n webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\n scroll(options?: ScrollToOptions): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollBy(options?: ScrollToOptions): void;\n addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Window: {\n prototype: Window;\n new(): Window;\n};\n\ninterface WorkerEventMap extends AbstractWorkerEventMap {\n \"message\": MessageEvent;\n}\n\ninterface Worker extends EventTarget, AbstractWorker {\n onmessage: (this: Worker, ev: MessageEvent) => any;\n postMessage(message: any, transfer?: any[]): void;\n terminate(): void;\n addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Worker: {\n prototype: Worker;\n new(stringUrl: string): Worker;\n};\n\ninterface XMLDocument extends Document {\n addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLDocument: {\n prototype: XMLDocument;\n new(): XMLDocument;\n};\n\ninterface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {\n \"readystatechange\": Event;\n}\n\ninterface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {\n onreadystatechange: (this: XMLHttpRequest, ev: Event) => any;\n readonly readyState: number;\n readonly response: any;\n readonly responseText: string;\n responseType: XMLHttpRequestResponseType;\n readonly responseURL: string;\n readonly responseXML: Document | null;\n readonly status: number;\n readonly statusText: string;\n timeout: number;\n readonly upload: XMLHttpRequestUpload;\n withCredentials: boolean;\n msCaching?: string;\n abort(): void;\n getAllResponseHeaders(): string;\n getResponseHeader(header: string): string | null;\n msCachingEnabled(): boolean;\n open(method: string, url: string, async?: boolean, user?: string, password?: string): void;\n overrideMimeType(mime: string): void;\n send(data?: Document): void;\n send(data?: string): void;\n send(data?: any): void;\n setRequestHeader(header: string, value: string): void;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequest: {\n prototype: XMLHttpRequest;\n new(): XMLHttpRequest;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n};\n\ninterface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {\n addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequestUpload: {\n prototype: XMLHttpRequestUpload;\n new(): XMLHttpRequestUpload;\n};\n\ninterface XMLSerializer {\n serializeToString(target: Node): string;\n}\n\ndeclare var XMLSerializer: {\n prototype: XMLSerializer;\n new(): XMLSerializer;\n};\n\ninterface XPathEvaluator {\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n createNSResolver(nodeResolver?: Node): XPathNSResolver;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathEvaluator: {\n prototype: XPathEvaluator;\n new(): XPathEvaluator;\n};\n\ninterface XPathExpression {\n evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathExpression: {\n prototype: XPathExpression;\n new(): XPathExpression;\n};\n\ninterface XPathNSResolver {\n lookupNamespaceURI(prefix: string): string;\n}\n\ndeclare var XPathNSResolver: {\n prototype: XPathNSResolver;\n new(): XPathNSResolver;\n};\n\ninterface XPathResult {\n readonly booleanValue: boolean;\n readonly invalidIteratorState: boolean;\n readonly numberValue: number;\n readonly resultType: number;\n readonly singleNodeValue: Node;\n readonly snapshotLength: number;\n readonly stringValue: string;\n iterateNext(): Node;\n snapshotItem(index: number): Node;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n}\n\ndeclare var XPathResult: {\n prototype: XPathResult;\n new(): XPathResult;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n};\n\ninterface XSLTProcessor {\n clearParameters(): void;\n getParameter(namespaceURI: string, localName: string): any;\n importStylesheet(style: Node): void;\n removeParameter(namespaceURI: string, localName: string): void;\n reset(): void;\n setParameter(namespaceURI: string, localName: string, value: any): void;\n transformToDocument(source: Node): Document;\n transformToFragment(source: Node, document: Document): DocumentFragment;\n}\n\ndeclare var XSLTProcessor: {\n prototype: XSLTProcessor;\n new(): XSLTProcessor;\n};\n\ninterface AbstractWorkerEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface AbstractWorker {\n onerror: (this: AbstractWorker, ev: ErrorEvent) => any;\n addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface Body {\n readonly bodyUsed: boolean;\n arrayBuffer(): Promise;\n blob(): Promise;\n json(): Promise;\n text(): Promise;\n formData(): Promise;\n}\n\ninterface CanvasPathMethods {\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;\n bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;\n closePath(): void;\n ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n lineTo(x: number, y: number): void;\n moveTo(x: number, y: number): void;\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\n rect(x: number, y: number, w: number, h: number): void;\n}\n\ninterface ChildNode {\n remove(): void;\n}\n\ninterface DocumentEvent {\n createEvent(eventInterface: \"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface: \"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface: \"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface: \"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface: \"CloseEvent\"): CloseEvent;\n createEvent(eventInterface: \"CompositionEvent\"): CompositionEvent;\n createEvent(eventInterface: \"CustomEvent\"): CustomEvent;\n createEvent(eventInterface: \"DeviceLightEvent\"): DeviceLightEvent;\n createEvent(eventInterface: \"DeviceMotionEvent\"): DeviceMotionEvent;\n createEvent(eventInterface: \"DeviceOrientationEvent\"): DeviceOrientationEvent;\n createEvent(eventInterface: \"DragEvent\"): DragEvent;\n createEvent(eventInterface: \"ErrorEvent\"): ErrorEvent;\n createEvent(eventInterface: \"Event\"): Event;\n createEvent(eventInterface: \"Events\"): Event;\n createEvent(eventInterface: \"FocusEvent\"): FocusEvent;\n createEvent(eventInterface: \"FocusNavigationEvent\"): FocusNavigationEvent;\n createEvent(eventInterface: \"GamepadEvent\"): GamepadEvent;\n createEvent(eventInterface: \"HashChangeEvent\"): HashChangeEvent;\n createEvent(eventInterface: \"IDBVersionChangeEvent\"): IDBVersionChangeEvent;\n createEvent(eventInterface: \"KeyboardEvent\"): KeyboardEvent;\n createEvent(eventInterface: \"ListeningStateChangedEvent\"): ListeningStateChangedEvent;\n createEvent(eventInterface: \"LongRunningScriptDetectedEvent\"): LongRunningScriptDetectedEvent;\n createEvent(eventInterface: \"MSGestureEvent\"): MSGestureEvent;\n createEvent(eventInterface: \"MSManipulationEvent\"): MSManipulationEvent;\n createEvent(eventInterface: \"MSMediaKeyMessageEvent\"): MSMediaKeyMessageEvent;\n createEvent(eventInterface: \"MSMediaKeyNeededEvent\"): MSMediaKeyNeededEvent;\n createEvent(eventInterface: \"MSPointerEvent\"): MSPointerEvent;\n createEvent(eventInterface: \"MSSiteModeEvent\"): MSSiteModeEvent;\n createEvent(eventInterface: \"MediaEncryptedEvent\"): MediaEncryptedEvent;\n createEvent(eventInterface: \"MediaKeyMessageEvent\"): MediaKeyMessageEvent;\n createEvent(eventInterface: \"MediaStreamErrorEvent\"): MediaStreamErrorEvent;\n createEvent(eventInterface: \"MediaStreamEvent\"): MediaStreamEvent;\n createEvent(eventInterface: \"MediaStreamTrackEvent\"): MediaStreamTrackEvent;\n createEvent(eventInterface: \"MessageEvent\"): MessageEvent;\n createEvent(eventInterface: \"MouseEvent\"): MouseEvent;\n createEvent(eventInterface: \"MouseEvents\"): MouseEvent;\n createEvent(eventInterface: \"MutationEvent\"): MutationEvent;\n createEvent(eventInterface: \"MutationEvents\"): MutationEvent;\n createEvent(eventInterface: \"NavigationCompletedEvent\"): NavigationCompletedEvent;\n createEvent(eventInterface: \"NavigationEvent\"): NavigationEvent;\n createEvent(eventInterface: \"NavigationEventWithReferrer\"): NavigationEventWithReferrer;\n createEvent(eventInterface: \"OfflineAudioCompletionEvent\"): OfflineAudioCompletionEvent;\n createEvent(eventInterface: \"OverflowEvent\"): OverflowEvent;\n createEvent(eventInterface: \"PageTransitionEvent\"): PageTransitionEvent;\n createEvent(eventInterface: \"PaymentRequestUpdateEvent\"): PaymentRequestUpdateEvent;\n createEvent(eventInterface: \"PermissionRequestedEvent\"): PermissionRequestedEvent;\n createEvent(eventInterface: \"PointerEvent\"): PointerEvent;\n createEvent(eventInterface: \"PopStateEvent\"): PopStateEvent;\n createEvent(eventInterface: \"ProgressEvent\"): ProgressEvent;\n createEvent(eventInterface: \"RTCDTMFToneChangeEvent\"): RTCDTMFToneChangeEvent;\n createEvent(eventInterface: \"RTCDtlsTransportStateChangedEvent\"): RTCDtlsTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCIceCandidatePairChangedEvent\"): RTCIceCandidatePairChangedEvent;\n createEvent(eventInterface: \"RTCIceGathererEvent\"): RTCIceGathererEvent;\n createEvent(eventInterface: \"RTCIceTransportStateChangedEvent\"): RTCIceTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceEvent\"): RTCPeerConnectionIceEvent;\n createEvent(eventInterface: \"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface: \"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface: \"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface: \"ScriptNotifyEvent\"): ScriptNotifyEvent;\n createEvent(eventInterface: \"ServiceWorkerMessageEvent\"): ServiceWorkerMessageEvent;\n createEvent(eventInterface: \"SpeechSynthesisEvent\"): SpeechSynthesisEvent;\n createEvent(eventInterface: \"StorageEvent\"): StorageEvent;\n createEvent(eventInterface: \"TextEvent\"): TextEvent;\n createEvent(eventInterface: \"TouchEvent\"): TouchEvent;\n createEvent(eventInterface: \"TrackEvent\"): TrackEvent;\n createEvent(eventInterface: \"TransitionEvent\"): TransitionEvent;\n createEvent(eventInterface: \"UIEvent\"): UIEvent;\n createEvent(eventInterface: \"UIEvents\"): UIEvent;\n createEvent(eventInterface: \"UnviewableContentIdentifiedEvent\"): UnviewableContentIdentifiedEvent;\n createEvent(eventInterface: \"WebGLContextEvent\"): WebGLContextEvent;\n createEvent(eventInterface: \"WheelEvent\"): WheelEvent;\n createEvent(eventInterface: string): Event;\n}\n\ninterface DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\n}\n\ninterface ElementTraversal {\n readonly childElementCount: number;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n readonly nextElementSibling: Element | null;\n readonly previousElementSibling: Element | null;\n}\n\ninterface GetSVGDocument {\n getSVGDocument(): Document;\n}\n\ninterface GlobalEventHandlersEventMap {\n \"pointercancel\": PointerEvent;\n \"pointerdown\": PointerEvent;\n \"pointerenter\": PointerEvent;\n \"pointerleave\": PointerEvent;\n \"pointermove\": PointerEvent;\n \"pointerout\": PointerEvent;\n \"pointerover\": PointerEvent;\n \"pointerup\": PointerEvent;\n \"wheel\": WheelEvent;\n}\n\ninterface GlobalEventHandlers {\n onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any;\n addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface GlobalFetch {\n fetch(input: RequestInfo, init?: RequestInit): Promise;\n}\n\ninterface HTMLTableAlignment {\n /**\n * Sets or retrieves a value that you can use to implement your own ch functionality for the object.\n */\n ch: string;\n /**\n * Sets or retrieves a value that you can use to implement your own chOff functionality for the object.\n */\n chOff: string;\n /**\n * Sets or retrieves how text and other content are vertically aligned within the object that contains them.\n */\n vAlign: string;\n}\n\ninterface IDBEnvironment {\n readonly indexedDB: IDBFactory;\n}\n\ninterface LinkStyle {\n readonly sheet: StyleSheet;\n}\n\ninterface MSBaseReaderEventMap {\n \"abort\": Event;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n}\n\ninterface MSBaseReader {\n onabort: (this: MSBaseReader, ev: Event) => any;\n onerror: (this: MSBaseReader, ev: ErrorEvent) => any;\n onload: (this: MSBaseReader, ev: Event) => any;\n onloadend: (this: MSBaseReader, ev: ProgressEvent) => any;\n onloadstart: (this: MSBaseReader, ev: Event) => any;\n onprogress: (this: MSBaseReader, ev: ProgressEvent) => any;\n readonly readyState: number;\n readonly result: any;\n abort(): void;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface MSFileSaver {\n msSaveBlob(blob: any, defaultName?: string): boolean;\n msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;\n}\n\ninterface MSNavigatorDoNotTrack {\n confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;\n confirmWebWideTrackingException(args: ExceptionInformation): boolean;\n removeSiteSpecificTrackingException(args: ExceptionInformation): void;\n removeWebWideTrackingException(args: ExceptionInformation): void;\n storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;\n storeWebWideTrackingException(args: StoreExceptionsInformation): void;\n}\n\ninterface NavigatorBeacon {\n sendBeacon(url: USVString, data?: BodyInit): boolean;\n}\n\ninterface NavigatorConcurrentHardware {\n readonly hardwareConcurrency: number;\n}\n\ninterface NavigatorContentUtils {\n}\n\ninterface NavigatorGeolocation {\n readonly geolocation: Geolocation;\n}\n\ninterface NavigatorID {\n readonly appCodeName: string;\n readonly appName: string;\n readonly appVersion: string;\n readonly platform: string;\n readonly product: string;\n readonly productSub: string;\n readonly userAgent: string;\n readonly vendor: string;\n readonly vendorSub: string;\n}\n\ninterface NavigatorOnLine {\n readonly onLine: boolean;\n}\n\ninterface NavigatorStorageUtils {\n}\n\ninterface NavigatorUserMedia {\n readonly mediaDevices: MediaDevices;\n getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;\n}\n\ninterface NodeSelector {\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface RandomSource {\n getRandomValues(array: T): T;\n}\n\ninterface SVGAnimatedPoints {\n readonly animatedPoints: SVGPointList;\n readonly points: SVGPointList;\n}\n\ninterface SVGFilterPrimitiveStandardAttributes {\n readonly height: SVGAnimatedLength;\n readonly result: SVGAnimatedString;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n}\n\ninterface SVGFitToViewBox {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly viewBox: SVGAnimatedRect;\n}\n\ninterface SVGTests {\n readonly requiredExtensions: SVGStringList;\n readonly requiredFeatures: SVGStringList;\n readonly systemLanguage: SVGStringList;\n hasExtension(extension: string): boolean;\n}\n\ninterface SVGURIReference {\n readonly href: SVGAnimatedString;\n}\n\ninterface WindowBase64 {\n atob(encodedString: string): string;\n btoa(rawString: string): string;\n}\n\ninterface WindowConsole {\n readonly console: Console;\n}\n\ninterface WindowLocalStorage {\n readonly localStorage: Storage;\n}\n\ninterface WindowSessionStorage {\n readonly sessionStorage: Storage;\n}\n\ninterface WindowTimers extends Object, WindowTimersExtension {\n clearInterval(handle: number): void;\n clearTimeout(handle: number): void;\n setInterval(handler: (...args: any[]) => void, timeout: number): number;\n setInterval(handler: any, timeout?: any, ...args: any[]): number;\n setTimeout(handler: (...args: any[]) => void, timeout: number): number;\n setTimeout(handler: any, timeout?: any, ...args: any[]): number;\n}\n\ninterface WindowTimersExtension {\n clearImmediate(handle: number): void;\n setImmediate(handler: (...args: any[]) => void): number;\n setImmediate(handler: any, ...args: any[]): number;\n}\n\ninterface XMLHttpRequestEventTargetEventMap {\n \"abort\": Event;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n \"timeout\": ProgressEvent;\n}\n\ninterface XMLHttpRequestEventTarget {\n onabort: (this: XMLHttpRequest, ev: Event) => any;\n onerror: (this: XMLHttpRequest, ev: ErrorEvent) => any;\n onload: (this: XMLHttpRequest, ev: Event) => any;\n onloadend: (this: XMLHttpRequest, ev: ProgressEvent) => any;\n onloadstart: (this: XMLHttpRequest, ev: Event) => any;\n onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any;\n ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface BroadcastChannel extends EventTarget {\n readonly name: string;\n onmessage: (ev: MessageEvent) => any;\n onmessageerror: (ev: MessageEvent) => any;\n close(): void;\n postMessage(message: any): void;\n addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var BroadcastChannel: {\n prototype: BroadcastChannel;\n new(name: string): BroadcastChannel;\n};\n\ninterface BroadcastChannelEventMap {\n message: MessageEvent;\n messageerror: MessageEvent;\n}\n\ninterface ErrorEventInit {\n message?: string;\n filename?: string;\n lineno?: number;\n conlno?: number;\n error?: any;\n}\n\ninterface StorageEventInit extends EventInit {\n key?: string;\n oldValue?: string;\n newValue?: string;\n url: string;\n storageArea?: Storage;\n}\n\ninterface Canvas2DContextAttributes {\n alpha?: boolean;\n willReadFrequently?: boolean;\n storage?: boolean;\n [attribute: string]: boolean | string | undefined;\n}\n\ninterface ImageBitmapOptions {\n imageOrientation?: \"none\" | \"flipY\";\n premultiplyAlpha?: \"none\" | \"premultiply\" | \"default\";\n colorSpaceConversion?: \"none\" | \"default\";\n resizeWidth?: number;\n resizeHeight?: number;\n resizeQuality?: \"pixelated\" | \"low\" | \"medium\" | \"high\";\n}\n\ninterface ImageBitmap {\n readonly width: number;\n readonly height: number;\n close(): void;\n}\n\ninterface URLSearchParams {\n /**\n * Appends a specified key/value pair as a new search parameter.\n */\n append(name: string, value: string): void;\n /**\n * Deletes the given search parameter, and its associated value, from the list of all search parameters.\n */\n delete(name: string): void;\n /**\n * Returns the first value associated to the given search parameter.\n */\n get(name: string): string | null;\n /**\n * Returns all the values association with a given search parameter.\n */\n getAll(name: string): string[];\n /**\n * Returns a Boolean indicating if such a search parameter exists.\n */\n has(name: string): boolean;\n /**\n * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\n */\n set(name: string, value: string): void;\n}\n\ndeclare var URLSearchParams: {\n prototype: URLSearchParams;\n /**\n * Constructor returning a URLSearchParams object.\n */\n new (init?: string | URLSearchParams): URLSearchParams;\n};\n\ninterface NodeListOf extends NodeList {\n length: number;\n item(index: number): TNode;\n [index: number]: TNode;\n}\n\ninterface HTMLCollectionOf extends HTMLCollection {\n item(index: number): T;\n namedItem(name: string): T;\n [index: number]: T;\n}\n\ninterface BlobPropertyBag {\n type?: string;\n endings?: string;\n}\n\ninterface FilePropertyBag extends BlobPropertyBag {\n lastModified?: number;\n}\n\ninterface EventListenerObject {\n handleEvent(evt: Event): void;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface ScrollOptions {\n behavior?: ScrollBehavior;\n}\n\ninterface ScrollToOptions extends ScrollOptions {\n left?: number;\n top?: number;\n}\n\ninterface ScrollIntoViewOptions extends ScrollOptions {\n block?: ScrollLogicalPosition;\n inline?: ScrollLogicalPosition;\n}\n\ninterface ClipboardEventInit extends EventInit {\n data?: string;\n dataType?: string;\n}\n\ninterface IDBArrayKey extends Array {\n}\n\ninterface RsaKeyGenParams extends Algorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaHashedKeyGenParams extends RsaKeyGenParams {\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaKeyAlgorithm extends KeyAlgorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaHashedImportParams {\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaPssParams {\n saltLength: number;\n}\n\ninterface RsaOaepParams extends Algorithm {\n label?: BufferSource;\n}\n\ninterface EcdsaParams extends Algorithm {\n hash: AlgorithmIdentifier;\n}\n\ninterface EcKeyGenParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcKeyAlgorithm extends KeyAlgorithm {\n typedCurve: string;\n}\n\ninterface EcKeyImportParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcdhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface AesCtrParams extends Algorithm {\n counter: BufferSource;\n length: number;\n}\n\ninterface AesKeyAlgorithm extends KeyAlgorithm {\n length: number;\n}\n\ninterface AesKeyGenParams extends Algorithm {\n length: number;\n}\n\ninterface AesDerivedKeyParams extends Algorithm {\n length: number;\n}\n\ninterface AesCbcParams extends Algorithm {\n iv: BufferSource;\n}\n\ninterface AesCmacParams extends Algorithm {\n length: number;\n}\n\ninterface AesGcmParams extends Algorithm {\n iv: BufferSource;\n additionalData?: BufferSource;\n tagLength?: number;\n}\n\ninterface AesCfbParams extends Algorithm {\n iv: BufferSource;\n}\n\ninterface HmacImportParams extends Algorithm {\n hash?: AlgorithmIdentifier;\n length?: number;\n}\n\ninterface HmacKeyAlgorithm extends KeyAlgorithm {\n hash: AlgorithmIdentifier;\n length: number;\n}\n\ninterface HmacKeyGenParams extends Algorithm {\n hash: AlgorithmIdentifier;\n length?: number;\n}\n\ninterface DhKeyGenParams extends Algorithm {\n prime: Uint8Array;\n generator: Uint8Array;\n}\n\ninterface DhKeyAlgorithm extends KeyAlgorithm {\n prime: Uint8Array;\n generator: Uint8Array;\n}\n\ninterface DhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface DhImportKeyParams extends Algorithm {\n prime: Uint8Array;\n generator: Uint8Array;\n}\n\ninterface ConcatParams extends Algorithm {\n hash?: AlgorithmIdentifier;\n algorithmId: Uint8Array;\n partyUInfo: Uint8Array;\n partyVInfo: Uint8Array;\n publicInfo?: Uint8Array;\n privateInfo?: Uint8Array;\n}\n\ninterface HkdfCtrParams extends Algorithm {\n hash: AlgorithmIdentifier;\n label: BufferSource;\n context: BufferSource;\n}\n\ninterface Pbkdf2Params extends Algorithm {\n salt: BufferSource;\n iterations: number;\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaOtherPrimesInfo {\n r: string;\n d: string;\n t: string;\n}\n\ninterface JsonWebKey {\n kty: string;\n use?: string;\n key_ops?: string[];\n alg?: string;\n kid?: string;\n x5u?: string;\n x5c?: string;\n x5t?: string;\n ext?: boolean;\n crv?: string;\n x?: string;\n y?: string;\n d?: string;\n n?: string;\n e?: string;\n p?: string;\n q?: string;\n dp?: string;\n dq?: string;\n qi?: string;\n oth?: RsaOtherPrimesInfo[];\n k?: string;\n}\n\ninterface ParentNode {\n readonly children: HTMLCollection;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n readonly childElementCount: number;\n}\n\ninterface DocumentOrShadowRoot {\n readonly activeElement: Element | null;\n readonly stylesheets: StyleSheetList;\n getSelection(): Selection | null;\n elementFromPoint(x: number, y: number): Element | null;\n elementsFromPoint(x: number, y: number): Element[];\n}\n\ninterface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment {\n readonly host: Element;\n innerHTML: string;\n}\n\ninterface ShadowRootInit {\n mode: \"open\" | \"closed\";\n delegatesFocus?: boolean;\n}\n\ninterface HTMLSlotElement extends HTMLElement {\n name: string;\n assignedNodes(options?: AssignedNodesOptions): Node[];\n}\n\ninterface AssignedNodesOptions {\n flatten?: boolean;\n}\n\ninterface ElementDefinitionOptions {\n extends: string;\n}\n\ninterface CustomElementRegistry {\n define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;\n get(name: string): any;\n whenDefined(name: string): PromiseLike;\n}\n\ninterface PromiseRejectionEvent extends Event {\n readonly promise: PromiseLike;\n readonly reason: any;\n}\n\ninterface PromiseRejectionEventInit extends EventInit {\n promise: PromiseLike;\n reason?: any;\n}\n\ninterface EventListenerOptions {\n capture?: boolean;\n}\n\ninterface AddEventListenerOptions extends EventListenerOptions {\n passive?: boolean;\n once?: boolean;\n}\n\ninterface TouchEventInit extends EventModifierInit {\n touches?: Touch[];\n targetTouches?: Touch[];\n changedTouches?: Touch[];\n}\n\ninterface HTMLDialogElement extends HTMLElement {\n open: boolean;\n returnValue: string;\n close(returnValue?: string): void;\n show(): void;\n showModal(): void;\n}\n\ndeclare var HTMLDialogElement: {\n prototype: HTMLDialogElement;\n new(): HTMLDialogElement;\n};\n\ninterface HTMLMainElement extends HTMLElement {\n}\n\ndeclare var HTMLMainElement: {\n prototype: HTMLMainElement;\n new(): HTMLMainElement;\n};\n\ninterface HTMLDetailsElement extends HTMLElement {\n open: boolean;\n}\n\ndeclare var HTMLDetailsElement: {\n prototype: HTMLDetailsElement;\n new(): HTMLDetailsElement;\n};\n\ninterface HTMLSummaryElement extends HTMLElement {\n}\n\ndeclare var HTMLSummaryElement: {\n prototype: HTMLSummaryElement;\n new(): HTMLSummaryElement;\n};\n\ninterface DOMRectReadOnly {\n readonly bottom: number;\n readonly height: number;\n readonly left: number;\n readonly right: number;\n readonly top: number;\n readonly width: number;\n readonly x: number;\n readonly y: number;\n}\n\ndeclare var DOMRectReadOnly: {\n prototype: DOMRectReadOnly;\n new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;\n fromRect(rectangle?: DOMRectInit): DOMRectReadOnly;\n};\n\ninterface EXT_blend_minmax {\n readonly MIN_EXT: number;\n readonly MAX_EXT: number;\n}\n\ninterface EXT_frag_depth {\n}\n\ninterface EXT_shader_texture_lod {\n}\n\ninterface EXT_sRGB {\n readonly SRGB_EXT: number;\n readonly SRGB_ALPHA_EXT: number;\n readonly SRGB8_ALPHA8_EXT: number;\n readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number;\n}\n\ninterface DOMRect extends DOMRectReadOnly {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var DOMRect: {\n prototype: DOMRect;\n new (x?: number, y?: number, width?: number, height?: number): DOMRect;\n fromRect(rectangle?: DOMRectInit): DOMRect;\n};\n\ninterface DOMRectList {\n readonly length: number;\n item(index: number): DOMRect | null;\n [index: number]: DOMRect;\n}\n\ninterface OES_vertex_array_object {\n readonly VERTEX_ARRAY_BINDING_OES: number;\n createVertexArrayOES(): WebGLVertexArrayObjectOES;\n deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n isVertexArrayOES(value: any): value is WebGLVertexArrayObjectOES;\n bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n}\n\ninterface WebGLVertexArrayObjectOES {\n}\n\ninterface WEBGL_color_buffer_float {\n readonly RGBA32F_EXT: number;\n readonly RGB32F_EXT: number;\n readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number;\n readonly UNSIGNED_NORMALIZED_EXT: number;\n}\n\ninterface WEBGL_compressed_texture_astc {\n readonly COMPRESSED_RGBA_ASTC_4x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x8_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x8_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x12_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: number;\n getSupportedProfiles(): string[];\n}\n\ninterface WEBGL_compressed_texture_s3tc_srgb {\n readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;\n}\n\ninterface WEBGL_debug_shaders {\n getTranslatedShaderSource(shader: WebGLShader): string;\n}\n\ninterface WEBGL_draw_buffers {\n readonly COLOR_ATTACHMENT0_WEBGL: number;\n readonly COLOR_ATTACHMENT1_WEBGL: number;\n readonly COLOR_ATTACHMENT2_WEBGL: number;\n readonly COLOR_ATTACHMENT3_WEBGL: number;\n readonly COLOR_ATTACHMENT4_WEBGL: number;\n readonly COLOR_ATTACHMENT5_WEBGL: number;\n readonly COLOR_ATTACHMENT6_WEBGL: number;\n readonly COLOR_ATTACHMENT7_WEBGL: number;\n readonly COLOR_ATTACHMENT8_WEBGL: number;\n readonly COLOR_ATTACHMENT9_WEBGL: number;\n readonly COLOR_ATTACHMENT10_WEBGL: number;\n readonly COLOR_ATTACHMENT11_WEBGL: number;\n readonly COLOR_ATTACHMENT12_WEBGL: number;\n readonly COLOR_ATTACHMENT13_WEBGL: number;\n readonly COLOR_ATTACHMENT14_WEBGL: number;\n readonly COLOR_ATTACHMENT15_WEBGL: number;\n readonly DRAW_BUFFER0_WEBGL: number;\n readonly DRAW_BUFFER1_WEBGL: number;\n readonly DRAW_BUFFER2_WEBGL: number;\n readonly DRAW_BUFFER3_WEBGL: number;\n readonly DRAW_BUFFER4_WEBGL: number;\n readonly DRAW_BUFFER5_WEBGL: number;\n readonly DRAW_BUFFER6_WEBGL: number;\n readonly DRAW_BUFFER7_WEBGL: number;\n readonly DRAW_BUFFER8_WEBGL: number;\n readonly DRAW_BUFFER9_WEBGL: number;\n readonly DRAW_BUFFER10_WEBGL: number;\n readonly DRAW_BUFFER11_WEBGL: number;\n readonly DRAW_BUFFER12_WEBGL: number;\n readonly DRAW_BUFFER13_WEBGL: number;\n readonly DRAW_BUFFER14_WEBGL: number;\n readonly DRAW_BUFFER15_WEBGL: number;\n readonly MAX_COLOR_ATTACHMENTS_WEBGL: number;\n readonly MAX_DRAW_BUFFERS_WEBGL: number;\n drawBuffersWEBGL(buffers: number[]): void;\n}\n\ninterface WEBGL_lose_context {\n loseContext(): void;\n restoreContext(): void;\n}\n\ninterface AbortController {\n readonly signal: AbortSignal;\n abort(): void;\n}\n\ndeclare var AbortController: {\n prototype: AbortController;\n new(): AbortController;\n};\n\ninterface AbortSignal extends EventTarget {\n readonly aborted: boolean;\n onabort: (ev: Event) => any;\n}\n\ninterface EventSource extends EventTarget {\n readonly url: string;\n readonly withCredentials: boolean;\n readonly CONNECTING: number;\n readonly OPEN: number;\n readonly CLOSED: number;\n readonly readyState: number;\n onopen: (evt: MessageEvent) => any;\n onmessage: (evt: MessageEvent) => any;\n onerror: (evt: MessageEvent) => any;\n close(): void;\n}\n\ndeclare var EventSource: {\n prototype: EventSource;\n new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;\n};\n\ninterface EventSourceInit {\n readonly withCredentials: boolean;\n}\n\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\ninterface ErrorEventHandler {\n (message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;\n}\ninterface ForEachCallback {\n (keyId: any, status: MediaKeyStatus): void;\n}\ninterface FrameRequestCallback {\n (time: number): void;\n}\ninterface FunctionStringCallback {\n (data: string): void;\n}\ninterface IntersectionObserverCallback {\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\n}\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\ninterface MSExecAtPriorityFunctionCallback {\n (...args: any[]): any;\n}\ninterface MSLaunchUriCallback {\n (): void;\n}\ninterface MSUnsafeFunctionCallback {\n (): any;\n}\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\ninterface NotificationPermissionCallback {\n (permission: NotificationPermission): void;\n}\ninterface PositionCallback {\n (position: Position): void;\n}\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\ninterface RTCPeerConnectionErrorCallback {\n (error: DOMError): void;\n}\ninterface RTCSessionDescriptionCallback {\n (sdp: RTCSessionDescription): void;\n}\ninterface RTCStatsCallback {\n (report: RTCStatsReport): void;\n}\ninterface VoidFunction {\n (): void;\n}\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"abbr\": HTMLElement;\n \"acronym\": HTMLElement;\n \"address\": HTMLElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"article\": HTMLElement;\n \"aside\": HTMLElement;\n \"audio\": HTMLAudioElement;\n \"b\": HTMLElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"bdo\": HTMLElement;\n \"big\": HTMLElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"center\": HTMLElement;\n \"cite\": HTMLElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"del\": HTMLModElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"h1\": HTMLHeadingElement;\n \"h2\": HTMLHeadingElement;\n \"h3\": HTMLHeadingElement;\n \"h4\": HTMLHeadingElement;\n \"h5\": HTMLHeadingElement;\n \"h6\": HTMLHeadingElement;\n \"head\": HTMLHeadElement;\n \"header\": HTMLElement;\n \"hgroup\": HTMLElement;\n \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"i\": HTMLElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"kbd\": HTMLElement;\n \"keygen\": HTMLElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nav\": HTMLElement;\n \"nextid\": HTMLUnknownElement;\n \"nobr\": HTMLElement;\n \"noframes\": HTMLElement;\n \"noscript\": HTMLElement;\n \"object\": HTMLObjectElement;\n \"ol\": HTMLOListElement;\n \"optgroup\": HTMLOptGroupElement;\n \"option\": HTMLOptionElement;\n \"output\": HTMLOutputElement;\n \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"rt\": HTMLElement;\n \"ruby\": HTMLElement;\n \"s\": HTMLElement;\n \"samp\": HTMLElement;\n \"script\": HTMLScriptElement;\n \"section\": HTMLElement;\n \"select\": HTMLSelectElement;\n \"small\": HTMLElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"textarea\": HTMLTextAreaElement;\n \"tfoot\": HTMLTableSectionElement;\n \"th\": HTMLTableHeaderCellElement;\n \"thead\": HTMLTableSectionElement;\n \"time\": HTMLTimeElement;\n \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"wbr\": HTMLElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface SVGElementTagNameMap {\n \"circle\": SVGCircleElement;\n \"clippath\": SVGClipPathElement;\n \"defs\": SVGDefsElement;\n \"desc\": SVGDescElement;\n \"ellipse\": SVGEllipseElement;\n \"feblend\": SVGFEBlendElement;\n \"fecolormatrix\": SVGFEColorMatrixElement;\n \"fecomponenttransfer\": SVGFEComponentTransferElement;\n \"fecomposite\": SVGFECompositeElement;\n \"feconvolvematrix\": SVGFEConvolveMatrixElement;\n \"fediffuselighting\": SVGFEDiffuseLightingElement;\n \"fedisplacementmap\": SVGFEDisplacementMapElement;\n \"fedistantlight\": SVGFEDistantLightElement;\n \"feflood\": SVGFEFloodElement;\n \"fefunca\": SVGFEFuncAElement;\n \"fefuncb\": SVGFEFuncBElement;\n \"fefuncg\": SVGFEFuncGElement;\n \"fefuncr\": SVGFEFuncRElement;\n \"fegaussianblur\": SVGFEGaussianBlurElement;\n \"feimage\": SVGFEImageElement;\n \"femerge\": SVGFEMergeElement;\n \"femergenode\": SVGFEMergeNodeElement;\n \"femorphology\": SVGFEMorphologyElement;\n \"feoffset\": SVGFEOffsetElement;\n \"fepointlight\": SVGFEPointLightElement;\n \"fespecularlighting\": SVGFESpecularLightingElement;\n \"fespotlight\": SVGFESpotLightElement;\n \"fetile\": SVGFETileElement;\n \"feturbulence\": SVGFETurbulenceElement;\n \"filter\": SVGFilterElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"g\": SVGGElement;\n \"image\": SVGImageElement;\n \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"marker\": SVGMarkerElement;\n \"mask\": SVGMaskElement;\n \"metadata\": SVGMetadataElement;\n \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\n \"stop\": SVGStopElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\n \"tspan\": SVGTSpanElement;\n \"use\": SVGUseElement;\n \"view\": SVGViewElement;\n}\n\n/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */\ninterface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { }\n\ndeclare var Audio: { new(src?: string): HTMLAudioElement; };\ndeclare var Image: { new(width?: number, height?: number): HTMLImageElement; };\ndeclare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; };\ndeclare var applicationCache: ApplicationCache;\ndeclare var caches: CacheStorage;\ndeclare var clientInformation: Navigator;\ndeclare var closed: boolean;\ndeclare var crypto: Crypto;\ndeclare var defaultStatus: string;\ndeclare var devicePixelRatio: number;\ndeclare var document: Document;\ndeclare var doNotTrack: string;\ndeclare var event: Event | undefined;\ndeclare var external: External;\ndeclare var frameElement: Element;\ndeclare var frames: Window;\ndeclare var history: History;\ndeclare var innerHeight: number;\ndeclare var innerWidth: number;\ndeclare var isSecureContext: boolean;\ndeclare var length: number;\ndeclare var location: Location;\ndeclare var locationbar: BarProp;\ndeclare var menubar: BarProp;\ndeclare var msContentScript: ExtensionScriptApis;\ndeclare var msCredentials: MSCredentials;\ndeclare const name: never;\ndeclare var navigator: Navigator;\ndeclare var offscreenBuffering: string | boolean;\ndeclare var onabort: (this: Window, ev: UIEvent) => any;\ndeclare var onafterprint: (this: Window, ev: Event) => any;\ndeclare var onbeforeprint: (this: Window, ev: Event) => any;\ndeclare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any;\ndeclare var onblur: (this: Window, ev: FocusEvent) => any;\ndeclare var oncanplay: (this: Window, ev: Event) => any;\ndeclare var oncanplaythrough: (this: Window, ev: Event) => any;\ndeclare var onchange: (this: Window, ev: Event) => any;\ndeclare var onclick: (this: Window, ev: MouseEvent) => any;\ndeclare var oncompassneedscalibration: (this: Window, ev: Event) => any;\ndeclare var oncontextmenu: (this: Window, ev: PointerEvent) => any;\ndeclare var ondblclick: (this: Window, ev: MouseEvent) => any;\ndeclare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any;\ndeclare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any;\ndeclare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any;\ndeclare var ondrag: (this: Window, ev: DragEvent) => any;\ndeclare var ondragend: (this: Window, ev: DragEvent) => any;\ndeclare var ondragenter: (this: Window, ev: DragEvent) => any;\ndeclare var ondragleave: (this: Window, ev: DragEvent) => any;\ndeclare var ondragover: (this: Window, ev: DragEvent) => any;\ndeclare var ondragstart: (this: Window, ev: DragEvent) => any;\ndeclare var ondrop: (this: Window, ev: DragEvent) => any;\ndeclare var ondurationchange: (this: Window, ev: Event) => any;\ndeclare var onemptied: (this: Window, ev: Event) => any;\ndeclare var onended: (this: Window, ev: MediaStreamErrorEvent) => any;\ndeclare var onerror: ErrorEventHandler;\ndeclare var onfocus: (this: Window, ev: FocusEvent) => any;\ndeclare var onhashchange: (this: Window, ev: HashChangeEvent) => any;\ndeclare var oninput: (this: Window, ev: Event) => any;\ndeclare var oninvalid: (this: Window, ev: Event) => any;\ndeclare var onkeydown: (this: Window, ev: KeyboardEvent) => any;\ndeclare var onkeypress: (this: Window, ev: KeyboardEvent) => any;\ndeclare var onkeyup: (this: Window, ev: KeyboardEvent) => any;\ndeclare var onload: (this: Window, ev: Event) => any;\ndeclare var onloadeddata: (this: Window, ev: Event) => any;\ndeclare var onloadedmetadata: (this: Window, ev: Event) => any;\ndeclare var onloadstart: (this: Window, ev: Event) => any;\ndeclare var onmessage: (this: Window, ev: MessageEvent) => any;\ndeclare var onmousedown: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseenter: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseleave: (this: Window, ev: MouseEvent) => any;\ndeclare var onmousemove: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseout: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseover: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseup: (this: Window, ev: MouseEvent) => any;\ndeclare var onmousewheel: (this: Window, ev: WheelEvent) => any;\ndeclare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointermove: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerout: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerover: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerup: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onoffline: (this: Window, ev: Event) => any;\ndeclare var ononline: (this: Window, ev: Event) => any;\ndeclare var onorientationchange: (this: Window, ev: Event) => any;\ndeclare var onpagehide: (this: Window, ev: PageTransitionEvent) => any;\ndeclare var onpageshow: (this: Window, ev: PageTransitionEvent) => any;\ndeclare var onpause: (this: Window, ev: Event) => any;\ndeclare var onplay: (this: Window, ev: Event) => any;\ndeclare var onplaying: (this: Window, ev: Event) => any;\ndeclare var onpopstate: (this: Window, ev: PopStateEvent) => any;\ndeclare var onprogress: (this: Window, ev: ProgressEvent) => any;\ndeclare var onratechange: (this: Window, ev: Event) => any;\ndeclare var onreadystatechange: (this: Window, ev: ProgressEvent) => any;\ndeclare var onreset: (this: Window, ev: Event) => any;\ndeclare var onresize: (this: Window, ev: UIEvent) => any;\ndeclare var onscroll: (this: Window, ev: UIEvent) => any;\ndeclare var onseeked: (this: Window, ev: Event) => any;\ndeclare var onseeking: (this: Window, ev: Event) => any;\ndeclare var onselect: (this: Window, ev: UIEvent) => any;\ndeclare var onstalled: (this: Window, ev: Event) => any;\ndeclare var onstorage: (this: Window, ev: StorageEvent) => any;\ndeclare var onsubmit: (this: Window, ev: Event) => any;\ndeclare var onsuspend: (this: Window, ev: Event) => any;\ndeclare var ontimeupdate: (this: Window, ev: Event) => any;\ndeclare var ontouchcancel: (ev: TouchEvent) => any;\ndeclare var ontouchend: (ev: TouchEvent) => any;\ndeclare var ontouchmove: (ev: TouchEvent) => any;\ndeclare var ontouchstart: (ev: TouchEvent) => any;\ndeclare var onunload: (this: Window, ev: Event) => any;\ndeclare var onvolumechange: (this: Window, ev: Event) => any;\ndeclare var onwaiting: (this: Window, ev: Event) => any;\ndeclare var opener: any;\ndeclare var orientation: string | number;\ndeclare var outerHeight: number;\ndeclare var outerWidth: number;\ndeclare var pageXOffset: number;\ndeclare var pageYOffset: number;\ndeclare var parent: Window;\ndeclare var performance: Performance;\ndeclare var personalbar: BarProp;\ndeclare var screen: Screen;\ndeclare var screenLeft: number;\ndeclare var screenTop: number;\ndeclare var screenX: number;\ndeclare var screenY: number;\ndeclare var scrollbars: BarProp;\ndeclare var scrollX: number;\ndeclare var scrollY: number;\ndeclare var self: Window;\ndeclare var speechSynthesis: SpeechSynthesis;\ndeclare var status: string;\ndeclare var statusbar: BarProp;\ndeclare var styleMedia: StyleMedia;\ndeclare var toolbar: BarProp;\ndeclare var top: Window;\ndeclare var window: Window;\ndeclare var customElements: CustomElementRegistry;\ndeclare function alert(message?: any): void;\ndeclare function blur(): void;\ndeclare function cancelAnimationFrame(handle: number): void;\ndeclare function captureEvents(): void;\ndeclare function close(): void;\ndeclare function confirm(message?: string): boolean;\ndeclare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\ndeclare function focus(): void;\ndeclare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;\ndeclare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;\ndeclare function getSelection(): Selection;\ndeclare function matchMedia(mediaQuery: string): MediaQueryList;\ndeclare function moveBy(x?: number, y?: number): void;\ndeclare function moveTo(x?: number, y?: number): void;\ndeclare function msWriteProfilerMark(profilerMarkName: string): void;\ndeclare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\ndeclare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\ndeclare function print(): void;\ndeclare function prompt(message?: string, _default?: string): string | null;\ndeclare function releaseEvents(): void;\ndeclare function requestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function resizeBy(x?: number, y?: number): void;\ndeclare function resizeTo(x?: number, y?: number): void;\ndeclare function scroll(x?: number, y?: number): void;\ndeclare function scrollBy(x?: number, y?: number): void;\ndeclare function scrollTo(x?: number, y?: number): void;\ndeclare function stop(): void;\ndeclare function webkitCancelAnimationFrame(handle: number): void;\ndeclare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\ndeclare function scroll(options?: ScrollToOptions): void;\ndeclare function scrollTo(options?: ScrollToOptions): void;\ndeclare function scrollBy(options?: ScrollToOptions): void;\ndeclare function toString(): string;\ndeclare function dispatchEvent(evt: Event): boolean;\ndeclare function clearInterval(handle: number): void;\ndeclare function clearTimeout(handle: number): void;\ndeclare function setInterval(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setInterval(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function setTimeout(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function clearImmediate(handle: number): void;\ndeclare function setImmediate(handler: (...args: any[]) => void): number;\ndeclare function setImmediate(handler: any, ...args: any[]): number;\ndeclare var sessionStorage: Storage;\ndeclare var localStorage: Storage;\ndeclare var console: Console;\ndeclare var onpointercancel: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerdown: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerenter: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerleave: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointermove: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerout: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerover: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerup: (this: Window, ev: PointerEvent) => any;\ndeclare var onwheel: (this: Window, ev: WheelEvent) => any;\ndeclare var indexedDB: IDBFactory;\ndeclare function atob(encodedString: string): string;\ndeclare function btoa(rawString: string): string;\ndeclare function fetch(input: RequestInfo, init?: RequestInit): Promise;\ndeclare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\ndeclare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\ndeclare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\ntype AAGUID = string;\ntype AlgorithmIdentifier = string | Algorithm;\ntype BodyInit = Blob | BufferSource | FormData | string;\ntype ByteString = string;\ntype ConstrainBoolean = boolean | ConstrainBooleanParameters;\ntype ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;\ntype ConstrainDouble = number | ConstrainDoubleRange;\ntype ConstrainLong = number | ConstrainLongRange;\ntype CryptoOperationData = ArrayBufferView;\ntype GLbitfield = number;\ntype GLboolean = boolean;\ntype GLbyte = number;\ntype GLclampf = number;\ntype GLenum = number;\ntype GLfloat = number;\ntype GLint = number;\ntype GLintptr = number;\ntype GLshort = number;\ntype GLsizei = number;\ntype GLsizeiptr = number;\ntype GLubyte = number;\ntype GLuint = number;\ntype GLushort = number;\ntype IDBKeyPath = string;\ntype KeyFormat = string;\ntype KeyType = string;\ntype KeyUsage = string;\ntype MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload;\ntype MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent;\ntype MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload;\ntype RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete;\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\ntype RequestInfo = Request | string;\ntype USVString = string;\ntype payloadtype = number;\ntype ScrollBehavior = \"auto\" | \"instant\" | \"smooth\";\ntype ScrollLogicalPosition = \"start\" | \"center\" | \"end\" | \"nearest\";\ntype IDBValidKey = number | string | Date | IDBArrayKey;\ntype BufferSource = ArrayBuffer | ArrayBufferView;\ntype MouseWheelEvent = WheelEvent;\ntype ScrollRestoration = \"auto\" | \"manual\";\ntype FormDataEntryValue = string | File;\ntype InsertPosition = \"beforebegin\" | \"afterbegin\" | \"beforeend\" | \"afterend\";\ntype HeadersInit = Headers | string[][] | { [key: string]: string };\ntype AppendMode = \"segments\" | \"sequence\";\ntype AudioContextState = \"suspended\" | \"running\" | \"closed\";\ntype BiquadFilterType = \"lowpass\" | \"highpass\" | \"bandpass\" | \"lowshelf\" | \"highshelf\" | \"peaking\" | \"notch\" | \"allpass\";\ntype CanvasFillRule = \"nonzero\" | \"evenodd\";\ntype ChannelCountMode = \"max\" | \"clamped-max\" | \"explicit\";\ntype ChannelInterpretation = \"speakers\" | \"discrete\";\ntype DistanceModelType = \"linear\" | \"inverse\" | \"exponential\";\ntype ExpandGranularity = \"character\" | \"word\" | \"sentence\" | \"textedit\";\ntype GamepadInputEmulationType = \"mouse\" | \"keyboard\" | \"gamepad\";\ntype IDBCursorDirection = \"next\" | \"nextunique\" | \"prev\" | \"prevunique\";\ntype IDBRequestReadyState = \"pending\" | \"done\";\ntype IDBTransactionMode = \"readonly\" | \"readwrite\" | \"versionchange\";\ntype ListeningState = \"inactive\" | \"active\" | \"disambiguation\";\ntype MediaDeviceKind = \"audioinput\" | \"audiooutput\" | \"videoinput\";\ntype MediaKeyMessageType = \"license-request\" | \"license-renewal\" | \"license-release\" | \"individualization-request\";\ntype MediaKeySessionType = \"temporary\" | \"persistent-license\" | \"persistent-release-message\";\ntype MediaKeysRequirement = \"required\" | \"optional\" | \"not-allowed\";\ntype MediaKeyStatus = \"usable\" | \"expired\" | \"output-downscaled\" | \"output-not-allowed\" | \"status-pending\" | \"internal-error\";\ntype MediaStreamTrackState = \"live\" | \"ended\";\ntype MSCredentialType = \"FIDO_2_0\";\ntype MSIceAddrType = \"os\" | \"stun\" | \"turn\" | \"peer-derived\";\ntype MSIceType = \"failed\" | \"direct\" | \"relay\";\ntype MSStatsType = \"description\" | \"localclientevent\" | \"inbound-network\" | \"outbound-network\" | \"inbound-payload\" | \"outbound-payload\" | \"transportdiagnostics\";\ntype MSTransportType = \"Embedded\" | \"USB\" | \"NFC\" | \"BT\";\ntype MSWebViewPermissionState = \"unknown\" | \"defer\" | \"allow\" | \"deny\";\ntype MSWebViewPermissionType = \"geolocation\" | \"unlimitedIndexedDBQuota\" | \"media\" | \"pointerlock\" | \"webnotifications\";\ntype NavigationReason = \"up\" | \"down\" | \"left\" | \"right\";\ntype NavigationType = \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\";\ntype NotificationDirection = \"auto\" | \"ltr\" | \"rtl\";\ntype NotificationPermission = \"default\" | \"denied\" | \"granted\";\ntype OscillatorType = \"sine\" | \"square\" | \"sawtooth\" | \"triangle\" | \"custom\";\ntype OverSampleType = \"none\" | \"2x\" | \"4x\";\ntype PanningModelType = \"equalpower\";\ntype PaymentComplete = \"success\" | \"fail\" | \"\";\ntype PaymentShippingType = \"shipping\" | \"delivery\" | \"pickup\";\ntype PushEncryptionKeyName = \"p256dh\" | \"auth\";\ntype PushPermissionState = \"granted\" | \"denied\" | \"prompt\";\ntype ReferrerPolicy = \"\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-only\" | \"origin-when-cross-origin\" | \"unsafe-url\";\ntype RequestCache = \"default\" | \"no-store\" | \"reload\" | \"no-cache\" | \"force-cache\";\ntype RequestCredentials = \"omit\" | \"same-origin\" | \"include\";\ntype RequestDestination = \"\" | \"document\" | \"sharedworker\" | \"subresource\" | \"unknown\" | \"worker\";\ntype RequestMode = \"navigate\" | \"same-origin\" | \"no-cors\" | \"cors\";\ntype RequestRedirect = \"follow\" | \"error\" | \"manual\";\ntype RequestType = \"\" | \"audio\" | \"font\" | \"image\" | \"script\" | \"style\" | \"track\" | \"video\";\ntype ResponseType = \"basic\" | \"cors\" | \"default\" | \"error\" | \"opaque\" | \"opaqueredirect\";\ntype RTCBundlePolicy = \"balanced\" | \"max-compat\" | \"max-bundle\";\ntype RTCDegradationPreference = \"maintain-framerate\" | \"maintain-resolution\" | \"balanced\";\ntype RTCDtlsRole = \"auto\" | \"client\" | \"server\";\ntype RTCDtlsTransportState = \"new\" | \"connecting\" | \"connected\" | \"closed\";\ntype RTCIceCandidateType = \"host\" | \"srflx\" | \"prflx\" | \"relay\";\ntype RTCIceComponent = \"RTP\" | \"RTCP\";\ntype RTCIceConnectionState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"failed\" | \"disconnected\" | \"closed\";\ntype RTCIceGathererState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceGatheringState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceGatherPolicy = \"all\" | \"nohost\" | \"relay\";\ntype RTCIceProtocol = \"udp\" | \"tcp\";\ntype RTCIceRole = \"controlling\" | \"controlled\";\ntype RTCIceTcpCandidateType = \"active\" | \"passive\" | \"so\";\ntype RTCIceTransportPolicy = \"none\" | \"relay\" | \"all\";\ntype RTCIceTransportState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"disconnected\" | \"closed\";\ntype RTCSdpType = \"offer\" | \"pranswer\" | \"answer\";\ntype RTCSignalingState = \"stable\" | \"have-local-offer\" | \"have-remote-offer\" | \"have-local-pranswer\" | \"have-remote-pranswer\" | \"closed\";\ntype RTCStatsIceCandidatePairState = \"frozen\" | \"waiting\" | \"inprogress\" | \"failed\" | \"succeeded\" | \"cancelled\";\ntype RTCStatsIceCandidateType = \"host\" | \"serverreflexive\" | \"peerreflexive\" | \"relayed\";\ntype RTCStatsType = \"inboundrtp\" | \"outboundrtp\" | \"session\" | \"datachannel\" | \"track\" | \"transport\" | \"candidatepair\" | \"localcandidate\" | \"remotecandidate\";\ntype ScopedCredentialType = \"ScopedCred\";\ntype ServiceWorkerState = \"installing\" | \"installed\" | \"activating\" | \"activated\" | \"redundant\";\ntype Transport = \"usb\" | \"nfc\" | \"ble\";\ntype VideoFacingModeEnum = \"user\" | \"environment\" | \"left\" | \"right\";\ntype VisibilityState = \"hidden\" | \"visible\" | \"prerender\" | \"unloaded\";\ntype XMLHttpRequestResponseType = \"\" | \"arraybuffer\" | \"blob\" | \"document\" | \"json\" | \"text\";\n\n\n/////////////////////////////\n/// WorkerGlobalScope APIs\n/////////////////////////////\n// These are only available in a Web Worker\ndeclare function importScripts(...urls: string[]): void;\n\n\n\n\n/////////////////////////////\n/// Windows Script Host APIS\n/////////////////////////////\n\n\ninterface ActiveXObject {\n new (s: string): any;\n}\ndeclare var ActiveXObject: ActiveXObject;\n\ninterface ITextWriter {\n Write(s: string): void;\n WriteLine(s: string): void;\n Close(): void;\n}\n\ninterface TextStreamBase {\n /**\n * The column number of the current character position in an input stream.\n */\n Column: number;\n\n /**\n * The current line number in an input stream.\n */\n Line: number;\n\n /**\n * Closes a text stream.\n * It is not necessary to close standard streams; they close automatically when the process ends. If\n * you close a standard stream, be aware that any other pointers to that standard stream become invalid.\n */\n Close(): void;\n}\n\ninterface TextStreamWriter extends TextStreamBase {\n /**\n * Sends a string to an output stream.\n */\n Write(s: string): void;\n\n /**\n * Sends a specified number of blank lines (newline characters) to an output stream.\n */\n WriteBlankLines(intLines: number): void;\n\n /**\n * Sends a string followed by a newline character to an output stream.\n */\n WriteLine(s: string): void;\n}\n\ninterface TextStreamReader extends TextStreamBase {\n /**\n * Returns a specified number of characters from an input stream, starting at the current pointer position.\n * Does not return until the ENTER key is pressed.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n Read(characters: number): string;\n\n /**\n * Returns all characters from an input stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadAll(): string;\n\n /**\n * Returns an entire line from an input stream.\n * Although this method extracts the newline character, it does not add it to the returned string.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadLine(): string;\n\n /**\n * Skips a specified number of characters when reading from an input text stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)\n */\n Skip(characters: number): void;\n\n /**\n * Skips the next line when reading from an input text stream.\n * Can only be used on a stream in reading mode, not writing or appending mode.\n */\n SkipLine(): void;\n\n /**\n * Indicates whether the stream pointer position is at the end of a line.\n */\n AtEndOfLine: boolean;\n\n /**\n * Indicates whether the stream pointer position is at the end of a stream.\n */\n AtEndOfStream: boolean;\n}\n\ndeclare var WScript: {\n /**\n * Outputs text to either a message box (under WScript.exe) or the command console window followed by\n * a newline (under CScript.exe).\n */\n Echo(s: any): void;\n\n /**\n * Exposes the write-only error output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdErr: TextStreamWriter;\n\n /**\n * Exposes the write-only output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdOut: TextStreamWriter;\n Arguments: { length: number; Item(n: number): string; };\n\n /**\n * The full path of the currently running script.\n */\n ScriptFullName: string;\n\n /**\n * Forces the script to stop immediately, with an optional exit code.\n */\n Quit(exitCode?: number): number;\n\n /**\n * The Windows Script Host build version number.\n */\n BuildVersion: number;\n\n /**\n * Fully qualified path of the host executable.\n */\n FullName: string;\n\n /**\n * Gets/sets the script mode - interactive(true) or batch(false).\n */\n Interactive: boolean;\n\n /**\n * The name of the host executable (WScript.exe or CScript.exe).\n */\n Name: string;\n\n /**\n * Path of the directory containing the host executable.\n */\n Path: string;\n\n /**\n * The filename of the currently running script.\n */\n ScriptName: string;\n\n /**\n * Exposes the read-only input stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdIn: TextStreamReader;\n\n /**\n * Windows Script Host version\n */\n Version: string;\n\n /**\n * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.\n */\n ConnectObject(objEventSource: any, strPrefix: string): void;\n\n /**\n * Creates a COM object.\n * @param strProgiID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n CreateObject(strProgID: string, strPrefix?: string): any;\n\n /**\n * Disconnects a COM object from its event sources.\n */\n DisconnectObject(obj: any): void;\n\n /**\n * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.\n * @param strPathname Fully qualified path to the file containing the object persisted to disk.\n * For objects in memory, pass a zero-length string.\n * @param strProgID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;\n\n /**\n * Suspends script execution for a specified length of time, then continues execution.\n * @param intTime Interval (in milliseconds) to suspend script execution.\n */\n Sleep(intTime: number): void;\n};\n\n/**\n * Represents an Automation SAFEARRAY\n */\ndeclare class SafeArray {\n private constructor();\n private SafeArray_typekey: SafeArray;\n}\n\n/**\n * Allows enumerating over a COM collection, which may not have indexed item access.\n */\ninterface Enumerator {\n /**\n * Returns true if the current item is the last one in the collection, or the collection is empty,\n * or the current item is undefined.\n */\n atEnd(): boolean;\n\n /**\n * Returns the current item in the collection\n */\n item(): T;\n\n /**\n * Resets the current item in the collection to the first item. If there are no items in the collection,\n * the current item is set to undefined.\n */\n moveFirst(): void;\n\n /**\n * Moves the current item to the next item in the collection. If the enumerator is at the end of\n * the collection or the collection is empty, the current item is set to undefined.\n */\n moveNext(): void;\n}\n\ninterface EnumeratorConstructor {\n new (safearray: SafeArray): Enumerator;\n new (collection: { Item(index: any): T }): Enumerator;\n new (collection: any): Enumerator;\n}\n\ndeclare var Enumerator: EnumeratorConstructor;\n\n/**\n * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.\n */\ninterface VBArray {\n /**\n * Returns the number of dimensions (1-based).\n */\n dimensions(): number;\n\n /**\n * Takes an index for each dimension in the array, and returns the item at the corresponding location.\n */\n getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;\n\n /**\n * Returns the smallest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n lbound(dimension?: number): number;\n\n /**\n * Returns the largest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n ubound(dimension?: number): number;\n\n /**\n * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,\n * each successive dimension is appended to the end of the array.\n * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]\n */\n toArray(): T[];\n}\n\ninterface VBArrayConstructor {\n new (safeArray: SafeArray): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ndeclare class VarDate {\n private constructor();\n private VarDate_typekey: VarDate;\n}\n\ninterface DateConstructor {\n new (vd: VarDate): Date;\n}\n\ninterface Date {\n getVarDate: () => VarDate;\n}\n\n\n/// \n\ninterface DOMTokenList {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Headers {\n [Symbol.iterator](): IterableIterator<[string, string]>;\n /**\n * Returns an iterator allowing to go through all key/value pairs contained in this object.\n */\n entries(): IterableIterator<[string, string]>;\n /**\n * Returns an iterator allowing to go through all keys f the key/value pairs contained in this object.\n */\n keys(): IterableIterator;\n /**\n * Returns an iterator allowing to go through all values of the key/value pairs contained in this object.\n */\n values(): IterableIterator;\n}\n\ninterface NodeList {\n /**\n * Returns an array of key, value pairs for every entry in the list\n */\n entries(): IterableIterator<[number, Node]>;\n /**\n * Performs the specified action for each node in an list.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void;\n /**\n * Returns an list of keys in the list\n */\n keys(): IterableIterator;\n\n /**\n * Returns an list of values in the list\n */\n values(): IterableIterator;\n\n\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface NodeListOf {\n\n /**\n * Returns an array of key, value pairs for every entry in the list\n */\n entries(): IterableIterator<[number, TNode]>;\n\n /**\n * Performs the specified action for each node in an list.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf) => void, thisArg?: any): void;\n /**\n * Returns an list of keys in the list\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the list\n */\n values(): IterableIterator;\n\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface HTMLCollectionBase {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface HTMLCollectionOf {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface FormData {\n /**\n * Returns an array of key, value pairs for every entry in the list\n */\n entries(): IterableIterator<[string, string | File]>;\n /**\n * Returns a list of keys in the list\n */\n keys(): IterableIterator;\n /**\n * Returns a list of values in the list\n */\n values(): IterableIterator;\n\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface URLSearchParams {\n /**\n * Returns an array of key, value pairs for every entry in the search params\n */\n entries(): IterableIterator<[string, string]>;\n /**\n * Returns a list of keys in the search params\n */\n keys(): IterableIterator;\n /**\n * Returns a list of values in the search params\n */\n values(): IterableIterator;\n /**\n * iterate over key/value pairs\n */\n [Symbol.iterator](): IterableIterator<[string, string]>;\n}\n"; +export const contents = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n\n/////////////////////////////\n/// ECMAScript APIs\n/////////////////////////////\n\ndeclare const NaN: number;\ndeclare const Infinity: number;\n\n/**\n * Evaluates JavaScript code and executes it.\n * @param x A String value that contains valid JavaScript code.\n */\ndeclare function eval(x: string): any;\n\n/**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\ndeclare function parseInt(s: string, radix?: number): number;\n\n/**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\ndeclare function parseFloat(string: string): number;\n\n/**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\n * @param number A numeric value.\n */\ndeclare function isNaN(number: number): boolean;\n\n/**\n * Determines whether a supplied number is finite.\n * @param number Any numeric value.\n */\ndeclare function isFinite(number: number): boolean;\n\n/**\n * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\n * @param encodedURI A value representing an encoded URI.\n */\ndeclare function decodeURI(encodedURI: string): string;\n\n/**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n * @param encodedURIComponent A value representing an encoded URI component.\n */\ndeclare function decodeURIComponent(encodedURIComponent: string): string;\n\n/**\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\n * @param uri A value representing an encoded URI.\n */\ndeclare function encodeURI(uri: string): string;\n\n/**\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\n * @param uriComponent A value representing an encoded URI component.\n */\ndeclare function encodeURIComponent(uriComponent: string): string;\n\n/**\n * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\n * @param string A string value\n */\ndeclare function escape(string: string): string;\n\n/**\n * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\n * @param string A string value\n */\ndeclare function unescape(string: string): string;\n\ninterface PropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n value?: any;\n writable?: boolean;\n get?(): any;\n set?(v: any): void;\n}\n\ninterface PropertyDescriptorMap {\n [s: string]: PropertyDescriptor;\n}\n\ninterface Object {\n /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\n constructor: Function;\n\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns a date converted to a string using the current locale. */\n toLocaleString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): Object;\n\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: string): boolean;\n\n /**\n * Determines whether an object exists in another object's prototype chain.\n * @param v Another object whose prototype chain is to be checked.\n */\n isPrototypeOf(v: Object): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: string): boolean;\n}\n\ninterface ObjectConstructor {\n new(value?: any): Object;\n (): any;\n (value: any): any;\n\n /** A reference to the prototype for a class of objects. */\n readonly prototype: Object;\n\n /**\n * Returns the prototype of an object.\n * @param o The object that references the prototype.\n */\n getPrototypeOf(o: any): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor | undefined;\n\n /**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\n getOwnPropertyNames(o: any): string[];\n\n /**\n * Creates an object that has the specified prototype or that has null prototype.\n * @param o Object to use as a prototype. May be null.\n */\n create(o: object | null): any;\n\n /**\n * Creates an object that has the specified prototype, and that optionally contains specified properties.\n * @param o Object to use as a prototype. May be null\n * @param properties JavaScript object that contains one or more property descriptors.\n */\n create(o: object | null, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\n */\n defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any;\n\n /**\n * Adds one or more properties to an object, and/or modifies attributes of existing properties.\n * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\n * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\n */\n defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n seal(o: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(a: T[]): ReadonlyArray;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(f: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(o: T): Readonly;\n\n /**\n * Prevents the addition of new properties to an object.\n * @param o Object to make non-extensible.\n */\n preventExtensions(o: T): T;\n\n /**\n * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isSealed(o: any): boolean;\n\n /**\n * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isFrozen(o: any): boolean;\n\n /**\n * Returns a value that indicates whether new properties can be added to an object.\n * @param o Object to test.\n */\n isExtensible(o: any): boolean;\n\n /**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n keys(o: {}): string[];\n}\n\n/**\n * Provides functionality common to all JavaScript objects.\n */\ndeclare const Object: ObjectConstructor;\n\n/**\n * Creates a new function.\n */\ninterface Function {\n /**\n * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\n * @param thisArg The object to be used as the this object.\n * @param argArray A set of arguments to be passed to the function.\n */\n apply(this: Function, thisArg: any, argArray?: any): any;\n\n /**\n * Calls a method of an object, substituting another object for the current object.\n * @param thisArg The object to be used as the current object.\n * @param argArray A list of arguments to be passed to the method.\n */\n call(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg An object to which the this keyword can refer inside the new function.\n * @param argArray A list of arguments to be passed to the new function.\n */\n bind(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /** Returns a string representation of a function. */\n toString(): string;\n\n prototype: any;\n readonly length: number;\n\n // Non-standard extensions\n arguments: any;\n caller: Function;\n}\n\ninterface FunctionConstructor {\n /**\n * Creates a new function.\n * @param args A list of arguments the function accepts.\n */\n new(...args: string[]): Function;\n (...args: string[]): Function;\n readonly prototype: Function;\n}\n\ndeclare const Function: FunctionConstructor;\n\ninterface IArguments {\n [index: number]: any;\n length: number;\n callee: Function;\n}\n\ninterface String {\n /** Returns a string representation of a string. */\n toString(): string;\n\n /**\n * Returns the character at the specified index.\n * @param pos The zero-based index of the desired character.\n */\n charAt(pos: number): string;\n\n /**\n * Returns the Unicode value of the character at the specified location.\n * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\n */\n charCodeAt(index: number): number;\n\n /**\n * Returns a string that contains the concatenation of two or more strings.\n * @param strings The strings to append to the end of the string.\n */\n concat(...strings: string[]): string;\n\n /**\n * Returns the position of the first occurrence of a substring.\n * @param searchString The substring to search for in the string\n * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\n */\n indexOf(searchString: string, position?: number): number;\n\n /**\n * Returns the last occurrence of a substring in the string.\n * @param searchString The substring to search for.\n * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\n */\n lastIndexOf(searchString: string, position?: number): number;\n\n /**\n * Determines whether two strings are equivalent in the current locale.\n * @param that String to compare to target string\n */\n localeCompare(that: string): number;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A variable name or string literal containing the regular expression pattern and flags.\n */\n match(regexp: string | RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string | RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param regexp The regular expression pattern and applicable flags.\n */\n search(regexp: string | RegExp): number;\n\n /**\n * Returns a section of a string.\n * @param start The index to the beginning of the specified portion of stringObj.\n * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\n * If this value is not specified, the substring continues to the end of stringObj.\n */\n slice(start?: number, end?: number): string;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(separator: string | RegExp, limit?: number): string[];\n\n /**\n * Returns the substring at the specified location within a String object.\n * @param start The zero-based index number indicating the beginning of the substring.\n * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\n * If end is omitted, the characters from start through the end of the original string are returned.\n */\n substring(start: number, end?: number): string;\n\n /** Converts all the alphabetic characters in a string to lowercase. */\n toLowerCase(): string;\n\n /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\n toLocaleLowerCase(): string;\n\n /** Converts all the alphabetic characters in a string to uppercase. */\n toUpperCase(): string;\n\n /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\n toLocaleUpperCase(): string;\n\n /** Removes the leading and trailing white space and line terminator characters from a string. */\n trim(): string;\n\n /** Returns the length of a String object. */\n readonly length: number;\n\n // IE extensions\n /**\n * Gets a substring beginning at the specified location and having the specified length.\n * @param from The starting position of the desired substring. The index of the first character in the string is zero.\n * @param length The number of characters to include in the returned substring.\n */\n substr(from: number, length?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): string;\n\n readonly [index: number]: string;\n}\n\ninterface StringConstructor {\n new(value?: any): String;\n (value?: any): string;\n readonly prototype: String;\n fromCharCode(...codes: number[]): string;\n}\n\n/**\n * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\n */\ndeclare const String: StringConstructor;\n\ninterface Boolean {\n /** Returns the primitive value of the specified object. */\n valueOf(): boolean;\n}\n\ninterface BooleanConstructor {\n new(value?: any): Boolean;\n (value?: any): boolean;\n readonly prototype: Boolean;\n}\n\ndeclare const Boolean: BooleanConstructor;\n\ninterface Number {\n /**\n * Returns a string representation of an object.\n * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\n */\n toString(radix?: number): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toFixed(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toExponential(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\n */\n toPrecision(precision?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): number;\n}\n\ninterface NumberConstructor {\n new(value?: any): Number;\n (value?: any): number;\n readonly prototype: Number;\n\n /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\n readonly MAX_VALUE: number;\n\n /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\n readonly MIN_VALUE: number;\n\n /**\n * A value that is not a number.\n * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\n */\n readonly NaN: number;\n\n /**\n * A value that is less than the largest negative number that can be represented in JavaScript.\n * JavaScript displays NEGATIVE_INFINITY values as -infinity.\n */\n readonly NEGATIVE_INFINITY: number;\n\n /**\n * A value greater than the largest number that can be represented in JavaScript.\n * JavaScript displays POSITIVE_INFINITY values as infinity.\n */\n readonly POSITIVE_INFINITY: number;\n}\n\n/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\ndeclare const Number: NumberConstructor;\n\ninterface TemplateStringsArray extends ReadonlyArray {\n readonly raw: ReadonlyArray;\n}\n\ninterface Math {\n /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\n readonly E: number;\n /** The natural logarithm of 10. */\n readonly LN10: number;\n /** The natural logarithm of 2. */\n readonly LN2: number;\n /** The base-2 logarithm of e. */\n readonly LOG2E: number;\n /** The base-10 logarithm of e. */\n readonly LOG10E: number;\n /** Pi. This is the ratio of the circumference of a circle to its diameter. */\n readonly PI: number;\n /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\n readonly SQRT1_2: number;\n /** The square root of 2. */\n readonly SQRT2: number;\n /**\n * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\n * For example, the absolute value of -5 is the same as the absolute value of 5.\n * @param x A numeric expression for which the absolute value is needed.\n */\n abs(x: number): number;\n /**\n * Returns the arc cosine (or inverse cosine) of a number.\n * @param x A numeric expression.\n */\n acos(x: number): number;\n /**\n * Returns the arcsine of a number.\n * @param x A numeric expression.\n */\n asin(x: number): number;\n /**\n * Returns the arctangent of a number.\n * @param x A numeric expression for which the arctangent is needed.\n */\n atan(x: number): number;\n /**\n * Returns the angle (in radians) from the X axis to a point.\n * @param y A numeric expression representing the cartesian y-coordinate.\n * @param x A numeric expression representing the cartesian x-coordinate.\n */\n atan2(y: number, x: number): number;\n /**\n * Returns the smallest integer greater than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n ceil(x: number): number;\n /**\n * Returns the cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cos(x: number): number;\n /**\n * Returns e (the base of natural logarithms) raised to a power.\n * @param x A numeric expression representing the power of e.\n */\n exp(x: number): number;\n /**\n * Returns the greatest integer less than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n floor(x: number): number;\n /**\n * Returns the natural logarithm (base e) of a number.\n * @param x A numeric expression.\n */\n log(x: number): number;\n /**\n * Returns the larger of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n max(...values: number[]): number;\n /**\n * Returns the smaller of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n min(...values: number[]): number;\n /**\n * Returns the value of a base expression taken to a specified power.\n * @param x The base value of the expression.\n * @param y The exponent value of the expression.\n */\n pow(x: number, y: number): number;\n /** Returns a pseudorandom number between 0 and 1. */\n random(): number;\n /**\n * Returns a supplied numeric expression rounded to the nearest number.\n * @param x The value to be rounded to the nearest number.\n */\n round(x: number): number;\n /**\n * Returns the sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sin(x: number): number;\n /**\n * Returns the square root of a number.\n * @param x A numeric expression.\n */\n sqrt(x: number): number;\n /**\n * Returns the tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tan(x: number): number;\n}\n/** An intrinsic object that provides basic mathematics functionality and constants. */\ndeclare const Math: Math;\n\n/** Enables basic storage and retrieval of dates and times. */\ninterface Date {\n /** Returns a string representation of a date. The format of the string depends on the locale. */\n toString(): string;\n /** Returns a date as a string value. */\n toDateString(): string;\n /** Returns a time as a string value. */\n toTimeString(): string;\n /** Returns a value as a string value appropriate to the host environment's current locale. */\n toLocaleString(): string;\n /** Returns a date as a string value appropriate to the host environment's current locale. */\n toLocaleDateString(): string;\n /** Returns a time as a string value appropriate to the host environment's current locale. */\n toLocaleTimeString(): string;\n /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\n valueOf(): number;\n /** Gets the time value in milliseconds. */\n getTime(): number;\n /** Gets the year, using local time. */\n getFullYear(): number;\n /** Gets the year using Universal Coordinated Time (UTC). */\n getUTCFullYear(): number;\n /** Gets the month, using local time. */\n getMonth(): number;\n /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\n getUTCMonth(): number;\n /** Gets the day-of-the-month, using local time. */\n getDate(): number;\n /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\n getUTCDate(): number;\n /** Gets the day of the week, using local time. */\n getDay(): number;\n /** Gets the day of the week using Universal Coordinated Time (UTC). */\n getUTCDay(): number;\n /** Gets the hours in a date, using local time. */\n getHours(): number;\n /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\n getUTCHours(): number;\n /** Gets the minutes of a Date object, using local time. */\n getMinutes(): number;\n /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\n getUTCMinutes(): number;\n /** Gets the seconds of a Date object, using local time. */\n getSeconds(): number;\n /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCSeconds(): number;\n /** Gets the milliseconds of a Date, using local time. */\n getMilliseconds(): number;\n /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCMilliseconds(): number;\n /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\n getTimezoneOffset(): number;\n /**\n * Sets the date and time value in the Date object.\n * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\n */\n setTime(time: number): number;\n /**\n * Sets the milliseconds value in the Date object using local time.\n * @param ms A numeric value equal to the millisecond value.\n */\n setMilliseconds(ms: number): number;\n /**\n * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\n * @param ms A numeric value equal to the millisecond value.\n */\n setUTCMilliseconds(ms: number): number;\n\n /**\n * Sets the seconds value in the Date object using local time.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setSeconds(sec: number, ms?: number): number;\n /**\n * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCSeconds(sec: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using local time.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the hour value in the Date object using local time.\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the numeric day-of-the-month value of the Date object using local time.\n * @param date A numeric value equal to the day of the month.\n */\n setDate(date: number): number;\n /**\n * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\n * @param date A numeric value equal to the day of the month.\n */\n setUTCDate(date: number): number;\n /**\n * Sets the month value in the Date object using local time.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\n */\n setMonth(month: number, date?: number): number;\n /**\n * Sets the month value in the Date object using Universal Coordinated Time (UTC).\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\n */\n setUTCMonth(month: number, date?: number): number;\n /**\n * Sets the year of the Date object using local time.\n * @param year A numeric value for the year.\n * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\n * @param date A numeric value equal for the day of the month.\n */\n setFullYear(year: number, month?: number, date?: number): number;\n /**\n * Sets the year value in the Date object using Universal Coordinated Time (UTC).\n * @param year A numeric value equal to the year.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\n * @param date A numeric value equal to the day of the month.\n */\n setUTCFullYear(year: number, month?: number, date?: number): number;\n /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\n toUTCString(): string;\n /** Returns a date as a string value in ISO format. */\n toISOString(): string;\n /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\n toJSON(key?: any): string;\n}\n\ninterface DateConstructor {\n new(): Date;\n new(value: number): Date;\n new(value: string): Date;\n new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\n (): string;\n readonly prototype: Date;\n /**\n * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\n * @param s A date string\n */\n parse(s: string): number;\n /**\n * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\n * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as an number between 0 and 11 (January to December).\n * @param date The date as an number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.\n * @param ms An number from 0 to 999 that specifies the milliseconds.\n */\n UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\n now(): number;\n}\n\ndeclare const Date: DateConstructor;\n\ninterface RegExpMatchArray extends Array {\n index?: number;\n input?: string;\n}\n\ninterface RegExpExecArray extends Array {\n index: number;\n input: string;\n}\n\ninterface RegExp {\n /**\n * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\n * @param string The String object or string literal on which to perform the search.\n */\n exec(string: string): RegExpExecArray | null;\n\n /**\n * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\n * @param string String on which to perform the search.\n */\n test(string: string): boolean;\n\n /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\n readonly source: string;\n\n /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\n readonly global: boolean;\n\n /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\n readonly ignoreCase: boolean;\n\n /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\n readonly multiline: boolean;\n\n lastIndex: number;\n\n // Non-standard extensions\n compile(): this;\n}\n\ninterface RegExpConstructor {\n new(pattern: RegExp | string): RegExp;\n new(pattern: string, flags?: string): RegExp;\n (pattern: RegExp | string): RegExp;\n (pattern: string, flags?: string): RegExp;\n readonly prototype: RegExp;\n\n // Non-standard extensions\n $1: string;\n $2: string;\n $3: string;\n $4: string;\n $5: string;\n $6: string;\n $7: string;\n $8: string;\n $9: string;\n lastMatch: string;\n}\n\ndeclare const RegExp: RegExpConstructor;\n\ninterface Error {\n name: string;\n message: string;\n stack?: string;\n}\n\ninterface ErrorConstructor {\n new(message?: string): Error;\n (message?: string): Error;\n readonly prototype: Error;\n}\n\ndeclare const Error: ErrorConstructor;\n\ninterface EvalError extends Error {\n}\n\ninterface EvalErrorConstructor {\n new(message?: string): EvalError;\n (message?: string): EvalError;\n readonly prototype: EvalError;\n}\n\ndeclare const EvalError: EvalErrorConstructor;\n\ninterface RangeError extends Error {\n}\n\ninterface RangeErrorConstructor {\n new(message?: string): RangeError;\n (message?: string): RangeError;\n readonly prototype: RangeError;\n}\n\ndeclare const RangeError: RangeErrorConstructor;\n\ninterface ReferenceError extends Error {\n}\n\ninterface ReferenceErrorConstructor {\n new(message?: string): ReferenceError;\n (message?: string): ReferenceError;\n readonly prototype: ReferenceError;\n}\n\ndeclare const ReferenceError: ReferenceErrorConstructor;\n\ninterface SyntaxError extends Error {\n}\n\ninterface SyntaxErrorConstructor {\n new(message?: string): SyntaxError;\n (message?: string): SyntaxError;\n readonly prototype: SyntaxError;\n}\n\ndeclare const SyntaxError: SyntaxErrorConstructor;\n\ninterface TypeError extends Error {\n}\n\ninterface TypeErrorConstructor {\n new(message?: string): TypeError;\n (message?: string): TypeError;\n readonly prototype: TypeError;\n}\n\ndeclare const TypeError: TypeErrorConstructor;\n\ninterface URIError extends Error {\n}\n\ninterface URIErrorConstructor {\n new(message?: string): URIError;\n (message?: string): URIError;\n readonly prototype: URIError;\n}\n\ndeclare const URIError: URIErrorConstructor;\n\ninterface JSON {\n /**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n * @param text A valid JSON string.\n * @param reviver A function that transforms the results. This function is called for each member of the object.\n * If a member contains nested objects, the nested objects are transformed before the parent object is.\n */\n parse(text: string, reviver?: (key: any, value: any) => any): any;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\n}\n\n/**\n * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\n */\ndeclare const JSON: JSON;\n\n\n/////////////////////////////\n/// ECMAScript Array API (specially handled by compiler)\n/////////////////////////////\n\ninterface ReadonlyArray {\n /**\n * Gets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n readonly length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n\n readonly [n: number]: T;\n}\n\ninterface ConcatArray {\n readonly length: number;\n readonly [n: number]: T;\n join(separator?: string): string;\n slice(start?: number, end?: number): T[];\n}\n\ninterface Array {\n /**\n * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Appends new elements to an array, and returns the new length of the array.\n * @param items New elements of the Array.\n */\n push(...items: T[]): number;\n /**\n * Removes the last element from an array and returns it.\n */\n pop(): T | undefined;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Reverses the elements in an Array.\n */\n reverse(): T[];\n /**\n * Removes the first element from an array and returns it.\n */\n shift(): T | undefined;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: T, b: T) => number): this;\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n */\n splice(start: number, deleteCount?: number): T[];\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @param items Elements to insert into the array in place of the deleted elements.\n */\n splice(start: number, deleteCount: number, ...items: T[]): T[];\n /**\n * Inserts new elements at the start of an array.\n * @param items Elements to insert at the start of the Array.\n */\n unshift(...items: T[]): number;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n\n [n: number]: T;\n}\n\ninterface ArrayConstructor {\n new(arrayLength?: number): any[];\n new (arrayLength: number): T[];\n new (...items: T[]): T[];\n (arrayLength?: number): any[];\n (arrayLength: number): T[];\n (...items: T[]): T[];\n isArray(arg: any): arg is Array;\n readonly prototype: Array;\n}\n\ndeclare const Array: ArrayConstructor;\n\ninterface TypedPropertyDescriptor {\n enumerable?: boolean;\n configurable?: boolean;\n writable?: boolean;\n value?: T;\n get?: () => T;\n set?: (value: T) => void;\n}\n\ndeclare type ClassDecorator = (target: TFunction) => TFunction | void;\ndeclare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\ndeclare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;\ndeclare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\n\ndeclare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike;\n\ninterface PromiseLike {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike;\n}\n\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}\n\ninterface ArrayLike {\n readonly length: number;\n readonly [n: number]: T;\n}\n\n/**\n * Make all properties in T optional\n */\ntype Partial = {\n [P in keyof T]?: T[P];\n};\n\n/**\n * Make all properties in T required\n */\ntype Required = {\n [P in keyof T]-?: T[P];\n};\n\n/**\n * Make all properties in T readonly\n */\ntype Readonly = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * From T pick a set of properties K\n */\ntype Pick = {\n [P in K]: T[P];\n};\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype Record = {\n [P in K]: T;\n};\n\n/**\n * Exclude from T those types that are assignable to U\n */\ntype Exclude = T extends U ? never : T;\n\n/**\n * Extract from T those types that are assignable to U\n */\ntype Extract = T extends U ? T : never;\n\n/**\n * Exclude null and undefined from T\n */\ntype NonNullable = T extends null | undefined ? never : T;\n\n/**\n * Obtain the return type of a function type\n */\ntype ReturnType any> = T extends (...args: any[]) => infer R ? R : any;\n\n/**\n * Obtain the return type of a constructor function type\n */\ntype InstanceType any> = T extends new (...args: any[]) => infer R ? R : any;\n\n/**\n * Marker for contextual 'this' type\n */\ninterface ThisType { }\n\n/**\n * Represents a raw buffer of binary data, which is used to store data for the\n * different typed arrays. ArrayBuffers cannot be read from or written to directly,\n * but can be passed to a typed array or DataView Object to interpret the raw\n * buffer as needed.\n */\ninterface ArrayBuffer {\n /**\n * Read-only. The length of the ArrayBuffer (in bytes).\n */\n readonly byteLength: number;\n\n /**\n * Returns a section of an ArrayBuffer.\n */\n slice(begin: number, end?: number): ArrayBuffer;\n}\n\n/**\n * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\n */\ninterface ArrayBufferTypes {\n ArrayBuffer: ArrayBuffer;\n}\ntype ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\n\ninterface ArrayBufferConstructor {\n readonly prototype: ArrayBuffer;\n new(byteLength: number): ArrayBuffer;\n isView(arg: any): arg is ArrayBufferView;\n}\ndeclare const ArrayBuffer: ArrayBufferConstructor;\n\ninterface ArrayBufferView {\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n byteOffset: number;\n}\n\ninterface DataView {\n readonly buffer: ArrayBuffer;\n readonly byteLength: number;\n readonly byteOffset: number;\n /**\n * Gets the Float32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Float64 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat64(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Int8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt8(byteOffset: number): number;\n\n /**\n * Gets the Int16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt16(byteOffset: number, littleEndian?: boolean): number;\n /**\n * Gets the Int32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint8(byteOffset: number): number;\n\n /**\n * Gets the Uint16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Float64 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setInt8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Int16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setUint8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Uint16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n\ninterface DataViewConstructor {\n new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\n}\ndeclare const DataView: DataViewConstructor;\n\n/**\n * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Int8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\ninterface Int8ArrayConstructor {\n readonly prototype: Int8Array;\n new(length: number): Int8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\n\n\n}\ndeclare const Int8Array: Int8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ArrayConstructor {\n readonly prototype: Uint8Array;\n new(length: number): Uint8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\n\n}\ndeclare const Uint8Array: Uint8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\n * If the requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8ClampedArray {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8ClampedArray;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8ClampedArray;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8ClampedArray;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ClampedArrayConstructor {\n readonly prototype: Uint8ClampedArray;\n new(length: number): Uint8ClampedArray;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8ClampedArray;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\ndeclare const Uint8ClampedArray: Uint8ClampedArrayConstructor;\n\n/**\n * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int16ArrayConstructor {\n readonly prototype: Int16Array;\n new(length: number): Int16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\n\n\n}\ndeclare const Int16Array: Int16ArrayConstructor;\n\n/**\n * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint16ArrayConstructor {\n readonly prototype: Uint16Array;\n new(length: number): Uint16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\n\n\n}\ndeclare const Uint16Array: Uint16ArrayConstructor;\n/**\n * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int32ArrayConstructor {\n readonly prototype: Int32Array;\n new(length: number): Int32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\n\n}\ndeclare const Int32Array: Int32ArrayConstructor;\n\n/**\n * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint32ArrayConstructor {\n readonly prototype: Uint32Array;\n new(length: number): Uint32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\n\n}\ndeclare const Uint32Array: Uint32ArrayConstructor;\n\n/**\n * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float32ArrayConstructor {\n readonly prototype: Float32Array;\n new(length: number): Float32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\n\n\n}\ndeclare const Float32Array: Float32ArrayConstructor;\n\n/**\n * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Float64Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float64Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float64Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float64Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float64ArrayConstructor {\n readonly prototype: Float64Array;\n new(length: number): Float64Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\n\n}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare namespace Intl {\n interface CollatorOptions {\n usage?: string;\n localeMatcher?: string;\n numeric?: boolean;\n caseFirst?: string;\n sensitivity?: string;\n ignorePunctuation?: boolean;\n }\n\n interface ResolvedCollatorOptions {\n locale: string;\n usage: string;\n sensitivity: string;\n ignorePunctuation: boolean;\n collation: string;\n caseFirst: string;\n numeric: boolean;\n }\n\n interface Collator {\n compare(x: string, y: string): number;\n resolvedOptions(): ResolvedCollatorOptions;\n }\n var Collator: {\n new(locales?: string | string[], options?: CollatorOptions): Collator;\n (locales?: string | string[], options?: CollatorOptions): Collator;\n supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\n };\n\n interface NumberFormatOptions {\n localeMatcher?: string;\n style?: string;\n currency?: string;\n currencyDisplay?: string;\n useGrouping?: boolean;\n minimumIntegerDigits?: number;\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n }\n\n interface ResolvedNumberFormatOptions {\n locale: string;\n numberingSystem: string;\n style: string;\n currency?: string;\n currencyDisplay?: string;\n minimumIntegerDigits: number;\n minimumFractionDigits: number;\n maximumFractionDigits: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n useGrouping: boolean;\n }\n\n interface NumberFormat {\n format(value: number): string;\n resolvedOptions(): ResolvedNumberFormatOptions;\n }\n var NumberFormat: {\n new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\n };\n\n interface DateTimeFormatOptions {\n localeMatcher?: string;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n formatMatcher?: string;\n hour12?: boolean;\n timeZone?: string;\n }\n\n interface ResolvedDateTimeFormatOptions {\n locale: string;\n calendar: string;\n numberingSystem: string;\n timeZone: string;\n hour12?: boolean;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n }\n\n interface DateTimeFormat {\n format(date?: Date | number): string;\n resolvedOptions(): ResolvedDateTimeFormatOptions;\n }\n var DateTimeFormat: {\n new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\n };\n}\n\ninterface String {\n /**\n * Determines whether two strings are equivalent in the current or specified locale.\n * @param that String to compare to target string\n * @param locales A locale string or array of locale strings 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. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\n */\n localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\n}\n\ninterface Number {\n /**\n * Converts a number to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n}\n\ninterface Date {\n /**\n * Converts a date and time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n /**\n * Converts a date to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n\n /**\n * Converts a time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n}\n\n\ndeclare type PropertyKey = string | number | symbol;\n\ninterface Array {\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (this: void, value: T, index: number, obj: T[]) => value is S, thisArg?: any): S | undefined;\n find(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): T | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: T, index: number, obj: T[]) => boolean, thisArg?: any): number;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: T, start?: number, end?: number): this;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n}\n\ninterface ArrayConstructor {\n /**\n * Creates an array from an array-like object.\n * @param arrayLike An array-like object to convert to an array.\n */\n from(arrayLike: ArrayLike): T[];\n\n /**\n * Creates an array from an iterable object.\n * @param arrayLike An array-like object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[];\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: T[]): T[];\n}\n\ninterface DateConstructor {\n new (value: number | string | Date): Date;\n}\n\ninterface Function {\n /**\n * Returns the name of the function. Function names are read-only and can not be changed.\n */\n readonly name: string;\n}\n\ninterface Math {\n /**\n * Returns the number of leading zero bits in the 32-bit binary representation of a number.\n * @param x A numeric expression.\n */\n clz32(x: number): number;\n\n /**\n * Returns the result of 32-bit multiplication of two numbers.\n * @param x First number\n * @param y Second number\n */\n imul(x: number, y: number): number;\n\n /**\n * Returns the sign of the x, indicating whether x is positive, negative or zero.\n * @param x The numeric expression to test\n */\n sign(x: number): number;\n\n /**\n * Returns the base 10 logarithm of a number.\n * @param x A numeric expression.\n */\n log10(x: number): number;\n\n /**\n * Returns the base 2 logarithm of a number.\n * @param x A numeric expression.\n */\n log2(x: number): number;\n\n /**\n * Returns the natural logarithm of 1 + x.\n * @param x A numeric expression.\n */\n log1p(x: number): number;\n\n /**\n * Returns the result of (e^x - 1), which is an implementation-dependent approximation to\n * subtracting 1 from the exponential function of x (e raised to the power of x, where e\n * is the base of the natural logarithms).\n * @param x A numeric expression.\n */\n expm1(x: number): number;\n\n /**\n * Returns the hyperbolic cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cosh(x: number): number;\n\n /**\n * Returns the hyperbolic sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sinh(x: number): number;\n\n /**\n * Returns the hyperbolic tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tanh(x: number): number;\n\n /**\n * Returns the inverse hyperbolic cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n acosh(x: number): number;\n\n /**\n * Returns the inverse hyperbolic sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n asinh(x: number): number;\n\n /**\n * Returns the inverse hyperbolic tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n atanh(x: number): number;\n\n /**\n * Returns the square root of the sum of squares of its arguments.\n * @param values Values to compute the square root for.\n * If no arguments are passed, the result is +0.\n * If there is only one argument, the result is the absolute value.\n * If any argument is +Infinity or -Infinity, the result is +Infinity.\n * If any argument is NaN, the result is NaN.\n * If all arguments are either +0 or −0, the result is +0.\n */\n hypot(...values: number[]): number;\n\n /**\n * Returns the integral part of the a numeric expression, x, removing any fractional digits.\n * If x is already an integer, the result is x.\n * @param x A numeric expression.\n */\n trunc(x: number): number;\n\n /**\n * Returns the nearest single precision float representation of a number.\n * @param x A numeric expression.\n */\n fround(x: number): number;\n\n /**\n * Returns an implementation-dependent approximation to the cube root of number.\n * @param x A numeric expression.\n */\n cbrt(x: number): number;\n}\n\ninterface NumberConstructor {\n /**\n * The value of Number.EPSILON is the difference between 1 and the smallest value greater than 1\n * that is representable as a Number value, which is approximately:\n * 2.2204460492503130808472633361816 x 10‍−‍16.\n */\n readonly EPSILON: number;\n\n /**\n * Returns true if passed value is finite.\n * Unlike the global isFinite, Number.isFinite doesn't forcibly convert the parameter to a\n * number. Only finite values of the type number, result in true.\n * @param number A numeric value.\n */\n isFinite(number: number): boolean;\n\n /**\n * Returns true if the value passed is an integer, false otherwise.\n * @param number A numeric value.\n */\n isInteger(number: number): boolean;\n\n /**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a\n * number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter\n * to a number. Only values of the type number, that are also NaN, result in true.\n * @param number A numeric value.\n */\n isNaN(number: number): boolean;\n\n /**\n * Returns true if the value passed is a safe integer.\n * @param number A numeric value.\n */\n isSafeInteger(number: number): boolean;\n\n /**\n * The value of the largest integer n such that n and n + 1 are both exactly representable as\n * a Number value.\n * The value of Number.MAX_SAFE_INTEGER is 9007199254740991 2^53 − 1.\n */\n readonly MAX_SAFE_INTEGER: number;\n\n /**\n * The value of the smallest integer n such that n and n − 1 are both exactly representable as\n * a Number value.\n * The value of Number.MIN_SAFE_INTEGER is −9007199254740991 (−(2^53 − 1)).\n */\n readonly MIN_SAFE_INTEGER: number;\n\n /**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\n parseFloat(string: string): number;\n\n /**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\n parseInt(string: string, radix?: number): number;\n}\n\ninterface Object {\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: PropertyKey): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: PropertyKey): boolean;\n}\n\ninterface ObjectConstructor {\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param source The source object from which to copy properties.\n */\n assign(target: T, source: U): T & U;\n\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param source1 The first source object from which to copy properties.\n * @param source2 The second source object from which to copy properties.\n */\n assign(target: T, source1: U, source2: V): T & U & V;\n\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param source1 The first source object from which to copy properties.\n * @param source2 The second source object from which to copy properties.\n * @param source3 The third source object from which to copy properties.\n */\n assign(target: T, source1: U, source2: V, source3: W): T & U & V & W;\n\n /**\n * Copy the values of all of the enumerable own properties from one or more source objects to a\n * target object. Returns the target object.\n * @param target The target object to copy to.\n * @param sources One or more source objects from which to copy properties\n */\n assign(target: object, ...sources: any[]): any;\n\n /**\n * Returns an array of all symbol properties found directly on object o.\n * @param o Object to retrieve the symbols from.\n */\n getOwnPropertySymbols(o: any): symbol[];\n\n /**\n * Returns true if the values are the same value, false otherwise.\n * @param value1 The first value.\n * @param value2 The second value.\n */\n is(value1: any, value2: any): boolean;\n\n /**\n * Sets the prototype of a specified object o to object proto or null. Returns the object o.\n * @param o The object to change its prototype.\n * @param proto The value of the new prototype or null.\n */\n setPrototypeOf(o: any, proto: object | null): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not\n * inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, propertyKey: PropertyKey): PropertyDescriptor | undefined;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript\n * object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor\n * property.\n */\n defineProperty(o: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): any;\n}\n\ninterface ReadonlyArray {\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray) => value is S, thisArg?: any): S | undefined;\n find(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): T | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: T, index: number, obj: ReadonlyArray) => boolean, thisArg?: any): number;\n}\n\ninterface RegExp {\n /**\n * Returns a string indicating the flags of the regular expression in question. This field is read-only.\n * The characters in this string are sequenced and concatenated in the following order:\n *\n * - \"g\" for global\n * - \"i\" for ignoreCase\n * - \"m\" for multiline\n * - \"u\" for unicode\n * - \"y\" for sticky\n *\n * If no flags are set, the value is the empty string.\n */\n readonly flags: string;\n\n /**\n * Returns a Boolean value indicating the state of the sticky flag (y) used with a regular\n * expression. Default is false. Read-only.\n */\n readonly sticky: boolean;\n\n /**\n * Returns a Boolean value indicating the state of the Unicode flag (u) used with a regular\n * expression. Default is false. Read-only.\n */\n readonly unicode: boolean;\n}\n\ninterface RegExpConstructor {\n new (pattern: RegExp, flags?: string): RegExp;\n (pattern: RegExp, flags?: string): RegExp;\n}\n\ninterface String {\n /**\n * Returns a nonnegative integer Number less than 1114112 (0x110000) that is the code point\n * value of the UTF-16 encoded code point starting at the string element at position pos in\n * the String resulting from converting this object to a String.\n * If there is no element at that position, the result is undefined.\n * If a valid UTF-16 surrogate pair does not begin at pos, the result is the code unit at pos.\n */\n codePointAt(pos: number): number | undefined;\n\n /**\n * Returns true if searchString appears as a substring of the result of converting this\n * object to a String, at one or more positions that are\n * greater than or equal to position; otherwise, returns false.\n * @param searchString search string\n * @param position If position is undefined, 0 is assumed, so as to search all of the String.\n */\n includes(searchString: string, position?: number): boolean;\n\n /**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * endPosition – length(this). Otherwise returns false.\n */\n endsWith(searchString: string, endPosition?: number): boolean;\n\n /**\n * Returns the String value result of normalizing the string into the normalization form\n * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n * is \"NFC\"\n */\n normalize(form: \"NFC\" | \"NFD\" | \"NFKC\" | \"NFKD\"): string;\n\n /**\n * Returns the String value result of normalizing the string into the normalization form\n * named by form as specified in Unicode Standard Annex #15, Unicode Normalization Forms.\n * @param form Applicable values: \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", If not specified default\n * is \"NFC\"\n */\n normalize(form?: string): string;\n\n /**\n * Returns a String value that is made from count copies appended together. If count is 0,\n * the empty string is returned.\n * @param count number of copies to append\n */\n repeat(count: number): string;\n\n /**\n * Returns true if the sequence of elements of searchString converted to a String is the\n * same as the corresponding elements of this object (converted to a String) starting at\n * position. Otherwise returns false.\n */\n startsWith(searchString: string, position?: number): boolean;\n\n /**\n * Returns an HTML anchor element and sets the name attribute to the text value\n * @param name\n */\n anchor(name: string): string;\n\n /** Returns a HTML element */\n big(): string;\n\n /** Returns a HTML element */\n blink(): string;\n\n /** Returns a HTML element */\n bold(): string;\n\n /** Returns a HTML element */\n fixed(): string;\n\n /** Returns a HTML element and sets the color attribute value */\n fontcolor(color: string): string;\n\n /** Returns a HTML element and sets the size attribute value */\n fontsize(size: number): string;\n\n /** Returns a HTML element and sets the size attribute value */\n fontsize(size: string): string;\n\n /** Returns an HTML element */\n italics(): string;\n\n /** Returns an HTML element and sets the href attribute value */\n link(url: string): string;\n\n /** Returns a HTML element */\n small(): string;\n\n /** Returns a HTML element */\n strike(): string;\n\n /** Returns a HTML element */\n sub(): string;\n\n /** Returns a HTML element */\n sup(): string;\n}\n\ninterface StringConstructor {\n /**\n * Return the String value whose elements are, in order, the elements in the List elements.\n * If length is 0, the empty string is returned.\n */\n fromCodePoint(...codePoints: number[]): string;\n\n /**\n * String.raw is intended for use as a tag function of a Tagged Template String. When called\n * as such the first argument will be a well formed template call site object and the rest\n * parameter will contain the substitution values.\n * @param template A well-formed template string call site representation.\n * @param substitutions A set of substitution values.\n */\n raw(template: TemplateStringsArray, ...substitutions: any[]): string;\n}\n\n\ninterface Map {\n clear(): void;\n delete(key: K): boolean;\n forEach(callbackfn: (value: V, key: K, map: Map) => void, thisArg?: any): void;\n get(key: K): V | undefined;\n has(key: K): boolean;\n set(key: K, value: V): this;\n readonly size: number;\n}\n\ninterface MapConstructor {\n new (): Map;\n new (entries?: ReadonlyArray<[K, V]>): Map;\n readonly prototype: Map;\n}\ndeclare var Map: MapConstructor;\n\ninterface ReadonlyMap {\n forEach(callbackfn: (value: V, key: K, map: ReadonlyMap) => void, thisArg?: any): void;\n get(key: K): V | undefined;\n has(key: K): boolean;\n readonly size: number;\n}\n\ninterface WeakMap {\n delete(key: K): boolean;\n get(key: K): V | undefined;\n has(key: K): boolean;\n set(key: K, value: V): this;\n}\n\ninterface WeakMapConstructor {\n new (): WeakMap;\n new (entries?: ReadonlyArray<[K, V]>): WeakMap;\n readonly prototype: WeakMap;\n}\ndeclare var WeakMap: WeakMapConstructor;\n\ninterface Set {\n add(value: T): this;\n clear(): void;\n delete(value: T): boolean;\n forEach(callbackfn: (value: T, value2: T, set: Set) => void, thisArg?: any): void;\n has(value: T): boolean;\n readonly size: number;\n}\n\ninterface SetConstructor {\n new (): Set;\n new (values?: ReadonlyArray): Set;\n readonly prototype: Set;\n}\ndeclare var Set: SetConstructor;\n\ninterface ReadonlySet {\n forEach(callbackfn: (value: T, value2: T, set: ReadonlySet) => void, thisArg?: any): void;\n has(value: T): boolean;\n readonly size: number;\n}\n\ninterface WeakSet {\n add(value: T): this;\n delete(value: T): boolean;\n has(value: T): boolean;\n}\n\ninterface WeakSetConstructor {\n new (): WeakSet;\n new (values?: ReadonlyArray): WeakSet;\n readonly prototype: WeakSet;\n}\ndeclare var WeakSet: WeakSetConstructor;\n\n\ninterface Generator extends Iterator { }\n\ninterface GeneratorFunction {\n /**\n * Creates a new Generator object.\n * @param args A list of arguments the function accepts.\n */\n new (...args: any[]): Generator;\n /**\n * Creates a new Generator object.\n * @param args A list of arguments the function accepts.\n */\n (...args: any[]): Generator;\n /**\n * The length of the arguments.\n */\n readonly length: number;\n /**\n * Returns the name of the function.\n */\n readonly name: string;\n /**\n * A reference to the prototype.\n */\n readonly prototype: Generator;\n}\n\ninterface GeneratorFunctionConstructor {\n /**\n * Creates a new Generator function.\n * @param args A list of arguments the function accepts.\n */\n new (...args: string[]): GeneratorFunction;\n /**\n * Creates a new Generator function.\n * @param args A list of arguments the function accepts.\n */\n (...args: string[]): GeneratorFunction;\n /**\n * The length of the arguments.\n */\n readonly length: number;\n /**\n * Returns the name of the function.\n */\n readonly name: string;\n /**\n * A reference to the prototype.\n */\n readonly prototype: GeneratorFunction;\n}\n\n\n/// \n\ninterface SymbolConstructor {\n /**\n * A method that returns the default iterator for an object. Called by the semantics of the\n * for-of statement.\n */\n readonly iterator: symbol;\n}\n\ninterface IteratorResult {\n done: boolean;\n value: T;\n}\n\ninterface Iterator {\n next(value?: any): IteratorResult;\n return?(value?: any): IteratorResult;\n throw?(e?: any): IteratorResult;\n}\n\ninterface Iterable {\n [Symbol.iterator](): Iterator;\n}\n\ninterface IterableIterator extends Iterator {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Array {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\n\n /**\n * Returns an iterable of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface ArrayConstructor {\n /**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n */\n from(iterable: Iterable | ArrayLike): T[];\n\n /**\n * Creates an array from an iterable object.\n * @param iterable An iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(iterable: Iterable | ArrayLike, mapfn: (v: T, k: number) => U, thisArg?: any): U[];\n}\n\ninterface ReadonlyArray {\n /** Iterator of values in the array. */\n [Symbol.iterator](): IterableIterator;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, T]>;\n\n /**\n * Returns an iterable of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface IArguments {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Map {\n /** Returns an iterable of entries in the map. */\n [Symbol.iterator](): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the map.\n */\n entries(): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of keys in the map\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the map\n */\n values(): IterableIterator;\n}\n\ninterface ReadonlyMap {\n /** Returns an iterable of entries in the map. */\n [Symbol.iterator](): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of key, value pairs for every entry in the map.\n */\n entries(): IterableIterator<[K, V]>;\n\n /**\n * Returns an iterable of keys in the map\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the map\n */\n values(): IterableIterator;\n}\n\ninterface MapConstructor {\n new (iterable: Iterable<[K, V]>): Map;\n}\n\ninterface WeakMap { }\n\ninterface WeakMapConstructor {\n new (iterable: Iterable<[K, V]>): WeakMap;\n}\n\ninterface Set {\n /** Iterates over values in the set. */\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an iterable of [v,v] pairs for every value `v` in the set.\n */\n entries(): IterableIterator<[T, T]>;\n /**\n * Despite its name, returns an iterable of the values in the set,\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the set.\n */\n values(): IterableIterator;\n}\n\ninterface ReadonlySet {\n /** Iterates over values in the set. */\n [Symbol.iterator](): IterableIterator;\n\n /**\n * Returns an iterable of [v,v] pairs for every value `v` in the set.\n */\n entries(): IterableIterator<[T, T]>;\n\n /**\n * Despite its name, returns an iterable of the values in the set,\n */\n keys(): IterableIterator;\n\n /**\n * Returns an iterable of values in the set.\n */\n values(): IterableIterator;\n}\n\ninterface SetConstructor {\n new (iterable: Iterable): Set;\n}\n\ninterface WeakSet { }\n\ninterface WeakSetConstructor {\n new (iterable: Iterable): WeakSet;\n}\n\ninterface Promise { }\n\ninterface PromiseConstructor {\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: Iterable>): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: Iterable>): Promise;\n}\n\ndeclare namespace Reflect {\n function enumerate(target: object): IterableIterator;\n}\n\ninterface String {\n /** Iterator */\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Int8Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Int8ArrayConstructor {\n new (elements: Iterable): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\n}\n\ninterface Uint8Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint8ArrayConstructor {\n new (elements: Iterable): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\n}\n\ninterface Uint8ClampedArray {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint8ClampedArrayConstructor {\n new (elements: Iterable): Uint8ClampedArray;\n\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\n\ninterface Int16Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Int16ArrayConstructor {\n new (elements: Iterable): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\n}\n\ninterface Uint16Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint16ArrayConstructor {\n new (elements: Iterable): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\n}\n\ninterface Int32Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Int32ArrayConstructor {\n new (elements: Iterable): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\n}\n\ninterface Uint32Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Uint32ArrayConstructor {\n new (elements: Iterable): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\n}\n\ninterface Float32Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Float32ArrayConstructor {\n new (elements: Iterable): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\n}\n\ninterface Float64Array {\n [Symbol.iterator](): IterableIterator;\n /**\n * Returns an array of key, value pairs for every entry in the array\n */\n entries(): IterableIterator<[number, number]>;\n /**\n * Returns an list of keys in the array\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the array\n */\n values(): IterableIterator;\n}\n\ninterface Float64ArrayConstructor {\n new (elements: Iterable): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: Iterable, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\n}\n\n\ninterface PromiseConstructor {\n /**\n * A reference to the prototype.\n */\n readonly prototype: Promise;\n\n /**\n * Creates a new Promise.\n * @param executor A callback used to initialize the promise. This callback is passed two arguments:\n * a resolve callback used resolve the promise with a value or the result of another promise,\n * and a reject callback used to reject the promise with a provided reason or error.\n */\n new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike, T6 | PromiseLike]): Promise<[T1, T2, T3, T4, T5, T6]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike , T5 | PromiseLike]): Promise<[T1, T2, T3, T4, T5]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike ]): Promise<[T1, T2, T3, T4]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise<[T1, T2, T3]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise<[T1, T2]>;\n\n /**\n * Creates a Promise that is resolved with an array of results when all of the provided Promises\n * resolve, or rejected when any Promise is rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n all(values: (T | PromiseLike)[]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike, T10 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike, T9 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike, T8 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike, T7 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike, T6 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike, T5 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike, T4 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike, T3 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: [T1 | PromiseLike, T2 | PromiseLike]): Promise;\n\n /**\n * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved\n * or rejected.\n * @param values An array of Promises.\n * @returns A new Promise.\n */\n race(values: (T | PromiseLike)[]): Promise;\n\n /**\n * Creates a new rejected promise for the provided reason.\n * @param reason The reason the promise was rejected.\n * @returns A new rejected Promise.\n */\n reject(reason: any): Promise;\n\n /**\n * Creates a new rejected promise for the provided reason.\n * @param reason The reason the promise was rejected.\n * @returns A new rejected Promise.\n */\n reject(reason: any): Promise;\n\n /**\n * Creates a new resolved promise for the provided value.\n * @param value A promise.\n * @returns A promise whose internal state matches the provided promise.\n */\n resolve(value: T | PromiseLike): Promise;\n\n /**\n * Creates a new resolved promise .\n * @returns A resolved promise.\n */\n resolve(): Promise;\n}\n\ndeclare var Promise: PromiseConstructor;\n\ninterface ProxyHandler {\n getPrototypeOf? (target: T): object | null;\n setPrototypeOf? (target: T, v: any): boolean;\n isExtensible? (target: T): boolean;\n preventExtensions? (target: T): boolean;\n getOwnPropertyDescriptor? (target: T, p: PropertyKey): PropertyDescriptor | undefined;\n has? (target: T, p: PropertyKey): boolean;\n get? (target: T, p: PropertyKey, receiver: any): any;\n set? (target: T, p: PropertyKey, value: any, receiver: any): boolean;\n deleteProperty? (target: T, p: PropertyKey): boolean;\n defineProperty? (target: T, p: PropertyKey, attributes: PropertyDescriptor): boolean;\n enumerate? (target: T): PropertyKey[];\n ownKeys? (target: T): PropertyKey[];\n apply? (target: T, thisArg: any, argArray?: any): any;\n construct? (target: T, argArray: any, newTarget?: any): object;\n}\n\ninterface ProxyConstructor {\n revocable(target: T, handler: ProxyHandler): { proxy: T; revoke: () => void; };\n new (target: T, handler: ProxyHandler): T;\n}\ndeclare var Proxy: ProxyConstructor;\n\n\ndeclare namespace Reflect {\n function apply(target: Function, thisArgument: any, argumentsList: ArrayLike): any;\n function construct(target: Function, argumentsList: ArrayLike, newTarget?: any): any;\n function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;\n function deleteProperty(target: object, propertyKey: PropertyKey): boolean;\n function get(target: object, propertyKey: PropertyKey, receiver?: any): any;\n function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;\n function getPrototypeOf(target: object): object;\n function has(target: object, propertyKey: PropertyKey): boolean;\n function isExtensible(target: object): boolean;\n function ownKeys(target: object): PropertyKey[];\n function preventExtensions(target: object): boolean;\n function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;\n function setPrototypeOf(target: object, proto: any): boolean;\n}\n\n\ninterface Symbol {\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): symbol;\n}\n\ninterface SymbolConstructor {\n /**\n * A reference to the prototype.\n */\n readonly prototype: Symbol;\n\n /**\n * Returns a new unique Symbol value.\n * @param description Description of the new Symbol object.\n */\n (description?: string | number): symbol;\n\n /**\n * Returns a Symbol object from the global symbol registry matching the given key if found.\n * Otherwise, returns a new symbol with this key.\n * @param key key to search for.\n */\n for(key: string): symbol;\n\n /**\n * Returns a key from the global symbol registry matching the given Symbol if found.\n * Otherwise, returns a undefined.\n * @param sym Symbol to find the key for.\n */\n keyFor(sym: symbol): string | undefined;\n}\n\ndeclare var Symbol: SymbolConstructor;\n\n/// \n\ninterface SymbolConstructor {\n /**\n * A method that determines if a constructor object recognizes an object as one of the\n * constructor’s instances. Called by the semantics of the instanceof operator.\n */\n readonly hasInstance: symbol;\n\n /**\n * A Boolean value that if true indicates that an object should flatten to its array elements\n * by Array.prototype.concat.\n */\n readonly isConcatSpreadable: symbol;\n\n /**\n * A regular expression method that matches the regular expression against a string. Called\n * by the String.prototype.match method.\n */\n readonly match: symbol;\n\n /**\n * A regular expression method that replaces matched substrings of a string. Called by the\n * String.prototype.replace method.\n */\n readonly replace: symbol;\n\n /**\n * A regular expression method that returns the index within a string that matches the\n * regular expression. Called by the String.prototype.search method.\n */\n readonly search: symbol;\n\n /**\n * A function valued property that is the constructor function that is used to create\n * derived objects.\n */\n readonly species: symbol;\n\n /**\n * A regular expression method that splits a string at the indices that match the regular\n * expression. Called by the String.prototype.split method.\n */\n readonly split: symbol;\n\n /**\n * A method that converts an object to a corresponding primitive value.\n * Called by the ToPrimitive abstract operation.\n */\n readonly toPrimitive: symbol;\n\n /**\n * A String value that is used in the creation of the default string description of an object.\n * Called by the built-in method Object.prototype.toString.\n */\n readonly toStringTag: symbol;\n\n /**\n * An Object whose own property names are property names that are excluded from the 'with'\n * environment bindings of the associated objects.\n */\n readonly unscopables: symbol;\n}\n\ninterface Symbol {\n readonly [Symbol.toStringTag]: \"Symbol\";\n}\n\ninterface Array {\n /**\n * Returns an object whose properties have the value 'true'\n * when they will be absent when used in a 'with' statement.\n */\n [Symbol.unscopables](): {\n copyWithin: boolean;\n entries: boolean;\n fill: boolean;\n find: boolean;\n findIndex: boolean;\n keys: boolean;\n values: boolean;\n };\n}\n\ninterface Date {\n /**\n * Converts a Date object to a string.\n */\n [Symbol.toPrimitive](hint: \"default\"): string;\n /**\n * Converts a Date object to a string.\n */\n [Symbol.toPrimitive](hint: \"string\"): string;\n /**\n * Converts a Date object to a number.\n */\n [Symbol.toPrimitive](hint: \"number\"): number;\n /**\n * Converts a Date object to a string or number.\n *\n * @param hint The strings \"number\", \"string\", or \"default\" to specify what primitive to return.\n *\n * @throws {TypeError} If 'hint' was given something other than \"number\", \"string\", or \"default\".\n * @returns A number if 'hint' was \"number\", a string if 'hint' was \"string\" or \"default\".\n */\n [Symbol.toPrimitive](hint: string): string | number;\n}\n\ninterface Map {\n readonly [Symbol.toStringTag]: \"Map\";\n}\n\ninterface WeakMap {\n readonly [Symbol.toStringTag]: \"WeakMap\";\n}\n\ninterface Set {\n readonly [Symbol.toStringTag]: \"Set\";\n}\n\ninterface WeakSet {\n readonly [Symbol.toStringTag]: \"WeakSet\";\n}\n\ninterface JSON {\n readonly [Symbol.toStringTag]: \"JSON\";\n}\n\ninterface Function {\n /**\n * Determines whether the given value inherits from this function if this function was used\n * as a constructor function.\n *\n * A constructor function can control which objects are recognized as its instances by\n * 'instanceof' by overriding this method.\n */\n [Symbol.hasInstance](value: any): boolean;\n}\n\ninterface GeneratorFunction {\n readonly [Symbol.toStringTag]: \"GeneratorFunction\";\n}\n\ninterface Math {\n readonly [Symbol.toStringTag]: \"Math\";\n}\n\ninterface Promise {\n readonly [Symbol.toStringTag]: \"Promise\";\n}\n\ninterface PromiseConstructor {\n readonly [Symbol.species]: PromiseConstructor;\n}\n\ninterface RegExp {\n /**\n * Matches a string with this regular expression, and returns an array containing the results of\n * that search.\n * @param string A string to search within.\n */\n [Symbol.match](string: string): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using this regular expression.\n * @param string A String object or string literal whose contents matching against\n * this regular expression will be replaced\n * @param replaceValue A String object or string literal containing the text to replace for every\n * successful match of this regular expression.\n */\n [Symbol.replace](string: string, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using this regular expression.\n * @param string A String object or string literal whose contents matching against\n * this regular expression will be replaced\n * @param replacer A function that returns the replacement text.\n */\n [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the position beginning first substring match in a regular expression search\n * using this regular expression.\n *\n * @param string The string to search within.\n */\n [Symbol.search](string: string): number;\n\n /**\n * Returns an array of substrings that were delimited by strings in the original input that\n * match against this regular expression.\n *\n * If the regular expression contains capturing parentheses, then each time this\n * regular expression matches, the results (including any undefined results) of the\n * capturing parentheses are spliced.\n *\n * @param string string value to split\n * @param limit if not undefined, the output array is truncated so that it contains no more\n * than 'limit' elements.\n */\n [Symbol.split](string: string, limit?: number): string[];\n}\n\ninterface RegExpConstructor {\n readonly [Symbol.species]: RegExpConstructor;\n}\n\ninterface String {\n /**\n * Matches a string an object that supports being matched against, and returns an array containing the results of that search.\n * @param matcher An object that supports being matched against.\n */\n match(matcher: { [Symbol.match](string: string): RegExpMatchArray | null; }): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using an object that supports replacement within a string.\n * @param searchValue A object can search for and replace matches within a string.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: { [Symbol.replace](string: string, replaceValue: string): string; }, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using an object that supports replacement within a string.\n * @param searchValue A object can search for and replace matches within a string.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: { [Symbol.replace](string: string, replacer: (substring: string, ...args: any[]) => string): string; }, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param searcher An object which supports searching within a string.\n */\n search(searcher: { [Symbol.search](string: string): number; }): number;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param splitter An object that can split a string.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(splitter: { [Symbol.split](string: string, limit?: number): string[]; }, limit?: number): string[];\n}\n\ninterface ArrayBuffer {\n readonly [Symbol.toStringTag]: \"ArrayBuffer\";\n}\n\ninterface DataView {\n readonly [Symbol.toStringTag]: \"DataView\";\n}\n\ninterface Int8Array {\n readonly [Symbol.toStringTag]: \"Int8Array\";\n}\n\ninterface Uint8Array {\n readonly [Symbol.toStringTag]: \"UInt8Array\";\n}\n\ninterface Uint8ClampedArray {\n readonly [Symbol.toStringTag]: \"Uint8ClampedArray\";\n}\n\ninterface Int16Array {\n readonly [Symbol.toStringTag]: \"Int16Array\";\n}\n\ninterface Uint16Array {\n readonly [Symbol.toStringTag]: \"Uint16Array\";\n}\n\ninterface Int32Array {\n readonly [Symbol.toStringTag]: \"Int32Array\";\n}\n\ninterface Uint32Array {\n readonly [Symbol.toStringTag]: \"Uint32Array\";\n}\n\ninterface Float32Array {\n readonly [Symbol.toStringTag]: \"Float32Array\";\n}\n\ninterface Float64Array {\n readonly [Symbol.toStringTag]: \"Float64Array\";\n}\n\ninterface ArrayConstructor {\n readonly [Symbol.species]: ArrayConstructor;\n}\ninterface MapConstructor {\n readonly [Symbol.species]: MapConstructor;\n}\ninterface SetConstructor {\n readonly [Symbol.species]: SetConstructor;\n}\ninterface ArrayBufferConstructor {\n readonly [Symbol.species]: ArrayBufferConstructor;\n}\n\n/////////////////////////////\n/// DOM APIs\n/////////////////////////////\n\ninterface Account {\n displayName: string;\n id: string;\n imageURL?: string;\n name?: string;\n rpDisplayName: string;\n}\n\ninterface AddEventListenerOptions extends EventListenerOptions {\n once?: boolean;\n passive?: boolean;\n}\n\ninterface AesCbcParams extends Algorithm {\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface AesCtrParams extends Algorithm {\n counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n length: number;\n}\n\ninterface AesDerivedKeyParams extends Algorithm {\n length: number;\n}\n\ninterface AesGcmParams extends Algorithm {\n additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n tagLength?: number;\n}\n\ninterface AesKeyAlgorithm extends KeyAlgorithm {\n length: number;\n}\n\ninterface AesKeyGenParams extends Algorithm {\n length: number;\n}\n\ninterface Algorithm {\n name: string;\n}\n\ninterface AnalyserOptions extends AudioNodeOptions {\n fftSize?: number;\n maxDecibels?: number;\n minDecibels?: number;\n smoothingTimeConstant?: number;\n}\n\ninterface AnimationEventInit extends EventInit {\n animationName?: string;\n elapsedTime?: number;\n}\n\ninterface AssertionOptions {\n allowList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: string;\n timeoutSeconds?: number;\n}\n\ninterface AudioBufferOptions {\n length: number;\n numberOfChannels?: number;\n sampleRate: number;\n}\n\ninterface AudioBufferSourceOptions {\n buffer?: AudioBuffer | null;\n detune?: number;\n loop?: boolean;\n loopEnd?: number;\n loopStart?: number;\n playbackRate?: number;\n}\n\ninterface AudioContextInfo {\n currentTime?: number;\n sampleRate?: number;\n}\n\ninterface AudioContextOptions {\n latencyHint?: AudioContextLatencyCategory | number;\n sampleRate?: number;\n}\n\ninterface AudioNodeOptions {\n channelCount?: number;\n channelCountMode?: ChannelCountMode;\n channelInterpretation?: ChannelInterpretation;\n}\n\ninterface AudioParamDescriptor {\n defaultValue?: number;\n maxValue?: number;\n minValue?: number;\n name?: string;\n}\n\ninterface AudioProcessingEventInit extends EventInit {\n inputBuffer: AudioBuffer;\n outputBuffer: AudioBuffer;\n playbackTime: number;\n}\n\ninterface AudioTimestamp {\n contextTime?: number;\n performanceTime?: number;\n}\n\ninterface BiquadFilterOptions extends AudioNodeOptions {\n Q?: number;\n detune?: number;\n frequency?: number;\n gain?: number;\n type?: BiquadFilterType;\n}\n\ninterface ByteLengthChunk {\n byteLength?: number;\n}\n\ninterface CacheQueryOptions {\n cacheName?: string;\n ignoreMethod?: boolean;\n ignoreSearch?: boolean;\n ignoreVary?: boolean;\n}\n\ninterface ChannelMergerOptions extends AudioNodeOptions {\n numberOfInputs?: number;\n}\n\ninterface ChannelSplitterOptions extends AudioNodeOptions {\n numberOfOutputs?: number;\n}\n\ninterface ClientData {\n challenge: string;\n extensions?: WebAuthnExtensions;\n hashAlg: string | Algorithm;\n origin: string;\n rpId: string;\n tokenBinding?: string;\n}\n\ninterface ClientQueryOptions {\n includeReserved?: boolean;\n includeUncontrolled?: boolean;\n type?: ClientTypes;\n}\n\ninterface CloseEventInit extends EventInit {\n code?: number;\n reason?: string;\n wasClean?: boolean;\n}\n\ninterface CompositionEventInit extends UIEventInit {\n data?: string;\n}\n\ninterface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface ConstantSourceOptions {\n offset?: number;\n}\n\ninterface ConstrainBooleanParameters {\n exact?: boolean;\n ideal?: boolean;\n}\n\ninterface ConstrainDOMStringParameters {\n exact?: string | string[];\n ideal?: string | string[];\n}\n\ninterface ConstrainDoubleRange extends DoubleRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainLongRange extends LongRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainVideoFacingModeParameters {\n exact?: VideoFacingModeEnum | VideoFacingModeEnum[];\n ideal?: VideoFacingModeEnum | VideoFacingModeEnum[];\n}\n\ninterface ConvolverOptions extends AudioNodeOptions {\n buffer?: AudioBuffer | null;\n disableNormalization?: boolean;\n}\n\ninterface CustomEventInit extends EventInit {\n detail?: T;\n}\n\ninterface DOMRectInit {\n height?: number;\n width?: number;\n x?: number;\n y?: number;\n}\n\ninterface DelayOptions extends AudioNodeOptions {\n delayTime?: number;\n maxDelayTime?: number;\n}\n\ninterface DeviceAccelerationDict {\n x?: number | null;\n y?: number | null;\n z?: number | null;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceMotionEventInit extends EventInit {\n acceleration?: DeviceAccelerationDict | null;\n accelerationIncludingGravity?: DeviceAccelerationDict | null;\n interval?: number | null;\n rotationRate?: DeviceRotationRateDict | null;\n}\n\ninterface DeviceOrientationEventInit extends EventInit {\n absolute?: boolean;\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface DynamicsCompressorOptions extends AudioNodeOptions {\n attack?: number;\n knee?: number;\n ratio?: number;\n release?: number;\n threshold?: number;\n}\n\ninterface EcKeyAlgorithm extends KeyAlgorithm {\n namedCurve: string;\n}\n\ninterface EcKeyGenParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcKeyImportParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcdhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface EcdsaParams extends Algorithm {\n hash: string | Algorithm;\n}\n\ninterface ErrorEventInit extends EventInit {\n colno?: number;\n error?: any;\n filename?: string;\n lineno?: number;\n message?: string;\n}\n\ninterface EventInit {\n bubbles?: boolean;\n cancelable?: boolean;\n scoped?: boolean;\n}\n\ninterface EventListenerOptions {\n capture?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n altKey?: boolean;\n ctrlKey?: boolean;\n metaKey?: boolean;\n modifierAltGraph?: boolean;\n modifierCapsLock?: boolean;\n modifierFn?: boolean;\n modifierFnLock?: boolean;\n modifierHyper?: boolean;\n modifierNumLock?: boolean;\n modifierOS?: boolean;\n modifierScrollLock?: boolean;\n modifierSuper?: boolean;\n modifierSymbol?: boolean;\n modifierSymbolLock?: boolean;\n shiftKey?: boolean;\n}\n\ninterface ExceptionInformation {\n domain?: string | null;\n}\n\ninterface ExtendableEventInit extends EventInit {\n}\n\ninterface ExtendableMessageEventInit extends ExtendableEventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[] | null;\n source?: object | ServiceWorker | MessagePort | null;\n}\n\ninterface FetchEventInit extends ExtendableEventInit {\n clientId?: string;\n request: Request;\n reservedClientId?: string;\n targetClientId?: string;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget | null;\n}\n\ninterface FocusNavigationEventInit extends EventInit {\n navigationReason?: string | null;\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface FocusNavigationOrigin {\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface GainOptions extends AudioNodeOptions {\n gain?: number;\n}\n\ninterface GamepadEventInit extends EventInit {\n gamepad?: Gamepad;\n}\n\ninterface GetNotificationOptions {\n tag?: string;\n}\n\ninterface HashChangeEventInit extends EventInit {\n newURL?: string;\n oldURL?: string;\n}\n\ninterface HkdfParams extends Algorithm {\n hash: string | Algorithm;\n info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface HmacImportParams extends Algorithm {\n hash: string | Algorithm;\n length?: number;\n}\n\ninterface HmacKeyAlgorithm extends KeyAlgorithm {\n hash: KeyAlgorithm;\n length: number;\n}\n\ninterface HmacKeyGenParams extends Algorithm {\n hash: string | Algorithm;\n length?: number;\n}\n\ninterface IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: string | string[];\n}\n\ninterface IIRFilterOptions extends AudioNodeOptions {\n feedback: number[];\n feedforward: number[];\n}\n\ninterface IntersectionObserverEntryInit {\n boundingClientRect: DOMRectInit;\n intersectionRect: DOMRectInit;\n isIntersecting: boolean;\n rootBounds: DOMRectInit;\n target: Element;\n time: number;\n}\n\ninterface IntersectionObserverInit {\n root?: Element | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface JsonWebKey {\n alg?: string;\n crv?: string;\n d?: string;\n dp?: string;\n dq?: string;\n e?: string;\n ext?: boolean;\n k?: string;\n key_ops?: string[];\n kty?: string;\n n?: string;\n oth?: RsaOtherPrimesInfo[];\n p?: string;\n q?: string;\n qi?: string;\n use?: string;\n x?: string;\n y?: string;\n}\n\ninterface KeyAlgorithm {\n name: string;\n}\n\ninterface KeyboardEventInit extends EventModifierInit {\n code?: string;\n key?: string;\n location?: number;\n repeat?: boolean;\n}\n\ninterface LongRange {\n max?: number;\n min?: number;\n}\n\ninterface MSAccountInfo {\n accountImageUri?: string;\n accountName?: string;\n rpDisplayName: string;\n userDisplayName: string;\n userId?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n cpuInsufficientEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceHowlingEventCount?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n networkDelayEventRatio?: number;\n networkSendQualityEventRatio?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n burstLossLength1?: number;\n burstLossLength2?: number;\n burstLossLength3?: number;\n burstLossLength4?: number;\n burstLossLength5?: number;\n burstLossLength6?: number;\n burstLossLength7?: number;\n burstLossLength8OrHigher?: number;\n fecRecvDistance1?: number;\n fecRecvDistance2?: number;\n fecRecvDistance3?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\n packetReorderRatio?: number;\n ratioCompressedSamplesAvg?: number;\n ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvNoiseLevelCh1?: number;\n recvSignalLevelCh1?: number;\n renderLoopbackSignalLevel?: number;\n renderNoiseLevel?: number;\n renderSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n audioFECUsed?: boolean;\n samplingRate?: number;\n sendMutePercent?: number;\n signal?: MSAudioSendSignal;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendNoiseLevelCh1?: number;\n sendSignalLevelCh1?: number;\n}\n\ninterface MSConnectivity {\n iceType?: MSIceType;\n iceWarningFlags?: MSIceWarningFlags;\n relayAddress?: MSRelayAddress;\n}\n\ninterface MSCredentialFilter {\n accept?: MSCredentialSpec[];\n}\n\ninterface MSCredentialParameters {\n type?: MSCredentialType;\n}\n\ninterface MSCredentialSpec {\n id?: string;\n type: MSCredentialType;\n}\n\ninterface MSDCCEventInit extends EventInit {\n maxFr?: number;\n maxFs?: number;\n}\n\ninterface MSDSHEventInit extends EventInit {\n sources?: number[];\n timestamp?: number;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n deviceDevName?: string;\n localAddr?: MSIPAddressInfo;\n networkconnectivity?: MSNetworkConnectivityInfo;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n transport?: RTCIceProtocol;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: string[];\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n manufacturerMacAddrMask?: string;\n port?: number;\n}\n\ninterface MSIceWarningFlags {\n allocationMessageIntegrityFailed?: boolean;\n alternateServerReceived?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n fipsAllocationFailure?: boolean;\n multipleRelayServersAttempted?: boolean;\n noRelayServersConfigured?: boolean;\n portRangeExhausted?: boolean;\n pseudoTLSFailure?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n turnTcpTimedOut?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkBandwidthLowEventRatio?: number;\n networkReceiveQualityEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n delay?: MSDelay;\n jitter?: MSJitter;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n linkspeed?: number;\n networkConnectionDetails?: string;\n vpn?: boolean;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: boolean;\n interfaceTypeWWAN?: boolean;\n interfaceTypeWireless?: boolean;\n}\n\ninterface MSOutboundNetwork extends MSNetwork {\n appliedBandwidthLimit?: number;\n}\n\ninterface MSPacketLoss {\n lossRate?: number;\n lossRateMax?: number;\n}\n\ninterface MSPayloadBase extends RTCStats {\n payloadDescription?: string;\n}\n\ninterface MSPortRange {\n max?: number;\n min?: number;\n}\n\ninterface MSRelayAddress {\n port?: number;\n relayAddress?: string;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n allocationTimeInMs?: number;\n baseAddress?: string;\n baseInterface?: MSNetworkInterfaceType;\n iceRole?: RTCIceRole;\n iceWarningFlags?: MSIceWarningFlags;\n interfaces?: MSNetworkInterfaceType;\n localAddrType?: MSIceAddrType;\n localAddress?: string;\n localInterface?: MSNetworkInterfaceType;\n localMR?: string;\n localMRTCPPort?: number;\n localSite?: string;\n msRtcEngineVersion?: string;\n networkName?: string;\n numConsentReqReceived?: number;\n numConsentReqSent?: number;\n numConsentRespReceived?: number;\n numConsentRespSent?: number;\n portRangeMax?: number;\n portRangeMin?: number;\n protocol?: RTCIceProtocol;\n remoteAddrType?: MSIceAddrType;\n remoteAddress?: string;\n remoteMR?: string;\n remoteMRTCPPort?: number;\n remoteSite?: string;\n rtpRtcpMux?: boolean;\n stunVer?: number;\n}\n\ninterface MSUtilization {\n bandwidthEstimation?: number;\n bandwidthEstimationAvg?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationStdDev?: number;\n packets?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n durationSeconds?: number;\n resolution?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n recvBitRateAverage?: number;\n recvBitRateMaximum?: number;\n recvCodecType?: string;\n recvFpsHarmonicAverage?: number;\n recvFrameRateAverage?: number;\n recvNumResSwitches?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvReorderBufferReorderedPackets?: number;\n recvResolutionHeight?: number;\n recvResolutionWidth?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n reorderBufferTotalPackets?: number;\n videoFrameLossRate?: number;\n videoPostFECPLR?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n h720Quality?: number;\n vgaQuality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendBitRateAverage?: number;\n sendBitRateMaximum?: number;\n sendFrameRateAverage?: number;\n sendResolutionHeight?: number;\n sendResolutionWidth?: number;\n sendVideoStreamsMax?: number;\n}\n\ninterface MediaElementAudioSourceOptions {\n mediaElement: HTMLMediaElement;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initData?: ArrayBuffer | null;\n initDataType?: string;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n message?: ArrayBuffer | null;\n messageType?: MediaKeyMessageType;\n}\n\ninterface MediaKeySystemConfiguration {\n audioCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: MediaKeysRequirement;\n initDataTypes?: string[];\n persistentState?: MediaKeysRequirement;\n videoCapabilities?: MediaKeySystemMediaCapability[];\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n audio?: boolean | MediaTrackConstraints;\n video?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError | null;\n}\n\ninterface MediaStreamEventInit extends EventInit {\n stream?: MediaStream;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack | null;\n}\n\ninterface MediaTrackCapabilities {\n aspectRatio?: number | DoubleRange;\n deviceId?: string;\n echoCancellation?: boolean[];\n facingMode?: string;\n frameRate?: number | DoubleRange;\n groupId?: string;\n height?: number | LongRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n volume?: number | DoubleRange;\n width?: number | LongRange;\n}\n\ninterface MediaTrackConstraintSet {\n aspectRatio?: number | ConstrainDoubleRange;\n channelCount?: number | ConstrainLongRange;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n displaySurface?: string | string[] | ConstrainDOMStringParameters;\n echoCancellation?: boolean | ConstrainBooleanParameters;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n frameRate?: number | ConstrainDoubleRange;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n height?: number | ConstrainLongRange;\n latency?: number | ConstrainDoubleRange;\n logicalSurface?: boolean | ConstrainBooleanParameters;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n volume?: number | ConstrainDoubleRange;\n width?: number | ConstrainLongRange;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackSettings {\n aspectRatio?: number;\n deviceId?: string;\n echoCancellation?: boolean;\n facingMode?: string;\n frameRate?: number;\n groupId?: string;\n height?: number;\n sampleRate?: number;\n sampleSize?: number;\n volume?: number;\n width?: number;\n}\n\ninterface MediaTrackSupportedConstraints {\n aspectRatio?: boolean;\n deviceId?: boolean;\n echoCancellation?: boolean;\n facingMode?: boolean;\n frameRate?: boolean;\n groupId?: boolean;\n height?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n volume?: boolean;\n width?: boolean;\n}\n\ninterface MessageEventInit extends EventInit {\n channel?: string;\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[];\n source?: Window | null;\n}\n\ninterface MouseEventInit extends EventModifierInit {\n button?: number;\n buttons?: number;\n clientX?: number;\n clientY?: number;\n relatedTarget?: EventTarget | null;\n screenX?: number;\n screenY?: number;\n}\n\ninterface MsZoomToOptions {\n animate?: string;\n contentX?: number;\n contentY?: number;\n scaleFactor?: number;\n viewportX?: string | null;\n viewportY?: string | null;\n}\n\ninterface MutationObserverInit {\n attributeFilter?: string[];\n attributeOldValue?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n characterDataOldValue?: boolean;\n childList?: boolean;\n subtree?: boolean;\n}\n\ninterface NotificationEventInit extends ExtendableEventInit {\n action?: string;\n notification: Notification;\n}\n\ninterface NotificationOptions {\n body?: string;\n data?: any;\n dir?: NotificationDirection;\n icon?: string;\n lang?: string;\n tag?: string;\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface OfflineAudioCompletionEventInit extends EventInit {\n renderedBuffer: AudioBuffer;\n}\n\ninterface OscillatorOptions extends AudioNodeOptions {\n detune?: number;\n frequency?: number;\n periodicWave?: PeriodicWave;\n type?: OscillatorType;\n}\n\ninterface PannerOptions extends AudioNodeOptions {\n coneInnerAngle?: number;\n coneOuterAngle?: number;\n coneOuterGain?: number;\n distanceModel?: DistanceModelType;\n maxDistance?: number;\n orientationX?: number;\n orientationY?: number;\n orientationZ?: number;\n panningModel?: PanningModelType;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n refDistance?: number;\n rolloffFactor?: number;\n}\n\ninterface PaymentCurrencyAmount {\n currency: string;\n currencySystem?: string;\n value: string;\n}\n\ninterface PaymentDetailsBase {\n displayItems?: PaymentItem[];\n modifiers?: PaymentDetailsModifier[];\n shippingOptions?: PaymentShippingOption[];\n}\n\ninterface PaymentDetailsInit extends PaymentDetailsBase {\n id?: string;\n total: PaymentItem;\n}\n\ninterface PaymentDetailsModifier {\n additionalDisplayItems?: PaymentItem[];\n data?: any;\n supportedMethods: string | string[];\n total?: PaymentItem;\n}\n\ninterface PaymentDetailsUpdate extends PaymentDetailsBase {\n error?: string;\n total?: PaymentItem;\n}\n\ninterface PaymentItem {\n amount: PaymentCurrencyAmount;\n label: string;\n pending?: boolean;\n}\n\ninterface PaymentMethodData {\n data?: any;\n supportedMethods: string | string[];\n}\n\ninterface PaymentOptions {\n requestPayerEmail?: boolean;\n requestPayerName?: boolean;\n requestPayerPhone?: boolean;\n requestShipping?: boolean;\n shippingType?: string;\n}\n\ninterface PaymentRequestUpdateEventInit extends EventInit {\n}\n\ninterface PaymentShippingOption {\n amount: PaymentCurrencyAmount;\n id: string;\n label: string;\n selected?: boolean;\n}\n\ninterface Pbkdf2Params extends Algorithm {\n hash: string | Algorithm;\n iterations: number;\n salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PeriodicWaveOptions extends PeriodicWaveConstraints {\n imag?: number[];\n real?: number[];\n}\n\ninterface PointerEventInit extends MouseEventInit {\n height?: number;\n isPrimary?: boolean;\n pointerId?: number;\n pointerType?: string;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n width?: number;\n}\n\ninterface PopStateEventInit extends EventInit {\n state?: any;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n maximumAge?: number;\n timeout?: number;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface PushEventInit extends ExtendableEventInit {\n data?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | string | null;\n}\n\ninterface PushSubscriptionChangeInit extends ExtendableEventInit {\n newSubscription?: PushSubscription;\n oldSubscription?: PushSubscription;\n}\n\ninterface PushSubscriptionOptionsInit {\n applicationServerKey?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | string | null;\n userVisibleOnly?: boolean;\n}\n\ninterface QueuingStrategy {\n highWaterMark?: number;\n size?: WritableStreamChunkCallback;\n}\n\ninterface RTCConfiguration {\n bundlePolicy?: RTCBundlePolicy;\n iceServers?: RTCIceServer[];\n iceTransportPolicy?: RTCIceTransportPolicy;\n peerIdentity?: string;\n}\n\ninterface RTCDTMFToneChangeEventInit extends EventInit {\n tone?: string;\n}\n\ninterface RTCDtlsFingerprint {\n algorithm?: string;\n value?: string;\n}\n\ninterface RTCDtlsParameters {\n fingerprints?: RTCDtlsFingerprint[];\n role?: RTCDtlsRole;\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n addressSourceUrl?: string;\n candidateType?: RTCStatsIceCandidateType;\n ipAddress?: string;\n portNumber?: number;\n priority?: number;\n transport?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidateDictionary {\n foundation?: string;\n ip?: string;\n msMTurnSessionId?: string;\n port?: number;\n priority?: number;\n protocol?: RTCIceProtocol;\n relatedAddress?: string;\n relatedPort?: number;\n tcpType?: RTCIceTcpCandidateType;\n type?: RTCIceCandidateType;\n}\n\ninterface RTCIceCandidateInit {\n candidate?: string;\n sdpMLineIndex?: number;\n sdpMid?: string;\n}\n\ninterface RTCIceCandidatePair {\n local?: RTCIceCandidateDictionary;\n remote?: RTCIceCandidateDictionary;\n}\n\ninterface RTCIceCandidatePairStats extends RTCStats {\n availableIncomingBitrate?: number;\n availableOutgoingBitrate?: number;\n bytesReceived?: number;\n bytesSent?: number;\n localCandidateId?: string;\n nominated?: boolean;\n priority?: number;\n readable?: boolean;\n remoteCandidateId?: string;\n roundTripTime?: number;\n state?: RTCStatsIceCandidatePairState;\n transportId?: string;\n writable?: boolean;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: RTCIceGatherPolicy;\n iceservers?: RTCIceServer[];\n portRange?: MSPortRange;\n}\n\ninterface RTCIceParameters {\n iceLite?: boolean | null;\n password?: string;\n usernameFragment?: string;\n}\n\ninterface RTCIceServer {\n credential?: string | null;\n urls?: any;\n username?: string | null;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n bytesReceived?: number;\n fractionLost?: number;\n jitter?: number;\n packetsLost?: number;\n packetsReceived?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n frameHeight?: number;\n frameWidth?: number;\n framesCorrupted?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesPerSecond?: number;\n framesReceived?: number;\n framesSent?: number;\n remoteSource?: boolean;\n ssrcIds?: string[];\n trackIdentifier?: string;\n}\n\ninterface RTCOfferOptions {\n iceRestart?: boolean;\n offerToReceiveAudio?: number;\n offerToReceiveVideo?: number;\n voiceActivityDetection?: boolean;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n bytesSent?: number;\n packetsSent?: number;\n roundTripTime?: number;\n targetBitrate?: number;\n}\n\ninterface RTCPeerConnectionIceEventInit extends EventInit {\n candidate?: RTCIceCandidate;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n associateStatsId?: string;\n codecId?: string;\n firCount?: number;\n isRemote?: boolean;\n mediaTrackId?: string;\n mediaType?: string;\n nackCount?: number;\n pliCount?: number;\n sliCount?: number;\n ssrc?: string;\n transportId?: string;\n}\n\ninterface RTCRtcpFeedback {\n parameter?: string;\n type?: string;\n}\n\ninterface RTCRtcpParameters {\n cname?: string;\n mux?: boolean;\n reducedSize?: boolean;\n ssrc?: number;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n fecMechanisms?: string[];\n headerExtensions?: RTCRtpHeaderExtension[];\n}\n\ninterface RTCRtpCodecCapability {\n clockRate?: number;\n kind?: string;\n maxSpatialLayers?: number;\n maxTemporalLayers?: number;\n maxptime?: number;\n name?: string;\n numChannels?: number;\n options?: any;\n parameters?: any;\n preferredPayloadType?: number;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n clockRate?: number;\n maxptime?: number;\n name?: string;\n numChannels?: number;\n parameters?: any;\n payloadType?: number;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n}\n\ninterface RTCRtpContributingSource {\n audioLevel?: number;\n csrc?: number;\n timestamp?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n active?: boolean;\n codecPayloadType?: number;\n dependencyEncodingIds?: string[];\n encodingId?: string;\n fec?: RTCRtpFecParameters;\n framerateScale?: number;\n maxBitrate?: number;\n maxFramerate?: number;\n minQuality?: number;\n priority?: number;\n resolutionScale?: number;\n rtx?: RTCRtpRtxParameters;\n ssrc?: number;\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n mechanism?: string;\n ssrc?: number;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n preferredEncrypt?: boolean;\n preferredId?: number;\n uri?: string;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n encrypt?: boolean;\n id?: number;\n uri?: string;\n}\n\ninterface RTCRtpParameters {\n codecs?: RTCRtpCodecParameters[];\n degradationPreference?: RTCDegradationPreference;\n encodings?: RTCRtpEncodingParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n muxId?: string;\n rtcp?: RTCRtcpParameters;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRtpUnhandled {\n muxId?: string;\n payloadType?: number;\n ssrc?: number;\n}\n\ninterface RTCSessionDescriptionInit {\n sdp?: string;\n type?: RTCSdpType;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiLength?: number;\n mkiValue?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n tag?: number;\n}\n\ninterface RTCSsrcRange {\n max?: number;\n min?: number;\n}\n\ninterface RTCStats {\n id?: string;\n msType?: MSStatsType;\n timestamp?: number;\n type?: RTCStatsType;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n activeConnection?: boolean;\n bytesReceived?: number;\n bytesSent?: number;\n localCertificateId?: string;\n remoteCertificateId?: string;\n rtcpTransportStatsId?: string;\n selectedCandidatePairId?: string;\n}\n\ninterface RegistrationOptions {\n scope?: string;\n}\n\ninterface RequestInit {\n body?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null;\n cache?: RequestCache;\n credentials?: RequestCredentials;\n headers?: HeadersInit;\n integrity?: string;\n keepalive?: boolean;\n method?: string;\n mode?: RequestMode;\n redirect?: RequestRedirect;\n referrer?: string;\n referrerPolicy?: ReferrerPolicy;\n signal?: AbortSignal;\n window?: any;\n}\n\ninterface ResponseInit {\n headers?: HeadersInit;\n status?: number;\n statusText?: string;\n}\n\ninterface RsaHashedImportParams extends Algorithm {\n hash: string | Algorithm;\n}\n\ninterface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {\n hash: KeyAlgorithm;\n}\n\ninterface RsaHashedKeyGenParams extends RsaKeyGenParams {\n hash: string | Algorithm;\n}\n\ninterface RsaKeyAlgorithm extends KeyAlgorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaKeyGenParams extends Algorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaOaepParams extends Algorithm {\n label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface RsaOtherPrimesInfo {\n d?: string;\n r?: string;\n t?: string;\n}\n\ninterface RsaPssParams extends Algorithm {\n saltLength: number;\n}\n\ninterface ScopedCredentialDescriptor {\n id: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n transports?: Transport[];\n type: ScopedCredentialType;\n}\n\ninterface ScopedCredentialOptions {\n excludeList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: string;\n timeoutSeconds?: number;\n}\n\ninterface ScopedCredentialParameters {\n algorithm: string | Algorithm;\n type: ScopedCredentialType;\n}\n\ninterface SecurityPolicyViolationEventInit extends EventInit {\n blockedURI?: string;\n columnNumber?: number;\n documentURI?: string;\n effectiveDirective?: string;\n lineNumber?: number;\n originalPolicy?: string;\n referrer?: string;\n sourceFile?: string;\n statusCode?: number;\n violatedDirective?: string;\n}\n\ninterface ServiceWorkerMessageEventInit extends EventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[] | null;\n source?: ServiceWorker | MessagePort | null;\n}\n\ninterface SpeechSynthesisEventInit extends EventInit {\n charIndex?: number;\n charLength?: number;\n elapsedTime?: number;\n name?: string;\n utterance?: SpeechSynthesisUtterance | null;\n}\n\ninterface StereoPannerOptions extends AudioNodeOptions {\n pan?: number;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n detailURI?: string | null;\n explanationString?: string | null;\n siteName?: string | null;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface SyncEventInit extends ExtendableEventInit {\n lastChance?: boolean;\n tag: string;\n}\n\ninterface TextDecodeOptions {\n stream?: boolean;\n}\n\ninterface TextDecoderOptions {\n fatal?: boolean;\n ignoreBOM?: boolean;\n}\n\ninterface TrackEventInit extends EventInit {\n track?: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ninterface TransitionEventInit extends EventInit {\n elapsedTime?: number;\n propertyName?: string;\n}\n\ninterface UIEventInit extends EventInit {\n detail?: number;\n view?: Window | null;\n}\n\ninterface UnderlyingSink {\n abort?: WritableStreamErrorCallback;\n close?: WritableStreamDefaultControllerCallback;\n start: WritableStreamDefaultControllerCallback;\n write?: WritableStreamChunkCallback;\n}\n\ninterface VRDisplayEventInit extends EventInit {\n display: VRDisplay;\n reason?: VRDisplayEventReason;\n}\n\ninterface VRLayer {\n leftBounds?: number[] | null;\n rightBounds?: number[] | null;\n source?: HTMLCanvasElement | null;\n}\n\ninterface VRStageParameters {\n sittingToStandingTransform?: Float32Array;\n sizeX?: number;\n sizeY?: number;\n}\n\ninterface WaveShaperOptions extends AudioNodeOptions {\n curve?: number[];\n oversample?: OverSampleType;\n}\n\ninterface WebAuthnExtensions {\n}\n\ninterface WebGLContextAttributes {\n alpha?: boolean;\n antialias?: boolean;\n depth?: boolean;\n failIfMajorPerformanceCaveat?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n stencil?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaMode?: number;\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n}\n\ninterface EventListener {\n (evt: Event): void;\n}\n\ntype WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; };\n\ntype WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; };\n\ntype WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; };\n\ninterface ANGLE_instanced_arrays {\n drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;\n drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;\n vertexAttribDivisorANGLE(index: number, divisor: number): void;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n}\n\ndeclare var ANGLE_instanced_arrays: {\n prototype: ANGLE_instanced_arrays;\n new(): ANGLE_instanced_arrays;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n};\n\ninterface AbortController {\n readonly signal: AbortSignal;\n abort(): void;\n}\n\ndeclare var AbortController: {\n prototype: AbortController;\n new(): AbortController;\n};\n\ninterface AbortSignalEventMap {\n \"abort\": ProgressEvent;\n}\n\ninterface AbortSignal extends EventTarget {\n readonly aborted: boolean;\n onabort: ((this: AbortSignal, ev: ProgressEvent) => any) | null;\n addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AbortSignal: {\n prototype: AbortSignal;\n new(): AbortSignal;\n};\n\ninterface AbstractWorkerEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface AbstractWorker {\n onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;\n addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface AesCfbParams extends Algorithm {\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface AesCmacParams extends Algorithm {\n length: number;\n}\n\ninterface AnalyserNode extends AudioNode {\n fftSize: number;\n readonly frequencyBinCount: number;\n maxDecibels: number;\n minDecibels: number;\n smoothingTimeConstant: number;\n getByteFrequencyData(array: Uint8Array): void;\n getByteTimeDomainData(array: Uint8Array): void;\n getFloatFrequencyData(array: Float32Array): void;\n getFloatTimeDomainData(array: Float32Array): void;\n}\n\ndeclare var AnalyserNode: {\n prototype: AnalyserNode;\n new(): AnalyserNode;\n};\n\ninterface Animation {\n currentTime: number | null;\n effect: AnimationEffectReadOnly;\n readonly finished: Promise;\n id: string;\n readonly pending: boolean;\n readonly playState: \"idle\" | \"running\" | \"paused\" | \"finished\";\n playbackRate: number;\n readonly ready: Promise;\n startTime: number;\n timeline: AnimationTimeline;\n cancel(): void;\n finish(): void;\n oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any;\n onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any;\n pause(): void;\n play(): void;\n reverse(): void;\n}\n\ndeclare var Animation: {\n prototype: Animation;\n new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation;\n};\n\ninterface AnimationEffectReadOnly {\n readonly timing: number;\n getComputedTiming(): ComputedTimingProperties;\n}\n\ninterface AnimationEvent extends Event {\n readonly animationName: string;\n readonly elapsedTime: number;\n}\n\ndeclare var AnimationEvent: {\n prototype: AnimationEvent;\n new(typeArg: string, eventInitDict?: AnimationEventInit): AnimationEvent;\n};\n\ninterface AnimationKeyFrame {\n easing?: string | string[];\n offset?: number | null | (number | null)[];\n [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined;\n}\n\ninterface AnimationOptions {\n delay?: number;\n direction?: \"normal\" | \"reverse\" | \"alternate\" | \"alternate-reverse\";\n duration?: number;\n easing?: string;\n endDelay?: number;\n fill?: \"none\" | \"forwards\" | \"backwards\" | \"both\"| \"auto\";\n id?: string;\n iterationStart?: number;\n iterations?: number;\n}\n\ninterface AnimationPlaybackEvent extends Event {\n readonly currentTime: number | null;\n readonly timelineTime: number | null;\n}\n\ndeclare var AnimationPlaybackEvent: {\n prototype: AnimationPlaybackEvent;\n new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent;\n};\n\ninterface AnimationPlaybackEventInit extends EventInit {\n currentTime?: number | null;\n timelineTime?: number | null;\n}\n\ninterface AnimationTimeline {\n readonly currentTime: number | null;\n}\n\ninterface ApplicationCacheEventMap {\n \"cached\": Event;\n \"checking\": Event;\n \"downloading\": Event;\n \"error\": Event;\n \"noupdate\": Event;\n \"obsolete\": Event;\n \"progress\": ProgressEvent;\n \"updateready\": Event;\n}\n\ninterface ApplicationCache extends EventTarget {\n oncached: ((this: ApplicationCache, ev: Event) => any) | null;\n onchecking: ((this: ApplicationCache, ev: Event) => any) | null;\n ondownloading: ((this: ApplicationCache, ev: Event) => any) | null;\n onerror: ((this: ApplicationCache, ev: Event) => any) | null;\n onnoupdate: ((this: ApplicationCache, ev: Event) => any) | null;\n onobsolete: ((this: ApplicationCache, ev: Event) => any) | null;\n onprogress: ((this: ApplicationCache, ev: ProgressEvent) => any) | null;\n onupdateready: ((this: ApplicationCache, ev: Event) => any) | null;\n readonly status: number;\n abort(): void;\n swapCache(): void;\n update(): void;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ApplicationCache: {\n prototype: ApplicationCache;\n new(): ApplicationCache;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n};\n\ninterface AssignedNodesOptions {\n flatten?: boolean;\n}\n\ninterface Attr extends Node {\n readonly name: string;\n readonly ownerElement: Element | null;\n readonly prefix: string | null;\n readonly specified: boolean;\n value: string;\n}\n\ndeclare var Attr: {\n prototype: Attr;\n new(): Attr;\n};\n\ninterface AudioBuffer {\n readonly duration: number;\n readonly length: number;\n readonly numberOfChannels: number;\n readonly sampleRate: number;\n copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;\n copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;\n getChannelData(channel: number): Float32Array;\n}\n\ndeclare var AudioBuffer: {\n prototype: AudioBuffer;\n new(): AudioBuffer;\n};\n\ninterface AudioBufferSourceNodeEventMap {\n \"ended\": Event;\n}\n\ninterface AudioBufferSourceNode extends AudioNode {\n buffer: AudioBuffer | null;\n readonly detune: AudioParam;\n loop: boolean;\n loopEnd: number;\n loopStart: number;\n onended: ((this: AudioBufferSourceNode, ev: Event) => any) | null;\n readonly playbackRate: AudioParam;\n start(when?: number, offset?: number, duration?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioBufferSourceNode: {\n prototype: AudioBufferSourceNode;\n new(): AudioBufferSourceNode;\n};\n\ninterface AudioContextEventMap {\n \"statechange\": Event;\n}\n\ninterface AudioContextBase extends EventTarget {\n readonly currentTime: number;\n readonly destination: AudioDestinationNode;\n readonly listener: AudioListener;\n onstatechange: ((this: AudioContext, ev: Event) => any) | null;\n readonly sampleRate: number;\n readonly state: AudioContextState;\n close(): Promise;\n createAnalyser(): AnalyserNode;\n createBiquadFilter(): BiquadFilterNode;\n createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;\n createBufferSource(): AudioBufferSourceNode;\n createChannelMerger(numberOfInputs?: number): ChannelMergerNode;\n createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;\n createConvolver(): ConvolverNode;\n createDelay(maxDelayTime?: number): DelayNode;\n createDynamicsCompressor(): DynamicsCompressorNode;\n createGain(): GainNode;\n createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode;\n createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;\n createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;\n createOscillator(): OscillatorNode;\n createPanner(): PannerNode;\n createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave;\n createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;\n createStereoPanner(): StereoPannerNode;\n createWaveShaper(): WaveShaperNode;\n decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise;\n resume(): Promise;\n addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface AudioContext extends AudioContextBase {\n suspend(): Promise;\n}\n\ndeclare var AudioContext: {\n prototype: AudioContext;\n new(): AudioContext;\n};\n\ninterface AudioDestinationNode extends AudioNode {\n readonly maxChannelCount: number;\n}\n\ndeclare var AudioDestinationNode: {\n prototype: AudioDestinationNode;\n new(): AudioDestinationNode;\n};\n\ninterface AudioListener {\n /** @deprecated */\n dopplerFactor: number;\n /** @deprecated */\n speedOfSound: number;\n /** @deprecated */\n setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;\n /** @deprecated */\n setPosition(x: number, y: number, z: number): void;\n /** @deprecated */\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var AudioListener: {\n prototype: AudioListener;\n new(): AudioListener;\n};\n\ninterface AudioNode extends EventTarget {\n channelCount: number;\n channelCountMode: ChannelCountMode;\n channelInterpretation: ChannelInterpretation;\n readonly context: AudioContext;\n readonly numberOfInputs: number;\n readonly numberOfOutputs: number;\n connect(destination: AudioNode, output?: number, input?: number): AudioNode;\n connect(destination: AudioParam, output?: number): void;\n disconnect(): void;\n disconnect(output: number): void;\n disconnect(destination: AudioNode): void;\n disconnect(destination: AudioNode, output: number): void;\n disconnect(destination: AudioNode, output: number, input: number): void;\n disconnect(destination: AudioParam): void;\n disconnect(destination: AudioParam, output: number): void;\n}\n\ndeclare var AudioNode: {\n prototype: AudioNode;\n new(): AudioNode;\n};\n\ninterface AudioParam {\n readonly defaultValue: number;\n value: number;\n cancelScheduledValues(cancelTime: number): AudioParam;\n exponentialRampToValueAtTime(value: number, endTime: number): AudioParam;\n linearRampToValueAtTime(value: number, endTime: number): AudioParam;\n setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam;\n setValueAtTime(value: number, startTime: number): AudioParam;\n setValueCurveAtTime(values: number[], startTime: number, duration: number): AudioParam;\n}\n\ndeclare var AudioParam: {\n prototype: AudioParam;\n new(): AudioParam;\n};\n\ninterface AudioProcessingEvent extends Event {\n readonly inputBuffer: AudioBuffer;\n readonly outputBuffer: AudioBuffer;\n readonly playbackTime: number;\n}\n\ndeclare var AudioProcessingEvent: {\n prototype: AudioProcessingEvent;\n new(): AudioProcessingEvent;\n};\n\ninterface AudioTrack {\n enabled: boolean;\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var AudioTrack: {\n prototype: AudioTrack;\n new(): AudioTrack;\n};\n\ninterface AudioTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface AudioTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: AudioTrackList, ev: TrackEvent) => any) | null;\n onchange: ((this: AudioTrackList, ev: Event) => any) | null;\n onremovetrack: ((this: AudioTrackList, ev: TrackEvent) => any) | null;\n getTrackById(id: string): AudioTrack | null;\n item(index: number): AudioTrack;\n addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: AudioTrack;\n}\n\ndeclare var AudioTrackList: {\n prototype: AudioTrackList;\n new(): AudioTrackList;\n};\n\ninterface BarProp {\n readonly visible: boolean;\n}\n\ndeclare var BarProp: {\n prototype: BarProp;\n new(): BarProp;\n};\n\ninterface BeforeUnloadEvent extends Event {\n returnValue: any;\n}\n\ndeclare var BeforeUnloadEvent: {\n prototype: BeforeUnloadEvent;\n new(): BeforeUnloadEvent;\n};\n\ninterface BhxBrowser {\n readonly lastError: DOMException;\n checkMatchesGlobExpression(pattern: string, value: string): boolean;\n checkMatchesUriExpression(pattern: string, value: string): boolean;\n clearLastError(): void;\n currentWindowId(): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\n genericFunction(functionId: number, destination: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n getExtensionId(): string;\n getThisAddress(): any;\n registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\n registerGenericListenerHandler(eventHandler: Function): void;\n setLastError(parameters: string): void;\n webPlatformGenericFunction(destination: any, parameters?: string, callbackId?: number): void;\n}\n\ndeclare var BhxBrowser: {\n prototype: BhxBrowser;\n new(): BhxBrowser;\n};\n\ninterface BiquadFilterNode extends AudioNode {\n readonly Q: AudioParam;\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n readonly gain: AudioParam;\n type: BiquadFilterType;\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var BiquadFilterNode: {\n prototype: BiquadFilterNode;\n new(): BiquadFilterNode;\n};\n\ninterface Blob {\n readonly size: number;\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n slice(start?: number, end?: number, contentType?: string): Blob;\n}\n\ndeclare var Blob: {\n prototype: Blob;\n new (blobParts?: any[], options?: BlobPropertyBag): Blob;\n};\n\ninterface BlobPropertyBag {\n endings?: string;\n type?: string;\n}\n\ninterface Body {\n readonly bodyUsed: boolean;\n arrayBuffer(): Promise;\n blob(): Promise;\n formData(): Promise;\n json(): Promise;\n text(): Promise;\n}\n\ninterface BroadcastChannel extends EventTarget {\n readonly name: string;\n onmessage: (ev: MessageEvent) => any;\n onmessageerror: (ev: MessageEvent) => any;\n addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n close(): void;\n postMessage(message: any): void;\n removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var BroadcastChannel: {\n prototype: BroadcastChannel;\n new(name: string): BroadcastChannel;\n};\n\ninterface BroadcastChannelEventMap {\n message: MessageEvent;\n messageerror: MessageEvent;\n}\n\ninterface ByteLengthQueuingStrategy {\n highWaterMark: number;\n size(chunk?: any): number;\n}\n\ndeclare var ByteLengthQueuingStrategy: {\n prototype: ByteLengthQueuingStrategy;\n new(strategy: QueuingStrategy): ByteLengthQueuingStrategy;\n};\n\ninterface CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\n};\n\ninterface CSS {\n escape(value: string): string;\n supports(property: string, value?: string): boolean;\n}\ndeclare var CSS: CSS;\n\ninterface CSSConditionRule extends CSSGroupingRule {\n conditionText: string;\n}\n\ndeclare var CSSConditionRule: {\n prototype: CSSConditionRule;\n new(): CSSConditionRule;\n};\n\ninterface CSSFontFaceRule extends CSSRule {\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSFontFaceRule: {\n prototype: CSSFontFaceRule;\n new(): CSSFontFaceRule;\n};\n\ninterface CSSGroupingRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n deleteRule(index: number): void;\n insertRule(rule: string, index: number): number;\n}\n\ndeclare var CSSGroupingRule: {\n prototype: CSSGroupingRule;\n new(): CSSGroupingRule;\n};\n\ninterface CSSImportRule extends CSSRule {\n readonly href: string;\n readonly media: MediaList;\n readonly styleSheet: CSSStyleSheet;\n}\n\ndeclare var CSSImportRule: {\n prototype: CSSImportRule;\n new(): CSSImportRule;\n};\n\ninterface CSSKeyframeRule extends CSSRule {\n keyText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSKeyframeRule: {\n prototype: CSSKeyframeRule;\n new(): CSSKeyframeRule;\n};\n\ninterface CSSKeyframesRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n name: string;\n appendRule(rule: string): void;\n deleteRule(rule: string): void;\n findRule(rule: string): CSSKeyframeRule | null;\n}\n\ndeclare var CSSKeyframesRule: {\n prototype: CSSKeyframesRule;\n new(): CSSKeyframesRule;\n};\n\ninterface CSSMediaRule extends CSSConditionRule {\n readonly media: MediaList;\n}\n\ndeclare var CSSMediaRule: {\n prototype: CSSMediaRule;\n new(): CSSMediaRule;\n};\n\ninterface CSSNamespaceRule extends CSSRule {\n readonly namespaceURI: string;\n readonly prefix: string;\n}\n\ndeclare var CSSNamespaceRule: {\n prototype: CSSNamespaceRule;\n new(): CSSNamespaceRule;\n};\n\ninterface CSSPageRule extends CSSRule {\n readonly pseudoClass: string;\n readonly selector: string;\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSPageRule: {\n prototype: CSSPageRule;\n new(): CSSPageRule;\n};\n\ninterface CSSRule {\n cssText: string;\n readonly parentRule: CSSRule | null;\n readonly parentStyleSheet: CSSStyleSheet | null;\n readonly type: number;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n}\n\ndeclare var CSSRule: {\n prototype: CSSRule;\n new(): CSSRule;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n};\n\ninterface CSSRuleList {\n readonly length: number;\n item(index: number): CSSRule | null;\n [index: number]: CSSRule;\n}\n\ndeclare var CSSRuleList: {\n prototype: CSSRuleList;\n new(): CSSRuleList;\n};\n\ninterface CSSStyleDeclaration {\n alignContent: string | null;\n alignItems: string | null;\n alignSelf: string | null;\n alignmentBaseline: string | null;\n animation: string | null;\n animationDelay: string | null;\n animationDirection: string | null;\n animationDuration: string | null;\n animationFillMode: string | null;\n animationIterationCount: string | null;\n animationName: string | null;\n animationPlayState: string | null;\n animationTimingFunction: string | null;\n backfaceVisibility: string | null;\n background: string | null;\n backgroundAttachment: string | null;\n backgroundClip: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n backgroundOrigin: string | null;\n backgroundPosition: string | null;\n backgroundPositionX: string | null;\n backgroundPositionY: string | null;\n backgroundRepeat: string | null;\n backgroundSize: string | null;\n baselineShift: string | null;\n border: string | null;\n borderBottom: string | null;\n borderBottomColor: string | null;\n borderBottomLeftRadius: string | null;\n borderBottomRightRadius: string | null;\n borderBottomStyle: string | null;\n borderBottomWidth: string | null;\n borderCollapse: string | null;\n borderColor: string | null;\n borderImage: string | null;\n borderImageOutset: string | null;\n borderImageRepeat: string | null;\n borderImageSlice: string | null;\n borderImageSource: string | null;\n borderImageWidth: string | null;\n borderLeft: string | null;\n borderLeftColor: string | null;\n borderLeftStyle: string | null;\n borderLeftWidth: string | null;\n borderRadius: string | null;\n borderRight: string | null;\n borderRightColor: string | null;\n borderRightStyle: string | null;\n borderRightWidth: string | null;\n borderSpacing: string | null;\n borderStyle: string | null;\n borderTop: string | null;\n borderTopColor: string | null;\n borderTopLeftRadius: string | null;\n borderTopRightRadius: string | null;\n borderTopStyle: string | null;\n borderTopWidth: string | null;\n borderWidth: string | null;\n bottom: string | null;\n boxShadow: string | null;\n boxSizing: string | null;\n breakAfter: string | null;\n breakBefore: string | null;\n breakInside: string | null;\n captionSide: string | null;\n clear: string | null;\n clip: string | null;\n clipPath: string | null;\n clipRule: string | null;\n color: string | null;\n colorInterpolationFilters: string | null;\n columnCount: any;\n columnFill: string | null;\n columnGap: any;\n columnRule: string | null;\n columnRuleColor: any;\n columnRuleStyle: string | null;\n columnRuleWidth: any;\n columnSpan: string | null;\n columnWidth: any;\n columns: string | null;\n content: string | null;\n counterIncrement: string | null;\n counterReset: string | null;\n cssFloat: string | null;\n cssText: string;\n cursor: string | null;\n direction: string | null;\n display: string | null;\n dominantBaseline: string | null;\n emptyCells: string | null;\n enableBackground: string | null;\n fill: string | null;\n fillOpacity: string | null;\n fillRule: string | null;\n filter: string | null;\n flex: string | null;\n flexBasis: string | null;\n flexDirection: string | null;\n flexFlow: string | null;\n flexGrow: string | null;\n flexShrink: string | null;\n flexWrap: string | null;\n floodColor: string | null;\n floodOpacity: string | null;\n font: string | null;\n fontFamily: string | null;\n fontFeatureSettings: string | null;\n fontSize: string | null;\n fontSizeAdjust: string | null;\n fontStretch: string | null;\n fontStyle: string | null;\n fontVariant: string | null;\n fontWeight: string | null;\n gap: string | null;\n glyphOrientationHorizontal: string | null;\n glyphOrientationVertical: string | null;\n grid: string | null;\n gridArea: string | null;\n gridAutoColumns: string | null;\n gridAutoFlow: string | null;\n gridAutoRows: string | null;\n gridColumn: string | null;\n gridColumnEnd: string | null;\n gridColumnGap: string | null;\n gridColumnStart: string | null;\n gridGap: string | null;\n gridRow: string | null;\n gridRowEnd: string | null;\n gridRowGap: string | null;\n gridRowStart: string | null;\n gridTemplate: string | null;\n gridTemplateAreas: string | null;\n gridTemplateColumns: string | null;\n gridTemplateRows: string | null;\n height: string | null;\n imeMode: string | null;\n justifyContent: string | null;\n justifyItems: string | null;\n justifySelf: string | null;\n kerning: string | null;\n layoutGrid: string | null;\n layoutGridChar: string | null;\n layoutGridLine: string | null;\n layoutGridMode: string | null;\n layoutGridType: string | null;\n left: string | null;\n readonly length: number;\n letterSpacing: string | null;\n lightingColor: string | null;\n lineBreak: string | null;\n lineHeight: string | null;\n listStyle: string | null;\n listStyleImage: string | null;\n listStylePosition: string | null;\n listStyleType: string | null;\n margin: string | null;\n marginBottom: string | null;\n marginLeft: string | null;\n marginRight: string | null;\n marginTop: string | null;\n marker: string | null;\n markerEnd: string | null;\n markerMid: string | null;\n markerStart: string | null;\n mask: string | null;\n maskImage: string | null;\n maxHeight: string | null;\n maxWidth: string | null;\n minHeight: string | null;\n minWidth: string | null;\n msContentZoomChaining: string | null;\n msContentZoomLimit: string | null;\n msContentZoomLimitMax: any;\n msContentZoomLimitMin: any;\n msContentZoomSnap: string | null;\n msContentZoomSnapPoints: string | null;\n msContentZoomSnapType: string | null;\n msContentZooming: string | null;\n msFlowFrom: string | null;\n msFlowInto: string | null;\n msFontFeatureSettings: string | null;\n msGridColumn: any;\n msGridColumnAlign: string | null;\n msGridColumnSpan: any;\n msGridColumns: string | null;\n msGridRow: any;\n msGridRowAlign: string | null;\n msGridRowSpan: any;\n msGridRows: string | null;\n msHighContrastAdjust: string | null;\n msHyphenateLimitChars: string | null;\n msHyphenateLimitLines: any;\n msHyphenateLimitZone: any;\n msHyphens: string | null;\n msImeAlign: string | null;\n msOverflowStyle: string | null;\n msScrollChaining: string | null;\n msScrollLimit: string | null;\n msScrollLimitXMax: any;\n msScrollLimitXMin: any;\n msScrollLimitYMax: any;\n msScrollLimitYMin: any;\n msScrollRails: string | null;\n msScrollSnapPointsX: string | null;\n msScrollSnapPointsY: string | null;\n msScrollSnapType: string | null;\n msScrollSnapX: string | null;\n msScrollSnapY: string | null;\n msScrollTranslation: string | null;\n msTextCombineHorizontal: string | null;\n msTextSizeAdjust: any;\n msTouchAction: string | null;\n msTouchSelect: string | null;\n msUserSelect: string | null;\n msWrapFlow: string;\n msWrapMargin: any;\n msWrapThrough: string;\n objectFit: string | null;\n objectPosition: string | null;\n opacity: string | null;\n order: string | null;\n orphans: string | null;\n outline: string | null;\n outlineColor: string | null;\n outlineOffset: string | null;\n outlineStyle: string | null;\n outlineWidth: string | null;\n overflow: string | null;\n overflowX: string | null;\n overflowY: string | null;\n padding: string | null;\n paddingBottom: string | null;\n paddingLeft: string | null;\n paddingRight: string | null;\n paddingTop: string | null;\n pageBreakAfter: string | null;\n pageBreakBefore: string | null;\n pageBreakInside: string | null;\n readonly parentRule: CSSRule;\n penAction: string | null;\n perspective: string | null;\n perspectiveOrigin: string | null;\n pointerEvents: string | null;\n position: string | null;\n quotes: string | null;\n resize: string | null;\n right: string | null;\n rotate: string | null;\n rowGap: string | null;\n rubyAlign: string | null;\n rubyOverhang: string | null;\n rubyPosition: string | null;\n scale: string | null;\n stopColor: string | null;\n stopOpacity: string | null;\n stroke: string | null;\n strokeDasharray: string | null;\n strokeDashoffset: string | null;\n strokeLinecap: string | null;\n strokeLinejoin: string | null;\n strokeMiterlimit: string | null;\n strokeOpacity: string | null;\n strokeWidth: string | null;\n tableLayout: string | null;\n textAlign: string | null;\n textAlignLast: string | null;\n textAnchor: string | null;\n textCombineUpright: string | null;\n textDecoration: string | null;\n textIndent: string | null;\n textJustify: string | null;\n textKashida: string | null;\n textKashidaSpace: string | null;\n textOverflow: string | null;\n textShadow: string | null;\n textTransform: string | null;\n textUnderlinePosition: string | null;\n top: string | null;\n touchAction: string | null;\n transform: string | null;\n transformOrigin: string | null;\n transformStyle: string | null;\n transition: string | null;\n transitionDelay: string | null;\n transitionDuration: string | null;\n transitionProperty: string | null;\n transitionTimingFunction: string | null;\n translate: string | null;\n unicodeBidi: string | null;\n userSelect: string | null;\n verticalAlign: string | null;\n visibility: string | null;\n webkitAlignContent: string | null;\n webkitAlignItems: string | null;\n webkitAlignSelf: string | null;\n webkitAnimation: string | null;\n webkitAnimationDelay: string | null;\n webkitAnimationDirection: string | null;\n webkitAnimationDuration: string | null;\n webkitAnimationFillMode: string | null;\n webkitAnimationIterationCount: string | null;\n webkitAnimationName: string | null;\n webkitAnimationPlayState: string | null;\n webkitAnimationTimingFunction: string | null;\n webkitAppearance: string | null;\n webkitBackfaceVisibility: string | null;\n webkitBackgroundClip: string | null;\n webkitBackgroundOrigin: string | null;\n webkitBackgroundSize: string | null;\n webkitBorderBottomLeftRadius: string | null;\n webkitBorderBottomRightRadius: string | null;\n webkitBorderImage: string | null;\n webkitBorderRadius: string | null;\n webkitBorderTopLeftRadius: string | null;\n webkitBorderTopRightRadius: string | null;\n webkitBoxAlign: string | null;\n webkitBoxDirection: string | null;\n webkitBoxFlex: string | null;\n webkitBoxOrdinalGroup: string | null;\n webkitBoxOrient: string | null;\n webkitBoxPack: string | null;\n webkitBoxSizing: string | null;\n webkitColumnBreakAfter: string | null;\n webkitColumnBreakBefore: string | null;\n webkitColumnBreakInside: string | null;\n webkitColumnCount: any;\n webkitColumnGap: any;\n webkitColumnRule: string | null;\n webkitColumnRuleColor: any;\n webkitColumnRuleStyle: string | null;\n webkitColumnRuleWidth: any;\n webkitColumnSpan: string | null;\n webkitColumnWidth: any;\n webkitColumns: string | null;\n webkitFilter: string | null;\n webkitFlex: string | null;\n webkitFlexBasis: string | null;\n webkitFlexDirection: string | null;\n webkitFlexFlow: string | null;\n webkitFlexGrow: string | null;\n webkitFlexShrink: string | null;\n webkitFlexWrap: string | null;\n webkitJustifyContent: string | null;\n webkitOrder: string | null;\n webkitPerspective: string | null;\n webkitPerspectiveOrigin: string | null;\n webkitTapHighlightColor: string | null;\n webkitTextFillColor: string | null;\n webkitTextSizeAdjust: any;\n webkitTextStroke: string | null;\n webkitTextStrokeColor: string | null;\n webkitTextStrokeWidth: string | null;\n webkitTransform: string | null;\n webkitTransformOrigin: string | null;\n webkitTransformStyle: string | null;\n webkitTransition: string | null;\n webkitTransitionDelay: string | null;\n webkitTransitionDuration: string | null;\n webkitTransitionProperty: string | null;\n webkitTransitionTimingFunction: string | null;\n webkitUserModify: string | null;\n webkitUserSelect: string | null;\n webkitWritingMode: string | null;\n whiteSpace: string | null;\n widows: string | null;\n width: string | null;\n wordBreak: string | null;\n wordSpacing: string | null;\n wordWrap: string | null;\n writingMode: string | null;\n zIndex: string | null;\n zoom: string | null;\n getPropertyPriority(propertyName: string): string;\n getPropertyValue(propertyName: string): string;\n item(index: number): string;\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string | null, priority?: string | null): void;\n [index: number]: string;\n}\n\ndeclare var CSSStyleDeclaration: {\n prototype: CSSStyleDeclaration;\n new(): CSSStyleDeclaration;\n};\n\ninterface CSSStyleRule extends CSSRule {\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSStyleRule: {\n prototype: CSSStyleRule;\n new(): CSSStyleRule;\n};\n\ninterface CSSStyleSheet extends StyleSheet {\n readonly cssRules: CSSRuleList;\n /** @deprecated */\n cssText: string;\n /** @deprecated */\n readonly id: string;\n /** @deprecated */\n readonly imports: StyleSheetList;\n /** @deprecated */\n readonly isAlternate: boolean;\n /** @deprecated */\n readonly isPrefAlternate: boolean;\n readonly ownerRule: CSSRule | null;\n /** @deprecated */\n readonly owningElement: Element;\n /** @deprecated */\n readonly pages: any;\n /** @deprecated */\n readonly readOnly: boolean;\n readonly rules: CSSRuleList;\n /** @deprecated */\n addImport(bstrURL: string, lIndex?: number): number;\n /** @deprecated */\n addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;\n addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;\n deleteRule(index?: number): void;\n insertRule(rule: string, index?: number): number;\n /** @deprecated */\n removeImport(lIndex: number): void;\n removeRule(lIndex: number): void;\n}\n\ndeclare var CSSStyleSheet: {\n prototype: CSSStyleSheet;\n new(): CSSStyleSheet;\n};\n\ninterface CSSSupportsRule extends CSSConditionRule {\n}\n\ndeclare var CSSSupportsRule: {\n prototype: CSSSupportsRule;\n new(): CSSSupportsRule;\n};\n\ninterface Cache {\n add(request: Request | string): Promise;\n addAll(requests: (Request | string)[]): Promise;\n delete(request: Request | string, options?: CacheQueryOptions): Promise;\n keys(request?: Request | string, options?: CacheQueryOptions): Promise;\n match(request: Request | string, options?: CacheQueryOptions): Promise;\n matchAll(request?: Request | string, options?: CacheQueryOptions): Promise;\n put(request: Request | string, response: Response): Promise;\n}\n\ndeclare var Cache: {\n prototype: Cache;\n new(): Cache;\n};\n\ninterface CacheStorage {\n delete(cacheName: string): Promise;\n has(cacheName: string): Promise;\n keys(): Promise;\n match(request: Request | string, options?: CacheQueryOptions): Promise;\n open(cacheName: string): Promise;\n}\n\ndeclare var CacheStorage: {\n prototype: CacheStorage;\n new(): CacheStorage;\n};\n\ninterface Canvas2DContextAttributes {\n alpha?: boolean;\n storage?: boolean;\n willReadFrequently?: boolean;\n [attribute: string]: boolean | string | undefined;\n}\n\ninterface CanvasGradient {\n addColorStop(offset: number, color: string): void;\n}\n\ndeclare var CanvasGradient: {\n prototype: CanvasGradient;\n new(): CanvasGradient;\n};\n\ninterface CanvasPathMethods {\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;\n arcTo(x1: number, y1: number, x2: number, y2: number, radiusX: number, radiusY: number, rotation: number): void;\n bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;\n closePath(): void;\n ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n lineTo(x: number, y: number): void;\n moveTo(x: number, y: number): void;\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\n rect(x: number, y: number, w: number, h: number): void;\n}\n\ninterface CanvasPattern {\n setTransform(matrix: SVGMatrix): void;\n}\n\ndeclare var CanvasPattern: {\n prototype: CanvasPattern;\n new(): CanvasPattern;\n};\n\ninterface CanvasRenderingContext2D extends CanvasPathMethods {\n readonly canvas: HTMLCanvasElement;\n fillStyle: string | CanvasGradient | CanvasPattern;\n font: string;\n globalAlpha: number;\n globalCompositeOperation: string;\n imageSmoothingEnabled: boolean;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n mozImageSmoothingEnabled: boolean;\n msFillRule: CanvasFillRule;\n oImageSmoothingEnabled: boolean;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n textAlign: string;\n textBaseline: string;\n webkitImageSmoothingEnabled: boolean;\n beginPath(): void;\n clearRect(x: number, y: number, w: number, h: number): void;\n clip(fillRule?: CanvasFillRule): void;\n clip(path: Path2D, fillRule?: CanvasFillRule): void;\n createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;\n createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;\n drawFocusIfNeeded(element: Element): void;\n drawFocusIfNeeded(path: Path2D, element: Element): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void;\n fill(fillRule?: CanvasFillRule): void;\n fill(path: Path2D, fillRule?: CanvasFillRule): void;\n fillRect(x: number, y: number, w: number, h: number): void;\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\n getLineDash(): number[];\n isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInStroke(x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInStroke(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\n measureText(text: string): TextMetrics;\n putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;\n restore(): void;\n rotate(angle: number): void;\n save(): void;\n scale(x: number, y: number): void;\n setLineDash(segments: number[]): void;\n setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n stroke(path?: Path2D): void;\n strokeRect(x: number, y: number, w: number, h: number): void;\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\n transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n translate(x: number, y: number): void;\n}\n\ndeclare var CanvasRenderingContext2D: {\n prototype: CanvasRenderingContext2D;\n new(): CanvasRenderingContext2D;\n};\n\ninterface ChannelMergerNode extends AudioNode {\n}\n\ndeclare var ChannelMergerNode: {\n prototype: ChannelMergerNode;\n new(): ChannelMergerNode;\n};\n\ninterface ChannelSplitterNode extends AudioNode {\n}\n\ndeclare var ChannelSplitterNode: {\n prototype: ChannelSplitterNode;\n new(): ChannelSplitterNode;\n};\n\ninterface CharacterData extends Node, ChildNode {\n data: string;\n readonly length: number;\n appendData(arg: string): void;\n deleteData(offset: number, count: number): void;\n insertData(offset: number, arg: string): void;\n replaceData(offset: number, count: number, arg: string): void;\n substringData(offset: number, count: number): string;\n}\n\ndeclare var CharacterData: {\n prototype: CharacterData;\n new(): CharacterData;\n};\n\ninterface ChildNode {\n remove(): void;\n}\n\ninterface ClientRect {\n bottom: number;\n readonly height: number;\n left: number;\n right: number;\n top: number;\n readonly width: number;\n}\n\ndeclare var ClientRect: {\n prototype: ClientRect;\n new(): ClientRect;\n};\n\ninterface ClientRectList {\n readonly length: number;\n item(index: number): ClientRect;\n [index: number]: ClientRect;\n}\n\ndeclare var ClientRectList: {\n prototype: ClientRectList;\n new(): ClientRectList;\n};\n\ninterface ClipboardEvent extends Event {\n readonly clipboardData: DataTransfer;\n}\n\ndeclare var ClipboardEvent: {\n prototype: ClipboardEvent;\n new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;\n};\n\ninterface ClipboardEventInit extends EventInit {\n data?: string;\n dataType?: string;\n}\n\ninterface CloseEvent extends Event {\n readonly code: number;\n readonly reason: string;\n readonly wasClean: boolean;\n /** @deprecated */\n initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;\n}\n\ndeclare var CloseEvent: {\n prototype: CloseEvent;\n new(type: string, eventInitDict?: CloseEventInit): CloseEvent;\n};\n\ninterface Comment extends CharacterData {\n text: string;\n}\n\ndeclare var Comment: {\n prototype: Comment;\n new(data?: string): Comment;\n};\n\ninterface CompositionEvent extends UIEvent {\n readonly data: string;\n readonly locale: string;\n initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;\n}\n\ndeclare var CompositionEvent: {\n prototype: CompositionEvent;\n new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;\n};\n\ninterface ComputedTimingProperties {\n activeDuration: number;\n currentIteration: number | null;\n endTime: number;\n localTime: number | null;\n progress: number | null;\n}\n\ninterface ConcatParams extends Algorithm {\n algorithmId: Uint8Array;\n hash?: string | Algorithm;\n partyUInfo: Uint8Array;\n partyVInfo: Uint8Array;\n privateInfo?: Uint8Array;\n publicInfo?: Uint8Array;\n}\n\ninterface Console {\n memory: any;\n assert(condition?: boolean, message?: string, ...data: any[]): void;\n clear(): void;\n count(label?: string): void;\n debug(message?: any, ...optionalParams: any[]): void;\n dir(value?: any, ...optionalParams: any[]): void;\n dirxml(value: any): void;\n error(message?: any, ...optionalParams: any[]): void;\n exception(message?: string, ...optionalParams: any[]): void;\n group(groupTitle?: string, ...optionalParams: any[]): void;\n groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;\n groupEnd(): void;\n info(message?: any, ...optionalParams: any[]): void;\n log(message?: any, ...optionalParams: any[]): void;\n markTimeline(label?: string): void;\n msIsIndependentlyComposed(element: Element): boolean;\n profile(reportName?: string): void;\n profileEnd(): void;\n select(element: Element): void;\n table(...tabularData: any[]): void;\n time(label?: string): void;\n timeEnd(label?: string): void;\n timeStamp(label?: string): void;\n timeline(label?: string): void;\n timelineEnd(label?: string): void;\n trace(message?: any, ...optionalParams: any[]): void;\n warn(message?: any, ...optionalParams: any[]): void;\n}\n\ndeclare var Console: {\n prototype: Console;\n new(): Console;\n};\n\ninterface ContentScriptGlobalScope extends EventTarget {\n readonly msContentScript: ExtensionScriptApis;\n readonly window: Window;\n}\n\ndeclare var ContentScriptGlobalScope: {\n prototype: ContentScriptGlobalScope;\n new(): ContentScriptGlobalScope;\n};\n\ninterface ConvolverNode extends AudioNode {\n buffer: AudioBuffer | null;\n normalize: boolean;\n}\n\ndeclare var ConvolverNode: {\n prototype: ConvolverNode;\n new(): ConvolverNode;\n};\n\ninterface Coordinates {\n readonly accuracy: number;\n readonly altitude: number | null;\n readonly altitudeAccuracy: number | null;\n readonly heading: number | null;\n readonly latitude: number;\n readonly longitude: number;\n readonly speed: number | null;\n}\n\ndeclare var Coordinates: {\n prototype: Coordinates;\n new(): Coordinates;\n};\n\ninterface CountQueuingStrategy {\n highWaterMark: number;\n size(): number;\n}\n\ndeclare var CountQueuingStrategy: {\n prototype: CountQueuingStrategy;\n new(strategy: QueuingStrategy): CountQueuingStrategy;\n};\n\ninterface Crypto {\n readonly subtle: SubtleCrypto;\n getRandomValues(array: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null;\n}\n\ndeclare var Crypto: {\n prototype: Crypto;\n new(): Crypto;\n};\n\ninterface CryptoKey {\n readonly algorithm: KeyAlgorithm;\n readonly extractable: boolean;\n readonly type: string;\n readonly usages: string[];\n}\n\ndeclare var CryptoKey: {\n prototype: CryptoKey;\n new(): CryptoKey;\n};\n\ninterface CryptoKeyPair {\n privateKey: CryptoKey;\n publicKey: CryptoKey;\n}\n\ndeclare var CryptoKeyPair: {\n prototype: CryptoKeyPair;\n new(): CryptoKeyPair;\n};\n\ninterface CustomElementRegistry {\n define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;\n get(name: string): any;\n whenDefined(name: string): PromiseLike;\n}\n\ninterface CustomEvent extends Event {\n readonly detail: T;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;\n}\n\ndeclare var CustomEvent: {\n prototype: CustomEvent;\n new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;\n};\n\ninterface DOMError {\n readonly name: string;\n toString(): string;\n}\n\ndeclare var DOMError: {\n prototype: DOMError;\n new(): DOMError;\n};\n\ninterface DOMException {\n readonly code: number;\n readonly message: string;\n readonly name: string;\n toString(): string;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n}\n\ndeclare var DOMException: {\n prototype: DOMException;\n new(message?: string, name?: string): DOMException;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n};\n\ninterface DOMImplementation {\n createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document;\n createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;\n createHTMLDocument(title?: string): Document;\n hasFeature(feature: string | null, version: string | null): boolean;\n}\n\ndeclare var DOMImplementation: {\n prototype: DOMImplementation;\n new(): DOMImplementation;\n};\n\ninterface DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\n}\n\ninterface DOMParser {\n parseFromString(source: string, mimeType: string): Document;\n}\n\ndeclare var DOMParser: {\n prototype: DOMParser;\n new(): DOMParser;\n};\n\ninterface DOMRect extends DOMRectReadOnly {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var DOMRect: {\n prototype: DOMRect;\n new (x?: number, y?: number, width?: number, height?: number): DOMRect;\n fromRect(rectangle?: DOMRectInit): DOMRect;\n};\n\ninterface DOMRectList {\n readonly length: number;\n item(index: number): DOMRect | null;\n [index: number]: DOMRect;\n}\n\ninterface DOMRectReadOnly {\n readonly bottom: number;\n readonly height: number;\n readonly left: number;\n readonly right: number;\n readonly top: number;\n readonly width: number;\n readonly x: number;\n readonly y: number;\n}\n\ndeclare var DOMRectReadOnly: {\n prototype: DOMRectReadOnly;\n new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;\n fromRect(rectangle?: DOMRectInit): DOMRectReadOnly;\n};\n\ninterface DOMSettableTokenList extends DOMTokenList {\n value: string;\n}\n\ndeclare var DOMSettableTokenList: {\n prototype: DOMSettableTokenList;\n new(): DOMSettableTokenList;\n};\n\ninterface DOMStringList {\n readonly length: number;\n contains(str: string): boolean;\n item(index: number): string | null;\n [index: number]: string;\n}\n\ndeclare var DOMStringList: {\n prototype: DOMStringList;\n new(): DOMStringList;\n};\n\ninterface DOMStringMap {\n [name: string]: string | undefined;\n}\n\ndeclare var DOMStringMap: {\n prototype: DOMStringMap;\n new(): DOMStringMap;\n};\n\ninterface DOMTokenList {\n readonly length: number;\n add(...tokens: string[]): void;\n contains(token: string): boolean;\n item(index: number): string | null;\n remove(...tokens: string[]): void;\n toString(): string;\n toggle(token: string, force?: boolean): boolean;\n [index: number]: string;\n}\n\ndeclare var DOMTokenList: {\n prototype: DOMTokenList;\n new(): DOMTokenList;\n};\n\ninterface DataCue extends TextTrackCue {\n data: ArrayBuffer;\n addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var DataCue: {\n prototype: DataCue;\n new(): DataCue;\n};\n\ninterface DataTransfer {\n dropEffect: string;\n effectAllowed: string;\n readonly files: FileList;\n readonly items: DataTransferItemList;\n readonly types: string[];\n clearData(format?: string): boolean;\n getData(format: string): string;\n setData(format: string, data: string): boolean;\n setDragImage(image: Element, x: number, y: number): void;\n}\n\ndeclare var DataTransfer: {\n prototype: DataTransfer;\n new(): DataTransfer;\n};\n\ninterface DataTransferItem {\n readonly kind: string;\n readonly type: string;\n getAsFile(): File | null;\n getAsString(_callback: FunctionStringCallback | null): void;\n webkitGetAsEntry(): any;\n}\n\ndeclare var DataTransferItem: {\n prototype: DataTransferItem;\n new(): DataTransferItem;\n};\n\ninterface DataTransferItemList {\n readonly length: number;\n add(data: File): DataTransferItem | null;\n add(data: string, type: string): DataTransferItem | null;\n clear(): void;\n item(index: number): DataTransferItem;\n remove(index: number): void;\n [name: number]: DataTransferItem;\n}\n\ndeclare var DataTransferItemList: {\n prototype: DataTransferItemList;\n new(): DataTransferItemList;\n};\n\ninterface DeferredPermissionRequest {\n readonly id: number;\n readonly type: MSWebViewPermissionType;\n readonly uri: string;\n allow(): void;\n deny(): void;\n}\n\ndeclare var DeferredPermissionRequest: {\n prototype: DeferredPermissionRequest;\n new(): DeferredPermissionRequest;\n};\n\ninterface DelayNode extends AudioNode {\n readonly delayTime: AudioParam;\n}\n\ndeclare var DelayNode: {\n prototype: DelayNode;\n new(): DelayNode;\n};\n\ninterface DeviceAcceleration {\n readonly x: number | null;\n readonly y: number | null;\n readonly z: number | null;\n}\n\ndeclare var DeviceAcceleration: {\n prototype: DeviceAcceleration;\n new(): DeviceAcceleration;\n};\n\ninterface DeviceLightEvent extends Event {\n readonly value: number;\n}\n\ndeclare var DeviceLightEvent: {\n prototype: DeviceLightEvent;\n new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;\n};\n\ninterface DeviceMotionEvent extends Event {\n readonly acceleration: DeviceAcceleration | null;\n readonly accelerationIncludingGravity: DeviceAcceleration | null;\n readonly interval: number | null;\n readonly rotationRate: DeviceRotationRate | null;\n initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void;\n}\n\ndeclare var DeviceMotionEvent: {\n prototype: DeviceMotionEvent;\n new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent;\n};\n\ninterface DeviceOrientationEvent extends Event {\n readonly absolute: boolean;\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void;\n}\n\ndeclare var DeviceOrientationEvent: {\n prototype: DeviceOrientationEvent;\n new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent;\n};\n\ninterface DeviceRotationRate {\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n}\n\ndeclare var DeviceRotationRate: {\n prototype: DeviceRotationRate;\n new(): DeviceRotationRate;\n};\n\ninterface DhImportKeyParams extends Algorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DhKeyAlgorithm extends KeyAlgorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface DhKeyGenParams extends Algorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DocumentEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"activate\": Event;\n \"beforeactivate\": Event;\n \"beforedeactivate\": Event;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": Event;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"fullscreenchange\": Event;\n \"fullscreenerror\": Event;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": Event;\n \"MSGestureChange\": Event;\n \"MSGestureDoubleTap\": Event;\n \"MSGestureEnd\": Event;\n \"MSGestureHold\": Event;\n \"MSGestureStart\": Event;\n \"MSGestureTap\": Event;\n \"MSInertiaStart\": Event;\n \"MSManipulationStateChanged\": Event;\n \"MSPointerCancel\": Event;\n \"MSPointerDown\": Event;\n \"MSPointerEnter\": Event;\n \"MSPointerLeave\": Event;\n \"MSPointerMove\": Event;\n \"MSPointerOut\": Event;\n \"MSPointerOver\": Event;\n \"MSPointerUp\": Event;\n \"mssitemodejumplistitemremoved\": Event;\n \"msthumbnailclick\": Event;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"pointerlockchange\": Event;\n \"pointerlockerror\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectionchange\": Event;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"stop\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": Event;\n \"touchend\": Event;\n \"touchmove\": Event;\n \"touchstart\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent {\n /**\n * Sets or gets the URL for the current document.\n */\n readonly URL: string;\n /**\n * Gets the URL for the document, stripped of any character encoding.\n */\n readonly URLUnencoded: string;\n /**\n * Gets the object that has the focus when the parent document has focus.\n */\n readonly activeElement: Element;\n /**\n * Sets or gets the color of all active links in the document.\n */\n alinkColor: string;\n /**\n * Returns a reference to the collection of elements contained by the object.\n */\n readonly all: HTMLAllCollection;\n /**\n * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.\n */\n readonly anchors: HTMLCollectionOf;\n /**\n * Retrieves a collection of all applet objects in the document.\n */\n readonly applets: HTMLCollectionOf;\n /**\n * Deprecated. Sets or retrieves a value that indicates the background color behind the object.\n */\n bgColor: string;\n /**\n * Specifies the beginning and end of the document body.\n */\n body: HTMLElement;\n readonly characterSet: string;\n /**\n * Gets or sets the character set used to encode the object.\n */\n charset: string;\n /**\n * Gets a value that indicates whether standards-compliant mode is switched on for the object.\n */\n readonly compatMode: string;\n cookie: string;\n readonly currentScript: HTMLScriptElement | SVGScriptElement | null;\n readonly defaultView: Window;\n /**\n * Sets or gets a value that indicates whether the document can be edited.\n */\n designMode: string;\n /**\n * Sets or retrieves a value that indicates the reading order of the object.\n */\n dir: string;\n /**\n * Gets an object representing the document type declaration associated with the current document.\n */\n readonly doctype: DocumentType;\n /**\n * Gets a reference to the root node of the document.\n */\n readonly documentElement: HTMLElement;\n /**\n * Sets or gets the security domain of the document.\n */\n domain: string;\n /**\n * Retrieves a collection of all embed objects in the document.\n */\n readonly embeds: HTMLCollectionOf;\n /**\n * Sets or gets the foreground (text) color of the document.\n */\n fgColor: string;\n /**\n * Retrieves a collection, in source order, of all form objects in the document.\n */\n readonly forms: HTMLCollectionOf;\n readonly fullscreenElement: Element | null;\n readonly fullscreenEnabled: boolean;\n readonly head: HTMLHeadElement;\n readonly hidden: boolean;\n /**\n * Retrieves a collection, in source order, of img objects in the document.\n */\n readonly images: HTMLCollectionOf;\n /**\n * Gets the implementation object of the current document.\n */\n readonly implementation: DOMImplementation;\n /**\n * Returns the character encoding used to create the webpage that is loaded into the document object.\n */\n readonly inputEncoding: string | null;\n /**\n * Gets the date that the page was last modified, if the page supplies one.\n */\n readonly lastModified: string;\n /**\n * Sets or gets the color of the document links.\n */\n linkColor: string;\n /**\n * Retrieves a collection of all a objects that specify the href property and all area objects in the document.\n */\n readonly links: HTMLCollectionOf;\n /**\n * Contains information about the current URL.\n */\n location: Location;\n msCSSOMElementFloatMetrics: boolean;\n msCapsLockWarningOff: boolean;\n /**\n * Fires when the user aborts the download.\n * @param ev The event.\n */\n onabort: ((this: Document, ev: UIEvent) => any) | null;\n /**\n * Fires when the object is set as the active element.\n * @param ev The event.\n */\n onactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires immediately before the object is set as the active element.\n * @param ev The event.\n */\n onbeforeactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires immediately before the activeElement is changed from the current object to another object in the parent document.\n * @param ev The event.\n */\n onbeforedeactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the object loses the input focus.\n * @param ev The focus event.\n */\n onblur: ((this: Document, ev: FocusEvent) => any) | null;\n /**\n * Occurs when playback is possible, but would require further buffering.\n * @param ev The event.\n */\n oncanplay: ((this: Document, ev: Event) => any) | null;\n oncanplaythrough: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the contents of the object or selection have changed.\n * @param ev The event.\n */\n onchange: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the left mouse button on the object\n * @param ev The mouse event.\n */\n onclick: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user clicks the right mouse button in the client area, opening the context menu.\n * @param ev The mouse event.\n */\n oncontextmenu: ((this: Document, ev: PointerEvent) => any) | null;\n /**\n * Fires when the user double-clicks the object.\n * @param ev The mouse event.\n */\n ondblclick: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the activeElement is changed from the current object to another object in the parent document.\n * @param ev The UI Event\n */\n ondeactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires on the source object continuously during a drag operation.\n * @param ev The event.\n */\n ondrag: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the source object when the user releases the mouse at the close of a drag operation.\n * @param ev The event.\n */\n ondragend: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the target element when the user drags the object to a valid drop target.\n * @param ev The drag event.\n */\n ondragenter: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\n * @param ev The drag event.\n */\n ondragleave: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the target element continuously while the user drags the object over a valid drop target.\n * @param ev The event.\n */\n ondragover: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the source object when the user starts to drag a text selection or selected object.\n * @param ev The event.\n */\n ondragstart: ((this: Document, ev: DragEvent) => any) | null;\n ondrop: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Occurs when the duration attribute is updated.\n * @param ev The event.\n */\n ondurationchange: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the media element is reset to its initial state.\n * @param ev The event.\n */\n onemptied: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the end of playback is reached.\n * @param ev The event\n */\n onended: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when an error occurs during object loading.\n * @param ev The event.\n */\n onerror: ((this: Document, ev: ErrorEvent) => any) | null;\n /**\n * Fires when the object receives focus.\n * @param ev The event.\n */\n onfocus: ((this: Document, ev: FocusEvent) => any) | null;\n onfullscreenchange: ((this: Document, ev: Event) => any) | null;\n onfullscreenerror: ((this: Document, ev: Event) => any) | null;\n oninput: ((this: Document, ev: Event) => any) | null;\n oninvalid: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user presses a key.\n * @param ev The keyboard event\n */\n onkeydown: ((this: Document, ev: KeyboardEvent) => any) | null;\n /**\n * Fires when the user presses an alphanumeric key.\n * @param ev The event.\n */\n onkeypress: ((this: Document, ev: KeyboardEvent) => any) | null;\n /**\n * Fires when the user releases a key.\n * @param ev The keyboard event\n */\n onkeyup: ((this: Document, ev: KeyboardEvent) => any) | null;\n /**\n * Fires immediately after the browser loads the object.\n * @param ev The event.\n */\n onload: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when media data is loaded at the current playback position.\n * @param ev The event.\n */\n onloadeddata: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the duration and dimensions of the media have been determined.\n * @param ev The event.\n */\n onloadedmetadata: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when Internet Explorer begins looking for media data.\n * @param ev The event.\n */\n onloadstart: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the object with either mouse button.\n * @param ev The mouse event.\n */\n onmousedown: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse over the object.\n * @param ev The mouse event.\n */\n onmousemove: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse pointer outside the boundaries of the object.\n * @param ev The mouse event.\n */\n onmouseout: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse pointer into the object.\n * @param ev The mouse event.\n */\n onmouseover: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user releases a mouse button while the mouse is over the object.\n * @param ev The mouse event.\n */\n onmouseup: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the wheel button is rotated.\n * @param ev The mouse event\n */\n onmousewheel: ((this: Document, ev: WheelEvent) => any) | null;\n onmscontentzoom: ((this: Document, ev: Event) => any) | null;\n onmsgesturechange: ((this: Document, ev: Event) => any) | null;\n onmsgesturedoubletap: ((this: Document, ev: Event) => any) | null;\n onmsgestureend: ((this: Document, ev: Event) => any) | null;\n onmsgesturehold: ((this: Document, ev: Event) => any) | null;\n onmsgesturestart: ((this: Document, ev: Event) => any) | null;\n onmsgesturetap: ((this: Document, ev: Event) => any) | null;\n onmsinertiastart: ((this: Document, ev: Event) => any) | null;\n onmsmanipulationstatechanged: ((this: Document, ev: Event) => any) | null;\n onmspointercancel: ((this: Document, ev: Event) => any) | null;\n onmspointerdown: ((this: Document, ev: Event) => any) | null;\n onmspointerenter: ((this: Document, ev: Event) => any) | null;\n onmspointerleave: ((this: Document, ev: Event) => any) | null;\n onmspointermove: ((this: Document, ev: Event) => any) | null;\n onmspointerout: ((this: Document, ev: Event) => any) | null;\n onmspointerover: ((this: Document, ev: Event) => any) | null;\n onmspointerup: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmssitemodejumplistitemremoved: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmsthumbnailclick: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when playback is paused.\n * @param ev The event.\n */\n onpause: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the play method is requested.\n * @param ev The event.\n */\n onplay: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the audio or video has started playing.\n * @param ev The event.\n */\n onplaying: ((this: Document, ev: Event) => any) | null;\n onpointerlockchange: ((this: Document, ev: Event) => any) | null;\n onpointerlockerror: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs to indicate progress while downloading media data.\n * @param ev The event.\n */\n onprogress: ((this: Document, ev: ProgressEvent) => any) | null;\n /**\n * Occurs when the playback rate is increased or decreased.\n * @param ev The event.\n */\n onratechange: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the state of the object has changed.\n * @param ev The event\n */\n onreadystatechange: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user resets a form.\n * @param ev The event.\n */\n onreset: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user repositions the scroll box in the scroll bar on the object.\n * @param ev The event.\n */\n onscroll: ((this: Document, ev: UIEvent) => any) | null;\n /**\n * Occurs when the seek operation ends.\n * @param ev The event.\n */\n onseeked: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the current playback position is moved.\n * @param ev The event.\n */\n onseeking: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the current selection changes.\n * @param ev The event.\n */\n onselect: ((this: Document, ev: UIEvent) => any) | null;\n /**\n * Fires when the selection state of a document changes.\n * @param ev The event.\n */\n onselectionchange: ((this: Document, ev: Event) => any) | null;\n onselectstart: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the download has stopped.\n * @param ev The event.\n */\n onstalled: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the Stop button or leaves the Web page.\n * @param ev The event.\n */\n onstop: ((this: Document, ev: Event) => any) | null;\n onsubmit: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs if the load operation has been intentionally halted.\n * @param ev The event.\n */\n onsuspend: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs to indicate the current playback position.\n * @param ev The event.\n */\n ontimeupdate: ((this: Document, ev: Event) => any) | null;\n ontouchcancel: ((this: Document, ev: Event) => any) | null;\n ontouchend: ((this: Document, ev: Event) => any) | null;\n ontouchmove: ((this: Document, ev: Event) => any) | null;\n ontouchstart: ((this: Document, ev: Event) => any) | null;\n onvisibilitychange: (this: Document, ev: Event) => any;\n /**\n * Occurs when the volume is changed, or playback is muted or unmuted.\n * @param ev The event.\n */\n onvolumechange: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when playback stops because the next frame of a video resource is not available.\n * @param ev The event.\n */\n onwaiting: ((this: Document, ev: Event) => any) | null;\n onwebkitfullscreenchange: ((this: Document, ev: Event) => any) | null;\n onwebkitfullscreenerror: ((this: Document, ev: Event) => any) | null;\n readonly plugins: HTMLCollectionOf;\n readonly pointerLockElement: Element;\n /**\n * Retrieves a value that indicates the current state of the object.\n */\n readonly readyState: string;\n /**\n * Gets the URL of the location that referred the user to the current page.\n */\n readonly referrer: string;\n /**\n * Gets the root svg element in the document hierarchy.\n */\n readonly rootElement: SVGSVGElement;\n /**\n * Retrieves a collection of all script objects in the document.\n */\n readonly scripts: HTMLCollectionOf;\n readonly scrollingElement: Element | null;\n /**\n * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\n */\n readonly styleSheets: StyleSheetList;\n /**\n * Contains the title of the document.\n */\n title: string;\n readonly visibilityState: VisibilityState;\n /**\n * Sets or gets the color of the links that the user has visited.\n */\n vlinkColor: string;\n readonly webkitCurrentFullScreenElement: Element | null;\n readonly webkitFullscreenElement: Element | null;\n readonly webkitFullscreenEnabled: boolean;\n readonly webkitIsFullScreen: boolean;\n readonly xmlEncoding: string | null;\n xmlStandalone: boolean;\n /**\n * Gets or sets the version attribute specified in the declaration of an XML document.\n */\n xmlVersion: string | null;\n adoptNode(source: T): T;\n captureEvents(): void;\n caretRangeFromPoint(x: number, y: number): Range;\n clear(): void;\n /**\n * Closes an output stream and forces the sent data to display.\n */\n close(): void;\n /**\n * Creates an attribute object with a specified name.\n * @param name String that sets the attribute object's name.\n */\n createAttribute(name: string): Attr;\n createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr;\n createCDATASection(data: string): CDATASection;\n /**\n * Creates a comment object with the specified data.\n * @param data Sets the comment object's data.\n */\n createComment(data: string): Comment;\n /**\n * Creates a new document.\n */\n createDocumentFragment(): DocumentFragment;\n /**\n * Creates an instance of the element for the specified tag.\n * @param tagName The name of an element.\n */\n createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];\n createElement(tagName: string, options?: ElementCreationOptions): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"a\"): SVGAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"circle\"): SVGCircleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"clipPath\"): SVGClipPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"componentTransferFunction\"): SVGComponentTransferFunctionElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"defs\"): SVGDefsElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"desc\"): SVGDescElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"ellipse\"): SVGEllipseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feBlend\"): SVGFEBlendElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feColorMatrix\"): SVGFEColorMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComponentTransfer\"): SVGFEComponentTransferElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComposite\"): SVGFECompositeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feConvolveMatrix\"): SVGFEConvolveMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDiffuseLighting\"): SVGFEDiffuseLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDisplacementMap\"): SVGFEDisplacementMapElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDistantLight\"): SVGFEDistantLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFlood\"): SVGFEFloodElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncA\"): SVGFEFuncAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncB\"): SVGFEFuncBElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncG\"): SVGFEFuncGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncR\"): SVGFEFuncRElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feGaussianBlur\"): SVGFEGaussianBlurElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feImage\"): SVGFEImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMerge\"): SVGFEMergeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMergeNode\"): SVGFEMergeNodeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMorphology\"): SVGFEMorphologyElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feOffset\"): SVGFEOffsetElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"fePointLight\"): SVGFEPointLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpecularLighting\"): SVGFESpecularLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpotLight\"): SVGFESpotLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTile\"): SVGFETileElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTurbulence\"): SVGFETurbulenceElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"filter\"): SVGFilterElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"foreignObject\"): SVGForeignObjectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"g\"): SVGGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"image\"): SVGImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"gradient\"): SVGGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"line\"): SVGLineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"linearGradient\"): SVGLinearGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"marker\"): SVGMarkerElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"mask\"): SVGMaskElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"path\"): SVGPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"metadata\"): SVGMetadataElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"pattern\"): SVGPatternElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polygon\"): SVGPolygonElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polyline\"): SVGPolylineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"radialGradient\"): SVGRadialGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"rect\"): SVGRectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"svg\"): SVGSVGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"script\"): SVGScriptElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"stop\"): SVGStopElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"style\"): SVGStyleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"switch\"): SVGSwitchElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"symbol\"): SVGSymbolElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"tspan\"): SVGTSpanElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textContent\"): SVGTextContentElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"text\"): SVGTextElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPath\"): SVGTextPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPositioning\"): SVGTextPositioningElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"title\"): SVGTitleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"use\"): SVGUseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"view\"): SVGViewElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: string): SVGElement;\n createElementNS(namespaceURI: string | null, qualifiedName: string): Element;\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n createNSResolver(nodeResolver: Node): XPathNSResolver;\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list\n * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;\n createProcessingInstruction(target: string, data: string): ProcessingInstruction;\n /**\n * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.\n */\n createRange(): Range;\n /**\n * Creates a text string from the specified value.\n * @param data String that specifies the nodeValue property of the text node.\n */\n createTextNode(data: string): Text;\n createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;\n createTouchList(...touches: Touch[]): TouchList;\n /**\n * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.\n * @param filter A custom NodeFilter function to use.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;\n /**\n * Returns the element for the specified x coordinate and the specified y coordinate.\n * @param x The x-offset\n * @param y The y-offset\n */\n elementFromPoint(x: number, y: number): Element;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n /**\n * Executes a command on the current document, current selection, or the given range.\n * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.\n * @param showUI Display the user interface, defaults to false.\n * @param value Value to assign.\n */\n execCommand(commandId: string, showUI?: boolean, value?: any): boolean;\n /**\n * Displays help information for the given command identifier.\n * @param commandId Displays help information for the given command identifier.\n */\n execCommandShowHelp(commandId: string): boolean;\n exitFullscreen(): void;\n exitPointerLock(): void;\n /**\n * Causes the element to receive the focus and executes the code specified by the onfocus event.\n */\n /** @deprecated */\n focus(): void;\n /**\n * Returns a reference to the first object with the specified value of the ID or NAME attribute.\n * @param elementId String that specifies the ID value. Case-insensitive.\n */\n getElementById(elementId: string): HTMLElement | null;\n getElementsByClassName(classNames: string): HTMLCollectionOf;\n /**\n * Gets a collection of objects based on the value of the NAME or ID attribute.\n * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.\n */\n getElementsByName(elementName: string): NodeListOf;\n /**\n * Retrieves a collection of objects based on the specified element name.\n * @param name Specifies the name of an element.\n */\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n /**\n * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.\n */\n getSelection(): Selection;\n /**\n * Gets a value indicating whether the object currently has focus.\n */\n hasFocus(): boolean;\n importNode(importedNode: T, deep: boolean): T;\n msElementsFromPoint(x: number, y: number): NodeListOf;\n msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf;\n /**\n * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.\n * @param url Specifies a MIME type for the document.\n * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.\n * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, \"fullscreen=yes, toolbar=yes\"). The following values are supported.\n * @param replace Specifies whether the existing entry for the document is replaced in the history list.\n */\n open(url?: string, name?: string, features?: string, replace?: boolean): Document;\n /**\n * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.\n * @param commandId Specifies a command identifier.\n */\n queryCommandEnabled(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandIndeterm(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates the current state of the command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandState(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the current command is supported on the current range.\n * @param commandId Specifies a command identifier.\n */\n queryCommandSupported(commandId: string): boolean;\n /**\n * Retrieves the string associated with a command.\n * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.\n */\n queryCommandText(commandId: string): string;\n /**\n * Returns the current value of the document, range, or current selection for the given command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandValue(commandId: string): string;\n releaseEvents(): void;\n webkitCancelFullScreen(): void;\n webkitExitFullscreen(): void;\n /**\n * Writes one or more HTML expressions to a document in the specified window.\n * @param content Specifies the text and HTML tags to write.\n */\n write(...content: string[]): void;\n /**\n * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.\n * @param content The text and HTML tags to write.\n */\n writeln(...content: string[]): void;\n addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Document: {\n prototype: Document;\n new(): Document;\n};\n\ninterface DocumentEvent {\n createEvent(eventInterface: \"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface: \"AnimationPlaybackEvent\"): AnimationPlaybackEvent;\n createEvent(eventInterface: \"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface: \"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface: \"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface: \"CloseEvent\"): CloseEvent;\n createEvent(eventInterface: \"CompositionEvent\"): CompositionEvent;\n createEvent(eventInterface: \"CustomEvent\"): CustomEvent;\n createEvent(eventInterface: \"DeviceLightEvent\"): DeviceLightEvent;\n createEvent(eventInterface: \"DeviceMotionEvent\"): DeviceMotionEvent;\n createEvent(eventInterface: \"DeviceOrientationEvent\"): DeviceOrientationEvent;\n createEvent(eventInterface: \"DragEvent\"): DragEvent;\n createEvent(eventInterface: \"ErrorEvent\"): ErrorEvent;\n createEvent(eventInterface: \"Event\"): Event;\n createEvent(eventInterface: \"Events\"): Event;\n createEvent(eventInterface: \"FocusEvent\"): FocusEvent;\n createEvent(eventInterface: \"FocusNavigationEvent\"): FocusNavigationEvent;\n createEvent(eventInterface: \"GamepadEvent\"): GamepadEvent;\n createEvent(eventInterface: \"HashChangeEvent\"): HashChangeEvent;\n createEvent(eventInterface: \"IDBVersionChangeEvent\"): IDBVersionChangeEvent;\n createEvent(eventInterface: \"KeyboardEvent\"): KeyboardEvent;\n createEvent(eventInterface: \"ListeningStateChangedEvent\"): ListeningStateChangedEvent;\n createEvent(eventInterface: \"MSDCCEvent\"): MSDCCEvent;\n createEvent(eventInterface: \"MSDSHEvent\"): MSDSHEvent;\n createEvent(eventInterface: \"MSMediaKeyMessageEvent\"): MSMediaKeyMessageEvent;\n createEvent(eventInterface: \"MSMediaKeyNeededEvent\"): MSMediaKeyNeededEvent;\n createEvent(eventInterface: \"MediaEncryptedEvent\"): MediaEncryptedEvent;\n createEvent(eventInterface: \"MediaKeyMessageEvent\"): MediaKeyMessageEvent;\n createEvent(eventInterface: \"MediaStreamErrorEvent\"): MediaStreamErrorEvent;\n createEvent(eventInterface: \"MediaStreamEvent\"): MediaStreamEvent;\n createEvent(eventInterface: \"MediaStreamTrackEvent\"): MediaStreamTrackEvent;\n createEvent(eventInterface: \"MessageEvent\"): MessageEvent;\n createEvent(eventInterface: \"MouseEvent\"): MouseEvent;\n createEvent(eventInterface: \"MouseEvents\"): MouseEvent;\n createEvent(eventInterface: \"MutationEvent\"): MutationEvent;\n createEvent(eventInterface: \"MutationEvents\"): MutationEvent;\n createEvent(eventInterface: \"OfflineAudioCompletionEvent\"): OfflineAudioCompletionEvent;\n createEvent(eventInterface: \"OverflowEvent\"): OverflowEvent;\n createEvent(eventInterface: \"PageTransitionEvent\"): PageTransitionEvent;\n createEvent(eventInterface: \"PaymentRequestUpdateEvent\"): PaymentRequestUpdateEvent;\n createEvent(eventInterface: \"PermissionRequestedEvent\"): PermissionRequestedEvent;\n createEvent(eventInterface: \"PointerEvent\"): PointerEvent;\n createEvent(eventInterface: \"PopStateEvent\"): PopStateEvent;\n createEvent(eventInterface: \"ProgressEvent\"): ProgressEvent;\n createEvent(eventInterface: \"PromiseRejectionEvent\"): PromiseRejectionEvent;\n createEvent(eventInterface: \"RTCDTMFToneChangeEvent\"): RTCDTMFToneChangeEvent;\n createEvent(eventInterface: \"RTCDtlsTransportStateChangedEvent\"): RTCDtlsTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCIceCandidatePairChangedEvent\"): RTCIceCandidatePairChangedEvent;\n createEvent(eventInterface: \"RTCIceGathererEvent\"): RTCIceGathererEvent;\n createEvent(eventInterface: \"RTCIceTransportStateChangedEvent\"): RTCIceTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceEvent\"): RTCPeerConnectionIceEvent;\n createEvent(eventInterface: \"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface: \"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface: \"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface: \"SecurityPolicyViolationEvent\"): SecurityPolicyViolationEvent;\n createEvent(eventInterface: \"ServiceWorkerMessageEvent\"): ServiceWorkerMessageEvent;\n createEvent(eventInterface: \"SpeechSynthesisEvent\"): SpeechSynthesisEvent;\n createEvent(eventInterface: \"StorageEvent\"): StorageEvent;\n createEvent(eventInterface: \"TextEvent\"): TextEvent;\n createEvent(eventInterface: \"TrackEvent\"): TrackEvent;\n createEvent(eventInterface: \"TransitionEvent\"): TransitionEvent;\n createEvent(eventInterface: \"UIEvent\"): UIEvent;\n createEvent(eventInterface: \"UIEvents\"): UIEvent;\n createEvent(eventInterface: \"VRDisplayEvent\"): VRDisplayEvent;\n createEvent(eventInterface: \"VRDisplayEvent \"): VRDisplayEvent ;\n createEvent(eventInterface: \"WebGLContextEvent\"): WebGLContextEvent;\n createEvent(eventInterface: \"WheelEvent\"): WheelEvent;\n createEvent(eventInterface: string): Event;\n}\n\ninterface DocumentFragment extends Node, ParentNode {\n getElementById(elementId: string): HTMLElement | null;\n}\n\ndeclare var DocumentFragment: {\n prototype: DocumentFragment;\n new(): DocumentFragment;\n};\n\ninterface DocumentOrShadowRoot {\n readonly activeElement: Element | null;\n readonly styleSheets: StyleSheetList;\n elementFromPoint(x: number, y: number): Element | null;\n elementsFromPoint(x: number, y: number): Element[];\n getSelection(): Selection | null;\n}\n\ninterface DocumentType extends Node, ChildNode {\n readonly entities: NamedNodeMap;\n readonly internalSubset: string | null;\n readonly name: string;\n readonly notations: NamedNodeMap;\n readonly publicId: string;\n readonly systemId: string;\n}\n\ndeclare var DocumentType: {\n prototype: DocumentType;\n new(): DocumentType;\n};\n\ninterface DragEvent extends MouseEvent {\n readonly dataTransfer: DataTransfer;\n initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void;\n msConvertURL(file: File, targetType: string, targetURL?: string): void;\n}\n\ndeclare var DragEvent: {\n prototype: DragEvent;\n new(type: \"drag\" | \"dragend\" | \"dragenter\" | \"dragexit\" | \"dragleave\" | \"dragover\" | \"dragstart\" | \"drop\", dragEventInit?: { dataTransfer?: DataTransfer }): DragEvent;\n};\n\ninterface DynamicsCompressorNode extends AudioNode {\n readonly attack: AudioParam;\n readonly knee: AudioParam;\n readonly ratio: AudioParam;\n readonly reduction: number;\n readonly release: AudioParam;\n readonly threshold: AudioParam;\n}\n\ndeclare var DynamicsCompressorNode: {\n prototype: DynamicsCompressorNode;\n new(): DynamicsCompressorNode;\n};\n\ninterface EXT_blend_minmax {\n readonly MAX_EXT: number;\n readonly MIN_EXT: number;\n}\n\ninterface EXT_frag_depth {\n}\n\ninterface EXT_sRGB {\n readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number;\n readonly SRGB8_ALPHA8_EXT: number;\n readonly SRGB_ALPHA_EXT: number;\n readonly SRGB_EXT: number;\n}\n\ninterface EXT_shader_texture_lod {\n}\n\ninterface EXT_texture_filter_anisotropic {\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n}\n\ndeclare var EXT_texture_filter_anisotropic: {\n prototype: EXT_texture_filter_anisotropic;\n new(): EXT_texture_filter_anisotropic;\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n};\n\ninterface ElementEventMap extends GlobalEventHandlersEventMap {\n \"ariarequest\": Event;\n \"command\": Event;\n \"gotpointercapture\": PointerEvent;\n \"lostpointercapture\": PointerEvent;\n \"MSGestureChange\": Event;\n \"MSGestureDoubleTap\": Event;\n \"MSGestureEnd\": Event;\n \"MSGestureHold\": Event;\n \"MSGestureStart\": Event;\n \"MSGestureTap\": Event;\n \"MSGotPointerCapture\": Event;\n \"MSInertiaStart\": Event;\n \"MSLostPointerCapture\": Event;\n \"MSPointerCancel\": Event;\n \"MSPointerDown\": Event;\n \"MSPointerEnter\": Event;\n \"MSPointerLeave\": Event;\n \"MSPointerMove\": Event;\n \"MSPointerOut\": Event;\n \"MSPointerOver\": Event;\n \"MSPointerUp\": Event;\n \"touchcancel\": Event;\n \"touchend\": Event;\n \"touchmove\": Event;\n \"touchstart\": Event;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Element extends Node, GlobalEventHandlers, ElementTraversal, ParentNode, ChildNode {\n readonly assignedSlot: HTMLSlotElement | null;\n readonly attributes: NamedNodeMap;\n readonly classList: DOMTokenList;\n className: string;\n readonly clientHeight: number;\n readonly clientLeft: number;\n readonly clientTop: number;\n readonly clientWidth: number;\n id: string;\n innerHTML: string;\n msContentZoomFactor: number;\n readonly msRegionOverflow: string;\n onariarequest: ((this: Element, ev: Event) => any) | null;\n oncommand: ((this: Element, ev: Event) => any) | null;\n ongotpointercapture: ((this: Element, ev: PointerEvent) => any) | null;\n onlostpointercapture: ((this: Element, ev: PointerEvent) => any) | null;\n onmsgesturechange: ((this: Element, ev: Event) => any) | null;\n onmsgesturedoubletap: ((this: Element, ev: Event) => any) | null;\n onmsgestureend: ((this: Element, ev: Event) => any) | null;\n onmsgesturehold: ((this: Element, ev: Event) => any) | null;\n onmsgesturestart: ((this: Element, ev: Event) => any) | null;\n onmsgesturetap: ((this: Element, ev: Event) => any) | null;\n onmsgotpointercapture: ((this: Element, ev: Event) => any) | null;\n onmsinertiastart: ((this: Element, ev: Event) => any) | null;\n onmslostpointercapture: ((this: Element, ev: Event) => any) | null;\n onmspointercancel: ((this: Element, ev: Event) => any) | null;\n onmspointerdown: ((this: Element, ev: Event) => any) | null;\n onmspointerenter: ((this: Element, ev: Event) => any) | null;\n onmspointerleave: ((this: Element, ev: Event) => any) | null;\n onmspointermove: ((this: Element, ev: Event) => any) | null;\n onmspointerout: ((this: Element, ev: Event) => any) | null;\n onmspointerover: ((this: Element, ev: Event) => any) | null;\n onmspointerup: ((this: Element, ev: Event) => any) | null;\n ontouchcancel: ((this: Element, ev: Event) => any) | null;\n ontouchend: ((this: Element, ev: Event) => any) | null;\n ontouchmove: ((this: Element, ev: Event) => any) | null;\n ontouchstart: ((this: Element, ev: Event) => any) | null;\n onwebkitfullscreenchange: ((this: Element, ev: Event) => any) | null;\n onwebkitfullscreenerror: ((this: Element, ev: Event) => any) | null;\n outerHTML: string;\n readonly prefix: string | null;\n readonly scrollHeight: number;\n scrollLeft: number;\n scrollTop: number;\n readonly scrollWidth: number;\n readonly shadowRoot: ShadowRoot | null;\n slot: string;\n readonly tagName: string;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n closest(selector: K): HTMLElementTagNameMap[K] | null;\n closest(selector: K): SVGElementTagNameMap[K] | null;\n closest(selector: string): Element | null;\n getAttribute(qualifiedName: string): string | null;\n getAttributeNS(namespaceURI: string, localName: string): string;\n getAttributeNode(name: string): Attr | null;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n getElementsByClassName(classNames: string): NodeListOf;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n hasAttribute(name: string): boolean;\n hasAttributeNS(namespaceURI: string, localName: string): boolean;\n hasAttributes(): boolean;\n insertAdjacentElement(position: InsertPosition, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: InsertPosition, html: string): void;\n insertAdjacentText(where: InsertPosition, text: string): void;\n matches(selectors: string): boolean;\n msGetRegionContent(): any;\n msGetUntransformedBounds(): ClientRect;\n msMatchesSelector(selectors: string): boolean;\n msReleasePointerCapture(pointerId: number): void;\n msSetPointerCapture(pointerId: number): void;\n msZoomTo(args: MsZoomToOptions): void;\n releasePointerCapture(pointerId: number): void;\n removeAttribute(qualifiedName: string): void;\n removeAttributeNS(namespaceURI: string, localName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n requestFullscreen(): void;\n requestPointerLock(): void;\n scroll(options?: ScrollToOptions): void;\n scroll(x: number, y: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x: number, y: number): void;\n scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x: number, y: number): void;\n setAttribute(qualifiedName: string, value: string): void;\n setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;\n setAttributeNode(newAttr: Attr): Attr;\n setAttributeNodeNS(newAttr: Attr): Attr;\n setPointerCapture(pointerId: number): void;\n webkitMatchesSelector(selectors: string): boolean;\n webkitRequestFullScreen(): void;\n webkitRequestFullscreen(): void;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Element: {\n prototype: Element;\n new(): Element;\n};\n\ninterface ElementCSSInlineStyle {\n readonly style: CSSStyleDeclaration;\n}\n\ninterface ElementCreationOptions {\n is?: string;\n}\n\ninterface ElementDefinitionOptions {\n extends: string;\n}\n\ninterface ElementTraversal {\n readonly childElementCount: number;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n readonly nextElementSibling: Element | null;\n readonly previousElementSibling: Element | null;\n}\n\ninterface ErrorEvent extends Event {\n readonly colno: number;\n readonly error: any;\n readonly filename: string;\n readonly lineno: number;\n readonly message: string;\n initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void;\n}\n\ndeclare var ErrorEvent: {\n prototype: ErrorEvent;\n new(typeArg: string, eventInitDict?: ErrorEventInit): ErrorEvent;\n};\n\ninterface Event {\n readonly bubbles: boolean;\n cancelBubble: boolean;\n readonly cancelable: boolean;\n readonly currentTarget: EventTarget | null;\n readonly defaultPrevented: boolean;\n readonly eventPhase: number;\n readonly isTrusted: boolean;\n returnValue: boolean;\n readonly scoped: boolean;\n readonly srcElement: Element | null;\n readonly target: EventTarget | null;\n readonly timeStamp: number;\n readonly type: string;\n deepPath(): EventTarget[];\n initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;\n preventDefault(): void;\n stopImmediatePropagation(): void;\n stopPropagation(): void;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n readonly NONE: number;\n}\n\ndeclare var Event: {\n prototype: Event;\n new(typeArg: string, eventInitDict?: EventInit): Event;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n readonly NONE: number;\n};\n\ninterface EventListenerObject {\n handleEvent(evt: Event): void;\n}\n\ninterface EventSource extends EventTarget {\n readonly CLOSED: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n onerror: (evt: MessageEvent) => any;\n onmessage: (evt: MessageEvent) => any;\n onopen: (evt: MessageEvent) => any;\n readonly readyState: number;\n readonly url: string;\n readonly withCredentials: boolean;\n close(): void;\n}\n\ndeclare var EventSource: {\n prototype: EventSource;\n new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;\n};\n\ninterface EventSourceInit {\n readonly withCredentials: boolean;\n}\n\ninterface EventTarget {\n addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;\n dispatchEvent(evt: Event): boolean;\n removeEventListener(type: string, listener?: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;\n}\n\ndeclare var EventTarget: {\n prototype: EventTarget;\n new(): EventTarget;\n};\n\ninterface ExtensionScriptApis {\n extensionIdToShortId(extensionId: string): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\n genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n genericWebRuntimeCallout(to: any, from: any, payload: string): void;\n getExtensionId(): string;\n registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\n registerGenericPersistentCallbackHandler(callbackHandler: Function): void;\n registerWebRuntimeCallbackHandler(handler: Function): any;\n}\n\ndeclare var ExtensionScriptApis: {\n prototype: ExtensionScriptApis;\n new(): ExtensionScriptApis;\n};\n\ninterface External {\n}\n\ndeclare var External: {\n prototype: External;\n new(): External;\n};\n\ninterface File extends Blob {\n readonly lastModified: number;\n /** @deprecated */\n readonly lastModifiedDate: Date;\n readonly name: string;\n readonly webkitRelativePath: string;\n}\n\ndeclare var File: {\n prototype: File;\n new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;\n};\n\ninterface FileList {\n readonly length: number;\n item(index: number): File | null;\n [index: number]: File;\n}\n\ndeclare var FileList: {\n prototype: FileList;\n new(): FileList;\n};\n\ninterface FilePropertyBag extends BlobPropertyBag {\n lastModified?: number;\n}\n\ninterface FileReaderEventMap {\n \"abort\": ProgressEvent;\n \"error\": ProgressEvent;\n \"load\": ProgressEvent;\n \"loadend\": ProgressEvent;\n \"loadstart\": ProgressEvent;\n \"progress\": ProgressEvent;\n}\n\ninterface FileReader extends EventTarget {\n readonly error: DOMException | null;\n onabort: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onerror: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onload: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null;\n readonly readyState: number;\n readonly result: any;\n abort(): void;\n readAsArrayBuffer(blob: Blob): void;\n readAsBinaryString(blob: Blob): void;\n readAsDataURL(blob: Blob): void;\n readAsText(blob: Blob, label?: string): void;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var FileReader: {\n prototype: FileReader;\n new(): FileReader;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n};\n\ninterface FocusEvent extends UIEvent {\n readonly relatedTarget: EventTarget;\n initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;\n}\n\ndeclare var FocusEvent: {\n prototype: FocusEvent;\n new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent;\n};\n\ninterface FocusNavigationEvent extends Event {\n readonly navigationReason: NavigationReason;\n readonly originHeight: number;\n readonly originLeft: number;\n readonly originTop: number;\n readonly originWidth: number;\n requestFocus(): void;\n}\n\ndeclare var FocusNavigationEvent: {\n prototype: FocusNavigationEvent;\n new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent;\n};\n\ninterface FormData {\n append(name: string, value: string | Blob, fileName?: string): void;\n delete(name: string): void;\n get(name: string): FormDataEntryValue | null;\n getAll(name: string): FormDataEntryValue[];\n has(name: string): boolean;\n set(name: string, value: string | Blob, fileName?: string): void;\n}\n\ndeclare var FormData: {\n prototype: FormData;\n new(): FormData;\n new(form: HTMLFormElement): FormData;\n};\n\ninterface GainNode extends AudioNode {\n readonly gain: AudioParam;\n}\n\ndeclare var GainNode: {\n prototype: GainNode;\n new(): GainNode;\n};\n\ninterface Gamepad {\n readonly axes: number[];\n readonly buttons: GamepadButton[];\n readonly connected: boolean;\n readonly displayId: number;\n readonly hand: GamepadHand;\n readonly hapticActuators: GamepadHapticActuator[];\n readonly id: string;\n readonly index: number;\n readonly mapping: GamepadMappingType;\n readonly pose: GamepadPose | null;\n readonly timestamp: number;\n}\n\ndeclare var Gamepad: {\n prototype: Gamepad;\n new(): Gamepad;\n};\n\ninterface GamepadButton {\n readonly pressed: boolean;\n readonly touched: boolean;\n readonly value: number;\n}\n\ndeclare var GamepadButton: {\n prototype: GamepadButton;\n new(): GamepadButton;\n};\n\ninterface GamepadEvent extends Event {\n readonly gamepad: Gamepad;\n}\n\ndeclare var GamepadEvent: {\n prototype: GamepadEvent;\n new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent;\n};\n\ninterface GamepadHapticActuator {\n readonly type: GamepadHapticActuatorType;\n pulse(value: number, duration: number): Promise;\n}\n\ndeclare var GamepadHapticActuator: {\n prototype: GamepadHapticActuator;\n new(): GamepadHapticActuator;\n};\n\ninterface GamepadPose {\n readonly angularAcceleration: Float32Array | null;\n readonly angularVelocity: Float32Array | null;\n readonly hasOrientation: boolean;\n readonly hasPosition: boolean;\n readonly linearAcceleration: Float32Array | null;\n readonly linearVelocity: Float32Array | null;\n readonly orientation: Float32Array | null;\n readonly position: Float32Array | null;\n}\n\ndeclare var GamepadPose: {\n prototype: GamepadPose;\n new(): GamepadPose;\n};\n\ninterface Geolocation {\n clearWatch(watchId: number): void;\n getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;\n watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;\n}\n\ndeclare var Geolocation: {\n prototype: Geolocation;\n new(): Geolocation;\n};\n\ninterface GetSVGDocument {\n getSVGDocument(): Document;\n}\n\ninterface GlobalEventHandlersEventMap {\n \"pointercancel\": PointerEvent;\n \"pointerdown\": PointerEvent;\n \"pointerenter\": PointerEvent;\n \"pointerleave\": PointerEvent;\n \"pointermove\": PointerEvent;\n \"pointerout\": PointerEvent;\n \"pointerover\": PointerEvent;\n \"pointerup\": PointerEvent;\n \"wheel\": WheelEvent;\n}\n\ninterface GlobalEventHandlers {\n onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;\n addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface GlobalFetch {\n fetch(input?: Request | string, init?: RequestInit): Promise;\n}\n\ninterface HTMLAllCollection {\n readonly length: number;\n item(nameOrIndex?: string): HTMLCollection | Element | null;\n namedItem(name: string): HTMLCollection | Element | null;\n [index: number]: Element;\n}\n\ndeclare var HTMLAllCollection: {\n prototype: HTMLAllCollection;\n new(): HTMLAllCollection;\n};\n\ninterface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {\n Methods: string;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n /** @deprecated */\n coords: string;\n download: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n readonly mimeType: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n name: string;\n readonly nameProp: string;\n readonly protocolLong: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n /** @deprecated */\n rev: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n type: string;\n urn: string;\n addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n};\n\ninterface HTMLAppletElement extends HTMLElement {\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n /** @deprecated */\n alt: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n /** @deprecated */\n archive: string;\n /** @deprecated */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n /** @deprecated */\n codeBase: string;\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n /** @deprecated */\n height: string;\n /** @deprecated */\n hspace: number;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n name: string;\n /** @deprecated */\n object: string;\n /** @deprecated */\n vspace: number;\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAppletElement: {\n prototype: HTMLAppletElement;\n new(): HTMLAppletElement;\n};\n\ninterface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils {\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n coords: string;\n download: string;\n /**\n * Sets or gets whether clicks in this region cause action.\n */\n /** @deprecated */\n noHref: boolean;\n rel: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAreaElement: {\n prototype: HTMLAreaElement;\n new(): HTMLAreaElement;\n};\n\ninterface HTMLAreasCollection extends HTMLCollectionBase {\n}\n\ndeclare var HTMLAreasCollection: {\n prototype: HTMLAreasCollection;\n new(): HTMLAreasCollection;\n};\n\ninterface HTMLAudioElement extends HTMLMediaElement {\n addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAudioElement: {\n prototype: HTMLAudioElement;\n new(): HTMLAudioElement;\n};\n\ninterface HTMLBRElement extends HTMLElement {\n /**\n * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.\n */\n /** @deprecated */\n clear: string;\n addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBRElement: {\n prototype: HTMLBRElement;\n new(): HTMLBRElement;\n};\n\ninterface HTMLBaseElement extends HTMLElement {\n /**\n * Gets or sets the baseline URL on which relative links are based.\n */\n href: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseElement: {\n prototype: HTMLBaseElement;\n new(): HTMLBaseElement;\n};\n\ninterface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n /** @deprecated */\n face: string;\n /**\n * Sets or retrieves the font size of the object.\n */\n /** @deprecated */\n size: number;\n addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseFontElement: {\n prototype: HTMLBaseFontElement;\n new(): HTMLBaseFontElement;\n};\n\ninterface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"load\": Event;\n \"orientationchange\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n}\n\ninterface HTMLBodyElement extends HTMLElement, WindowEventHandlers {\n /** @deprecated */\n aLink: string;\n /** @deprecated */\n background: string;\n /** @deprecated */\n bgColor: string;\n bgProperties: string;\n /** @deprecated */\n link: string;\n /** @deprecated */\n noWrap: boolean;\n onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null;\n onresize: ((this: HTMLBodyElement, ev: UIEvent) => any) | null;\n /** @deprecated */\n text: string;\n /** @deprecated */\n vLink: string;\n addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBodyElement: {\n prototype: HTMLBodyElement;\n new(): HTMLBodyElement;\n};\n\ninterface HTMLButtonElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: boolean;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n status: any;\n /**\n * Gets the classification and default behavior of the button.\n */\n type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the default or selected value of the control.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLButtonElement: {\n prototype: HTMLButtonElement;\n new(): HTMLButtonElement;\n};\n\ninterface HTMLCanvasElement extends HTMLElement {\n /**\n * Gets or sets the height of a canvas element on a document.\n */\n height: number;\n /**\n * Gets or sets the width of a canvas element on a document.\n */\n width: number;\n /**\n * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.\n * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext(\"2d\"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext(\"experimental-webgl\");\n */\n getContext(contextId: \"2d\", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null;\n getContext(contextId: \"webgl\" | \"experimental-webgl\", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;\n getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;\n /**\n * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.\n */\n msToBlob(): Blob;\n toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void;\n /**\n * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.\n * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.\n */\n toDataURL(type?: string, ...args: any[]): string;\n addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLCanvasElement: {\n prototype: HTMLCanvasElement;\n new(): HTMLCanvasElement;\n};\n\ninterface HTMLCollectionBase {\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Retrieves an object from various collections.\n */\n item(index: number): Element;\n [index: number]: Element;\n}\n\ninterface HTMLCollection extends HTMLCollectionBase {\n /**\n * Retrieves a select object or an object from an options collection.\n */\n namedItem(name: string): Element | null;\n}\n\ndeclare var HTMLCollection: {\n prototype: HTMLCollection;\n new(): HTMLCollection;\n};\n\ninterface HTMLCollectionOf extends HTMLCollectionBase {\n item(index: number): T;\n namedItem(name: string): T;\n [index: number]: T;\n}\n\ninterface HTMLDListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDListElement: {\n prototype: HTMLDListElement;\n new(): HTMLDListElement;\n};\n\ninterface HTMLDataElement extends HTMLElement {\n value: string;\n addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataElement: {\n prototype: HTMLDataElement;\n new(): HTMLDataElement;\n};\n\ninterface HTMLDataListElement extends HTMLElement {\n readonly options: HTMLCollectionOf;\n addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataListElement: {\n prototype: HTMLDataListElement;\n new(): HTMLDataListElement;\n};\n\ninterface HTMLDetailsElement extends HTMLElement {\n open: boolean;\n addEventListener(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDetailsElement: {\n prototype: HTMLDetailsElement;\n new(): HTMLDetailsElement;\n};\n\ninterface HTMLDialogElement extends HTMLElement {\n open: boolean;\n returnValue: string;\n close(returnValue?: string): void;\n show(): void;\n showModal(): void;\n addEventListener(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDialogElement: {\n prototype: HTMLDialogElement;\n new(): HTMLDialogElement;\n};\n\ninterface HTMLDirectoryElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDirectoryElement: {\n prototype: HTMLDirectoryElement;\n new(): HTMLDirectoryElement;\n};\n\ninterface HTMLDivElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n noWrap: boolean;\n addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDivElement: {\n prototype: HTMLDivElement;\n new(): HTMLDivElement;\n};\n\ninterface HTMLDocument extends Document {\n addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDocument: {\n prototype: HTMLDocument;\n new(): HTMLDocument;\n};\n\ninterface HTMLElementEventMap extends ElementEventMap {\n \"abort\": UIEvent;\n \"activate\": Event;\n \"beforeactivate\": Event;\n \"beforecopy\": Event;\n \"beforecut\": Event;\n \"beforedeactivate\": Event;\n \"beforepaste\": Event;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"copy\": ClipboardEvent;\n \"cuechange\": Event;\n \"cut\": ClipboardEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": Event;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": Event;\n \"MSManipulationStateChanged\": Event;\n \"paste\": ClipboardEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface HTMLElement extends Element, ElementCSSInlineStyle {\n accessKey: string;\n contentEditable: string;\n readonly dataset: DOMStringMap;\n dir: string;\n draggable: boolean;\n hidden: boolean;\n hideFocus: boolean;\n innerText: string;\n readonly isContentEditable: boolean;\n lang: string;\n readonly offsetHeight: number;\n readonly offsetLeft: number;\n readonly offsetParent: Element;\n readonly offsetTop: number;\n readonly offsetWidth: number;\n onabort: ((this: HTMLElement, ev: UIEvent) => any) | null;\n onactivate: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforeactivate: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforecopy: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforecut: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforedeactivate: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforepaste: ((this: HTMLElement, ev: Event) => any) | null;\n onblur: ((this: HTMLElement, ev: FocusEvent) => any) | null;\n oncanplay: ((this: HTMLElement, ev: Event) => any) | null;\n oncanplaythrough: ((this: HTMLElement, ev: Event) => any) | null;\n onchange: ((this: HTMLElement, ev: Event) => any) | null;\n onclick: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n oncontextmenu: ((this: HTMLElement, ev: PointerEvent) => any) | null;\n oncopy: ((this: HTMLElement, ev: ClipboardEvent) => any) | null;\n oncuechange: ((this: HTMLElement, ev: Event) => any) | null;\n oncut: ((this: HTMLElement, ev: ClipboardEvent) => any) | null;\n ondblclick: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n ondeactivate: ((this: HTMLElement, ev: Event) => any) | null;\n ondrag: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragend: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragenter: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragleave: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragover: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragstart: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondrop: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondurationchange: ((this: HTMLElement, ev: Event) => any) | null;\n onemptied: ((this: HTMLElement, ev: Event) => any) | null;\n onended: ((this: HTMLElement, ev: Event) => any) | null;\n onerror: ((this: HTMLElement, ev: ErrorEvent) => any) | null;\n onfocus: ((this: HTMLElement, ev: FocusEvent) => any) | null;\n oninput: ((this: HTMLElement, ev: Event) => any) | null;\n oninvalid: ((this: HTMLElement, ev: Event) => any) | null;\n onkeydown: ((this: HTMLElement, ev: KeyboardEvent) => any) | null;\n onkeypress: ((this: HTMLElement, ev: KeyboardEvent) => any) | null;\n onkeyup: ((this: HTMLElement, ev: KeyboardEvent) => any) | null;\n onload: ((this: HTMLElement, ev: Event) => any) | null;\n onloadeddata: ((this: HTMLElement, ev: Event) => any) | null;\n onloadedmetadata: ((this: HTMLElement, ev: Event) => any) | null;\n onloadstart: ((this: HTMLElement, ev: Event) => any) | null;\n onmousedown: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseenter: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseleave: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmousemove: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseout: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseover: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseup: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmousewheel: ((this: HTMLElement, ev: WheelEvent) => any) | null;\n onmscontentzoom: ((this: HTMLElement, ev: Event) => any) | null;\n onmsmanipulationstatechanged: ((this: HTMLElement, ev: Event) => any) | null;\n onpaste: ((this: HTMLElement, ev: ClipboardEvent) => any) | null;\n onpause: ((this: HTMLElement, ev: Event) => any) | null;\n onplay: ((this: HTMLElement, ev: Event) => any) | null;\n onplaying: ((this: HTMLElement, ev: Event) => any) | null;\n onprogress: ((this: HTMLElement, ev: ProgressEvent) => any) | null;\n onratechange: ((this: HTMLElement, ev: Event) => any) | null;\n onreset: ((this: HTMLElement, ev: Event) => any) | null;\n onscroll: ((this: HTMLElement, ev: UIEvent) => any) | null;\n onseeked: ((this: HTMLElement, ev: Event) => any) | null;\n onseeking: ((this: HTMLElement, ev: Event) => any) | null;\n onselect: ((this: HTMLElement, ev: UIEvent) => any) | null;\n onselectstart: ((this: HTMLElement, ev: Event) => any) | null;\n onstalled: ((this: HTMLElement, ev: Event) => any) | null;\n onsubmit: ((this: HTMLElement, ev: Event) => any) | null;\n onsuspend: ((this: HTMLElement, ev: Event) => any) | null;\n ontimeupdate: ((this: HTMLElement, ev: Event) => any) | null;\n onvolumechange: ((this: HTMLElement, ev: Event) => any) | null;\n onwaiting: ((this: HTMLElement, ev: Event) => any) | null;\n outerText: string;\n spellcheck: boolean;\n tabIndex: number;\n title: string;\n animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation;\n blur(): void;\n click(): void;\n dragDrop(): boolean;\n focus(): void;\n msGetInputContext(): MSInputMethodContext;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLElement: {\n prototype: HTMLElement;\n new(): HTMLElement;\n};\n\ninterface HTMLEmbedElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hidden: any;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n /** @deprecated */\n name: string;\n /**\n * Retrieves the palette used for the embedded document.\n */\n readonly palette: string;\n /**\n * Retrieves the URL of the plug-in used to view an embedded document.\n */\n readonly pluginspage: string;\n readonly readyState: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the height and width units of the embed object.\n */\n units: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLEmbedElement: {\n prototype: HTMLEmbedElement;\n new(): HTMLEmbedElement;\n};\n\ninterface HTMLFieldSetElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n name: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFieldSetElement: {\n prototype: HTMLFieldSetElement;\n new(): HTMLFieldSetElement;\n};\n\ninterface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n /** @deprecated */\n face: string;\n addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFontElement: {\n prototype: HTMLFontElement;\n new(): HTMLFontElement;\n};\n\ninterface HTMLFormControlsCollection extends HTMLCollectionBase {\n namedItem(name: string): HTMLCollection | Element | null;\n}\n\ndeclare var HTMLFormControlsCollection: {\n prototype: HTMLFormControlsCollection;\n new(): HTMLFormControlsCollection;\n};\n\ninterface HTMLFormElement extends HTMLElement {\n /**\n * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.\n */\n acceptCharset: string;\n /**\n * Sets or retrieves the URL to which the form content is sent for processing.\n */\n action: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Retrieves a collection, in source order, of all controls in a given form.\n */\n readonly elements: HTMLFormControlsCollection;\n /**\n * Sets or retrieves the MIME encoding for the form.\n */\n encoding: string;\n /**\n * Sets or retrieves the encoding type for the form.\n */\n enctype: string;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Sets or retrieves how to send the form data to the server.\n */\n method: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Designates a form that is not validated when submitted.\n */\n noValidate: boolean;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a form object or an object from an elements collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): any;\n /**\n * Retrieves a form object or an object from an elements collection.\n */\n namedItem(name: string): any;\n reportValidity(): boolean;\n /**\n * Fires when the user resets a form.\n */\n reset(): void;\n /**\n * Fires when a FORM is about to be submitted.\n */\n submit(): void;\n addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLFormElement: {\n prototype: HTMLFormElement;\n new(): HTMLFormElement;\n};\n\ninterface HTMLFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Retrieves the document object of the page or frame.\n */\n /** @deprecated */\n readonly contentDocument: Document | null;\n /**\n * Retrieves the object of the specified.\n */\n /** @deprecated */\n readonly contentWindow: Window | null;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n /** @deprecated */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string | number;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n /** @deprecated */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n /** @deprecated */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n /** @deprecated */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n /** @deprecated */\n name: string;\n /**\n * Sets or retrieves whether the user can resize the frame.\n */\n /** @deprecated */\n noResize: boolean;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n /** @deprecated */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n /** @deprecated */\n src: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string | number;\n addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameElement: {\n prototype: HTMLFrameElement;\n new(): HTMLFrameElement;\n};\n\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"load\": Event;\n \"orientationchange\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n}\n\ninterface HTMLFrameSetElement extends HTMLElement, WindowEventHandlers {\n /**\n * Sets or retrieves the frame widths of the object.\n */\n /** @deprecated */\n cols: string;\n name: string;\n onorientationchange: ((this: HTMLFrameSetElement, ev: Event) => any) | null;\n onresize: ((this: HTMLFrameSetElement, ev: UIEvent) => any) | null;\n /**\n * Sets or retrieves the frame heights of the object.\n */\n /** @deprecated */\n rows: string;\n addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameSetElement: {\n prototype: HTMLFrameSetElement;\n new(): HTMLFrameSetElement;\n};\n\ninterface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.\n */\n /** @deprecated */\n noShade: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n};\n\ninterface HTMLHeadElement extends HTMLElement {\n /** @deprecated */\n profile: string;\n addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadElement: {\n prototype: HTMLHeadElement;\n new(): HTMLHeadElement;\n};\n\ninterface HTMLHeadingElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadingElement: {\n prototype: HTMLHeadingElement;\n new(): HTMLHeadingElement;\n};\n\ninterface HTMLHtmlElement extends HTMLElement {\n /**\n * Sets or retrieves the DTD version that governs the current document.\n */\n /** @deprecated */\n version: string;\n addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHtmlElement: {\n prototype: HTMLHtmlElement;\n new(): HTMLHtmlElement;\n};\n\ninterface HTMLHyperlinkElementUtils {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n origin: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n toString(): string;\n}\n\ninterface HTMLIFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLIFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n allowFullscreen: boolean;\n allowPaymentRequest: boolean;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document | null;\n /**\n * Retrieves the object of the specified.\n */\n readonly contentWindow: Window | null;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n /** @deprecated */\n frameBorder: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n /** @deprecated */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n /** @deprecated */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n /** @deprecated */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n name: string;\n readonly sandbox: DOMTokenList;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n /** @deprecated */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrives the content of the page that is to contain.\n */\n srcdoc: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLIFrameElement: {\n prototype: HTMLIFrameElement;\n new(): HTMLIFrameElement;\n};\n\ninterface HTMLImageElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies the properties of a border drawn around an object.\n */\n /** @deprecated */\n border: string;\n /**\n * Retrieves whether the object is fully loaded.\n */\n readonly complete: boolean;\n crossOrigin: string | null;\n readonly currentSrc: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n /** @deprecated */\n hspace: number;\n /**\n * Sets or retrieves whether the image is a server-side image map.\n */\n isMap: boolean;\n /**\n * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.\n */\n longDesc: string;\n /** @deprecated */\n lowsrc: string;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n /** @deprecated */\n name: string;\n /**\n * The original height of the image resource before sizing.\n */\n readonly naturalHeight: number;\n /**\n * The original width of the image resource before sizing.\n */\n readonly naturalWidth: number;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n /** @deprecated */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n readonly x: number;\n readonly y: number;\n msGetAsCastingSource(): any;\n addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLImageElement: {\n prototype: HTMLImageElement;\n new(): HTMLImageElement;\n};\n\ninterface HTMLInputElement extends HTMLElement {\n /**\n * Sets or retrieves a comma-separated list of content types.\n */\n accept: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n checked: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n defaultChecked: boolean;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Returns a FileList object on a file type input object.\n */\n readonly files: FileList | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: boolean;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n indeterminate: boolean;\n /**\n * Specifies the ID of a pre-defined datalist of options for an input element.\n */\n readonly list: HTMLElement | null;\n /**\n * Defines the maximum acceptable value for an input element with type=\"number\".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.\n */\n max: string;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n /**\n * Defines the minimum acceptable value for an input element with type=\"number\". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.\n */\n min: string;\n minLength: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a string containing a regular expression that the user's input must match.\n */\n pattern: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n selectionDirection: string | null;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number | null;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number | null;\n size: number;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n /**\n * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.\n */\n step: string;\n /**\n * Returns the content type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n /** @deprecated */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns the value of the data at the cursor's current position.\n */\n value: string;\n valueAsDate: any;\n /**\n * Returns the input field value as a number.\n */\n valueAsNumber: number;\n webkitdirectory: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Makes the selection equal to the current object.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n /**\n * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.\n * @param n Value to decrement the value by.\n */\n stepDown(n?: number): void;\n /**\n * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.\n * @param n Value to increment the value by.\n */\n stepUp(n?: number): void;\n addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\n};\n\ninterface HTMLLIElement extends HTMLElement {\n /** @deprecated */\n type: string;\n /**\n * Sets or retrieves the value of a list item.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\n};\n\ninterface HTMLLabelElement extends HTMLElement {\n readonly control: HTMLInputElement | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the object to which the given label object is assigned.\n */\n htmlFor: string;\n addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLabelElement: {\n prototype: HTMLLabelElement;\n new(): HTMLLabelElement;\n};\n\ninterface HTMLLegendElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n /** @deprecated */\n align: string;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLegendElement: {\n prototype: HTMLLegendElement;\n new(): HTMLLegendElement;\n};\n\ninterface HTMLLinkElement extends HTMLElement, LinkStyle {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n crossOrigin: string | null;\n /** @deprecated */\n disabled: boolean;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n import?: Document;\n integrity: string;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n /** @deprecated */\n rev: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n /** @deprecated */\n target: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLinkElement: {\n prototype: HTMLLinkElement;\n new(): HTMLLinkElement;\n};\n\ninterface HTMLMainElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLMainElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMainElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMainElement: {\n prototype: HTMLMainElement;\n new(): HTMLMainElement;\n};\n\ninterface HTMLMapElement extends HTMLElement {\n /**\n * Retrieves a collection of the area objects defined for the given map object.\n */\n readonly areas: HTMLAreasCollection;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMapElement: {\n prototype: HTMLMapElement;\n new(): HTMLMapElement;\n};\n\ninterface HTMLMarqueeElementEventMap extends HTMLElementEventMap {\n \"bounce\": Event;\n \"finish\": Event;\n \"start\": Event;\n}\n\ninterface HTMLMarqueeElement extends HTMLElement {\n /** @deprecated */\n behavior: string;\n /** @deprecated */\n bgColor: string;\n /** @deprecated */\n direction: string;\n /** @deprecated */\n height: string;\n /** @deprecated */\n hspace: number;\n /** @deprecated */\n loop: number;\n /** @deprecated */\n onbounce: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n onfinish: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n onstart: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n scrollAmount: number;\n /** @deprecated */\n scrollDelay: number;\n /** @deprecated */\n trueSpeed: boolean;\n /** @deprecated */\n vspace: number;\n /** @deprecated */\n width: string;\n /** @deprecated */\n start(): void;\n /** @deprecated */\n stop(): void;\n addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMarqueeElement: {\n prototype: HTMLMarqueeElement;\n new(): HTMLMarqueeElement;\n};\n\ninterface HTMLMediaElementEventMap extends HTMLElementEventMap {\n \"encrypted\": MediaEncryptedEvent;\n \"msneedkey\": Event;\n}\n\ninterface HTMLMediaElement extends HTMLElement {\n /**\n * Returns an AudioTrackList object with the audio tracks for a given video element.\n */\n readonly audioTracks: AudioTrackList;\n /**\n * Gets or sets a value that indicates whether to start playing the media automatically.\n */\n autoplay: boolean;\n /**\n * Gets a collection of buffered time ranges.\n */\n readonly buffered: TimeRanges;\n /**\n * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).\n */\n controls: boolean;\n crossOrigin: string | null;\n /**\n * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.\n */\n readonly currentSrc: string;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n currentTime: number;\n defaultMuted: boolean;\n /**\n * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.\n */\n defaultPlaybackRate: number;\n /**\n * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.\n */\n readonly duration: number;\n /**\n * Gets information about whether the playback has ended or not.\n */\n readonly ended: boolean;\n /**\n * Returns an object representing the current error state of the audio or video element.\n */\n readonly error: MediaError | null;\n /**\n * Gets or sets a flag to specify whether playback should restart after it completes.\n */\n loop: boolean;\n readonly mediaKeys: MediaKeys | null;\n /**\n * Specifies the purpose of the audio or video media, such as background audio or alerts.\n */\n msAudioCategory: string;\n /**\n * Specifies the output device id that the audio will be sent to.\n */\n msAudioDeviceType: string;\n readonly msGraphicsTrustStatus: MSGraphicsTrust;\n /**\n * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element.\n */\n /** @deprecated */\n readonly msKeys: MSMediaKeys;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Specifies whether or not to enable low-latency playback on the media element.\n */\n msRealTime: boolean;\n /**\n * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.\n */\n muted: boolean;\n /**\n * Gets the current network activity for the element.\n */\n readonly networkState: number;\n onencrypted: ((this: HTMLMediaElement, ev: MediaEncryptedEvent) => any) | null;\n /** @deprecated */\n onmsneedkey: ((this: HTMLMediaElement, ev: Event) => any) | null;\n /**\n * Gets a flag that specifies whether playback is paused.\n */\n readonly paused: boolean;\n /**\n * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.\n */\n playbackRate: number;\n /**\n * Gets TimeRanges for the current media resource that has been played.\n */\n readonly played: TimeRanges;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n preload: string;\n readonly readyState: number;\n /**\n * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.\n */\n readonly seekable: TimeRanges;\n /**\n * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource.\n */\n readonly seeking: boolean;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcObject: MediaStream | MediaSource | Blob | null;\n readonly textTracks: TextTrackList;\n readonly videoTracks: VideoTrackList;\n /**\n * Gets or sets the volume level for audio portions of the media element.\n */\n volume: number;\n addTextTrack(kind: TextTrackKind, label?: string, language?: string): TextTrack;\n /**\n * Returns a string that specifies whether the client can play a given media resource type.\n */\n canPlayType(type: string): CanPlayTypeResult;\n /**\n * Resets the audio or video object and loads a new media resource.\n */\n load(): void;\n /**\n * Clears all effects from the media pipeline.\n */\n msClearEffects(): void;\n msGetAsCastingSource(): any;\n /**\n * Inserts the specified audio effect into media pipeline.\n */\n msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n /** @deprecated */\n msSetMediaKeys(mediaKeys: MSMediaKeys): void;\n /**\n * Specifies the media protection manager for a given media pipeline.\n */\n msSetMediaProtectionManager(mediaProtectionManager?: any): void;\n /**\n * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.\n */\n pause(): void;\n /**\n * Loads and starts playback of a media resource.\n */\n play(): Promise;\n setMediaKeys(mediaKeys: MediaKeys | null): Promise;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMediaElement: {\n prototype: HTMLMediaElement;\n new(): HTMLMediaElement;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n};\n\ninterface HTMLMenuElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n type: string;\n addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMenuElement: {\n prototype: HTMLMenuElement;\n new(): HTMLMenuElement;\n};\n\ninterface HTMLMetaElement extends HTMLElement {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n /**\n * Gets or sets meta-information to associate with httpEquiv or name.\n */\n content: string;\n /**\n * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.\n */\n httpEquiv: string;\n /**\n * Sets or retrieves the value specified in the content attribute of the meta object.\n */\n name: string;\n /**\n * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.\n */\n /** @deprecated */\n scheme: string;\n /**\n * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.\n */\n /** @deprecated */\n url: string;\n addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMetaElement: {\n prototype: HTMLMetaElement;\n new(): HTMLMetaElement;\n};\n\ninterface HTMLMeterElement extends HTMLElement {\n high: number;\n low: number;\n max: number;\n min: number;\n optimum: number;\n value: number;\n addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMeterElement: {\n prototype: HTMLMeterElement;\n new(): HTMLMeterElement;\n};\n\ninterface HTMLModElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n /**\n * Sets or retrieves the date and time of a modification to the object.\n */\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\n};\n\ninterface HTMLOListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n /**\n * The starting number.\n */\n start: number;\n type: string;\n addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOListElement: {\n prototype: HTMLOListElement;\n new(): HTMLOListElement;\n};\n\ninterface HTMLObjectElement extends HTMLElement, GetSVGDocument {\n /**\n * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.\n */\n readonly BaseHref: string;\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n /** @deprecated */\n archive: string;\n /** @deprecated */\n border: string;\n /**\n * Sets or retrieves the URL of the file containing the compiled Java class.\n */\n /** @deprecated */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n /** @deprecated */\n codeBase: string;\n /**\n * Sets or retrieves the Internet media type for the code associated with the object.\n */\n /** @deprecated */\n codeType: string;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document | null;\n /**\n * Sets or retrieves the URL that references the data of the object.\n */\n data: string;\n /** @deprecated */\n declare: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /** @deprecated */\n hspace: number;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly readyState: number;\n /**\n * Sets or retrieves a message to be displayed while an object is loading.\n */\n /** @deprecated */\n standby: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n typemustmatch: boolean;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /** @deprecated */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\n};\n\ninterface HTMLOptGroupElement extends HTMLElement {\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptGroupElement: {\n prototype: HTMLOptGroupElement;\n new(): HTMLOptGroupElement;\n};\n\ninterface HTMLOptionElement extends HTMLElement {\n /**\n * Sets or retrieves the status of an option.\n */\n defaultSelected: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the ordinal position of an option in a list box.\n */\n readonly index: number;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n /**\n * Sets or retrieves whether the option in the list box is the default item.\n */\n selected: boolean;\n /**\n * Sets or retrieves the text string specified by the option tag.\n */\n text: string;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptionElement: {\n prototype: HTMLOptionElement;\n new(): HTMLOptionElement;\n};\n\ninterface HTMLOptionsCollection extends HTMLCollectionOf {\n length: number;\n selectedIndex: number;\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\n remove(index: number): void;\n}\n\ndeclare var HTMLOptionsCollection: {\n prototype: HTMLOptionsCollection;\n new(): HTMLOptionsCollection;\n};\n\ninterface HTMLOutputElement extends HTMLElement {\n defaultValue: string;\n readonly form: HTMLFormElement | null;\n readonly htmlFor: DOMTokenList;\n name: string;\n readonly type: string;\n readonly validationMessage: string;\n readonly validity: ValidityState;\n value: string;\n readonly willValidate: boolean;\n checkValidity(): boolean;\n reportValidity(): boolean;\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOutputElement: {\n prototype: HTMLOutputElement;\n new(): HTMLOutputElement;\n};\n\ninterface HTMLParagraphElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n clear: string;\n addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParagraphElement: {\n prototype: HTMLParagraphElement;\n new(): HTMLParagraphElement;\n};\n\ninterface HTMLParamElement extends HTMLElement {\n /**\n * Sets or retrieves the name of an input parameter for an element.\n */\n name: string;\n /**\n * Sets or retrieves the content type of the resource designated by the value attribute.\n */\n /** @deprecated */\n type: string;\n /**\n * Sets or retrieves the value of an input parameter for an element.\n */\n value: string;\n /**\n * Sets or retrieves the data type of the value attribute.\n */\n /** @deprecated */\n valueType: string;\n addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParamElement: {\n prototype: HTMLParamElement;\n new(): HTMLParamElement;\n};\n\ninterface HTMLPictureElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPictureElement: {\n prototype: HTMLPictureElement;\n new(): HTMLPictureElement;\n};\n\ninterface HTMLPreElement extends HTMLElement {\n /**\n * Sets or gets a value that you can use to implement your own width functionality for the object.\n */\n /** @deprecated */\n width: number;\n addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPreElement: {\n prototype: HTMLPreElement;\n new(): HTMLPreElement;\n};\n\ninterface HTMLProgressElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Defines the maximum, or \"done\" value for a progress element.\n */\n max: number;\n /**\n * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).\n */\n readonly position: number;\n /**\n * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLProgressElement: {\n prototype: HTMLProgressElement;\n new(): HTMLProgressElement;\n};\n\ninterface HTMLQuoteElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLQuoteElement: {\n prototype: HTMLQuoteElement;\n new(): HTMLQuoteElement;\n};\n\ninterface HTMLScriptElement extends HTMLElement {\n async: boolean;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n crossOrigin: string | null;\n /**\n * Sets or retrieves the status of the script.\n */\n defer: boolean;\n /**\n * Sets or retrieves the event for which the script is written.\n */\n /** @deprecated */\n event: string;\n /**\n * Sets or retrieves the object that is bound to the event script.\n */\n /** @deprecated */\n htmlFor: string;\n integrity: string;\n noModule: boolean;\n /**\n * Retrieves the URL to an external file that contains the source code or data.\n */\n src: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n /**\n * Sets or retrieves the MIME type for the associated scripting engine.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLScriptElement: {\n prototype: HTMLScriptElement;\n new(): HTMLScriptElement;\n};\n\ninterface HTMLSelectElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n length: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly options: HTMLOptionsCollection;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the index of the selected option in a select object.\n */\n selectedIndex: number;\n readonly selectedOptions: HTMLCollectionOf;\n /**\n * Sets or retrieves the number of rows in the list box.\n */\n size: number;\n /**\n * Retrieves the type of select control based on the value of the MULTIPLE attribute.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Adds an element to the areas, controlRange, or options collection.\n * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.\n * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.\n */\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): Element | null;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.\n */\n namedItem(name: string): any;\n /**\n * Removes an element from the collection.\n * @param index Number that specifies the zero-based index of the element to remove from the collection.\n */\n remove(index?: number): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLSelectElement: {\n prototype: HTMLSelectElement;\n new(): HTMLSelectElement;\n};\n\ninterface HTMLSlotElement extends HTMLElement {\n name: string;\n assignedNodes(options?: AssignedNodesOptions): Node[];\n addEventListener(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface HTMLSourceElement extends HTMLElement {\n /**\n * Gets or sets the intended media type of the media source.\n */\n media: string;\n /** @deprecated */\n msKeySystem: string;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Gets or sets the MIME type of a media resource.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSourceElement: {\n prototype: HTMLSourceElement;\n new(): HTMLSourceElement;\n};\n\ninterface HTMLSpanElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSpanElement: {\n prototype: HTMLSpanElement;\n new(): HTMLSpanElement;\n};\n\ninterface HTMLStyleElement extends HTMLElement, LinkStyle {\n /** @deprecated */\n disabled: boolean;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Retrieves the CSS language in which the style sheet is written.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLStyleElement: {\n prototype: HTMLStyleElement;\n new(): HTMLStyleElement;\n};\n\ninterface HTMLSummaryElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLSummaryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSummaryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSummaryElement: {\n prototype: HTMLSummaryElement;\n new(): HTMLSummaryElement;\n};\n\ninterface HTMLTableCaptionElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the caption or legend.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCaptionElement: {\n prototype: HTMLTableCaptionElement;\n new(): HTMLTableCaptionElement;\n};\n\ninterface HTMLTableCellElement extends HTMLElement {\n /**\n * Sets or retrieves abbreviated text for the object.\n */\n abbr: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.\n */\n /** @deprecated */\n axis: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Retrieves the position of the object in the cells collection of a row.\n */\n readonly cellIndex: number;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number columns in the table that the object should span.\n */\n colSpan: number;\n /**\n * Sets or retrieves a list of header cells that provide information for the object.\n */\n headers: string;\n /**\n * Sets or retrieves the height of the object.\n */\n /** @deprecated */\n height: string;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n /** @deprecated */\n noWrap: boolean;\n /**\n * Sets or retrieves how many rows in a table the cell should span.\n */\n rowSpan: number;\n /**\n * Sets or retrieves the group of cells in a table to which the object's information applies.\n */\n scope: string;\n /** @deprecated */\n vAlign: string;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCellElement: {\n prototype: HTMLTableCellElement;\n new(): HTMLTableCellElement;\n};\n\ninterface HTMLTableColElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the object relative to the display or table.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number of columns in the group.\n */\n span: number;\n /** @deprecated */\n vAlign: string;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableColElement: {\n prototype: HTMLTableColElement;\n new(): HTMLTableColElement;\n};\n\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\n addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableDataCellElement: {\n prototype: HTMLTableDataCellElement;\n new(): HTMLTableDataCellElement;\n};\n\ninterface HTMLTableElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n /** @deprecated */\n border: string;\n /**\n * Retrieves the caption object of a table.\n */\n caption: HTMLTableCaptionElement | null;\n /**\n * Sets or retrieves the amount of space between the border of the cell and the content of the cell.\n */\n /** @deprecated */\n cellPadding: string;\n /**\n * Sets or retrieves the amount of space between cells in a table.\n */\n /** @deprecated */\n cellSpacing: string;\n /**\n * Sets or retrieves the way the border frame around the table is displayed.\n */\n /** @deprecated */\n frame: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n readonly rows: HTMLCollectionOf;\n /**\n * Sets or retrieves which dividing lines (inner borders) are displayed.\n */\n /** @deprecated */\n rules: string;\n /**\n * Sets or retrieves a description and/or structure of the object.\n */\n /** @deprecated */\n summary: string;\n /**\n * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.\n */\n readonly tBodies: HTMLCollectionOf;\n /**\n * Retrieves the tFoot object of the table.\n */\n tFoot: HTMLTableSectionElement | null;\n /**\n * Retrieves the tHead object of the table.\n */\n tHead: HTMLTableSectionElement | null;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n /**\n * Creates an empty caption element in the table.\n */\n createCaption(): HTMLTableCaptionElement;\n /**\n * Creates an empty tBody element in the table.\n */\n createTBody(): HTMLTableSectionElement;\n /**\n * Creates an empty tFoot element in the table.\n */\n createTFoot(): HTMLTableSectionElement;\n /**\n * Returns the tHead element object if successful, or null otherwise.\n */\n createTHead(): HTMLTableSectionElement;\n /**\n * Deletes the caption element and its contents from the table.\n */\n deleteCaption(): void;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Deletes the tFoot element and its contents from the table.\n */\n deleteTFoot(): void;\n /**\n * Deletes the tHead element and its contents from the table.\n */\n deleteTHead(): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableElement: {\n prototype: HTMLTableElement;\n new(): HTMLTableElement;\n};\n\ninterface HTMLTableHeaderCellElement extends HTMLTableCellElement {\n scope: string;\n addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableHeaderCellElement: {\n prototype: HTMLTableHeaderCellElement;\n new(): HTMLTableHeaderCellElement;\n};\n\ninterface HTMLTableRowElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Retrieves a collection of all cells in the table row.\n */\n readonly cells: HTMLCollectionOf;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Retrieves the position of the object in the rows collection for the table.\n */\n readonly rowIndex: number;\n /**\n * Retrieves the position of the object in the collection.\n */\n readonly sectionRowIndex: number;\n /** @deprecated */\n vAlign: string;\n /**\n * Removes the specified cell from the table row, as well as from the cells collection.\n * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.\n */\n deleteCell(index?: number): void;\n /**\n * Creates a new cell in the table row, and adds the cell to the cells collection.\n * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.\n */\n insertCell(index?: number): HTMLTableDataCellElement;\n addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableRowElement: {\n prototype: HTMLTableRowElement;\n new(): HTMLTableRowElement;\n};\n\ninterface HTMLTableSectionElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n readonly rows: HTMLCollectionOf;\n /** @deprecated */\n vAlign: string;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableSectionElement: {\n prototype: HTMLTableSectionElement;\n new(): HTMLTableSectionElement;\n};\n\ninterface HTMLTemplateElement extends HTMLElement {\n readonly content: DocumentFragment;\n addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTemplateElement: {\n prototype: HTMLTemplateElement;\n new(): HTMLTemplateElement;\n};\n\ninterface HTMLTextAreaElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n cols: number;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n minLength: number;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n /**\n * Sets or retrieves the value indicated whether the content of the object is read-only.\n */\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: number;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number;\n /**\n * Retrieves the type of control.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Retrieves or sets the text in the entry field of the textArea element.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Sets or retrieves how to handle wordwrapping in the object.\n */\n wrap: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Highlights the input area of a form element.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTextAreaElement: {\n prototype: HTMLTextAreaElement;\n new(): HTMLTextAreaElement;\n};\n\ninterface HTMLTimeElement extends HTMLElement {\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTimeElement: {\n prototype: HTMLTimeElement;\n new(): HTMLTimeElement;\n};\n\ninterface HTMLTitleElement extends HTMLElement {\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTitleElement: {\n prototype: HTMLTitleElement;\n new(): HTMLTitleElement;\n};\n\ninterface HTMLTrackElement extends HTMLElement {\n default: boolean;\n kind: string;\n label: string;\n readonly readyState: number;\n src: string;\n srclang: string;\n readonly track: TextTrack;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTrackElement: {\n prototype: HTMLTrackElement;\n new(): HTMLTrackElement;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n};\n\ninterface HTMLUListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n /** @deprecated */\n type: string;\n addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUListElement: {\n prototype: HTMLUListElement;\n new(): HTMLUListElement;\n};\n\ninterface HTMLUnknownElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUnknownElement: {\n prototype: HTMLUnknownElement;\n new(): HTMLUnknownElement;\n};\n\ninterface HTMLVideoElementEventMap extends HTMLMediaElementEventMap {\n \"MSVideoFormatChanged\": Event;\n \"MSVideoFrameStepCompleted\": Event;\n \"MSVideoOptimalLayoutChanged\": Event;\n}\n\ninterface HTMLVideoElement extends HTMLMediaElement {\n /**\n * Gets or sets the height of the video element.\n */\n height: number;\n msHorizontalMirror: boolean;\n readonly msIsLayoutOptimalForPlayback: boolean;\n readonly msIsStereo3D: boolean;\n msStereo3DPackingMode: string;\n msStereo3DRenderMode: string;\n msZoom: boolean;\n onMSVideoFormatChanged: ((this: HTMLVideoElement, ev: Event) => any) | null;\n onMSVideoFrameStepCompleted: ((this: HTMLVideoElement, ev: Event) => any) | null;\n onMSVideoOptimalLayoutChanged: ((this: HTMLVideoElement, ev: Event) => any) | null;\n /**\n * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.\n */\n poster: string;\n /**\n * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoHeight: number;\n /**\n * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoWidth: number;\n readonly webkitDisplayingFullscreen: boolean;\n readonly webkitSupportsFullscreen: boolean;\n /**\n * Gets or sets the width of the video element.\n */\n width: number;\n getVideoPlaybackQuality(): VideoPlaybackQuality;\n msFrameStep(forward: boolean): void;\n msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void;\n webkitEnterFullScreen(): void;\n webkitEnterFullscreen(): void;\n webkitExitFullScreen(): void;\n webkitExitFullscreen(): void;\n addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\n};\n\ninterface HTMLegendElement {\n readonly form: HTMLFormElement | null;\n}\n\ndeclare var HTMLegendElement: {\n prototype: HTMLegendElement;\n new(): HTMLegendElement;\n};\n\ninterface HashChangeEvent extends Event {\n readonly newURL: string;\n readonly oldURL: string;\n}\n\ndeclare var HashChangeEvent: {\n prototype: HashChangeEvent;\n new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\n};\n\ninterface Headers {\n append(name: string, value: string): void;\n delete(name: string): void;\n forEach(callback: Function, thisArg?: any): void;\n get(name: string): string | null;\n has(name: string): boolean;\n set(name: string, value: string): void;\n}\n\ndeclare var Headers: {\n prototype: Headers;\n new(init?: HeadersInit): Headers;\n};\n\ninterface History {\n readonly length: number;\n scrollRestoration: ScrollRestoration;\n readonly state: any;\n back(distance?: any): void;\n forward(distance?: any): void;\n go(delta?: any): void;\n pushState(data: any, title?: string, url?: string | null): void;\n replaceState(data: any, title?: string, url?: string | null): void;\n}\n\ndeclare var History: {\n prototype: History;\n new(): History;\n};\n\ninterface HkdfCtrParams extends Algorithm {\n context: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n hash: string | Algorithm;\n label: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface IDBArrayKey extends Array {\n}\n\ninterface IDBCursor {\n readonly direction: IDBCursorDirection;\n readonly key: IDBKeyRange | number | string | Date | IDBArrayKey;\n readonly primaryKey: any;\n readonly source: IDBObjectStore | IDBIndex;\n advance(count: number): void;\n continue(key?: IDBKeyRange | number | string | Date | IDBArrayKey): void;\n delete(): IDBRequest;\n update(value: any): IDBRequest;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n}\n\ndeclare var IDBCursor: {\n prototype: IDBCursor;\n new(): IDBCursor;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n};\n\ninterface IDBCursorWithValue extends IDBCursor {\n readonly value: any;\n}\n\ndeclare var IDBCursorWithValue: {\n prototype: IDBCursorWithValue;\n new(): IDBCursorWithValue;\n};\n\ninterface IDBDatabaseEventMap {\n \"abort\": Event;\n \"error\": Event;\n}\n\ninterface IDBDatabase extends EventTarget {\n readonly name: string;\n readonly objectStoreNames: DOMStringList;\n onabort: ((this: IDBDatabase, ev: Event) => any) | null;\n onerror: ((this: IDBDatabase, ev: Event) => any) | null;\n onversionchange: ((this: IDBDatabase, ev: Event) => any) | null;\n readonly version: number;\n close(): void;\n createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;\n deleteObjectStore(name: string): void;\n transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBDatabase: {\n prototype: IDBDatabase;\n new(): IDBDatabase;\n};\n\ninterface IDBEnvironment {\n readonly indexedDB: IDBFactory;\n}\n\ninterface IDBFactory {\n cmp(first: any, second: any): number;\n deleteDatabase(name: string): IDBOpenDBRequest;\n open(name: string, version?: number): IDBOpenDBRequest;\n}\n\ndeclare var IDBFactory: {\n prototype: IDBFactory;\n new(): IDBFactory;\n};\n\ninterface IDBIndex {\n readonly keyPath: string | string[];\n multiEntry: boolean;\n readonly name: string;\n readonly objectStore: IDBObjectStore;\n readonly unique: boolean;\n count(key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n get(key: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n getKey(key: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n openCursor(range?: IDBKeyRange | number | string | Date | IDBArrayKey, direction?: IDBCursorDirection): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | number | string | Date | IDBArrayKey, direction?: IDBCursorDirection): IDBRequest;\n}\n\ndeclare var IDBIndex: {\n prototype: IDBIndex;\n new(): IDBIndex;\n};\n\ninterface IDBKeyRange {\n readonly lower: any;\n readonly lowerOpen: boolean;\n readonly upper: any;\n readonly upperOpen: boolean;\n}\n\ndeclare var IDBKeyRange: {\n prototype: IDBKeyRange;\n new(): IDBKeyRange;\n bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;\n lowerBound(lower: any, open?: boolean): IDBKeyRange;\n only(value: any): IDBKeyRange;\n upperBound(upper: any, open?: boolean): IDBKeyRange;\n};\n\ninterface IDBObjectStore {\n autoIncrement: boolean;\n readonly indexNames: DOMStringList;\n readonly keyPath: string | string[] | null;\n readonly name: string;\n readonly transaction: IDBTransaction;\n add(value: any, key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n clear(): IDBRequest;\n count(key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;\n delete(key: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n deleteIndex(indexName: string): void;\n get(key: any): IDBRequest;\n index(name: string): IDBIndex;\n openCursor(range?: IDBKeyRange | number | string | Date | IDBArrayKey, direction?: IDBCursorDirection): IDBRequest;\n put(value: any, key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n}\n\ndeclare var IDBObjectStore: {\n prototype: IDBObjectStore;\n new(): IDBObjectStore;\n};\n\ninterface IDBOpenDBRequestEventMap extends IDBRequestEventMap {\n \"blocked\": Event;\n \"upgradeneeded\": IDBVersionChangeEvent;\n}\n\ninterface IDBOpenDBRequest extends IDBRequest {\n onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;\n onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;\n addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBOpenDBRequest: {\n prototype: IDBOpenDBRequest;\n new(): IDBOpenDBRequest;\n};\n\ninterface IDBRequestEventMap {\n \"error\": Event;\n \"success\": Event;\n}\n\ninterface IDBRequest extends EventTarget {\n readonly error: DOMException;\n onerror: ((this: IDBRequest, ev: Event) => any) | null;\n onsuccess: ((this: IDBRequest, ev: Event) => any) | null;\n readonly readyState: IDBRequestReadyState;\n readonly result: any;\n readonly source: IDBObjectStore | IDBIndex | IDBCursor;\n readonly transaction: IDBTransaction;\n addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBRequest: {\n prototype: IDBRequest;\n new(): IDBRequest;\n};\n\ninterface IDBTransactionEventMap {\n \"abort\": Event;\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface IDBTransaction extends EventTarget {\n readonly db: IDBDatabase;\n readonly error: DOMException;\n readonly mode: IDBTransactionMode;\n onabort: ((this: IDBTransaction, ev: Event) => any) | null;\n oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;\n onerror: ((this: IDBTransaction, ev: Event) => any) | null;\n abort(): void;\n objectStore(name: string): IDBObjectStore;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBTransaction: {\n prototype: IDBTransaction;\n new(): IDBTransaction;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n};\n\ninterface IDBVersionChangeEvent extends Event {\n readonly newVersion: number | null;\n readonly oldVersion: number;\n}\n\ndeclare var IDBVersionChangeEvent: {\n prototype: IDBVersionChangeEvent;\n new(): IDBVersionChangeEvent;\n};\n\ninterface IIRFilterNode extends AudioNode {\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var IIRFilterNode: {\n prototype: IIRFilterNode;\n new(): IIRFilterNode;\n};\n\ninterface ImageBitmap {\n readonly height: number;\n readonly width: number;\n close(): void;\n}\n\ninterface ImageBitmapOptions {\n colorSpaceConversion?: \"none\" | \"default\";\n imageOrientation?: \"none\" | \"flipY\";\n premultiplyAlpha?: \"none\" | \"premultiply\" | \"default\";\n resizeHeight?: number;\n resizeQuality?: \"pixelated\" | \"low\" | \"medium\" | \"high\";\n resizeWidth?: number;\n}\n\ninterface ImageData {\n readonly data: Uint8ClampedArray;\n readonly height: number;\n readonly width: number;\n}\n\ndeclare var ImageData: {\n prototype: ImageData;\n new(width: number, height: number): ImageData;\n new(array: Uint8ClampedArray, width: number, height: number): ImageData;\n};\n\ninterface IntersectionObserver {\n readonly root: Element | null;\n readonly rootMargin: string;\n readonly thresholds: number[];\n disconnect(): void;\n observe(target: Element): void;\n takeRecords(): IntersectionObserverEntry[];\n unobserve(target: Element): void;\n}\n\ndeclare var IntersectionObserver: {\n prototype: IntersectionObserver;\n new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;\n};\n\ninterface IntersectionObserverEntry {\n readonly boundingClientRect: ClientRect | DOMRect;\n readonly intersectionRatio: number;\n readonly intersectionRect: ClientRect | DOMRect;\n readonly isIntersecting: boolean;\n readonly rootBounds: ClientRect | DOMRect;\n readonly target: Element;\n readonly time: number;\n}\n\ndeclare var IntersectionObserverEntry: {\n prototype: IntersectionObserverEntry;\n new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;\n};\n\ninterface KeyboardEvent extends UIEvent {\n readonly altKey: boolean;\n /** @deprecated */\n char: string;\n /** @deprecated */\n readonly charCode: number;\n readonly code: string;\n readonly ctrlKey: boolean;\n readonly key: string;\n /** @deprecated */\n readonly keyCode: number;\n readonly location: number;\n readonly metaKey: boolean;\n readonly repeat: boolean;\n readonly shiftKey: boolean;\n /** @deprecated */\n readonly which: number;\n getModifierState(keyArg: string): boolean;\n /** @deprecated */\n initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n}\n\ndeclare var KeyboardEvent: {\n prototype: KeyboardEvent;\n new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n};\n\ninterface LinkStyle {\n readonly sheet: StyleSheet | null;\n}\n\ninterface ListeningStateChangedEvent extends Event {\n readonly label: string;\n readonly state: ListeningState;\n}\n\ndeclare var ListeningStateChangedEvent: {\n prototype: ListeningStateChangedEvent;\n new(): ListeningStateChangedEvent;\n};\n\ninterface Location {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n assign(url: string): void;\n reload(forcedReload?: boolean): void;\n replace(url: string): void;\n toString(): string;\n}\n\ndeclare var Location: {\n prototype: Location;\n new(): Location;\n};\n\ninterface MSAssertion {\n readonly id: string;\n readonly type: MSCredentialType;\n}\n\ndeclare var MSAssertion: {\n prototype: MSAssertion;\n new(): MSAssertion;\n};\n\ninterface MSBlobBuilder {\n append(data: any, endings?: string): void;\n getBlob(contentType?: string): Blob;\n}\n\ndeclare var MSBlobBuilder: {\n prototype: MSBlobBuilder;\n new(): MSBlobBuilder;\n};\n\ninterface MSCredentials {\n getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise;\n makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise;\n}\n\ndeclare var MSCredentials: {\n prototype: MSCredentials;\n new(): MSCredentials;\n};\n\ninterface MSDCCEvent extends Event {\n readonly maxFr: number;\n readonly maxFs: number;\n}\n\ndeclare var MSDCCEvent: {\n prototype: MSDCCEvent;\n new(type: string, eventInitDict: MSDCCEventInit): MSDCCEvent;\n};\n\ninterface MSDSHEvent extends Event {\n readonly sources: number[];\n readonly timestamp: number;\n}\n\ndeclare var MSDSHEvent: {\n prototype: MSDSHEvent;\n new(type: string, eventInitDict: MSDSHEventInit): MSDSHEvent;\n};\n\ninterface MSFIDOCredentialAssertion extends MSAssertion {\n readonly algorithm: string | Algorithm;\n readonly attestation: any;\n readonly publicKey: string;\n readonly transportHints: MSTransportType[];\n}\n\ndeclare var MSFIDOCredentialAssertion: {\n prototype: MSFIDOCredentialAssertion;\n new(): MSFIDOCredentialAssertion;\n};\n\ninterface MSFIDOSignature {\n readonly authnrData: string;\n readonly clientData: string;\n readonly signature: string;\n}\n\ndeclare var MSFIDOSignature: {\n prototype: MSFIDOSignature;\n new(): MSFIDOSignature;\n};\n\ninterface MSFIDOSignatureAssertion extends MSAssertion {\n readonly signature: MSFIDOSignature;\n}\n\ndeclare var MSFIDOSignatureAssertion: {\n prototype: MSFIDOSignatureAssertion;\n new(): MSFIDOSignatureAssertion;\n};\n\ninterface MSFileSaver {\n msSaveBlob(blob: any, defaultName?: string): boolean;\n msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;\n}\n\ninterface MSGesture {\n target: Element;\n addPointer(pointerId: number): void;\n stop(): void;\n}\n\ndeclare var MSGesture: {\n prototype: MSGesture;\n new(): MSGesture;\n};\n\ninterface MSGestureEvent extends UIEvent {\n readonly clientX: number;\n readonly clientY: number;\n readonly expansion: number;\n readonly gestureObject: any;\n readonly hwTimestamp: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly rotation: number;\n readonly scale: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly translationX: number;\n readonly translationY: number;\n readonly velocityAngular: number;\n readonly velocityExpansion: number;\n readonly velocityX: number;\n readonly velocityY: number;\n initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n}\n\ndeclare var MSGestureEvent: {\n prototype: MSGestureEvent;\n new(): MSGestureEvent;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n};\n\ninterface MSGraphicsTrust {\n readonly constrictionActive: boolean;\n readonly status: string;\n}\n\ndeclare var MSGraphicsTrust: {\n prototype: MSGraphicsTrust;\n new(): MSGraphicsTrust;\n};\n\ninterface MSInputMethodContextEventMap {\n \"MSCandidateWindowHide\": Event;\n \"MSCandidateWindowShow\": Event;\n \"MSCandidateWindowUpdate\": Event;\n}\n\ninterface MSInputMethodContext extends EventTarget {\n readonly compositionEndOffset: number;\n readonly compositionStartOffset: number;\n oncandidatewindowhide: ((this: MSInputMethodContext, ev: Event) => any) | null;\n oncandidatewindowshow: ((this: MSInputMethodContext, ev: Event) => any) | null;\n oncandidatewindowupdate: ((this: MSInputMethodContext, ev: Event) => any) | null;\n readonly target: HTMLElement;\n getCandidateWindowClientRect(): ClientRect;\n getCompositionAlternatives(): string[];\n hasComposition(): boolean;\n isCandidateWindowVisible(): boolean;\n addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSInputMethodContext: {\n prototype: MSInputMethodContext;\n new(): MSInputMethodContext;\n};\n\ninterface MSMediaKeyError {\n readonly code: number;\n readonly systemCode: number;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n}\n\ndeclare var MSMediaKeyError: {\n prototype: MSMediaKeyError;\n new(): MSMediaKeyError;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n};\n\ninterface MSMediaKeyMessageEvent extends Event {\n readonly destinationURL: string | null;\n readonly message: Uint8Array;\n}\n\ndeclare var MSMediaKeyMessageEvent: {\n prototype: MSMediaKeyMessageEvent;\n new(): MSMediaKeyMessageEvent;\n};\n\ninterface MSMediaKeyNeededEvent extends Event {\n readonly initData: Uint8Array | null;\n}\n\ndeclare var MSMediaKeyNeededEvent: {\n prototype: MSMediaKeyNeededEvent;\n new(): MSMediaKeyNeededEvent;\n};\n\ninterface MSMediaKeySession extends EventTarget {\n readonly error: MSMediaKeyError | null;\n readonly keySystem: string;\n readonly sessionId: string;\n close(): void;\n update(key: Uint8Array): void;\n}\n\ndeclare var MSMediaKeySession: {\n prototype: MSMediaKeySession;\n new(): MSMediaKeySession;\n};\n\ninterface MSMediaKeys {\n readonly keySystem: string;\n createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array | null): MSMediaKeySession;\n}\n\ndeclare var MSMediaKeys: {\n prototype: MSMediaKeys;\n new(keySystem: string): MSMediaKeys;\n isTypeSupported(keySystem: string, type?: string | null): boolean;\n isTypeSupportedWithFeatures(keySystem: string, type?: string | null): string;\n};\n\ninterface MSNavigatorDoNotTrack {\n confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;\n confirmWebWideTrackingException(args: ExceptionInformation): boolean;\n removeSiteSpecificTrackingException(args: ExceptionInformation): void;\n removeWebWideTrackingException(args: ExceptionInformation): void;\n storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;\n storeWebWideTrackingException(args: StoreExceptionsInformation): void;\n}\n\ninterface MSPointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var MSPointerEvent: {\n prototype: MSPointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;\n};\n\ninterface MSStream {\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n}\n\ndeclare var MSStream: {\n prototype: MSStream;\n new(): MSStream;\n};\n\ninterface MSStreamReaderEventMap {\n \"abort\": UIEvent;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n}\n\ninterface MSStreamReader extends EventTarget {\n readonly error: DOMError;\n onabort: ((this: MSStreamReader, ev: UIEvent) => any) | null;\n onerror: ((this: MSStreamReader, ev: ErrorEvent) => any) | null;\n onload: ((this: MSStreamReader, ev: Event) => any) | null;\n onloadend: ((this: MSStreamReader, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: MSStreamReader, ev: Event) => any) | null;\n onprogress: ((this: MSStreamReader, ev: ProgressEvent) => any) | null;\n readonly readyState: number;\n readonly result: any;\n abort(): void;\n readAsArrayBuffer(stream: MSStream, size?: number): void;\n readAsBinaryString(stream: MSStream, size?: number): void;\n readAsBlob(stream: MSStream, size?: number): void;\n readAsDataURL(stream: MSStream, size?: number): void;\n readAsText(stream: MSStream, encoding?: string, size?: number): void;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n addEventListener(type: K, listener: (this: MSStreamReader, ev: MSStreamReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSStreamReader, ev: MSStreamReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSStreamReader: {\n prototype: MSStreamReader;\n new(): MSStreamReader;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n};\n\ninterface MediaDeviceInfo {\n readonly deviceId: string;\n readonly groupId: string;\n readonly kind: MediaDeviceKind;\n readonly label: string;\n}\n\ndeclare var MediaDeviceInfo: {\n prototype: MediaDeviceInfo;\n new(): MediaDeviceInfo;\n};\n\ninterface MediaDevicesEventMap {\n \"devicechange\": Event;\n}\n\ninterface MediaDevices extends EventTarget {\n ondevicechange: ((this: MediaDevices, ev: Event) => any) | null;\n enumerateDevices(): Promise;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): Promise;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaDevices: {\n prototype: MediaDevices;\n new(): MediaDevices;\n};\n\ninterface MediaElementAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaElementAudioSourceNode: {\n prototype: MediaElementAudioSourceNode;\n new(): MediaElementAudioSourceNode;\n};\n\ninterface MediaEncryptedEvent extends Event {\n readonly initData: ArrayBuffer | null;\n readonly initDataType: string;\n}\n\ndeclare var MediaEncryptedEvent: {\n prototype: MediaEncryptedEvent;\n new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;\n};\n\ninterface MediaError {\n readonly code: number;\n readonly msExtendedCode: number;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n}\n\ndeclare var MediaError: {\n prototype: MediaError;\n new(): MediaError;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n};\n\ninterface MediaKeyMessageEvent extends Event {\n readonly message: ArrayBuffer;\n readonly messageType: MediaKeyMessageType;\n}\n\ndeclare var MediaKeyMessageEvent: {\n prototype: MediaKeyMessageEvent;\n new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;\n};\n\ninterface MediaKeySession extends EventTarget {\n readonly closed: Promise;\n readonly expiration: number;\n readonly keyStatuses: MediaKeyStatusMap;\n readonly sessionId: string;\n close(): Promise;\n generateRequest(initDataType: string, initData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n load(sessionId: string): Promise;\n remove(): Promise;\n update(response: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n}\n\ndeclare var MediaKeySession: {\n prototype: MediaKeySession;\n new(): MediaKeySession;\n};\n\ninterface MediaKeyStatusMap {\n readonly size: number;\n forEach(callback: Function, thisArg?: any): void;\n get(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): MediaKeyStatus;\n has(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): boolean;\n}\n\ndeclare var MediaKeyStatusMap: {\n prototype: MediaKeyStatusMap;\n new(): MediaKeyStatusMap;\n};\n\ninterface MediaKeySystemAccess {\n readonly keySystem: string;\n createMediaKeys(): Promise;\n getConfiguration(): MediaKeySystemConfiguration;\n}\n\ndeclare var MediaKeySystemAccess: {\n prototype: MediaKeySystemAccess;\n new(): MediaKeySystemAccess;\n};\n\ninterface MediaKeys {\n createSession(sessionType?: MediaKeySessionType): MediaKeySession;\n setServerCertificate(serverCertificate: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n}\n\ndeclare var MediaKeys: {\n prototype: MediaKeys;\n new(): MediaKeys;\n};\n\ninterface MediaList {\n readonly length: number;\n mediaText: string;\n appendMedium(medium: string): void;\n deleteMedium(medium: string): void;\n item(index: number): string | null;\n toString(): number;\n [index: number]: string;\n}\n\ndeclare var MediaList: {\n prototype: MediaList;\n new(): MediaList;\n};\n\ninterface MediaQueryList {\n readonly matches: boolean;\n readonly media: string;\n addListener(listener: MediaQueryListListener): void;\n removeListener(listener: MediaQueryListListener): void;\n}\n\ndeclare var MediaQueryList: {\n prototype: MediaQueryList;\n new(): MediaQueryList;\n};\n\ninterface MediaSource extends EventTarget {\n readonly activeSourceBuffers: SourceBufferList;\n duration: number;\n readonly readyState: string;\n readonly sourceBuffers: SourceBufferList;\n addSourceBuffer(type: string): SourceBuffer;\n endOfStream(error?: number): void;\n removeSourceBuffer(sourceBuffer: SourceBuffer): void;\n}\n\ndeclare var MediaSource: {\n prototype: MediaSource;\n new(): MediaSource;\n isTypeSupported(type: string): boolean;\n};\n\ninterface MediaStreamEventMap {\n \"active\": Event;\n \"addtrack\": MediaStreamTrackEvent;\n \"inactive\": Event;\n \"removetrack\": MediaStreamTrackEvent;\n}\n\ninterface MediaStream extends EventTarget {\n readonly active: boolean;\n readonly id: string;\n onactive: ((this: MediaStream, ev: Event) => any) | null;\n onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\n oninactive: ((this: MediaStream, ev: Event) => any) | null;\n onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\n addTrack(track: MediaStreamTrack): void;\n clone(): MediaStream;\n getAudioTracks(): MediaStreamTrack[];\n getTrackById(trackId: string): MediaStreamTrack | null;\n getTracks(): MediaStreamTrack[];\n getVideoTracks(): MediaStreamTrack[];\n removeTrack(track: MediaStreamTrack): void;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStream: {\n prototype: MediaStream;\n new(): MediaStream;\n new(stream: MediaStream): MediaStream;\n new(tracks: MediaStreamTrack[]): MediaStream;\n};\n\ninterface MediaStreamAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaStreamAudioSourceNode: {\n prototype: MediaStreamAudioSourceNode;\n new(): MediaStreamAudioSourceNode;\n};\n\ninterface MediaStreamError {\n readonly constraintName: string | null;\n readonly message: string | null;\n readonly name: string;\n}\n\ndeclare var MediaStreamError: {\n prototype: MediaStreamError;\n new(): MediaStreamError;\n};\n\ninterface MediaStreamErrorEvent extends Event {\n readonly error: MediaStreamError | null;\n}\n\ndeclare var MediaStreamErrorEvent: {\n prototype: MediaStreamErrorEvent;\n new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\n};\n\ninterface MediaStreamEvent extends Event {\n readonly stream: MediaStream | null;\n}\n\ndeclare var MediaStreamEvent: {\n prototype: MediaStreamEvent;\n new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent;\n};\n\ninterface MediaStreamTrackEventMap {\n \"ended\": MediaStreamErrorEvent;\n \"mute\": Event;\n \"overconstrained\": MediaStreamErrorEvent;\n \"unmute\": Event;\n}\n\ninterface MediaStreamTrack extends EventTarget {\n enabled: boolean;\n readonly id: string;\n readonly kind: string;\n readonly label: string;\n readonly muted: boolean;\n onended: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;\n onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\n onoverconstrained: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;\n onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\n readonly readonly: boolean;\n readonly readyState: MediaStreamTrackState;\n readonly remote: boolean;\n applyConstraints(constraints: MediaTrackConstraints): Promise;\n clone(): MediaStreamTrack;\n getCapabilities(): MediaTrackCapabilities;\n getConstraints(): MediaTrackConstraints;\n getSettings(): MediaTrackSettings;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStreamTrack: {\n prototype: MediaStreamTrack;\n new(): MediaStreamTrack;\n};\n\ninterface MediaStreamTrackEvent extends Event {\n readonly track: MediaStreamTrack;\n}\n\ndeclare var MediaStreamTrackEvent: {\n prototype: MediaStreamTrackEvent;\n new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent;\n};\n\ninterface MessageChannel {\n readonly port1: MessagePort;\n readonly port2: MessagePort;\n}\n\ndeclare var MessageChannel: {\n prototype: MessageChannel;\n new(): MessageChannel;\n};\n\ninterface MessageEvent extends Event {\n readonly data: any;\n readonly origin: string;\n readonly ports: ReadonlyArray;\n readonly source: Window | null;\n initMessageEvent(type: string, bubbles: boolean, cancelable: boolean, data: any, origin: string, lastEventId: string, source: Window): void;\n}\n\ndeclare var MessageEvent: {\n prototype: MessageEvent;\n new(type: string, eventInitDict?: MessageEventInit): MessageEvent;\n};\n\ninterface MessagePortEventMap {\n \"message\": MessageEvent;\n}\n\ninterface MessagePort extends EventTarget {\n onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;\n close(): void;\n postMessage(message?: any, transfer?: any[]): void;\n start(): void;\n addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MessagePort: {\n prototype: MessagePort;\n new(): MessagePort;\n};\n\ninterface MimeType {\n readonly description: string;\n readonly enabledPlugin: Plugin;\n readonly suffixes: string;\n readonly type: string;\n}\n\ndeclare var MimeType: {\n prototype: MimeType;\n new(): MimeType;\n};\n\ninterface MimeTypeArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(type: string): Plugin;\n [index: number]: Plugin;\n}\n\ndeclare var MimeTypeArray: {\n prototype: MimeTypeArray;\n new(): MimeTypeArray;\n};\n\ninterface MouseEvent extends UIEvent {\n readonly altKey: boolean;\n readonly button: number;\n readonly buttons: number;\n readonly clientX: number;\n readonly clientY: number;\n readonly ctrlKey: boolean;\n /** @deprecated */\n readonly fromElement: Element;\n readonly layerX: number;\n readonly layerY: number;\n readonly metaKey: boolean;\n readonly movementX: number;\n readonly movementY: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly relatedTarget: EventTarget;\n readonly screenX: number;\n readonly screenY: number;\n readonly shiftKey: boolean;\n /** @deprecated */\n readonly toElement: Element;\n /** @deprecated */\n readonly which: number;\n readonly x: number;\n readonly y: number;\n getModifierState(keyArg: string): boolean;\n initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void;\n}\n\ndeclare var MouseEvent: {\n prototype: MouseEvent;\n new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;\n};\n\ninterface MutationEvent extends Event {\n readonly attrChange: number;\n readonly attrName: string;\n readonly newValue: string;\n readonly prevValue: string;\n readonly relatedNode: Node;\n initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n}\n\ndeclare var MutationEvent: {\n prototype: MutationEvent;\n new(): MutationEvent;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n};\n\ninterface MutationObserver {\n disconnect(): void;\n observe(target: Node, options: MutationObserverInit): void;\n takeRecords(): MutationRecord[];\n}\n\ndeclare var MutationObserver: {\n prototype: MutationObserver;\n new(callback: MutationCallback): MutationObserver;\n};\n\ninterface MutationRecord {\n readonly addedNodes: NodeList;\n readonly attributeName: string | null;\n readonly attributeNamespace: string | null;\n readonly nextSibling: Node | null;\n readonly oldValue: string | null;\n readonly previousSibling: Node | null;\n readonly removedNodes: NodeList;\n readonly target: Node;\n readonly type: MutationRecordType;\n}\n\ndeclare var MutationRecord: {\n prototype: MutationRecord;\n new(): MutationRecord;\n};\n\ninterface NamedNodeMap {\n readonly length: number;\n getNamedItem(qualifiedName: string): Attr | null;\n getNamedItemNS(namespace: string | null, localName: string): Attr | null;\n item(index: number): Attr | null;\n removeNamedItem(qualifiedName: string): Attr;\n removeNamedItemNS(namespace: string | null, localName: string): Attr;\n setNamedItem(attr: Attr): Attr | null;\n setNamedItemNS(attr: Attr): Attr | null;\n [index: number]: Attr;\n}\n\ndeclare var NamedNodeMap: {\n prototype: NamedNodeMap;\n new(): NamedNodeMap;\n};\n\ninterface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage {\n readonly activeVRDisplays: ReadonlyArray;\n readonly authentication: WebAuthentication;\n readonly cookieEnabled: boolean;\n readonly doNotTrack: string | null;\n gamepadInputEmulation: GamepadInputEmulationType;\n readonly geolocation: Geolocation;\n readonly maxTouchPoints: number;\n readonly mimeTypes: MimeTypeArray;\n readonly msManipulationViewsEnabled: boolean;\n readonly msMaxTouchPoints: number;\n readonly msPointerEnabled: boolean;\n readonly plugins: PluginArray;\n readonly pointerEnabled: boolean;\n readonly serviceWorker: ServiceWorkerContainer;\n readonly webdriver: boolean;\n getGamepads(): (Gamepad | null)[];\n getVRDisplays(): Promise;\n javaEnabled(): boolean;\n msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\n requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise;\n vibrate(pattern: number | number[]): boolean;\n}\n\ndeclare var Navigator: {\n prototype: Navigator;\n new(): Navigator;\n};\n\ninterface NavigatorBeacon {\n sendBeacon(url: string, data?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null): boolean;\n}\n\ninterface NavigatorConcurrentHardware {\n readonly hardwareConcurrency: number;\n}\n\ninterface NavigatorContentUtils {\n}\n\ninterface NavigatorID {\n readonly appCodeName: string;\n readonly appName: string;\n readonly appVersion: string;\n readonly platform: string;\n readonly product: string;\n readonly productSub: string;\n readonly userAgent: string;\n readonly vendor: string;\n readonly vendorSub: string;\n}\n\ninterface NavigatorLanguage {\n readonly language: string;\n readonly languages: ReadonlyArray;\n}\n\ninterface NavigatorOnLine {\n readonly onLine: boolean;\n}\n\ninterface NavigatorStorageUtils {\n}\n\ninterface NavigatorUserMedia {\n readonly mediaDevices: MediaDevices;\n getDisplayMedia(constraints: MediaStreamConstraints): Promise;\n getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;\n}\n\ninterface Node extends EventTarget {\n readonly baseURI: string | null;\n readonly childNodes: NodeListOf;\n readonly firstChild: Node | null;\n readonly lastChild: Node | null;\n readonly localName: string | null;\n readonly namespaceURI: string | null;\n readonly nextSibling: Node | null;\n readonly nodeName: string;\n readonly nodeType: number;\n nodeValue: string | null;\n readonly ownerDocument: Document;\n readonly parentElement: HTMLElement | null;\n readonly parentNode: Node | null;\n readonly previousSibling: Node | null;\n textContent: string | null;\n appendChild(newChild: T): T;\n cloneNode(deep?: boolean): Node;\n compareDocumentPosition(other: Node): number;\n contains(child: Node): boolean;\n hasChildNodes(): boolean;\n insertBefore(newChild: T, refChild: Node | null): T;\n isDefaultNamespace(namespaceURI: string | null): boolean;\n isEqualNode(arg: Node): boolean;\n isSameNode(other: Node): boolean;\n lookupNamespaceURI(prefix: string | null): string | null;\n lookupPrefix(namespaceURI: string | null): string | null;\n normalize(): void;\n removeChild(oldChild: T): T;\n replaceChild(newChild: Node, oldChild: T): T;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n}\n\ndeclare var Node: {\n prototype: Node;\n new(): Node;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n};\n\ninterface NodeFilter {\n acceptNode(node: Node): number;\n}\n\ndeclare var NodeFilter: {\n readonly FILTER_ACCEPT: number;\n readonly FILTER_REJECT: number;\n readonly FILTER_SKIP: number;\n readonly SHOW_ALL: number;\n readonly SHOW_ATTRIBUTE: number;\n readonly SHOW_CDATA_SECTION: number;\n readonly SHOW_COMMENT: number;\n readonly SHOW_DOCUMENT: number;\n readonly SHOW_DOCUMENT_FRAGMENT: number;\n readonly SHOW_DOCUMENT_TYPE: number;\n readonly SHOW_ELEMENT: number;\n readonly SHOW_ENTITY: number;\n readonly SHOW_ENTITY_REFERENCE: number;\n readonly SHOW_NOTATION: number;\n readonly SHOW_PROCESSING_INSTRUCTION: number;\n readonly SHOW_TEXT: number;\n};\n\ninterface NodeIterator {\n /** @deprecated */\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter | null;\n readonly root: Node;\n readonly whatToShow: number;\n detach(): void;\n nextNode(): Node | null;\n previousNode(): Node | null;\n}\n\ndeclare var NodeIterator: {\n prototype: NodeIterator;\n new(): NodeIterator;\n};\n\ninterface NodeList {\n readonly length: number;\n item(index: number): Node;\n [index: number]: Node;\n}\n\ndeclare var NodeList: {\n prototype: NodeList;\n new(): NodeList;\n};\n\ninterface NodeListOf extends NodeList {\n length: number;\n item(index: number): TNode;\n [index: number]: TNode;\n}\n\ninterface NodeSelector {\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface NotificationEventMap {\n \"click\": Event;\n \"close\": Event;\n \"error\": Event;\n \"show\": Event;\n}\n\ninterface Notification extends EventTarget {\n readonly body: string | null;\n readonly data: any;\n readonly dir: NotificationDirection;\n readonly icon: string | null;\n readonly lang: string | null;\n onclick: ((this: Notification, ev: Event) => any) | null;\n onclose: ((this: Notification, ev: Event) => any) | null;\n onerror: ((this: Notification, ev: Event) => any) | null;\n onshow: ((this: Notification, ev: Event) => any) | null;\n readonly permission: NotificationPermission;\n readonly tag: string | null;\n readonly title: string;\n close(): void;\n addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Notification: {\n prototype: Notification;\n new(title: string, options?: NotificationOptions): Notification;\n requestPermission(callback?: NotificationPermissionCallback): Promise;\n};\n\ninterface OES_element_index_uint {\n}\n\ndeclare var OES_element_index_uint: {\n prototype: OES_element_index_uint;\n new(): OES_element_index_uint;\n};\n\ninterface OES_standard_derivatives {\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n}\n\ndeclare var OES_standard_derivatives: {\n prototype: OES_standard_derivatives;\n new(): OES_standard_derivatives;\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n};\n\ninterface OES_texture_float {\n}\n\ndeclare var OES_texture_float: {\n prototype: OES_texture_float;\n new(): OES_texture_float;\n};\n\ninterface OES_texture_float_linear {\n}\n\ndeclare var OES_texture_float_linear: {\n prototype: OES_texture_float_linear;\n new(): OES_texture_float_linear;\n};\n\ninterface OES_texture_half_float {\n readonly HALF_FLOAT_OES: number;\n}\n\ndeclare var OES_texture_half_float: {\n prototype: OES_texture_half_float;\n new(): OES_texture_half_float;\n readonly HALF_FLOAT_OES: number;\n};\n\ninterface OES_texture_half_float_linear {\n}\n\ndeclare var OES_texture_half_float_linear: {\n prototype: OES_texture_half_float_linear;\n new(): OES_texture_half_float_linear;\n};\n\ninterface OES_vertex_array_object {\n readonly VERTEX_ARRAY_BINDING_OES: number;\n bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n createVertexArrayOES(): WebGLVertexArrayObjectOES;\n deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n isVertexArrayOES(value: any): value is WebGLVertexArrayObjectOES;\n}\n\ninterface OfflineAudioCompletionEvent extends Event {\n readonly renderedBuffer: AudioBuffer;\n}\n\ndeclare var OfflineAudioCompletionEvent: {\n prototype: OfflineAudioCompletionEvent;\n new(): OfflineAudioCompletionEvent;\n};\n\ninterface OfflineAudioContextEventMap extends AudioContextEventMap {\n \"complete\": OfflineAudioCompletionEvent;\n}\n\ninterface OfflineAudioContext extends AudioContextBase {\n readonly length: number;\n oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null;\n startRendering(): Promise;\n suspend(suspendTime: number): Promise;\n addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OfflineAudioContext: {\n prototype: OfflineAudioContext;\n new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;\n};\n\ninterface OscillatorNodeEventMap {\n \"ended\": Event;\n}\n\ninterface OscillatorNode extends AudioNode {\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n onended: ((this: OscillatorNode, ev: Event) => any) | null;\n type: OscillatorType;\n setPeriodicWave(periodicWave: PeriodicWave): void;\n start(when?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OscillatorNode: {\n prototype: OscillatorNode;\n new(): OscillatorNode;\n};\n\ninterface OverflowEvent extends UIEvent {\n readonly horizontalOverflow: boolean;\n readonly orient: number;\n readonly verticalOverflow: boolean;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n}\n\ndeclare var OverflowEvent: {\n prototype: OverflowEvent;\n new(): OverflowEvent;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n};\n\ninterface PageTransitionEvent extends Event {\n readonly persisted: boolean;\n}\n\ndeclare var PageTransitionEvent: {\n prototype: PageTransitionEvent;\n new(): PageTransitionEvent;\n};\n\ninterface PannerNode extends AudioNode {\n coneInnerAngle: number;\n coneOuterAngle: number;\n coneOuterGain: number;\n distanceModel: DistanceModelType;\n maxDistance: number;\n panningModel: PanningModelType;\n refDistance: number;\n rolloffFactor: number;\n /** @deprecated */\n setOrientation(x: number, y: number, z: number): void;\n /** @deprecated */\n setPosition(x: number, y: number, z: number): void;\n /** @deprecated */\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var PannerNode: {\n prototype: PannerNode;\n new(): PannerNode;\n};\n\ninterface ParentNode {\n readonly children: HTMLCollection;\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface ParentNode {\n readonly childElementCount: number;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n}\n\ninterface Path2D extends CanvasPathMethods {\n}\n\ndeclare var Path2D: {\n prototype: Path2D;\n new(d?: Path2D | string): Path2D;\n};\n\ninterface PaymentAddress {\n readonly addressLine: string[];\n readonly city: string;\n readonly country: string;\n readonly dependentLocality: string;\n readonly languageCode: string;\n readonly organization: string;\n readonly phone: string;\n readonly postalCode: string;\n readonly recipient: string;\n readonly region: string;\n readonly sortingCode: string;\n toJSON(): any;\n}\n\ndeclare var PaymentAddress: {\n prototype: PaymentAddress;\n new(): PaymentAddress;\n};\n\ninterface PaymentRequestEventMap {\n \"shippingaddresschange\": Event;\n \"shippingoptionchange\": Event;\n}\n\ninterface PaymentRequest extends EventTarget {\n readonly id: string;\n onshippingaddresschange: ((this: PaymentRequest, ev: Event) => any) | null;\n onshippingoptionchange: ((this: PaymentRequest, ev: Event) => any) | null;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n readonly shippingType: PaymentShippingType | null;\n abort(): Promise;\n canMakePayment(): Promise;\n show(): Promise;\n addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var PaymentRequest: {\n prototype: PaymentRequest;\n new(methodData: PaymentMethodData[], details: PaymentDetailsInit, options?: PaymentOptions): PaymentRequest;\n};\n\ninterface PaymentRequestUpdateEvent extends Event {\n updateWith(detailsPromise: Promise): void;\n}\n\ndeclare var PaymentRequestUpdateEvent: {\n prototype: PaymentRequestUpdateEvent;\n new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;\n};\n\ninterface PaymentResponse {\n readonly details: any;\n readonly methodName: string;\n readonly payerEmail: string | null;\n readonly payerName: string | null;\n readonly payerPhone: string | null;\n readonly requestId: string;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n complete(result?: PaymentComplete): Promise;\n toJSON(): any;\n}\n\ndeclare var PaymentResponse: {\n prototype: PaymentResponse;\n new(): PaymentResponse;\n};\n\ninterface PerfWidgetExternal {\n readonly activeNetworkRequestCount: number;\n readonly averageFrameTime: number;\n readonly averagePaintTime: number;\n readonly extraInformationEnabled: boolean;\n readonly independentRenderingEnabled: boolean;\n readonly irDisablingContentString: string;\n readonly irStatusAvailable: boolean;\n readonly maxCpuSpeed: number;\n readonly paintRequestsPerSecond: number;\n readonly performanceCounter: number;\n readonly performanceCounterFrequency: number;\n addEventListener(eventType: string, callback: Function): void;\n getMemoryUsage(): number;\n getProcessCpuUsage(): number;\n getRecentCpuUsage(last: number | null): any;\n getRecentFrames(last: number | null): any;\n getRecentMemoryUsage(last: number | null): any;\n getRecentPaintRequests(last: number | null): any;\n removeEventListener(eventType: string, callback: Function): void;\n repositionWindow(x: number, y: number): void;\n resizeWindow(width: number, height: number): void;\n}\n\ndeclare var PerfWidgetExternal: {\n prototype: PerfWidgetExternal;\n new(): PerfWidgetExternal;\n};\n\ninterface Performance {\n /** @deprecated */\n readonly navigation: PerformanceNavigation;\n readonly timeOrigin: number;\n /** @deprecated */\n readonly timing: PerformanceTiming;\n clearMarks(markName?: string): void;\n clearMeasures(measureName?: string): void;\n clearResourceTimings(): void;\n getEntries(): any;\n getEntriesByName(name: string, type?: string): any;\n getEntriesByType(type: string): any;\n /** @deprecated */\n getMarks(markName?: string): any;\n /** @deprecated */\n getMeasures(measureName?: string): any;\n mark(markName: string): void;\n measure(measureName: string, startMarkName?: string, endMarkName?: string): void;\n now(): number;\n setResourceTimingBufferSize(maxSize: number): void;\n toJSON(): any;\n}\n\ndeclare var Performance: {\n prototype: Performance;\n new(): Performance;\n};\n\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceEntry: {\n prototype: PerformanceEntry;\n new(): PerformanceEntry;\n};\n\ninterface PerformanceMark extends PerformanceEntry {\n}\n\ndeclare var PerformanceMark: {\n prototype: PerformanceMark;\n new(): PerformanceMark;\n};\n\ninterface PerformanceMeasure extends PerformanceEntry {\n}\n\ndeclare var PerformanceMeasure: {\n prototype: PerformanceMeasure;\n new(): PerformanceMeasure;\n};\n\ninterface PerformanceNavigation {\n readonly redirectCount: number;\n readonly type: number;\n toJSON(): any;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n}\n\ndeclare var PerformanceNavigation: {\n prototype: PerformanceNavigation;\n new(): PerformanceNavigation;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n};\n\ninterface PerformanceNavigationTiming extends PerformanceEntry {\n /** @deprecated */\n readonly connectEnd: number;\n /** @deprecated */\n readonly connectStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n /** @deprecated */\n readonly domLoading: number;\n /** @deprecated */\n readonly domainLookupEnd: number;\n /** @deprecated */\n readonly domainLookupStart: number;\n /** @deprecated */\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n /** @deprecated */\n readonly navigationStart: number;\n readonly redirectCount: number;\n /** @deprecated */\n readonly redirectEnd: number;\n /** @deprecated */\n readonly redirectStart: number;\n /** @deprecated */\n readonly requestStart: number;\n /** @deprecated */\n readonly responseEnd: number;\n /** @deprecated */\n readonly responseStart: number;\n readonly type: NavigationType;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n readonly workerStart: number;\n}\n\ndeclare var PerformanceNavigationTiming: {\n prototype: PerformanceNavigationTiming;\n new(): PerformanceNavigationTiming;\n};\n\ninterface PerformanceResourceTiming extends PerformanceEntry {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly fetchStart: number;\n readonly initiatorType: string;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly workerStart: number;\n}\n\ndeclare var PerformanceResourceTiming: {\n prototype: PerformanceResourceTiming;\n new(): PerformanceResourceTiming;\n};\n\ninterface PerformanceTiming {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly domLoading: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly msFirstPaint: number;\n readonly navigationStart: number;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly secureConnectionStart: number;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceTiming: {\n prototype: PerformanceTiming;\n new(): PerformanceTiming;\n};\n\ninterface PeriodicWave {\n}\n\ndeclare var PeriodicWave: {\n prototype: PeriodicWave;\n new(): PeriodicWave;\n};\n\ninterface PermissionRequest extends DeferredPermissionRequest {\n readonly state: MSWebViewPermissionState;\n defer(): void;\n}\n\ndeclare var PermissionRequest: {\n prototype: PermissionRequest;\n new(): PermissionRequest;\n};\n\ninterface PermissionRequestedEvent extends Event {\n readonly permissionRequest: PermissionRequest;\n}\n\ndeclare var PermissionRequestedEvent: {\n prototype: PermissionRequestedEvent;\n new(): PermissionRequestedEvent;\n};\n\ninterface Plugin {\n readonly description: string;\n readonly filename: string;\n readonly length: number;\n readonly name: string;\n readonly version: string;\n item(index: number): MimeType;\n namedItem(type: string): MimeType;\n [index: number]: MimeType;\n}\n\ndeclare var Plugin: {\n prototype: Plugin;\n new(): Plugin;\n};\n\ninterface PluginArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(name: string): Plugin;\n refresh(reload?: boolean): void;\n [index: number]: Plugin;\n}\n\ndeclare var PluginArray: {\n prototype: PluginArray;\n new(): PluginArray;\n};\n\ninterface PointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var PointerEvent: {\n prototype: PointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent;\n};\n\ninterface PopStateEvent extends Event {\n readonly state: any;\n}\n\ndeclare var PopStateEvent: {\n prototype: PopStateEvent;\n new(type: string, eventInitDict?: PopStateEventInit): PopStateEvent;\n};\n\ninterface Position {\n readonly coords: Coordinates;\n readonly timestamp: number;\n}\n\ndeclare var Position: {\n prototype: Position;\n new(): Position;\n};\n\ninterface PositionError {\n readonly code: number;\n readonly message: string;\n toString(): string;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n}\n\ndeclare var PositionError: {\n prototype: PositionError;\n new(): PositionError;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n};\n\ninterface ProcessingInstruction extends CharacterData {\n readonly target: string;\n}\n\ndeclare var ProcessingInstruction: {\n prototype: ProcessingInstruction;\n new(): ProcessingInstruction;\n};\n\ninterface ProgressEvent extends Event {\n readonly lengthComputable: boolean;\n readonly loaded: number;\n readonly total: number;\n initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void;\n}\n\ndeclare var ProgressEvent: {\n prototype: ProgressEvent;\n new(typeArg: string, eventInitDict?: ProgressEventInit): ProgressEvent;\n};\n\ninterface PromiseRejectionEvent extends Event {\n readonly promise: PromiseLike;\n readonly reason: any;\n}\n\ninterface PromiseRejectionEventInit extends EventInit {\n promise: PromiseLike;\n reason?: any;\n}\n\ninterface PushManager {\n readonly supportedContentEncodings: ReadonlyArray;\n getSubscription(): Promise;\n permissionState(options?: PushSubscriptionOptionsInit): Promise;\n subscribe(options?: PushSubscriptionOptionsInit): Promise;\n}\n\ndeclare var PushManager: {\n prototype: PushManager;\n new(): PushManager;\n};\n\ninterface PushSubscription {\n readonly endpoint: string;\n readonly expirationTime: number | null;\n readonly options: PushSubscriptionOptions;\n getKey(name: PushEncryptionKeyName): ArrayBuffer | null;\n toJSON(): any;\n unsubscribe(): Promise;\n}\n\ndeclare var PushSubscription: {\n prototype: PushSubscription;\n new(): PushSubscription;\n};\n\ninterface PushSubscriptionOptions {\n readonly applicationServerKey: ArrayBuffer | null;\n readonly userVisibleOnly: boolean;\n}\n\ndeclare var PushSubscriptionOptions: {\n prototype: PushSubscriptionOptions;\n new(): PushSubscriptionOptions;\n};\n\ninterface RTCDTMFToneChangeEvent extends Event {\n readonly tone: string;\n}\n\ndeclare var RTCDTMFToneChangeEvent: {\n prototype: RTCDTMFToneChangeEvent;\n new(typeArg: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\n};\n\ninterface RTCDtlsTransportEventMap {\n \"dtlsstatechange\": RTCDtlsTransportStateChangedEvent;\n \"error\": Event;\n}\n\ninterface RTCDtlsTransport extends RTCStatsProvider {\n ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null;\n onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null;\n readonly state: RTCDtlsTransportState;\n readonly transport: RTCIceTransport;\n getLocalParameters(): RTCDtlsParameters;\n getRemoteCertificates(): ArrayBuffer[];\n getRemoteParameters(): RTCDtlsParameters | null;\n start(remoteParameters: RTCDtlsParameters): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtlsTransport: {\n prototype: RTCDtlsTransport;\n new(transport: RTCIceTransport): RTCDtlsTransport;\n};\n\ninterface RTCDtlsTransportStateChangedEvent extends Event {\n readonly state: RTCDtlsTransportState;\n}\n\ndeclare var RTCDtlsTransportStateChangedEvent: {\n prototype: RTCDtlsTransportStateChangedEvent;\n new(): RTCDtlsTransportStateChangedEvent;\n};\n\ninterface RTCDtmfSenderEventMap {\n \"tonechange\": RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDtmfSender extends EventTarget {\n readonly canInsertDTMF: boolean;\n readonly duration: number;\n readonly interToneGap: number;\n ontonechange: ((this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any) | null;\n readonly sender: RTCRtpSender;\n readonly toneBuffer: string;\n insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\n addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtmfSender: {\n prototype: RTCDtmfSender;\n new(sender: RTCRtpSender): RTCDtmfSender;\n};\n\ninterface RTCIceCandidate {\n candidate: string | null;\n sdpMLineIndex: number | null;\n sdpMid: string | null;\n toJSON(): any;\n}\n\ndeclare var RTCIceCandidate: {\n prototype: RTCIceCandidate;\n new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate;\n};\n\ninterface RTCIceCandidatePairChangedEvent extends Event {\n readonly pair: RTCIceCandidatePair;\n}\n\ndeclare var RTCIceCandidatePairChangedEvent: {\n prototype: RTCIceCandidatePairChangedEvent;\n new(): RTCIceCandidatePairChangedEvent;\n};\n\ninterface RTCIceGathererEventMap {\n \"error\": Event;\n \"localcandidate\": RTCIceGathererEvent;\n}\n\ninterface RTCIceGatherer extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n onerror: ((this: RTCIceGatherer, ev: Event) => any) | null;\n onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\n createAssociatedGatherer(): RTCIceGatherer;\n getLocalCandidates(): RTCIceCandidateDictionary[];\n getLocalParameters(): RTCIceParameters;\n addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceGatherer: {\n prototype: RTCIceGatherer;\n new(options: RTCIceGatherOptions): RTCIceGatherer;\n};\n\ninterface RTCIceGathererEvent extends Event {\n readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete;\n}\n\ndeclare var RTCIceGathererEvent: {\n prototype: RTCIceGathererEvent;\n new(): RTCIceGathererEvent;\n};\n\ninterface RTCIceTransportEventMap {\n \"candidatepairchange\": RTCIceCandidatePairChangedEvent;\n \"icestatechange\": RTCIceTransportStateChangedEvent;\n}\n\ninterface RTCIceTransport extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n readonly iceGatherer: RTCIceGatherer | null;\n oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null;\n onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null;\n readonly role: RTCIceRole;\n readonly state: RTCIceTransportState;\n addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void;\n createAssociatedTransport(): RTCIceTransport;\n getNominatedCandidatePair(): RTCIceCandidatePair | null;\n getRemoteCandidates(): RTCIceCandidateDictionary[];\n getRemoteParameters(): RTCIceParameters | null;\n setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void;\n start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceTransport: {\n prototype: RTCIceTransport;\n new(): RTCIceTransport;\n};\n\ninterface RTCIceTransportStateChangedEvent extends Event {\n readonly state: RTCIceTransportState;\n}\n\ndeclare var RTCIceTransportStateChangedEvent: {\n prototype: RTCIceTransportStateChangedEvent;\n new(): RTCIceTransportStateChangedEvent;\n};\n\ninterface RTCPeerConnectionEventMap {\n \"addstream\": MediaStreamEvent;\n \"icecandidate\": RTCPeerConnectionIceEvent;\n \"iceconnectionstatechange\": Event;\n \"icegatheringstatechange\": Event;\n \"negotiationneeded\": Event;\n \"removestream\": MediaStreamEvent;\n \"signalingstatechange\": Event;\n}\n\ninterface RTCPeerConnection extends EventTarget {\n readonly canTrickleIceCandidates: boolean | null;\n readonly iceConnectionState: RTCIceConnectionState;\n readonly iceGatheringState: RTCIceGatheringState;\n readonly localDescription: RTCSessionDescription | null;\n onaddstream: ((this: RTCPeerConnection, ev: MediaStreamEvent) => any) | null;\n onicecandidate: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any) | null;\n oniceconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onremovestream: ((this: RTCPeerConnection, ev: MediaStreamEvent) => any) | null;\n onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n readonly remoteDescription: RTCSessionDescription | null;\n readonly signalingState: RTCSignalingState;\n addIceCandidate(candidate: RTCIceCandidateInit | RTCIceCandidate): Promise;\n addStream(stream: MediaStream): void;\n close(): void;\n createAnswer(options?: RTCOfferOptions): Promise;\n createOffer(options?: RTCOfferOptions): Promise;\n getConfiguration(): RTCConfiguration;\n getLocalStreams(): MediaStream[];\n getRemoteStreams(): MediaStream[];\n getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n getStreamById(streamId: string): MediaStream | null;\n removeStream(stream: MediaStream): void;\n setLocalDescription(description: RTCSessionDescriptionInit): Promise;\n setRemoteDescription(description: RTCSessionDescriptionInit): Promise;\n addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCPeerConnection: {\n prototype: RTCPeerConnection;\n new(configuration: RTCConfiguration): RTCPeerConnection;\n};\n\ninterface RTCPeerConnectionIceEvent extends Event {\n readonly candidate: RTCIceCandidate;\n}\n\ndeclare var RTCPeerConnectionIceEvent: {\n prototype: RTCPeerConnectionIceEvent;\n new(type: string, eventInitDict: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent;\n};\n\ninterface RTCRtpReceiverEventMap {\n \"error\": Event;\n \"msdecodercapacitychange\": Event;\n \"msdsh\": Event;\n}\n\ninterface RTCRtpReceiver extends RTCStatsProvider {\n onerror: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n onmsdecodercapacitychange: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n onmsdsh: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack | null;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n getContributingSources(): RTCRtpContributingSource[];\n receive(parameters: RTCRtpParameters): void;\n requestSendCSRC(csrc: number): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpReceiver: {\n prototype: RTCRtpReceiver;\n new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCRtpSenderEventMap {\n \"error\": Event;\n \"ssrcconflict\": RTCSsrcConflictEvent;\n}\n\ninterface RTCRtpSender extends RTCStatsProvider {\n onerror: ((this: RTCRtpSender, ev: Event) => any) | null;\n onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n send(parameters: RTCRtpParameters): void;\n setTrack(track: MediaStreamTrack): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpSender: {\n prototype: RTCRtpSender;\n new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCSessionDescription {\n sdp: string | null;\n type: RTCSdpType | null;\n toJSON(): any;\n}\n\ndeclare var RTCSessionDescription: {\n prototype: RTCSessionDescription;\n new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;\n};\n\ninterface RTCSrtpSdesTransportEventMap {\n \"error\": Event;\n}\n\ninterface RTCSrtpSdesTransport extends EventTarget {\n onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null;\n readonly transport: RTCIceTransport;\n addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCSrtpSdesTransport: {\n prototype: RTCSrtpSdesTransport;\n new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport;\n getLocalParameters(): RTCSrtpSdesParameters[];\n};\n\ninterface RTCSsrcConflictEvent extends Event {\n readonly ssrc: number;\n}\n\ndeclare var RTCSsrcConflictEvent: {\n prototype: RTCSsrcConflictEvent;\n new(): RTCSsrcConflictEvent;\n};\n\ninterface RTCStatsProvider extends EventTarget {\n getStats(): Promise;\n msGetStats(): Promise;\n}\n\ndeclare var RTCStatsProvider: {\n prototype: RTCStatsProvider;\n new(): RTCStatsProvider;\n};\n\ninterface RandomSource {\n getRandomValues(array: T): T;\n}\n\ndeclare var RandomSource: {\n prototype: RandomSource;\n new(): RandomSource;\n};\n\ninterface Range {\n readonly collapsed: boolean;\n readonly commonAncestorContainer: Node;\n readonly endContainer: Node;\n readonly endOffset: number;\n readonly startContainer: Node;\n readonly startOffset: number;\n cloneContents(): DocumentFragment;\n cloneRange(): Range;\n collapse(toStart?: boolean): void;\n compareBoundaryPoints(how: number, sourceRange: Range): number;\n createContextualFragment(fragment: string): DocumentFragment;\n deleteContents(): void;\n detach(): void;\n expand(Unit: ExpandGranularity): boolean;\n extractContents(): DocumentFragment;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n insertNode(node: Node): void;\n isPointInRange(node: Node, offset: number): boolean;\n selectNode(node: Node): void;\n selectNodeContents(node: Node): void;\n setEnd(node: Node, offset: number): void;\n setEndAfter(node: Node): void;\n setEndBefore(node: Node): void;\n setStart(node: Node, offset: number): void;\n setStartAfter(node: Node): void;\n setStartBefore(node: Node): void;\n surroundContents(newParent: Node): void;\n toString(): string;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n}\n\ndeclare var Range: {\n prototype: Range;\n new(): Range;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n};\n\ninterface ReadableStream {\n readonly locked: boolean;\n cancel(): Promise;\n getReader(): ReadableStreamReader;\n}\n\ndeclare var ReadableStream: {\n prototype: ReadableStream;\n new(): ReadableStream;\n};\n\ninterface ReadableStreamReader {\n cancel(): Promise;\n read(): Promise;\n releaseLock(): void;\n}\n\ndeclare var ReadableStreamReader: {\n prototype: ReadableStreamReader;\n new(): ReadableStreamReader;\n};\n\ninterface Request extends Body {\n readonly cache: RequestCache;\n readonly credentials: RequestCredentials;\n readonly destination: RequestDestination;\n readonly headers: Headers;\n readonly integrity: string;\n readonly keepalive: boolean;\n readonly method: string;\n readonly mode: RequestMode;\n readonly redirect: RequestRedirect;\n readonly referrer: string;\n readonly referrerPolicy: ReferrerPolicy;\n readonly signal: AbortSignal | null;\n readonly type: RequestType;\n readonly url: string;\n clone(): Request;\n}\n\ndeclare var Request: {\n prototype: Request;\n new(input: Request | string, init?: RequestInit): Request;\n};\n\ninterface Response extends Body {\n readonly body: ReadableStream | null;\n readonly headers: Headers;\n readonly ok: boolean;\n readonly redirected: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly type: ResponseType;\n readonly url: string;\n clone(): Response;\n}\n\ndeclare var Response: {\n prototype: Response;\n new(body?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null, init?: ResponseInit): Response;\n error(): Response;\n redirect(url: string, status?: number): Response;\n};\n\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAElement: {\n prototype: SVGAElement;\n new(): SVGAElement;\n};\n\ninterface SVGAngle {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n}\n\ndeclare var SVGAngle: {\n prototype: SVGAngle;\n new(): SVGAngle;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n};\n\ninterface SVGAnimatedAngle {\n readonly animVal: SVGAngle;\n readonly baseVal: SVGAngle;\n}\n\ndeclare var SVGAnimatedAngle: {\n prototype: SVGAnimatedAngle;\n new(): SVGAnimatedAngle;\n};\n\ninterface SVGAnimatedBoolean {\n readonly animVal: boolean;\n baseVal: boolean;\n}\n\ndeclare var SVGAnimatedBoolean: {\n prototype: SVGAnimatedBoolean;\n new(): SVGAnimatedBoolean;\n};\n\ninterface SVGAnimatedEnumeration {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedEnumeration: {\n prototype: SVGAnimatedEnumeration;\n new(): SVGAnimatedEnumeration;\n};\n\ninterface SVGAnimatedInteger {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedInteger: {\n prototype: SVGAnimatedInteger;\n new(): SVGAnimatedInteger;\n};\n\ninterface SVGAnimatedLength {\n readonly animVal: SVGLength;\n readonly baseVal: SVGLength;\n}\n\ndeclare var SVGAnimatedLength: {\n prototype: SVGAnimatedLength;\n new(): SVGAnimatedLength;\n};\n\ninterface SVGAnimatedLengthList {\n readonly animVal: SVGLengthList;\n readonly baseVal: SVGLengthList;\n}\n\ndeclare var SVGAnimatedLengthList: {\n prototype: SVGAnimatedLengthList;\n new(): SVGAnimatedLengthList;\n};\n\ninterface SVGAnimatedNumber {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedNumber: {\n prototype: SVGAnimatedNumber;\n new(): SVGAnimatedNumber;\n};\n\ninterface SVGAnimatedNumberList {\n readonly animVal: SVGNumberList;\n readonly baseVal: SVGNumberList;\n}\n\ndeclare var SVGAnimatedNumberList: {\n prototype: SVGAnimatedNumberList;\n new(): SVGAnimatedNumberList;\n};\n\ninterface SVGAnimatedPoints {\n readonly animatedPoints: SVGPointList;\n readonly points: SVGPointList;\n}\n\ninterface SVGAnimatedPreserveAspectRatio {\n readonly animVal: SVGPreserveAspectRatio;\n readonly baseVal: SVGPreserveAspectRatio;\n}\n\ndeclare var SVGAnimatedPreserveAspectRatio: {\n prototype: SVGAnimatedPreserveAspectRatio;\n new(): SVGAnimatedPreserveAspectRatio;\n};\n\ninterface SVGAnimatedRect {\n readonly animVal: SVGRect;\n readonly baseVal: SVGRect;\n}\n\ndeclare var SVGAnimatedRect: {\n prototype: SVGAnimatedRect;\n new(): SVGAnimatedRect;\n};\n\ninterface SVGAnimatedString {\n readonly animVal: string;\n baseVal: string;\n}\n\ndeclare var SVGAnimatedString: {\n prototype: SVGAnimatedString;\n new(): SVGAnimatedString;\n};\n\ninterface SVGAnimatedTransformList {\n readonly animVal: SVGTransformList;\n readonly baseVal: SVGTransformList;\n}\n\ndeclare var SVGAnimatedTransformList: {\n prototype: SVGAnimatedTransformList;\n new(): SVGAnimatedTransformList;\n};\n\ninterface SVGCircleElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGCircleElement: {\n prototype: SVGCircleElement;\n new(): SVGCircleElement;\n};\n\ninterface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes {\n readonly clipPathUnits: SVGAnimatedEnumeration;\n addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGClipPathElement: {\n prototype: SVGClipPathElement;\n new(): SVGClipPathElement;\n};\n\ninterface SVGComponentTransferFunctionElement extends SVGElement {\n readonly amplitude: SVGAnimatedNumber;\n readonly exponent: SVGAnimatedNumber;\n readonly intercept: SVGAnimatedNumber;\n readonly offset: SVGAnimatedNumber;\n readonly slope: SVGAnimatedNumber;\n readonly tableValues: SVGAnimatedNumberList;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGComponentTransferFunctionElement: {\n prototype: SVGComponentTransferFunctionElement;\n new(): SVGComponentTransferFunctionElement;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n};\n\ninterface SVGDefsElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDefsElement: {\n prototype: SVGDefsElement;\n new(): SVGDefsElement;\n};\n\ninterface SVGDescElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDescElement: {\n prototype: SVGDescElement;\n new(): SVGDescElement;\n};\n\ninterface SVGElementEventMap extends ElementEventMap {\n \"click\": MouseEvent;\n \"dblclick\": MouseEvent;\n \"focusin\": FocusEvent;\n \"focusout\": FocusEvent;\n \"load\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n}\n\ninterface SVGElement extends Element, ElementCSSInlineStyle {\n readonly className: any;\n onclick: ((this: SVGElement, ev: MouseEvent) => any) | null;\n ondblclick: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onfocusin: ((this: SVGElement, ev: FocusEvent) => any) | null;\n onfocusout: ((this: SVGElement, ev: FocusEvent) => any) | null;\n onload: ((this: SVGElement, ev: Event) => any) | null;\n onmousedown: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmousemove: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmouseout: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmouseover: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmouseup: ((this: SVGElement, ev: MouseEvent) => any) | null;\n readonly ownerSVGElement: SVGSVGElement | null;\n readonly viewportElement: SVGElement | null;\n /** @deprecated */\n xmlbase: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGElement: {\n prototype: SVGElement;\n new(): SVGElement;\n};\n\ninterface SVGElementInstance extends EventTarget {\n readonly childNodes: SVGElementInstanceList;\n readonly correspondingElement: SVGElement;\n readonly correspondingUseElement: SVGUseElement;\n readonly firstChild: SVGElementInstance;\n readonly lastChild: SVGElementInstance;\n readonly nextSibling: SVGElementInstance;\n readonly parentNode: SVGElementInstance;\n readonly previousSibling: SVGElementInstance;\n}\n\ndeclare var SVGElementInstance: {\n prototype: SVGElementInstance;\n new(): SVGElementInstance;\n};\n\ninterface SVGElementInstanceList {\n /** @deprecated */\n readonly length: number;\n /** @deprecated */\n item(index: number): SVGElementInstance;\n}\n\ndeclare var SVGElementInstanceList: {\n prototype: SVGElementInstanceList;\n new(): SVGElementInstanceList;\n};\n\ninterface SVGEllipseElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGEllipseElement: {\n prototype: SVGEllipseElement;\n new(): SVGEllipseElement;\n};\n\ninterface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly mode: SVGAnimatedEnumeration;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEBlendElement: {\n prototype: SVGFEBlendElement;\n new(): SVGFEBlendElement;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n};\n\ninterface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly type: SVGAnimatedEnumeration;\n readonly values: SVGAnimatedNumberList;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEColorMatrixElement: {\n prototype: SVGFEColorMatrixElement;\n new(): SVGFEColorMatrixElement;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEComponentTransferElement: {\n prototype: SVGFEComponentTransferElement;\n new(): SVGFEComponentTransferElement;\n};\n\ninterface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly k1: SVGAnimatedNumber;\n readonly k2: SVGAnimatedNumber;\n readonly k3: SVGAnimatedNumber;\n readonly k4: SVGAnimatedNumber;\n readonly operator: SVGAnimatedEnumeration;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFECompositeElement: {\n prototype: SVGFECompositeElement;\n new(): SVGFECompositeElement;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n};\n\ninterface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly bias: SVGAnimatedNumber;\n readonly divisor: SVGAnimatedNumber;\n readonly edgeMode: SVGAnimatedEnumeration;\n readonly in1: SVGAnimatedString;\n readonly kernelMatrix: SVGAnimatedNumberList;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly orderX: SVGAnimatedInteger;\n readonly orderY: SVGAnimatedInteger;\n readonly preserveAlpha: SVGAnimatedBoolean;\n readonly targetX: SVGAnimatedInteger;\n readonly targetY: SVGAnimatedInteger;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEConvolveMatrixElement: {\n prototype: SVGFEConvolveMatrixElement;\n new(): SVGFEConvolveMatrixElement;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n};\n\ninterface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly diffuseConstant: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDiffuseLightingElement: {\n prototype: SVGFEDiffuseLightingElement;\n new(): SVGFEDiffuseLightingElement;\n};\n\ninterface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly scale: SVGAnimatedNumber;\n readonly xChannelSelector: SVGAnimatedEnumeration;\n readonly yChannelSelector: SVGAnimatedEnumeration;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDisplacementMapElement: {\n prototype: SVGFEDisplacementMapElement;\n new(): SVGFEDisplacementMapElement;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n};\n\ninterface SVGFEDistantLightElement extends SVGElement {\n readonly azimuth: SVGAnimatedNumber;\n readonly elevation: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDistantLightElement: {\n prototype: SVGFEDistantLightElement;\n new(): SVGFEDistantLightElement;\n};\n\ninterface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFloodElement: {\n prototype: SVGFEFloodElement;\n new(): SVGFEFloodElement;\n};\n\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncAElement: {\n prototype: SVGFEFuncAElement;\n new(): SVGFEFuncAElement;\n};\n\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncBElement: {\n prototype: SVGFEFuncBElement;\n new(): SVGFEFuncBElement;\n};\n\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncGElement: {\n prototype: SVGFEFuncGElement;\n new(): SVGFEFuncGElement;\n};\n\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncRElement: {\n prototype: SVGFEFuncRElement;\n new(): SVGFEFuncRElement;\n};\n\ninterface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly stdDeviationX: SVGAnimatedNumber;\n readonly stdDeviationY: SVGAnimatedNumber;\n setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;\n addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEGaussianBlurElement: {\n prototype: SVGFEGaussianBlurElement;\n new(): SVGFEGaussianBlurElement;\n};\n\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEImageElement: {\n prototype: SVGFEImageElement;\n new(): SVGFEImageElement;\n};\n\ninterface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeElement: {\n prototype: SVGFEMergeElement;\n new(): SVGFEMergeElement;\n};\n\ninterface SVGFEMergeNodeElement extends SVGElement {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeNodeElement: {\n prototype: SVGFEMergeNodeElement;\n new(): SVGFEMergeNodeElement;\n};\n\ninterface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly operator: SVGAnimatedEnumeration;\n readonly radiusX: SVGAnimatedNumber;\n readonly radiusY: SVGAnimatedNumber;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMorphologyElement: {\n prototype: SVGFEMorphologyElement;\n new(): SVGFEMorphologyElement;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n};\n\ninterface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly dx: SVGAnimatedNumber;\n readonly dy: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEOffsetElement: {\n prototype: SVGFEOffsetElement;\n new(): SVGFEOffsetElement;\n};\n\ninterface SVGFEPointLightElement extends SVGElement {\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEPointLightElement: {\n prototype: SVGFEPointLightElement;\n new(): SVGFEPointLightElement;\n};\n\ninterface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly specularConstant: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpecularLightingElement: {\n prototype: SVGFESpecularLightingElement;\n new(): SVGFESpecularLightingElement;\n};\n\ninterface SVGFESpotLightElement extends SVGElement {\n readonly limitingConeAngle: SVGAnimatedNumber;\n readonly pointsAtX: SVGAnimatedNumber;\n readonly pointsAtY: SVGAnimatedNumber;\n readonly pointsAtZ: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpotLightElement: {\n prototype: SVGFESpotLightElement;\n new(): SVGFESpotLightElement;\n};\n\ninterface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETileElement: {\n prototype: SVGFETileElement;\n new(): SVGFETileElement;\n};\n\ninterface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly baseFrequencyX: SVGAnimatedNumber;\n readonly baseFrequencyY: SVGAnimatedNumber;\n readonly numOctaves: SVGAnimatedInteger;\n readonly seed: SVGAnimatedNumber;\n readonly stitchTiles: SVGAnimatedEnumeration;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETurbulenceElement: {\n prototype: SVGFETurbulenceElement;\n new(): SVGFETurbulenceElement;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n /** @deprecated */\n readonly filterResX: SVGAnimatedInteger;\n /** @deprecated */\n readonly filterResY: SVGAnimatedInteger;\n readonly filterUnits: SVGAnimatedEnumeration;\n readonly height: SVGAnimatedLength;\n readonly primitiveUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n /** @deprecated */\n setFilterRes(filterResX: number, filterResY: number): void;\n addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFilterElement: {\n prototype: SVGFilterElement;\n new(): SVGFilterElement;\n};\n\ninterface SVGFilterPrimitiveStandardAttributes {\n readonly height: SVGAnimatedLength;\n readonly result: SVGAnimatedString;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n}\n\ninterface SVGFitToViewBox {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly viewBox: SVGAnimatedRect;\n}\n\ninterface SVGForeignObjectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGForeignObjectElement: {\n prototype: SVGForeignObjectElement;\n new(): SVGForeignObjectElement;\n};\n\ninterface SVGGElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGElement: {\n prototype: SVGGElement;\n new(): SVGGElement;\n};\n\ninterface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n readonly gradientTransform: SVGAnimatedTransformList;\n readonly gradientUnits: SVGAnimatedEnumeration;\n readonly spreadMethod: SVGAnimatedEnumeration;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGradientElement: {\n prototype: SVGGradientElement;\n new(): SVGGradientElement;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n};\n\ninterface SVGGraphicsElement extends SVGElement, SVGTests {\n /** @deprecated */\n readonly farthestViewportElement: SVGElement | null;\n /** @deprecated */\n readonly nearestViewportElement: SVGElement | null;\n readonly transform: SVGAnimatedTransformList;\n getBBox(): SVGRect;\n getCTM(): SVGMatrix | null;\n getScreenCTM(): SVGMatrix | null;\n /** @deprecated */\n getTransformToElement(element: SVGElement): SVGMatrix;\n addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGraphicsElement: {\n prototype: SVGGraphicsElement;\n new(): SVGGraphicsElement;\n};\n\ninterface SVGImageElement extends SVGGraphicsElement, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGImageElement: {\n prototype: SVGImageElement;\n new(): SVGImageElement;\n};\n\ninterface SVGLength {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n}\n\ndeclare var SVGLength: {\n prototype: SVGLength;\n new(): SVGLength;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n};\n\ninterface SVGLengthList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGLength): SVGLength;\n clear(): void;\n getItem(index: number): SVGLength;\n initialize(newItem: SVGLength): SVGLength;\n insertItemBefore(newItem: SVGLength, index: number): SVGLength;\n removeItem(index: number): SVGLength;\n replaceItem(newItem: SVGLength, index: number): SVGLength;\n}\n\ndeclare var SVGLengthList: {\n prototype: SVGLengthList;\n new(): SVGLengthList;\n};\n\ninterface SVGLineElement extends SVGGraphicsElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLineElement: {\n prototype: SVGLineElement;\n new(): SVGLineElement;\n};\n\ninterface SVGLinearGradientElement extends SVGGradientElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLinearGradientElement: {\n prototype: SVGLinearGradientElement;\n new(): SVGLinearGradientElement;\n};\n\ninterface SVGMarkerElement extends SVGElement, SVGFitToViewBox {\n readonly markerHeight: SVGAnimatedLength;\n readonly markerUnits: SVGAnimatedEnumeration;\n readonly markerWidth: SVGAnimatedLength;\n readonly orientAngle: SVGAnimatedAngle;\n readonly orientType: SVGAnimatedEnumeration;\n readonly refX: SVGAnimatedLength;\n readonly refY: SVGAnimatedLength;\n setOrientToAngle(angle: SVGAngle): void;\n setOrientToAuto(): void;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMarkerElement: {\n prototype: SVGMarkerElement;\n new(): SVGMarkerElement;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n};\n\ninterface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes {\n readonly height: SVGAnimatedLength;\n readonly maskContentUnits: SVGAnimatedEnumeration;\n readonly maskUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMaskElement: {\n prototype: SVGMaskElement;\n new(): SVGMaskElement;\n};\n\ninterface SVGMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n flipX(): SVGMatrix;\n flipY(): SVGMatrix;\n inverse(): SVGMatrix;\n multiply(secondMatrix: SVGMatrix): SVGMatrix;\n rotate(angle: number): SVGMatrix;\n rotateFromVector(x: number, y: number): SVGMatrix;\n scale(scaleFactor: number): SVGMatrix;\n scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix;\n skewX(angle: number): SVGMatrix;\n skewY(angle: number): SVGMatrix;\n translate(x: number, y: number): SVGMatrix;\n}\n\ndeclare var SVGMatrix: {\n prototype: SVGMatrix;\n new(): SVGMatrix;\n};\n\ninterface SVGMetadataElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMetadataElement: {\n prototype: SVGMetadataElement;\n new(): SVGMetadataElement;\n};\n\ninterface SVGNumber {\n value: number;\n}\n\ndeclare var SVGNumber: {\n prototype: SVGNumber;\n new(): SVGNumber;\n};\n\ninterface SVGNumberList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGNumber): SVGNumber;\n clear(): void;\n getItem(index: number): SVGNumber;\n initialize(newItem: SVGNumber): SVGNumber;\n insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;\n removeItem(index: number): SVGNumber;\n replaceItem(newItem: SVGNumber, index: number): SVGNumber;\n}\n\ndeclare var SVGNumberList: {\n prototype: SVGNumberList;\n new(): SVGNumberList;\n};\n\ninterface SVGPathElement extends SVGGraphicsElement {\n /** @deprecated */\n readonly pathSegList: SVGPathSegList;\n /** @deprecated */\n createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;\n /** @deprecated */\n createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;\n /** @deprecated */\n createSVGPathSegClosePath(): SVGPathSegClosePath;\n /** @deprecated */\n createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;\n /** @deprecated */\n createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;\n /** @deprecated */\n createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;\n /** @deprecated */\n createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;\n /** @deprecated */\n createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;\n /** @deprecated */\n createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;\n /** @deprecated */\n createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;\n /** @deprecated */\n createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;\n /** @deprecated */\n createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;\n /** @deprecated */\n createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;\n /** @deprecated */\n createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;\n /** @deprecated */\n createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;\n /** @deprecated */\n getPathSegAtLength(distance: number): number;\n getPointAtLength(distance: number): SVGPoint;\n getTotalLength(): number;\n addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPathElement: {\n prototype: SVGPathElement;\n new(): SVGPathElement;\n};\n\ninterface SVGPathSeg {\n readonly pathSegType: number;\n readonly pathSegTypeAsLetter: string;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n}\n\ndeclare var SVGPathSeg: {\n prototype: SVGPathSeg;\n new(): SVGPathSeg;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n};\n\ninterface SVGPathSegArcAbs extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcAbs: {\n prototype: SVGPathSegArcAbs;\n new(): SVGPathSegArcAbs;\n};\n\ninterface SVGPathSegArcRel extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcRel: {\n prototype: SVGPathSegArcRel;\n new(): SVGPathSegArcRel;\n};\n\ninterface SVGPathSegClosePath extends SVGPathSeg {\n}\n\ndeclare var SVGPathSegClosePath: {\n prototype: SVGPathSegClosePath;\n new(): SVGPathSegClosePath;\n};\n\ninterface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicAbs: {\n prototype: SVGPathSegCurvetoCubicAbs;\n new(): SVGPathSegCurvetoCubicAbs;\n};\n\ninterface SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicRel: {\n prototype: SVGPathSegCurvetoCubicRel;\n new(): SVGPathSegCurvetoCubicRel;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothAbs: {\n prototype: SVGPathSegCurvetoCubicSmoothAbs;\n new(): SVGPathSegCurvetoCubicSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothRel: {\n prototype: SVGPathSegCurvetoCubicSmoothRel;\n new(): SVGPathSegCurvetoCubicSmoothRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticAbs: {\n prototype: SVGPathSegCurvetoQuadraticAbs;\n new(): SVGPathSegCurvetoQuadraticAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticRel: {\n prototype: SVGPathSegCurvetoQuadraticRel;\n new(): SVGPathSegCurvetoQuadraticRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothAbs: {\n prototype: SVGPathSegCurvetoQuadraticSmoothAbs;\n new(): SVGPathSegCurvetoQuadraticSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothRel: {\n prototype: SVGPathSegCurvetoQuadraticSmoothRel;\n new(): SVGPathSegCurvetoQuadraticSmoothRel;\n};\n\ninterface SVGPathSegLinetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoAbs: {\n prototype: SVGPathSegLinetoAbs;\n new(): SVGPathSegLinetoAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalAbs: {\n prototype: SVGPathSegLinetoHorizontalAbs;\n new(): SVGPathSegLinetoHorizontalAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalRel: {\n prototype: SVGPathSegLinetoHorizontalRel;\n new(): SVGPathSegLinetoHorizontalRel;\n};\n\ninterface SVGPathSegLinetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoRel: {\n prototype: SVGPathSegLinetoRel;\n new(): SVGPathSegLinetoRel;\n};\n\ninterface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalAbs: {\n prototype: SVGPathSegLinetoVerticalAbs;\n new(): SVGPathSegLinetoVerticalAbs;\n};\n\ninterface SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalRel: {\n prototype: SVGPathSegLinetoVerticalRel;\n new(): SVGPathSegLinetoVerticalRel;\n};\n\ninterface SVGPathSegList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPathSeg): SVGPathSeg;\n clear(): void;\n getItem(index: number): SVGPathSeg;\n initialize(newItem: SVGPathSeg): SVGPathSeg;\n insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;\n removeItem(index: number): SVGPathSeg;\n replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;\n}\n\ndeclare var SVGPathSegList: {\n prototype: SVGPathSegList;\n new(): SVGPathSegList;\n};\n\ninterface SVGPathSegMovetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoAbs: {\n prototype: SVGPathSegMovetoAbs;\n new(): SVGPathSegMovetoAbs;\n};\n\ninterface SVGPathSegMovetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoRel: {\n prototype: SVGPathSegMovetoRel;\n new(): SVGPathSegMovetoRel;\n};\n\ninterface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly patternContentUnits: SVGAnimatedEnumeration;\n readonly patternTransform: SVGAnimatedTransformList;\n readonly patternUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPatternElement: {\n prototype: SVGPatternElement;\n new(): SVGPatternElement;\n};\n\ninterface SVGPoint {\n x: number;\n y: number;\n matrixTransform(matrix: SVGMatrix): SVGPoint;\n}\n\ndeclare var SVGPoint: {\n prototype: SVGPoint;\n new(): SVGPoint;\n};\n\ninterface SVGPointList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPoint): SVGPoint;\n clear(): void;\n getItem(index: number): SVGPoint;\n initialize(newItem: SVGPoint): SVGPoint;\n insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;\n removeItem(index: number): SVGPoint;\n replaceItem(newItem: SVGPoint, index: number): SVGPoint;\n}\n\ndeclare var SVGPointList: {\n prototype: SVGPointList;\n new(): SVGPointList;\n};\n\ninterface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolygonElement: {\n prototype: SVGPolygonElement;\n new(): SVGPolygonElement;\n};\n\ninterface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolylineElement: {\n prototype: SVGPolylineElement;\n new(): SVGPolylineElement;\n};\n\ninterface SVGPreserveAspectRatio {\n align: number;\n meetOrSlice: number;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n}\n\ndeclare var SVGPreserveAspectRatio: {\n prototype: SVGPreserveAspectRatio;\n new(): SVGPreserveAspectRatio;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n};\n\ninterface SVGRadialGradientElement extends SVGGradientElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly fx: SVGAnimatedLength;\n readonly fy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRadialGradientElement: {\n prototype: SVGRadialGradientElement;\n new(): SVGRadialGradientElement;\n};\n\ninterface SVGRect {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var SVGRect: {\n prototype: SVGRect;\n new(): SVGRect;\n};\n\ninterface SVGRectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRectElement: {\n prototype: SVGRectElement;\n new(): SVGRectElement;\n};\n\ninterface SVGSVGElementEventMap extends SVGElementEventMap {\n \"SVGAbort\": Event;\n \"SVGError\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"SVGUnload\": Event;\n \"SVGZoom\": SVGZoomEvent;\n}\n\ninterface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan {\n /** @deprecated */\n contentScriptType: string;\n /** @deprecated */\n contentStyleType: string;\n currentScale: number;\n readonly currentTranslate: SVGPoint;\n readonly height: SVGAnimatedLength;\n onabort: ((this: SVGSVGElement, ev: Event) => any) | null;\n onerror: ((this: SVGSVGElement, ev: Event) => any) | null;\n onresize: ((this: SVGSVGElement, ev: UIEvent) => any) | null;\n onscroll: ((this: SVGSVGElement, ev: UIEvent) => any) | null;\n onunload: ((this: SVGSVGElement, ev: Event) => any) | null;\n onzoom: ((this: SVGSVGElement, ev: SVGZoomEvent) => any) | null;\n /** @deprecated */\n readonly pixelUnitToMillimeterX: number;\n /** @deprecated */\n readonly pixelUnitToMillimeterY: number;\n /** @deprecated */\n readonly screenPixelToMillimeterX: number;\n /** @deprecated */\n readonly screenPixelToMillimeterY: number;\n /** @deprecated */\n readonly viewport: SVGRect;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n checkEnclosure(element: SVGElement, rect: SVGRect): boolean;\n checkIntersection(element: SVGElement, rect: SVGRect): boolean;\n createSVGAngle(): SVGAngle;\n createSVGLength(): SVGLength;\n createSVGMatrix(): SVGMatrix;\n createSVGNumber(): SVGNumber;\n createSVGPoint(): SVGPoint;\n createSVGRect(): SVGRect;\n createSVGTransform(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n deselectAll(): void;\n /** @deprecated */\n forceRedraw(): void;\n getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\n /** @deprecated */\n getCurrentTime(): number;\n getElementById(elementId: string): Element;\n getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n /** @deprecated */\n pauseAnimations(): void;\n /** @deprecated */\n setCurrentTime(seconds: number): void;\n /** @deprecated */\n suspendRedraw(maxWaitMilliseconds: number): number;\n /** @deprecated */\n unpauseAnimations(): void;\n /** @deprecated */\n unsuspendRedraw(suspendHandleID: number): void;\n /** @deprecated */\n unsuspendRedrawAll(): void;\n addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSVGElement: {\n prototype: SVGSVGElement;\n new(): SVGSVGElement;\n};\n\ninterface SVGScriptElement extends SVGElement, SVGURIReference {\n type: string;\n addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGScriptElement: {\n prototype: SVGScriptElement;\n new(): SVGScriptElement;\n};\n\ninterface SVGStopElement extends SVGElement {\n readonly offset: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStopElement: {\n prototype: SVGStopElement;\n new(): SVGStopElement;\n};\n\ninterface SVGStringList {\n readonly numberOfItems: number;\n appendItem(newItem: string): string;\n clear(): void;\n getItem(index: number): string;\n initialize(newItem: string): string;\n insertItemBefore(newItem: string, index: number): string;\n removeItem(index: number): string;\n replaceItem(newItem: string, index: number): string;\n}\n\ndeclare var SVGStringList: {\n prototype: SVGStringList;\n new(): SVGStringList;\n};\n\ninterface SVGStylable {\n className: any;\n}\n\ndeclare var SVGStylable: {\n prototype: SVGStylable;\n new(): SVGStylable;\n};\n\ninterface SVGStyleElement extends SVGElement {\n disabled: boolean;\n media: string;\n title: string;\n type: string;\n addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStyleElement: {\n prototype: SVGStyleElement;\n new(): SVGStyleElement;\n};\n\ninterface SVGSwitchElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSwitchElement: {\n prototype: SVGSwitchElement;\n new(): SVGSwitchElement;\n};\n\ninterface SVGSymbolElement extends SVGElement, SVGFitToViewBox {\n addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSymbolElement: {\n prototype: SVGSymbolElement;\n new(): SVGSymbolElement;\n};\n\ninterface SVGTSpanElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\n};\n\ninterface SVGTests {\n readonly requiredExtensions: SVGStringList;\n /** @deprecated */\n readonly requiredFeatures: SVGStringList;\n readonly systemLanguage: SVGStringList;\n /** @deprecated */\n hasExtension(extension: string): boolean;\n}\n\ninterface SVGTextContentElement extends SVGGraphicsElement {\n readonly lengthAdjust: SVGAnimatedEnumeration;\n readonly textLength: SVGAnimatedLength;\n getCharNumAtPosition(point: SVGPoint): number;\n getComputedTextLength(): number;\n getEndPositionOfChar(charnum: number): SVGPoint;\n getExtentOfChar(charnum: number): SVGRect;\n getNumberOfChars(): number;\n getRotationOfChar(charnum: number): number;\n getStartPositionOfChar(charnum: number): SVGPoint;\n getSubStringLength(charnum: number, nchars: number): number;\n selectSubString(charnum: number, nchars: number): void;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextContentElement: {\n prototype: SVGTextContentElement;\n new(): SVGTextContentElement;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n};\n\ninterface SVGTextElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextElement: {\n prototype: SVGTextElement;\n new(): SVGTextElement;\n};\n\ninterface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {\n readonly method: SVGAnimatedEnumeration;\n readonly spacing: SVGAnimatedEnumeration;\n readonly startOffset: SVGAnimatedLength;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPathElement: {\n prototype: SVGTextPathElement;\n new(): SVGTextPathElement;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n};\n\ninterface SVGTextPositioningElement extends SVGTextContentElement {\n readonly dx: SVGAnimatedLengthList;\n readonly dy: SVGAnimatedLengthList;\n readonly rotate: SVGAnimatedNumberList;\n readonly x: SVGAnimatedLengthList;\n readonly y: SVGAnimatedLengthList;\n addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPositioningElement: {\n prototype: SVGTextPositioningElement;\n new(): SVGTextPositioningElement;\n};\n\ninterface SVGTitleElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTitleElement: {\n prototype: SVGTitleElement;\n new(): SVGTitleElement;\n};\n\ninterface SVGTransform {\n readonly angle: number;\n readonly matrix: SVGMatrix;\n readonly type: number;\n setMatrix(matrix: SVGMatrix): void;\n setRotate(angle: number, cx: number, cy: number): void;\n setScale(sx: number, sy: number): void;\n setSkewX(angle: number): void;\n setSkewY(angle: number): void;\n setTranslate(tx: number, ty: number): void;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n}\n\ndeclare var SVGTransform: {\n prototype: SVGTransform;\n new(): SVGTransform;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n};\n\ninterface SVGTransformList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGTransform): SVGTransform;\n clear(): void;\n consolidate(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n getItem(index: number): SVGTransform;\n initialize(newItem: SVGTransform): SVGTransform;\n insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;\n removeItem(index: number): SVGTransform;\n replaceItem(newItem: SVGTransform, index: number): SVGTransform;\n}\n\ndeclare var SVGTransformList: {\n prototype: SVGTransformList;\n new(): SVGTransformList;\n};\n\ninterface SVGURIReference {\n readonly href: SVGAnimatedString;\n}\n\ninterface SVGUnitTypes {\n readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\n readonly SVG_UNIT_TYPE_UNKNOWN: number;\n readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\n}\ndeclare var SVGUnitTypes: SVGUnitTypes;\n\ninterface SVGUseElement extends SVGGraphicsElement, SVGURIReference {\n readonly animatedInstanceRoot: SVGElementInstance | null;\n readonly height: SVGAnimatedLength;\n readonly instanceRoot: SVGElementInstance | null;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGUseElement: {\n prototype: SVGUseElement;\n new(): SVGUseElement;\n};\n\ninterface SVGViewElement extends SVGElement, SVGFitToViewBox, SVGZoomAndPan {\n /** @deprecated */\n readonly viewTarget: SVGStringList;\n addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGViewElement: {\n prototype: SVGViewElement;\n new(): SVGViewElement;\n};\n\ninterface SVGZoomAndPan {\n readonly zoomAndPan: number;\n}\n\ndeclare var SVGZoomAndPan: {\n readonly SVG_ZOOMANDPAN_DISABLE: number;\n readonly SVG_ZOOMANDPAN_MAGNIFY: number;\n readonly SVG_ZOOMANDPAN_UNKNOWN: number;\n};\n\ninterface SVGZoomEvent extends UIEvent {\n readonly newScale: number;\n readonly newTranslate: SVGPoint;\n readonly previousScale: number;\n readonly previousTranslate: SVGPoint;\n readonly zoomRectScreen: SVGRect;\n}\n\ndeclare var SVGZoomEvent: {\n prototype: SVGZoomEvent;\n new(): SVGZoomEvent;\n};\n\ninterface ScopedCredential {\n readonly id: ArrayBuffer;\n readonly type: ScopedCredentialType;\n}\n\ndeclare var ScopedCredential: {\n prototype: ScopedCredential;\n new(): ScopedCredential;\n};\n\ninterface ScopedCredentialInfo {\n readonly credential: ScopedCredential;\n readonly publicKey: CryptoKey;\n}\n\ndeclare var ScopedCredentialInfo: {\n prototype: ScopedCredentialInfo;\n new(): ScopedCredentialInfo;\n};\n\ninterface ScreenEventMap {\n \"MSOrientationChange\": Event;\n}\n\ninterface Screen extends EventTarget {\n readonly availHeight: number;\n readonly availWidth: number;\n /** @deprecated */\n bufferDepth: number;\n readonly colorDepth: number;\n readonly deviceXDPI: number;\n readonly deviceYDPI: number;\n readonly fontSmoothingEnabled: boolean;\n readonly height: number;\n readonly logicalXDPI: number;\n readonly logicalYDPI: number;\n readonly msOrientation: string;\n onmsorientationchange: ((this: Screen, ev: Event) => any) | null;\n readonly pixelDepth: number;\n readonly systemXDPI: number;\n readonly systemYDPI: number;\n readonly width: number;\n lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean;\n msLockOrientation(orientations: string | string[]): boolean;\n msUnlockOrientation(): void;\n unlockOrientation(): void;\n addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Screen: {\n prototype: Screen;\n new(): Screen;\n};\n\ninterface ScriptProcessorNodeEventMap {\n \"audioprocess\": AudioProcessingEvent;\n}\n\ninterface ScriptProcessorNode extends AudioNode {\n /** @deprecated */\n readonly bufferSize: number;\n /** @deprecated */\n onaudioprocess: ((this: ScriptProcessorNode, ev: AudioProcessingEvent) => any) | null;\n addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ScriptProcessorNode: {\n prototype: ScriptProcessorNode;\n new(): ScriptProcessorNode;\n};\n\ninterface ScrollIntoViewOptions extends ScrollOptions {\n block?: ScrollLogicalPosition;\n inline?: ScrollLogicalPosition;\n}\n\ninterface ScrollOptions {\n behavior?: ScrollBehavior;\n}\n\ninterface ScrollToOptions extends ScrollOptions {\n left?: number;\n top?: number;\n}\n\ninterface SecurityPolicyViolationEvent extends Event {\n readonly blockedURI: string;\n readonly columnNumber: number;\n readonly documentURI: string;\n readonly effectiveDirective: string;\n readonly lineNumber: number;\n readonly originalPolicy: string;\n readonly referrer: string;\n readonly sourceFile: string;\n readonly statusCode: number;\n readonly violatedDirective: string;\n}\n\ndeclare var SecurityPolicyViolationEvent: {\n prototype: SecurityPolicyViolationEvent;\n new(type: string, eventInitDict?: SecurityPolicyViolationEventInit): SecurityPolicyViolationEvent;\n};\n\ninterface Selection {\n readonly anchorNode: Node;\n readonly anchorOffset: number;\n readonly baseNode: Node;\n readonly baseOffset: number;\n readonly extentNode: Node;\n readonly extentOffset: number;\n readonly focusNode: Node;\n readonly focusOffset: number;\n readonly isCollapsed: boolean;\n readonly rangeCount: number;\n readonly type: string;\n addRange(range: Range): void;\n collapse(parentNode: Node, offset: number): void;\n collapseToEnd(): void;\n collapseToStart(): void;\n containsNode(node: Node, partlyContained: boolean): boolean;\n deleteFromDocument(): void;\n empty(): void;\n extend(newNode: Node, offset: number): void;\n getRangeAt(index: number): Range;\n removeAllRanges(): void;\n removeRange(range: Range): void;\n selectAllChildren(parentNode: Node): void;\n setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;\n setPosition(parentNode: Node, offset: number): void;\n toString(): string;\n}\n\ndeclare var Selection: {\n prototype: Selection;\n new(): Selection;\n};\n\ninterface ServiceUIFrameContext {\n getCachedFrameMessage(key: string): string;\n postFrameMessage(key: string, data: string): void;\n}\ndeclare var ServiceUIFrameContext: ServiceUIFrameContext;\n\ninterface ServiceWorkerEventMap extends AbstractWorkerEventMap {\n \"statechange\": Event;\n}\n\ninterface ServiceWorker extends EventTarget, AbstractWorker {\n onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;\n readonly scriptURL: string;\n readonly state: ServiceWorkerState;\n postMessage(message: any, transfer?: any[]): void;\n addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorker: {\n prototype: ServiceWorker;\n new(): ServiceWorker;\n};\n\ninterface ServiceWorkerContainerEventMap {\n \"controllerchange\": Event;\n \"message\": ServiceWorkerMessageEvent;\n \"messageerror\": MessageEvent;\n}\n\ninterface ServiceWorkerContainer extends EventTarget {\n readonly controller: ServiceWorker | null;\n oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;\n onmessage: ((this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any) | null;\n onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\n readonly ready: Promise;\n getRegistration(clientURL?: string): Promise;\n getRegistrations(): Promise;\n register(scriptURL: string, options?: RegistrationOptions): Promise;\n startMessages(): void;\n addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerContainer: {\n prototype: ServiceWorkerContainer;\n new(): ServiceWorkerContainer;\n};\n\ninterface ServiceWorkerMessageEvent extends Event {\n readonly data: any;\n readonly lastEventId: string;\n readonly origin: string;\n readonly ports: ReadonlyArray | null;\n readonly source: ServiceWorker | MessagePort | null;\n}\n\ndeclare var ServiceWorkerMessageEvent: {\n prototype: ServiceWorkerMessageEvent;\n new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent;\n};\n\ninterface ServiceWorkerRegistrationEventMap {\n \"updatefound\": Event;\n}\n\ninterface ServiceWorkerRegistration extends EventTarget {\n readonly active: ServiceWorker | null;\n readonly installing: ServiceWorker | null;\n onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;\n readonly pushManager: PushManager;\n readonly scope: string;\n readonly sync: SyncManager;\n readonly waiting: ServiceWorker | null;\n getNotifications(filter?: GetNotificationOptions): Promise;\n showNotification(title: string, options?: NotificationOptions): Promise;\n unregister(): Promise;\n update(): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerRegistration: {\n prototype: ServiceWorkerRegistration;\n new(): ServiceWorkerRegistration;\n};\n\ninterface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment {\n readonly host: Element;\n innerHTML: string;\n}\n\ninterface ShadowRootInit {\n delegatesFocus?: boolean;\n mode: \"open\" | \"closed\";\n}\n\ninterface SourceBuffer extends EventTarget {\n appendWindowEnd: number;\n appendWindowStart: number;\n readonly audioTracks: AudioTrackList;\n readonly buffered: TimeRanges;\n mode: AppendMode;\n timestampOffset: number;\n readonly updating: boolean;\n readonly videoTracks: VideoTrackList;\n abort(): void;\n appendBuffer(data: ArrayBuffer | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n appendStream(stream: MSStream, maxSize?: number): void;\n remove(start: number, end: number): void;\n}\n\ndeclare var SourceBuffer: {\n prototype: SourceBuffer;\n new(): SourceBuffer;\n};\n\ninterface SourceBufferList extends EventTarget {\n readonly length: number;\n item(index: number): SourceBuffer;\n [index: number]: SourceBuffer;\n}\n\ndeclare var SourceBufferList: {\n prototype: SourceBufferList;\n new(): SourceBufferList;\n};\n\ninterface SpeechSynthesisEventMap {\n \"voiceschanged\": Event;\n}\n\ninterface SpeechSynthesis extends EventTarget {\n onvoiceschanged: ((this: SpeechSynthesis, ev: Event) => any) | null;\n readonly paused: boolean;\n readonly pending: boolean;\n readonly speaking: boolean;\n cancel(): void;\n getVoices(): SpeechSynthesisVoice[];\n pause(): void;\n resume(): void;\n speak(utterance: SpeechSynthesisUtterance): void;\n addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesis: {\n prototype: SpeechSynthesis;\n new(): SpeechSynthesis;\n};\n\ninterface SpeechSynthesisEvent extends Event {\n readonly charIndex: number;\n readonly charLength: number;\n readonly elapsedTime: number;\n readonly name: string;\n readonly utterance: SpeechSynthesisUtterance;\n}\n\ndeclare var SpeechSynthesisEvent: {\n prototype: SpeechSynthesisEvent;\n new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent;\n};\n\ninterface SpeechSynthesisUtteranceEventMap {\n \"boundary\": Event;\n \"end\": Event;\n \"error\": Event;\n \"mark\": Event;\n \"pause\": Event;\n \"resume\": Event;\n \"start\": Event;\n}\n\ninterface SpeechSynthesisUtterance extends EventTarget {\n lang: string;\n onboundary: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onend: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onerror: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onmark: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onpause: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onresume: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onstart: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n pitch: number;\n rate: number;\n text: string;\n voice: SpeechSynthesisVoice;\n volume: number;\n addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesisUtterance: {\n prototype: SpeechSynthesisUtterance;\n new(): SpeechSynthesisUtterance;\n new(text: string): SpeechSynthesisUtterance;\n};\n\ninterface SpeechSynthesisVoice {\n readonly default: boolean;\n readonly lang: string;\n readonly localService: boolean;\n readonly name: string;\n readonly voiceURI: string;\n}\n\ndeclare var SpeechSynthesisVoice: {\n prototype: SpeechSynthesisVoice;\n new(): SpeechSynthesisVoice;\n};\n\ninterface StereoPannerNode extends AudioNode {\n readonly pan: AudioParam;\n}\n\ndeclare var StereoPannerNode: {\n prototype: StereoPannerNode;\n new(): StereoPannerNode;\n};\n\ninterface Storage {\n readonly length: number;\n clear(): void;\n getItem(key: string): string | null;\n key(index: number): string | null;\n removeItem(key: string): void;\n setItem(key: string, value: string): void;\n [key: string]: any;\n}\n\ndeclare var Storage: {\n prototype: Storage;\n new(): Storage;\n};\n\ninterface StorageEvent extends Event {\n readonly key: string | null;\n readonly newValue: string | null;\n readonly oldValue: string | null;\n readonly storageArea: Storage | null;\n readonly url: string;\n}\n\ndeclare var StorageEvent: {\n prototype: StorageEvent;\n new (type: string, eventInitDict?: StorageEventInit): StorageEvent;\n};\n\ninterface StorageEventInit extends EventInit {\n key?: string;\n newValue?: string;\n oldValue?: string;\n storageArea?: Storage;\n url: string;\n}\n\ninterface StyleMedia {\n readonly type: string;\n matchMedium(mediaquery: string): boolean;\n}\n\ndeclare var StyleMedia: {\n prototype: StyleMedia;\n new(): StyleMedia;\n};\n\ninterface StyleSheet {\n disabled: boolean;\n readonly href: string | null;\n readonly media: MediaList;\n readonly ownerNode: Node;\n readonly parentStyleSheet: StyleSheet | null;\n readonly title: string | null;\n readonly type: string;\n}\n\ndeclare var StyleSheet: {\n prototype: StyleSheet;\n new(): StyleSheet;\n};\n\ninterface StyleSheetList {\n readonly length: number;\n item(index: number): StyleSheet | null;\n [index: number]: StyleSheet;\n}\n\ndeclare var StyleSheetList: {\n prototype: StyleSheetList;\n new(): StyleSheetList;\n};\n\ninterface SubtleCrypto {\n decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike;\n deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n digest(algorithm: string | Algorithm, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n exportKey(format: \"jwk\", key: CryptoKey): PromiseLike;\n exportKey(format: \"raw\" | \"pkcs8\" | \"spki\", key: CryptoKey): PromiseLike;\n exportKey(format: string, key: CryptoKey): PromiseLike;\n generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"jwk\", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"raw\" | \"pkcs8\" | \"spki\", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n unwrapKey(format: string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: string | Algorithm, unwrappedKeyAlgorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): PromiseLike;\n verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | Algorithm): PromiseLike;\n}\n\ndeclare var SubtleCrypto: {\n prototype: SubtleCrypto;\n new(): SubtleCrypto;\n};\n\ninterface SyncManager {\n getTags(): Promise;\n register(tag: string): Promise;\n}\n\ndeclare var SyncManager: {\n prototype: SyncManager;\n new(): SyncManager;\n};\n\ninterface Text extends CharacterData {\n readonly assignedSlot: HTMLSlotElement | null;\n readonly wholeText: string;\n splitText(offset: number): Text;\n}\n\ndeclare var Text: {\n prototype: Text;\n new(data?: string): Text;\n};\n\ninterface TextDecoder {\n readonly encoding: string;\n readonly fatal: boolean;\n readonly ignoreBOM: boolean;\n decode(input?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: TextDecodeOptions): string;\n}\n\ndeclare var TextDecoder: {\n prototype: TextDecoder;\n new(label?: string, options?: TextDecoderOptions): TextDecoder;\n};\n\ninterface TextEncoder {\n readonly encoding: string;\n encode(input?: string): Uint8Array;\n}\n\ndeclare var TextEncoder: {\n prototype: TextEncoder;\n new(): TextEncoder;\n};\n\ninterface TextEvent extends UIEvent {\n readonly data: string;\n initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n}\n\ndeclare var TextEvent: {\n prototype: TextEvent;\n new(): TextEvent;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n};\n\ninterface TextMetrics {\n readonly width: number;\n}\n\ndeclare var TextMetrics: {\n prototype: TextMetrics;\n new(): TextMetrics;\n};\n\ninterface TextTrackEventMap {\n \"cuechange\": Event;\n \"error\": Event;\n \"load\": Event;\n}\n\ninterface TextTrack extends EventTarget {\n readonly activeCues: TextTrackCueList;\n readonly cues: TextTrackCueList;\n readonly inBandMetadataTrackDispatchType: string;\n readonly kind: string;\n readonly label: string;\n readonly language: string;\n mode: TextTrackMode | number;\n oncuechange: ((this: TextTrack, ev: Event) => any) | null;\n onerror: ((this: TextTrack, ev: Event) => any) | null;\n onload: ((this: TextTrack, ev: Event) => any) | null;\n readonly readyState: number;\n addCue(cue: TextTrackCue): void;\n removeCue(cue: TextTrackCue): void;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrack: {\n prototype: TextTrack;\n new(): TextTrack;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n};\n\ninterface TextTrackCueEventMap {\n \"enter\": Event;\n \"exit\": Event;\n}\n\ninterface TextTrackCue extends EventTarget {\n endTime: number;\n id: string;\n onenter: ((this: TextTrackCue, ev: Event) => any) | null;\n onexit: ((this: TextTrackCue, ev: Event) => any) | null;\n pauseOnExit: boolean;\n startTime: number;\n text: string;\n readonly track: TextTrack;\n getCueAsHTML(): DocumentFragment;\n addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrackCue: {\n prototype: TextTrackCue;\n new(startTime: number, endTime: number, text: string): TextTrackCue;\n};\n\ninterface TextTrackCueList {\n readonly length: number;\n getCueById(id: string): TextTrackCue;\n item(index: number): TextTrackCue;\n [index: number]: TextTrackCue;\n}\n\ndeclare var TextTrackCueList: {\n prototype: TextTrackCueList;\n new(): TextTrackCueList;\n};\n\ninterface TextTrackListEventMap {\n \"addtrack\": TrackEvent;\n}\n\ninterface TextTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null;\n item(index: number): TextTrack;\n addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: TextTrack;\n}\n\ndeclare var TextTrackList: {\n prototype: TextTrackList;\n new(): TextTrackList;\n};\n\ninterface TimeRanges {\n readonly length: number;\n end(index: number): number;\n start(index: number): number;\n}\n\ndeclare var TimeRanges: {\n prototype: TimeRanges;\n new(): TimeRanges;\n};\n\ninterface Touch {\n readonly clientX: number;\n readonly clientY: number;\n readonly identifier: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly target: EventTarget;\n}\n\ndeclare var Touch: {\n prototype: Touch;\n new(): Touch;\n};\n\ninterface TouchEvent extends UIEvent {\n readonly altKey: boolean;\n readonly changedTouches: TouchList;\n readonly charCode: number;\n readonly ctrlKey: boolean;\n readonly keyCode: number;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly targetTouches: TouchList;\n readonly touches: TouchList;\n /** @deprecated */\n readonly which: number;\n}\n\ndeclare var TouchEvent: {\n prototype: TouchEvent;\n new(type: string, touchEventInit?: TouchEventInit): TouchEvent;\n};\n\ninterface TouchEventInit extends EventModifierInit {\n changedTouches?: Touch[];\n targetTouches?: Touch[];\n touches?: Touch[];\n}\n\ninterface TouchList {\n readonly length: number;\n item(index: number): Touch | null;\n [index: number]: Touch;\n}\n\ndeclare var TouchList: {\n prototype: TouchList;\n new(): TouchList;\n};\n\ninterface TrackEvent extends Event {\n readonly track: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ndeclare var TrackEvent: {\n prototype: TrackEvent;\n new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent;\n};\n\ninterface TransitionEvent extends Event {\n readonly elapsedTime: number;\n readonly propertyName: string;\n initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void;\n}\n\ndeclare var TransitionEvent: {\n prototype: TransitionEvent;\n new(typeArg: string, eventInitDict?: TransitionEventInit): TransitionEvent;\n};\n\ninterface TreeWalker {\n currentNode: Node;\n /** @deprecated */\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter | null;\n readonly root: Node;\n readonly whatToShow: number;\n firstChild(): Node | null;\n lastChild(): Node | null;\n nextNode(): Node | null;\n nextSibling(): Node | null;\n parentNode(): Node | null;\n previousNode(): Node | null;\n previousSibling(): Node | null;\n}\n\ndeclare var TreeWalker: {\n prototype: TreeWalker;\n new(): TreeWalker;\n};\n\ninterface UIEvent extends Event {\n readonly detail: number;\n readonly view: Window;\n initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void;\n}\n\ndeclare var UIEvent: {\n prototype: UIEvent;\n new(typeArg: string, eventInitDict?: UIEventInit): UIEvent;\n};\n\ninterface URL {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n password: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n readonly searchParams: URLSearchParams;\n username: string;\n toString(): string;\n}\n\ndeclare var URL: {\n prototype: URL;\n new(url: string, base?: string | URL): URL;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n};\n\ninterface URLSearchParams {\n /**\n * Appends a specified key/value pair as a new search parameter.\n */\n append(name: string, value: string): void;\n /**\n * Deletes the given search parameter, and its associated value, from the list of all search parameters.\n */\n delete(name: string): void;\n /**\n * Returns the first value associated to the given search parameter.\n */\n get(name: string): string | null;\n /**\n * Returns all the values association with a given search parameter.\n */\n getAll(name: string): string[];\n /**\n * Returns a Boolean indicating if such a search parameter exists.\n */\n has(name: string): boolean;\n /**\n * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\n */\n set(name: string, value: string): void;\n}\n\ndeclare var URLSearchParams: {\n prototype: URLSearchParams;\n new (init?: string | URLSearchParams): URLSearchParams;\n};\n\ninterface VRDisplay extends EventTarget {\n readonly capabilities: VRDisplayCapabilities;\n depthFar: number;\n depthNear: number;\n readonly displayId: number;\n readonly displayName: string;\n readonly isConnected: boolean;\n readonly isPresenting: boolean;\n readonly stageParameters: VRStageParameters | null;\n cancelAnimationFrame(handle: number): void;\n exitPresent(): Promise;\n getEyeParameters(whichEye: string): VREyeParameters;\n getFrameData(frameData: VRFrameData): boolean;\n getLayers(): VRLayer[];\n /** @deprecated */\n getPose(): VRPose;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n requestPresent(layers: VRLayer[]): Promise;\n resetPose(): void;\n submitFrame(pose?: VRPose): void;\n}\n\ndeclare var VRDisplay: {\n prototype: VRDisplay;\n new(): VRDisplay;\n};\n\ninterface VRDisplayCapabilities {\n readonly canPresent: boolean;\n readonly hasExternalDisplay: boolean;\n readonly hasOrientation: boolean;\n readonly hasPosition: boolean;\n readonly maxLayers: number;\n}\n\ndeclare var VRDisplayCapabilities: {\n prototype: VRDisplayCapabilities;\n new(): VRDisplayCapabilities;\n};\n\ninterface VRDisplayEvent extends Event {\n readonly display: VRDisplay;\n readonly reason: VRDisplayEventReason | null;\n}\n\ndeclare var VRDisplayEvent: {\n prototype: VRDisplayEvent;\n new(type: string, eventInitDict: VRDisplayEventInit): VRDisplayEvent;\n};\n\ninterface VREyeParameters {\n /** @deprecated */\n readonly fieldOfView: VRFieldOfView;\n readonly offset: Float32Array;\n readonly renderHeight: number;\n readonly renderWidth: number;\n}\n\ndeclare var VREyeParameters: {\n prototype: VREyeParameters;\n new(): VREyeParameters;\n};\n\ninterface VRFieldOfView {\n readonly downDegrees: number;\n readonly leftDegrees: number;\n readonly rightDegrees: number;\n readonly upDegrees: number;\n}\n\ndeclare var VRFieldOfView: {\n prototype: VRFieldOfView;\n new(): VRFieldOfView;\n};\n\ninterface VRFrameData {\n readonly leftProjectionMatrix: Float32Array;\n readonly leftViewMatrix: Float32Array;\n readonly pose: VRPose;\n readonly rightProjectionMatrix: Float32Array;\n readonly rightViewMatrix: Float32Array;\n readonly timestamp: number;\n}\n\ndeclare var VRFrameData: {\n prototype: VRFrameData;\n new(): VRFrameData;\n};\n\ninterface VRPose {\n readonly angularAcceleration: Float32Array | null;\n readonly angularVelocity: Float32Array | null;\n readonly linearAcceleration: Float32Array | null;\n readonly linearVelocity: Float32Array | null;\n readonly orientation: Float32Array | null;\n readonly position: Float32Array | null;\n readonly timestamp: number;\n}\n\ndeclare var VRPose: {\n prototype: VRPose;\n new(): VRPose;\n};\n\ninterface ValidityState {\n readonly badInput: boolean;\n readonly customError: boolean;\n readonly patternMismatch: boolean;\n readonly rangeOverflow: boolean;\n readonly rangeUnderflow: boolean;\n readonly stepMismatch: boolean;\n readonly tooLong: boolean;\n readonly tooShort: boolean;\n readonly typeMismatch: boolean;\n readonly valid: boolean;\n readonly valueMissing: boolean;\n}\n\ndeclare var ValidityState: {\n prototype: ValidityState;\n new(): ValidityState;\n};\n\ninterface VideoPlaybackQuality {\n readonly corruptedVideoFrames: number;\n readonly creationTime: number;\n readonly droppedVideoFrames: number;\n readonly totalFrameDelay: number;\n readonly totalVideoFrames: number;\n}\n\ndeclare var VideoPlaybackQuality: {\n prototype: VideoPlaybackQuality;\n new(): VideoPlaybackQuality;\n};\n\ninterface VideoTrack {\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n selected: boolean;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var VideoTrack: {\n prototype: VideoTrack;\n new(): VideoTrack;\n};\n\ninterface VideoTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface VideoTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: VideoTrackList, ev: TrackEvent) => any) | null;\n onchange: ((this: VideoTrackList, ev: Event) => any) | null;\n onremovetrack: ((this: VideoTrackList, ev: TrackEvent) => any) | null;\n readonly selectedIndex: number;\n getTrackById(id: string): VideoTrack | null;\n item(index: number): VideoTrack;\n addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\n};\n\ninterface WEBGL_color_buffer_float {\n readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number;\n readonly RGB32F_EXT: number;\n readonly RGBA32F_EXT: number;\n readonly UNSIGNED_NORMALIZED_EXT: number;\n}\n\ninterface WEBGL_compressed_texture_astc {\n readonly COMPRESSED_RGBA_ASTC_10x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x8_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x12_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_4x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: number;\n getSupportedProfiles(): string[];\n}\n\ninterface WEBGL_compressed_texture_s3tc {\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n}\n\ndeclare var WEBGL_compressed_texture_s3tc: {\n prototype: WEBGL_compressed_texture_s3tc;\n new(): WEBGL_compressed_texture_s3tc;\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n};\n\ninterface WEBGL_compressed_texture_s3tc_srgb {\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;\n readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: number;\n}\n\ninterface WEBGL_debug_renderer_info {\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n}\n\ndeclare var WEBGL_debug_renderer_info: {\n prototype: WEBGL_debug_renderer_info;\n new(): WEBGL_debug_renderer_info;\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n};\n\ninterface WEBGL_debug_shaders {\n getTranslatedShaderSource(shader: WebGLShader): string;\n}\n\ninterface WEBGL_depth_texture {\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n}\n\ndeclare var WEBGL_depth_texture: {\n prototype: WEBGL_depth_texture;\n new(): WEBGL_depth_texture;\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n};\n\ninterface WEBGL_draw_buffers {\n readonly COLOR_ATTACHMENT0_WEBGL: number;\n readonly COLOR_ATTACHMENT10_WEBGL: number;\n readonly COLOR_ATTACHMENT11_WEBGL: number;\n readonly COLOR_ATTACHMENT12_WEBGL: number;\n readonly COLOR_ATTACHMENT13_WEBGL: number;\n readonly COLOR_ATTACHMENT14_WEBGL: number;\n readonly COLOR_ATTACHMENT15_WEBGL: number;\n readonly COLOR_ATTACHMENT1_WEBGL: number;\n readonly COLOR_ATTACHMENT2_WEBGL: number;\n readonly COLOR_ATTACHMENT3_WEBGL: number;\n readonly COLOR_ATTACHMENT4_WEBGL: number;\n readonly COLOR_ATTACHMENT5_WEBGL: number;\n readonly COLOR_ATTACHMENT6_WEBGL: number;\n readonly COLOR_ATTACHMENT7_WEBGL: number;\n readonly COLOR_ATTACHMENT8_WEBGL: number;\n readonly COLOR_ATTACHMENT9_WEBGL: number;\n readonly DRAW_BUFFER0_WEBGL: number;\n readonly DRAW_BUFFER10_WEBGL: number;\n readonly DRAW_BUFFER11_WEBGL: number;\n readonly DRAW_BUFFER12_WEBGL: number;\n readonly DRAW_BUFFER13_WEBGL: number;\n readonly DRAW_BUFFER14_WEBGL: number;\n readonly DRAW_BUFFER15_WEBGL: number;\n readonly DRAW_BUFFER1_WEBGL: number;\n readonly DRAW_BUFFER2_WEBGL: number;\n readonly DRAW_BUFFER3_WEBGL: number;\n readonly DRAW_BUFFER4_WEBGL: number;\n readonly DRAW_BUFFER5_WEBGL: number;\n readonly DRAW_BUFFER6_WEBGL: number;\n readonly DRAW_BUFFER7_WEBGL: number;\n readonly DRAW_BUFFER8_WEBGL: number;\n readonly DRAW_BUFFER9_WEBGL: number;\n readonly MAX_COLOR_ATTACHMENTS_WEBGL: number;\n readonly MAX_DRAW_BUFFERS_WEBGL: number;\n drawBuffersWEBGL(buffers: number[]): void;\n}\n\ninterface WEBGL_lose_context {\n loseContext(): void;\n restoreContext(): void;\n}\n\ninterface WaveShaperNode extends AudioNode {\n curve: Float32Array | null;\n oversample: OverSampleType;\n}\n\ndeclare var WaveShaperNode: {\n prototype: WaveShaperNode;\n new(): WaveShaperNode;\n};\n\ninterface WebAuthentication {\n getAssertion(assertionChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: AssertionOptions): Promise;\n makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise;\n}\n\ndeclare var WebAuthentication: {\n prototype: WebAuthentication;\n new(): WebAuthentication;\n};\n\ninterface WebAuthnAssertion {\n readonly authenticatorData: ArrayBuffer;\n readonly clientData: ArrayBuffer;\n readonly credential: ScopedCredential;\n readonly signature: ArrayBuffer;\n}\n\ndeclare var WebAuthnAssertion: {\n prototype: WebAuthnAssertion;\n new(): WebAuthnAssertion;\n};\n\ninterface WebGLActiveInfo {\n readonly name: string;\n readonly size: number;\n readonly type: number;\n}\n\ndeclare var WebGLActiveInfo: {\n prototype: WebGLActiveInfo;\n new(): WebGLActiveInfo;\n};\n\ninterface WebGLBuffer extends WebGLObject {\n}\n\ndeclare var WebGLBuffer: {\n prototype: WebGLBuffer;\n new(): WebGLBuffer;\n};\n\ninterface WebGLContextEvent extends Event {\n readonly statusMessage: string;\n}\n\ndeclare var WebGLContextEvent: {\n prototype: WebGLContextEvent;\n new(typeArg: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent;\n};\n\ninterface WebGLFramebuffer extends WebGLObject {\n}\n\ndeclare var WebGLFramebuffer: {\n prototype: WebGLFramebuffer;\n new(): WebGLFramebuffer;\n};\n\ninterface WebGLObject {\n}\n\ndeclare var WebGLObject: {\n prototype: WebGLObject;\n new(): WebGLObject;\n};\n\ninterface WebGLProgram extends WebGLObject {\n}\n\ndeclare var WebGLProgram: {\n prototype: WebGLProgram;\n new(): WebGLProgram;\n};\n\ninterface WebGLRenderbuffer extends WebGLObject {\n}\n\ndeclare var WebGLRenderbuffer: {\n prototype: WebGLRenderbuffer;\n new(): WebGLRenderbuffer;\n};\n\ninterface WebGLRenderingContext {\n readonly canvas: HTMLCanvasElement;\n readonly drawingBufferHeight: number;\n readonly drawingBufferWidth: number;\n activeTexture(texture: number): void;\n attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void;\n bindBuffer(target: number, buffer: WebGLBuffer | null): void;\n bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void;\n bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void;\n bindTexture(target: number, texture: WebGLTexture | null): void;\n blendColor(red: number, green: number, blue: number, alpha: number): void;\n blendEquation(mode: number): void;\n blendEquationSeparate(modeRGB: number, modeAlpha: number): void;\n blendFunc(sfactor: number, dfactor: number): void;\n blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;\n bufferData(target: number, size: number | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number): void;\n bufferSubData(target: number, offset: number, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): void;\n checkFramebufferStatus(target: number): number;\n clear(mask: number): void;\n clearColor(red: number, green: number, blue: number, alpha: number): void;\n clearDepth(depth: number): void;\n clearStencil(s: number): void;\n colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;\n compileShader(shader: WebGLShader | null): void;\n compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;\n copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;\n createBuffer(): WebGLBuffer | null;\n createFramebuffer(): WebGLFramebuffer | null;\n createProgram(): WebGLProgram | null;\n createRenderbuffer(): WebGLRenderbuffer | null;\n createShader(type: number): WebGLShader | null;\n createTexture(): WebGLTexture | null;\n cullFace(mode: number): void;\n deleteBuffer(buffer: WebGLBuffer | null): void;\n deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;\n deleteProgram(program: WebGLProgram | null): void;\n deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;\n deleteShader(shader: WebGLShader | null): void;\n deleteTexture(texture: WebGLTexture | null): void;\n depthFunc(func: number): void;\n depthMask(flag: boolean): void;\n depthRange(zNear: number, zFar: number): void;\n detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n disable(cap: number): void;\n disableVertexAttribArray(index: number): void;\n drawArrays(mode: number, first: number, count: number): void;\n drawElements(mode: number, count: number, type: number, offset: number): void;\n enable(cap: number): void;\n enableVertexAttribArray(index: number): void;\n finish(): void;\n flush(): void;\n framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void;\n framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void;\n frontFace(mode: number): void;\n generateMipmap(target: number): void;\n getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null;\n getAttribLocation(program: WebGLProgram | null, name: string): number;\n getBufferParameter(target: number, pname: number): any;\n getContextAttributes(): WebGLContextAttributes;\n getError(): number;\n getExtension(extensionName: \"EXT_blend_minmax\"): EXT_blend_minmax | null;\n getExtension(extensionName: \"EXT_texture_filter_anisotropic\"): EXT_texture_filter_anisotropic | null;\n getExtension(extensionName: \"EXT_frag_depth\"): EXT_frag_depth | null;\n getExtension(extensionName: \"EXT_shader_texture_lod\"): EXT_shader_texture_lod | null;\n getExtension(extensionName: \"EXT_sRGB\"): EXT_sRGB | null;\n getExtension(extensionName: \"OES_vertex_array_object\"): OES_vertex_array_object | null;\n getExtension(extensionName: \"WEBGL_color_buffer_float\"): WEBGL_color_buffer_float | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_astc\"): WEBGL_compressed_texture_astc | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc_srgb\"): WEBGL_compressed_texture_s3tc_srgb | null;\n getExtension(extensionName: \"WEBGL_debug_shaders\"): WEBGL_debug_shaders | null;\n getExtension(extensionName: \"WEBGL_draw_buffers\"): WEBGL_draw_buffers | null;\n getExtension(extensionName: \"WEBGL_lose_context\"): WEBGL_lose_context | null;\n getExtension(extensionName: \"WEBGL_depth_texture\"): WEBGL_depth_texture | null;\n getExtension(extensionName: \"WEBGL_debug_renderer_info\"): WEBGL_debug_renderer_info | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc\"): WEBGL_compressed_texture_s3tc | null;\n getExtension(extensionName: \"OES_texture_half_float_linear\"): OES_texture_half_float_linear | null;\n getExtension(extensionName: \"OES_texture_half_float\"): OES_texture_half_float | null;\n getExtension(extensionName: \"OES_texture_float_linear\"): OES_texture_float_linear | null;\n getExtension(extensionName: \"OES_texture_float\"): OES_texture_float | null;\n getExtension(extensionName: \"OES_standard_derivatives\"): OES_standard_derivatives | null;\n getExtension(extensionName: \"OES_element_index_uint\"): OES_element_index_uint | null;\n getExtension(extensionName: \"ANGLE_instanced_arrays\"): ANGLE_instanced_arrays | null;\n getExtension(extensionName: string): any;\n getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any;\n getParameter(pname: number): any;\n getProgramInfoLog(program: WebGLProgram | null): string | null;\n getProgramParameter(program: WebGLProgram | null, pname: number): any;\n getRenderbufferParameter(target: number, pname: number): any;\n getShaderInfoLog(shader: WebGLShader | null): string | null;\n getShaderParameter(shader: WebGLShader | null, pname: number): any;\n getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null;\n getShaderSource(shader: WebGLShader | null): string | null;\n getSupportedExtensions(): string[] | null;\n getTexParameter(target: number, pname: number): any;\n getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any;\n getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null;\n getVertexAttrib(index: number, pname: number): any;\n getVertexAttribOffset(index: number, pname: number): number;\n hint(target: number, mode: number): void;\n isBuffer(buffer: WebGLBuffer | null): boolean;\n isContextLost(): boolean;\n isEnabled(cap: number): boolean;\n isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean;\n isProgram(program: WebGLProgram | null): boolean;\n isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean;\n isShader(shader: WebGLShader | null): boolean;\n isTexture(texture: WebGLTexture | null): boolean;\n lineWidth(width: number): void;\n linkProgram(program: WebGLProgram | null): void;\n pixelStorei(pname: number, param: number | boolean): void;\n polygonOffset(factor: number, units: number): void;\n readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;\n sampleCoverage(value: number, invert: boolean): void;\n scissor(x: number, y: number, width: number, height: number): void;\n shaderSource(shader: WebGLShader | null, source: string): void;\n stencilFunc(func: number, ref: number, mask: number): void;\n stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void;\n stencilMask(mask: number): void;\n stencilMaskSeparate(face: number, mask: number): void;\n stencilOp(fail: number, zfail: number, zpass: number): void;\n stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;\n texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n texParameterf(target: number, pname: number, param: number): void;\n texParameteri(target: number, pname: number, param: number): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n uniform1f(location: WebGLUniformLocation | null, x: number): void;\n uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform1i(location: WebGLUniformLocation | null, x: number): void;\n uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void;\n uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void;\n uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void;\n useProgram(program: WebGLProgram | null): void;\n validateProgram(program: WebGLProgram | null): void;\n vertexAttrib1f(indx: number, x: number): void;\n vertexAttrib1fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib2f(indx: number, x: number, y: number): void;\n vertexAttrib2fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib3f(indx: number, x: number, y: number, z: number): void;\n vertexAttrib3fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;\n vertexAttrib4fv(indx: number, values: Float32Array | number[]): void;\n vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;\n viewport(x: number, y: number, width: number, height: number): void;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly NO_ERROR: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB565: number;\n readonly RGB5_A1: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TRIANGLES: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n}\n\ndeclare var WebGLRenderingContext: {\n prototype: WebGLRenderingContext;\n new(): WebGLRenderingContext;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly NO_ERROR: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB565: number;\n readonly RGB5_A1: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TRIANGLES: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n};\n\ninterface WebGLShader extends WebGLObject {\n}\n\ndeclare var WebGLShader: {\n prototype: WebGLShader;\n new(): WebGLShader;\n};\n\ninterface WebGLShaderPrecisionFormat {\n readonly precision: number;\n readonly rangeMax: number;\n readonly rangeMin: number;\n}\n\ndeclare var WebGLShaderPrecisionFormat: {\n prototype: WebGLShaderPrecisionFormat;\n new(): WebGLShaderPrecisionFormat;\n};\n\ninterface WebGLTexture extends WebGLObject {\n}\n\ndeclare var WebGLTexture: {\n prototype: WebGLTexture;\n new(): WebGLTexture;\n};\n\ninterface WebGLUniformLocation {\n}\n\ndeclare var WebGLUniformLocation: {\n prototype: WebGLUniformLocation;\n new(): WebGLUniformLocation;\n};\n\ninterface WebGLVertexArrayObjectOES {\n}\n\ninterface WebKitCSSMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n m11: number;\n m12: number;\n m13: number;\n m14: number;\n m21: number;\n m22: number;\n m23: number;\n m24: number;\n m31: number;\n m32: number;\n m33: number;\n m34: number;\n m41: number;\n m42: number;\n m43: number;\n m44: number;\n inverse(): WebKitCSSMatrix;\n multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix;\n rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix;\n rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix;\n scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix;\n setMatrixValue(value: string): void;\n skewX(angle: number): WebKitCSSMatrix;\n skewY(angle: number): WebKitCSSMatrix;\n toString(): string;\n translate(x: number, y: number, z?: number): WebKitCSSMatrix;\n}\n\ndeclare var WebKitCSSMatrix: {\n prototype: WebKitCSSMatrix;\n new(text?: string): WebKitCSSMatrix;\n};\n\ninterface WebKitDirectoryEntry extends WebKitEntry {\n createReader(): WebKitDirectoryReader;\n}\n\ndeclare var WebKitDirectoryEntry: {\n prototype: WebKitDirectoryEntry;\n new(): WebKitDirectoryEntry;\n};\n\ninterface WebKitDirectoryReader {\n readEntries(successCallback: WebKitEntriesCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitDirectoryReader: {\n prototype: WebKitDirectoryReader;\n new(): WebKitDirectoryReader;\n};\n\ninterface WebKitEntry {\n readonly filesystem: WebKitFileSystem;\n readonly fullPath: string;\n readonly isDirectory: boolean;\n readonly isFile: boolean;\n readonly name: string;\n}\n\ndeclare var WebKitEntry: {\n prototype: WebKitEntry;\n new(): WebKitEntry;\n};\n\ninterface WebKitFileEntry extends WebKitEntry {\n file(successCallback: WebKitFileCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitFileEntry: {\n prototype: WebKitFileEntry;\n new(): WebKitFileEntry;\n};\n\ninterface WebKitFileSystem {\n readonly name: string;\n readonly root: WebKitDirectoryEntry;\n}\n\ndeclare var WebKitFileSystem: {\n prototype: WebKitFileSystem;\n new(): WebKitFileSystem;\n};\n\ninterface WebKitPoint {\n x: number;\n y: number;\n}\n\ndeclare var WebKitPoint: {\n prototype: WebKitPoint;\n new(x?: number, y?: number): WebKitPoint;\n};\n\ninterface WebSocketEventMap {\n \"close\": CloseEvent;\n \"error\": Event;\n \"message\": MessageEvent;\n \"open\": Event;\n}\n\ninterface WebSocket extends EventTarget {\n binaryType: BinaryType;\n readonly bufferedAmount: number;\n readonly extensions: string;\n onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;\n onerror: ((this: WebSocket, ev: Event) => any) | null;\n onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;\n onopen: ((this: WebSocket, ev: Event) => any) | null;\n readonly protocol: string;\n readonly readyState: number;\n readonly url: string;\n close(code?: number, reason?: string): void;\n send(data: string | ArrayBuffer | Blob | ArrayBufferView): void;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var WebSocket: {\n prototype: WebSocket;\n new(url: string, protocols?: string | string[]): WebSocket;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n};\n\ninterface WheelEvent extends MouseEvent {\n readonly deltaMode: number;\n readonly deltaX: number;\n readonly deltaY: number;\n readonly deltaZ: number;\n readonly wheelDelta: number;\n readonly wheelDeltaX: number;\n readonly wheelDeltaY: number;\n getCurrentPoint(element: Element): void;\n initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n}\n\ndeclare var WheelEvent: {\n prototype: WheelEvent;\n new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n};\n\ninterface WindowEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"compassneedscalibration\": Event;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"devicelight\": DeviceLightEvent;\n \"devicemotion\": DeviceMotionEvent;\n \"deviceorientation\": DeviceOrientationEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"message\": MessageEvent;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSGestureChange\": Event;\n \"MSGestureDoubleTap\": Event;\n \"MSGestureEnd\": Event;\n \"MSGestureHold\": Event;\n \"MSGestureStart\": Event;\n \"MSGestureTap\": Event;\n \"MSInertiaStart\": Event;\n \"MSPointerCancel\": Event;\n \"MSPointerDown\": Event;\n \"MSPointerEnter\": Event;\n \"MSPointerLeave\": Event;\n \"MSPointerMove\": Event;\n \"MSPointerOut\": Event;\n \"MSPointerOver\": Event;\n \"MSPointerUp\": Event;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"popstate\": PopStateEvent;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": ProgressEvent;\n \"reset\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"stalled\": Event;\n \"storage\": StorageEvent;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": Event;\n \"touchend\": Event;\n \"touchmove\": Event;\n \"touchstart\": Event;\n \"unload\": Event;\n \"volumechange\": Event;\n \"vrdisplayactivate\": Event;\n \"vrdisplayblur\": Event;\n \"vrdisplayconnect\": Event;\n \"vrdisplaydeactivate\": Event;\n \"vrdisplaydisconnect\": Event;\n \"vrdisplayfocus\": Event;\n \"vrdisplaypointerrestricted\": Event;\n \"vrdisplaypointerunrestricted\": Event;\n \"vrdisplaypresentchange\": Event;\n \"waiting\": Event;\n}\n\ninterface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch {\n Blob: typeof Blob;\n URL: typeof URL;\n URLSearchParams: typeof URLSearchParams;\n readonly applicationCache: ApplicationCache;\n readonly caches: CacheStorage;\n readonly clientInformation: Navigator;\n readonly closed: boolean;\n readonly crypto: Crypto;\n customElements: CustomElementRegistry;\n defaultStatus: string;\n readonly devicePixelRatio: number;\n readonly doNotTrack: string;\n readonly document: Document;\n event: Event | undefined;\n readonly external: External;\n readonly frameElement: Element;\n readonly frames: Window;\n readonly history: History;\n readonly innerHeight: number;\n readonly innerWidth: number;\n readonly isSecureContext: boolean;\n readonly length: number;\n location: Location;\n readonly locationbar: BarProp;\n readonly menubar: BarProp;\n readonly msContentScript: ExtensionScriptApis;\n readonly msCredentials: MSCredentials;\n name: string;\n readonly navigator: Navigator;\n offscreenBuffering: string | boolean;\n onabort: ((this: Window, ev: UIEvent) => any) | null;\n onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;\n onblur: ((this: Window, ev: FocusEvent) => any) | null;\n oncanplay: ((this: Window, ev: Event) => any) | null;\n oncanplaythrough: ((this: Window, ev: Event) => any) | null;\n onchange: ((this: Window, ev: Event) => any) | null;\n onclick: ((this: Window, ev: MouseEvent) => any) | null;\n oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\n oncontextmenu: ((this: Window, ev: PointerEvent) => any) | null;\n ondblclick: ((this: Window, ev: MouseEvent) => any) | null;\n ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\n ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\n ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\n ondrag: ((this: Window, ev: DragEvent) => any) | null;\n ondragend: ((this: Window, ev: DragEvent) => any) | null;\n ondragenter: ((this: Window, ev: DragEvent) => any) | null;\n ondragleave: ((this: Window, ev: DragEvent) => any) | null;\n ondragover: ((this: Window, ev: DragEvent) => any) | null;\n ondragstart: ((this: Window, ev: DragEvent) => any) | null;\n ondrop: ((this: Window, ev: DragEvent) => any) | null;\n ondurationchange: ((this: Window, ev: Event) => any) | null;\n onemptied: ((this: Window, ev: Event) => any) | null;\n onended: ((this: Window, ev: Event) => any) | null;\n onerror: ErrorEventHandler;\n onfocus: ((this: Window, ev: FocusEvent) => any) | null;\n onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null;\n oninput: ((this: Window, ev: Event) => any) | null;\n oninvalid: ((this: Window, ev: Event) => any) | null;\n onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null;\n onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null;\n onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null;\n onload: ((this: Window, ev: Event) => any) | null;\n onloadeddata: ((this: Window, ev: Event) => any) | null;\n onloadedmetadata: ((this: Window, ev: Event) => any) | null;\n onloadstart: ((this: Window, ev: Event) => any) | null;\n onmessage: ((this: Window, ev: MessageEvent) => any) | null;\n onmousedown: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseenter: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseleave: ((this: Window, ev: MouseEvent) => any) | null;\n onmousemove: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseout: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseover: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseup: ((this: Window, ev: MouseEvent) => any) | null;\n onmousewheel: ((this: Window, ev: WheelEvent) => any) | null;\n onmsgesturechange: ((this: Window, ev: Event) => any) | null;\n onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\n onmsgestureend: ((this: Window, ev: Event) => any) | null;\n onmsgesturehold: ((this: Window, ev: Event) => any) | null;\n onmsgesturestart: ((this: Window, ev: Event) => any) | null;\n onmsgesturetap: ((this: Window, ev: Event) => any) | null;\n onmsinertiastart: ((this: Window, ev: Event) => any) | null;\n onmspointercancel: ((this: Window, ev: Event) => any) | null;\n onmspointerdown: ((this: Window, ev: Event) => any) | null;\n onmspointerenter: ((this: Window, ev: Event) => any) | null;\n onmspointerleave: ((this: Window, ev: Event) => any) | null;\n onmspointermove: ((this: Window, ev: Event) => any) | null;\n onmspointerout: ((this: Window, ev: Event) => any) | null;\n onmspointerover: ((this: Window, ev: Event) => any) | null;\n onmspointerup: ((this: Window, ev: Event) => any) | null;\n onoffline: ((this: Window, ev: Event) => any) | null;\n ononline: ((this: Window, ev: Event) => any) | null;\n onorientationchange: ((this: Window, ev: Event) => any) | null;\n onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null;\n onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null;\n onpause: ((this: Window, ev: Event) => any) | null;\n onplay: ((this: Window, ev: Event) => any) | null;\n onplaying: ((this: Window, ev: Event) => any) | null;\n onpopstate: ((this: Window, ev: PopStateEvent) => any) | null;\n onprogress: ((this: Window, ev: ProgressEvent) => any) | null;\n onratechange: ((this: Window, ev: Event) => any) | null;\n onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null;\n onreset: ((this: Window, ev: Event) => any) | null;\n onresize: ((this: Window, ev: UIEvent) => any) | null;\n onscroll: ((this: Window, ev: UIEvent) => any) | null;\n onseeked: ((this: Window, ev: Event) => any) | null;\n onseeking: ((this: Window, ev: Event) => any) | null;\n onselect: ((this: Window, ev: UIEvent) => any) | null;\n onstalled: ((this: Window, ev: Event) => any) | null;\n onstorage: ((this: Window, ev: StorageEvent) => any) | null;\n onsubmit: ((this: Window, ev: Event) => any) | null;\n onsuspend: ((this: Window, ev: Event) => any) | null;\n ontimeupdate: ((this: Window, ev: Event) => any) | null;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n onunload: ((this: Window, ev: Event) => any) | null;\n onvolumechange: ((this: Window, ev: Event) => any) | null;\n onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\n onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\n onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\n onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\n onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\n onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\n onwaiting: ((this: Window, ev: Event) => any) | null;\n readonly opener: any;\n readonly orientation: string | number;\n readonly outerHeight: number;\n readonly outerWidth: number;\n readonly pageXOffset: number;\n readonly pageYOffset: number;\n readonly parent: Window;\n readonly performance: Performance;\n readonly personalbar: BarProp;\n readonly screen: Screen;\n readonly screenLeft: number;\n readonly screenTop: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly scrollX: number;\n readonly scrollY: number;\n readonly scrollbars: BarProp;\n readonly self: Window;\n readonly speechSynthesis: SpeechSynthesis;\n status: string;\n readonly statusbar: BarProp;\n readonly styleMedia: StyleMedia;\n readonly toolbar: BarProp;\n readonly top: Window;\n readonly window: Window;\n alert(message?: any): void;\n blur(): void;\n cancelAnimationFrame(handle: number): void;\n captureEvents(): void;\n close(): void;\n confirm(message?: string): boolean;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\n departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\n focus(): void;\n getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\n getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\n getSelection(): Selection;\n matchMedia(mediaQuery: string): MediaQueryList;\n moveBy(x?: number, y?: number): void;\n moveTo(x?: number, y?: number): void;\n msWriteProfilerMark(profilerMarkName: string): void;\n open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\n postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\n prompt(message?: string, _default?: string): string | null;\n releaseEvents(): void;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n resizeBy(x?: number, y?: number): void;\n resizeTo(x?: number, y?: number): void;\n scroll(options?: ScrollToOptions): void;\n scroll(x?: number, y?: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x?: number, y?: number): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x?: number, y?: number): void;\n stop(): void;\n webkitCancelAnimationFrame(handle: number): void;\n webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\n addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Window: {\n prototype: Window;\n new(): Window;\n};\n\ninterface WindowBase64 {\n atob(encodedString: string): string;\n btoa(rawString: string): string;\n}\n\ninterface WindowConsole {\n readonly console: Console;\n}\n\ninterface WindowEventHandlersEventMap {\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"hashchange\": HashChangeEvent;\n \"message\": MessageEvent;\n \"offline\": Event;\n \"online\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"popstate\": PopStateEvent;\n \"storage\": StorageEvent;\n \"unload\": Event;\n}\n\ninterface WindowEventHandlers {\n onafterprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any) | null;\n onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any) | null;\n onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;\n onoffline: ((this: WindowEventHandlers, ev: Event) => any) | null;\n ononline: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onpagehide: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\n onpageshow: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\n onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any) | null;\n onstorage: ((this: WindowEventHandlers, ev: StorageEvent) => any) | null;\n onunload: ((this: WindowEventHandlers, ev: Event) => any) | null;\n addEventListener(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface WindowLocalStorage {\n readonly localStorage: Storage;\n}\n\ninterface WindowSessionStorage {\n readonly sessionStorage: Storage;\n}\n\ninterface WindowTimers extends WindowTimersExtension {\n clearInterval(handle?: number): void;\n clearTimeout(handle?: number): void;\n setInterval(handler: (...args: any[]) => void, timeout: number): number;\n setInterval(handler: any, timeout?: any, ...args: any[]): number;\n setTimeout(handler: (...args: any[]) => void, timeout: number): number;\n setTimeout(handler: any, timeout?: any, ...args: any[]): number;\n}\n\ninterface WindowTimersExtension {\n clearImmediate(handle: number): void;\n setImmediate(handler: (...args: any[]) => void): number;\n setImmediate(handler: any, ...args: any[]): number;\n}\n\ninterface WorkerEventMap extends AbstractWorkerEventMap {\n \"message\": MessageEvent;\n}\n\ninterface Worker extends EventTarget, AbstractWorker {\n onmessage: ((this: Worker, ev: MessageEvent) => any) | null;\n /** @deprecated */\n postMessage(message: any, transfer?: any[]): void;\n terminate(): void;\n addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Worker: {\n prototype: Worker;\n new(stringUrl: string): Worker;\n};\n\ninterface WritableStream {\n readonly locked: boolean;\n abort(reason?: any): Promise;\n getWriter(): WritableStreamDefaultWriter;\n}\n\ndeclare var WritableStream: {\n prototype: WritableStream;\n new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream;\n};\n\ninterface WritableStreamDefaultController {\n error(error?: any): void;\n}\n\ndeclare var WritableStreamDefaultController: {\n prototype: WritableStreamDefaultController;\n new(): WritableStreamDefaultController;\n};\n\ninterface WritableStreamDefaultWriter {\n readonly closed: Promise;\n readonly desiredSize: number;\n readonly ready: Promise;\n abort(reason?: any): Promise;\n close(): Promise;\n releaseLock(): void;\n write(chunk?: any): Promise;\n}\n\ndeclare var WritableStreamDefaultWriter: {\n prototype: WritableStreamDefaultWriter;\n new(): WritableStreamDefaultWriter;\n};\n\ninterface XMLDocument extends Document {\n addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLDocument: {\n prototype: XMLDocument;\n new(): XMLDocument;\n};\n\ninterface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {\n \"readystatechange\": Event;\n}\n\ninterface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {\n msCaching: string;\n onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;\n readonly readyState: number;\n readonly response: any;\n readonly responseText: string;\n responseType: XMLHttpRequestResponseType;\n readonly responseURL: string;\n readonly responseXML: Document | null;\n readonly status: number;\n readonly statusText: string;\n timeout: number;\n readonly upload: XMLHttpRequestUpload;\n withCredentials: boolean;\n abort(): void;\n getAllResponseHeaders(): string;\n getResponseHeader(header: string): string | null;\n msCachingEnabled(): boolean;\n open(method: string, url: string, async?: boolean, user?: string | null, password?: string | null): void;\n overrideMimeType(mime: string): void;\n send(data?: any): void;\n setRequestHeader(header: string, value: string): void;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequest: {\n prototype: XMLHttpRequest;\n new(): XMLHttpRequest;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n};\n\ninterface XMLHttpRequestEventTargetEventMap {\n \"abort\": Event;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n \"timeout\": ProgressEvent;\n}\n\ninterface XMLHttpRequestEventTarget {\n onabort: ((this: XMLHttpRequest, ev: Event) => any) | null;\n onerror: ((this: XMLHttpRequest, ev: ErrorEvent) => any) | null;\n onload: ((this: XMLHttpRequest, ev: Event) => any) | null;\n onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: XMLHttpRequest, ev: Event) => any) | null;\n onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {\n addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequestUpload: {\n prototype: XMLHttpRequestUpload;\n new(): XMLHttpRequestUpload;\n};\n\ninterface XMLSerializer {\n serializeToString(target: Node): string;\n}\n\ndeclare var XMLSerializer: {\n prototype: XMLSerializer;\n new(): XMLSerializer;\n};\n\ninterface XPathEvaluator {\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n createNSResolver(nodeResolver?: Node): XPathNSResolver;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathEvaluator: {\n prototype: XPathEvaluator;\n new(): XPathEvaluator;\n};\n\ninterface XPathExpression {\n evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathExpression: {\n prototype: XPathExpression;\n new(): XPathExpression;\n};\n\ninterface XPathNSResolver {\n lookupNamespaceURI(prefix: string): string;\n}\n\ndeclare var XPathNSResolver: {\n prototype: XPathNSResolver;\n new(): XPathNSResolver;\n};\n\ninterface XPathResult {\n readonly booleanValue: boolean;\n readonly invalidIteratorState: boolean;\n readonly numberValue: number;\n readonly resultType: number;\n readonly singleNodeValue: Node;\n readonly snapshotLength: number;\n readonly stringValue: string;\n iterateNext(): Node;\n snapshotItem(index: number): Node;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n}\n\ndeclare var XPathResult: {\n prototype: XPathResult;\n new(): XPathResult;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n};\n\ninterface XSLTProcessor {\n clearParameters(): void;\n getParameter(namespaceURI: string, localName: string): any;\n importStylesheet(style: Node): void;\n removeParameter(namespaceURI: string, localName: string): void;\n reset(): void;\n setParameter(namespaceURI: string, localName: string, value: any): void;\n transformToDocument(source: Node): Document;\n transformToFragment(source: Node, document: Document): DocumentFragment;\n}\n\ndeclare var XSLTProcessor: {\n prototype: XSLTProcessor;\n new(): XSLTProcessor;\n};\n\ninterface webkitRTCPeerConnection extends RTCPeerConnection {\n addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var webkitRTCPeerConnection: {\n prototype: webkitRTCPeerConnection;\n new(configuration: RTCConfiguration): webkitRTCPeerConnection;\n};\n\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\n\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\n\ninterface ErrorEventHandler {\n (event: Event | string, source?: string, fileno?: number, columnNumber?: number, error?: Error): void;\n}\n\ninterface EventHandlerNonNull {\n (event: Event): any;\n}\n\ninterface ForEachCallback {\n (keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, status: MediaKeyStatus): void;\n}\n\ninterface FrameRequestCallback {\n (time: number): void;\n}\n\ninterface FunctionStringCallback {\n (data: string): void;\n}\n\ninterface IntersectionObserverCallback {\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\n}\n\ninterface MSLaunchUriCallback {\n (): void;\n}\n\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\n\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\n\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\n\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\n\ninterface NotificationPermissionCallback {\n (permission: NotificationPermission): void;\n}\n\ninterface PositionCallback {\n (position: Position): void;\n}\n\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\n\ninterface RTCPeerConnectionErrorCallback {\n (error: DOMError): void;\n}\n\ninterface RTCSessionDescriptionCallback {\n (sdp: RTCSessionDescription): void;\n}\n\ninterface RTCStatsCallback {\n (report: RTCStatsReport): void;\n}\n\ninterface VoidFunction {\n (): void;\n}\n\ninterface WritableStreamChunkCallback {\n (chunk: any, controller: WritableStreamDefaultController): void;\n}\n\ninterface WritableStreamDefaultControllerCallback {\n (controller: WritableStreamDefaultController): void;\n}\n\ninterface WritableStreamErrorCallback {\n (reason: string): void;\n}\n\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"abbr\": HTMLElement;\n \"acronym\": HTMLElement;\n \"address\": HTMLElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"article\": HTMLElement;\n \"aside\": HTMLElement;\n \"audio\": HTMLAudioElement;\n \"b\": HTMLElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"bdo\": HTMLElement;\n \"big\": HTMLElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"center\": HTMLElement;\n \"cite\": HTMLElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"del\": HTMLModElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"h1\": HTMLHeadingElement;\n \"h2\": HTMLHeadingElement;\n \"h3\": HTMLHeadingElement;\n \"h4\": HTMLHeadingElement;\n \"h5\": HTMLHeadingElement;\n \"h6\": HTMLHeadingElement;\n \"head\": HTMLHeadElement;\n \"header\": HTMLElement;\n \"hgroup\": HTMLElement;\n \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"i\": HTMLElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"kbd\": HTMLElement;\n \"keygen\": HTMLElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nav\": HTMLElement;\n \"nextid\": HTMLUnknownElement;\n \"nobr\": HTMLElement;\n \"noframes\": HTMLElement;\n \"noscript\": HTMLElement;\n \"object\": HTMLObjectElement;\n \"ol\": HTMLOListElement;\n \"optgroup\": HTMLOptGroupElement;\n \"option\": HTMLOptionElement;\n \"output\": HTMLOutputElement;\n \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"rt\": HTMLElement;\n \"ruby\": HTMLElement;\n \"s\": HTMLElement;\n \"samp\": HTMLElement;\n \"script\": HTMLScriptElement;\n \"section\": HTMLElement;\n \"select\": HTMLSelectElement;\n \"slot\": HTMLSlotElement;\n \"small\": HTMLElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"textarea\": HTMLTextAreaElement;\n \"tfoot\": HTMLTableSectionElement;\n \"th\": HTMLTableHeaderCellElement;\n \"thead\": HTMLTableSectionElement;\n \"time\": HTMLTimeElement;\n \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"wbr\": HTMLElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface SVGElementTagNameMap {\n \"circle\": SVGCircleElement;\n \"clippath\": SVGClipPathElement;\n \"defs\": SVGDefsElement;\n \"desc\": SVGDescElement;\n \"ellipse\": SVGEllipseElement;\n \"feblend\": SVGFEBlendElement;\n \"fecolormatrix\": SVGFEColorMatrixElement;\n \"fecomponenttransfer\": SVGFEComponentTransferElement;\n \"fecomposite\": SVGFECompositeElement;\n \"feconvolvematrix\": SVGFEConvolveMatrixElement;\n \"fediffuselighting\": SVGFEDiffuseLightingElement;\n \"fedisplacementmap\": SVGFEDisplacementMapElement;\n \"fedistantlight\": SVGFEDistantLightElement;\n \"feflood\": SVGFEFloodElement;\n \"fefunca\": SVGFEFuncAElement;\n \"fefuncb\": SVGFEFuncBElement;\n \"fefuncg\": SVGFEFuncGElement;\n \"fefuncr\": SVGFEFuncRElement;\n \"fegaussianblur\": SVGFEGaussianBlurElement;\n \"feimage\": SVGFEImageElement;\n \"femerge\": SVGFEMergeElement;\n \"femergenode\": SVGFEMergeNodeElement;\n \"femorphology\": SVGFEMorphologyElement;\n \"feoffset\": SVGFEOffsetElement;\n \"fepointlight\": SVGFEPointLightElement;\n \"fespecularlighting\": SVGFESpecularLightingElement;\n \"fespotlight\": SVGFESpotLightElement;\n \"fetile\": SVGFETileElement;\n \"feturbulence\": SVGFETurbulenceElement;\n \"filter\": SVGFilterElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"g\": SVGGElement;\n \"image\": SVGImageElement;\n \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"marker\": SVGMarkerElement;\n \"mask\": SVGMaskElement;\n \"metadata\": SVGMetadataElement;\n \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\n \"stop\": SVGStopElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\n \"tspan\": SVGTSpanElement;\n \"use\": SVGUseElement;\n \"view\": SVGViewElement;\n}\n\n/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */\ninterface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { }\n\ndeclare var Audio: {\n new(src?: string): HTMLAudioElement;\n};\ndeclare var Image: {\n new(width?: number, height?: number): HTMLImageElement;\n};\ndeclare var Option: {\n new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement;\n};\ndeclare var Blob: typeof Blob;\ndeclare var URL: typeof URL;\ndeclare var URLSearchParams: typeof URLSearchParams;\ndeclare var applicationCache: ApplicationCache;\ndeclare var caches: CacheStorage;\ndeclare var clientInformation: Navigator;\ndeclare var closed: boolean;\ndeclare var crypto: Crypto;\ndeclare var customElements: CustomElementRegistry;\ndeclare var defaultStatus: string;\ndeclare var devicePixelRatio: number;\ndeclare var doNotTrack: string;\ndeclare var document: Document;\ndeclare var event: Event | undefined;\ndeclare var external: External;\ndeclare var frameElement: Element;\ndeclare var frames: Window;\ndeclare var history: History;\ndeclare var innerHeight: number;\ndeclare var innerWidth: number;\ndeclare var isSecureContext: boolean;\ndeclare var length: number;\ndeclare var location: Location;\ndeclare var locationbar: BarProp;\ndeclare var menubar: BarProp;\ndeclare var msContentScript: ExtensionScriptApis;\ndeclare var msCredentials: MSCredentials;\ndeclare const name: never;\ndeclare var navigator: Navigator;\ndeclare var offscreenBuffering: string | boolean;\ndeclare var onabort: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;\ndeclare var onblur: ((this: Window, ev: FocusEvent) => any) | null;\ndeclare var oncanplay: ((this: Window, ev: Event) => any) | null;\ndeclare var oncanplaythrough: ((this: Window, ev: Event) => any) | null;\ndeclare var onchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onclick: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\ndeclare var oncontextmenu: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var ondblclick: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\ndeclare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\ndeclare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\ndeclare var ondrag: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragend: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragenter: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragleave: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragover: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragstart: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondrop: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondurationchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onemptied: ((this: Window, ev: Event) => any) | null;\ndeclare var onended: ((this: Window, ev: Event) => any) | null;\ndeclare var onerror: ErrorEventHandler;\ndeclare var onfocus: ((this: Window, ev: FocusEvent) => any) | null;\ndeclare var onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null;\ndeclare var oninput: ((this: Window, ev: Event) => any) | null;\ndeclare var oninvalid: ((this: Window, ev: Event) => any) | null;\ndeclare var onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null;\ndeclare var onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null;\ndeclare var onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null;\ndeclare var onload: ((this: Window, ev: Event) => any) | null;\ndeclare var onloadeddata: ((this: Window, ev: Event) => any) | null;\ndeclare var onloadedmetadata: ((this: Window, ev: Event) => any) | null;\ndeclare var onloadstart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmessage: ((this: Window, ev: MessageEvent) => any) | null;\ndeclare var onmousedown: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseenter: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseleave: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmousemove: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseout: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmousewheel: ((this: Window, ev: WheelEvent) => any) | null;\ndeclare var onmsgesturechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgestureend: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturehold: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturestart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturetap: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsinertiastart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointercancel: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerdown: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerenter: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerleave: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointermove: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerout: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerover: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerup: ((this: Window, ev: Event) => any) | null;\ndeclare var onoffline: ((this: Window, ev: Event) => any) | null;\ndeclare var ononline: ((this: Window, ev: Event) => any) | null;\ndeclare var onorientationchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null;\ndeclare var onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null;\ndeclare var onpause: ((this: Window, ev: Event) => any) | null;\ndeclare var onplay: ((this: Window, ev: Event) => any) | null;\ndeclare var onplaying: ((this: Window, ev: Event) => any) | null;\ndeclare var onpopstate: ((this: Window, ev: PopStateEvent) => any) | null;\ndeclare var onprogress: ((this: Window, ev: ProgressEvent) => any) | null;\ndeclare var onratechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null;\ndeclare var onreset: ((this: Window, ev: Event) => any) | null;\ndeclare var onresize: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onscroll: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onseeked: ((this: Window, ev: Event) => any) | null;\ndeclare var onseeking: ((this: Window, ev: Event) => any) | null;\ndeclare var onselect: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onstalled: ((this: Window, ev: Event) => any) | null;\ndeclare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;\ndeclare var onsubmit: ((this: Window, ev: Event) => any) | null;\ndeclare var onsuspend: ((this: Window, ev: Event) => any) | null;\ndeclare var ontimeupdate: ((this: Window, ev: Event) => any) | null;\ndeclare var ontouchcancel: (ev: TouchEvent) => any;\ndeclare var ontouchend: (ev: TouchEvent) => any;\ndeclare var ontouchmove: (ev: TouchEvent) => any;\ndeclare var ontouchstart: (ev: TouchEvent) => any;\ndeclare var onunload: ((this: Window, ev: Event) => any) | null;\ndeclare var onvolumechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onwaiting: ((this: Window, ev: Event) => any) | null;\ndeclare var opener: any;\ndeclare var orientation: string | number;\ndeclare var outerHeight: number;\ndeclare var outerWidth: number;\ndeclare var pageXOffset: number;\ndeclare var pageYOffset: number;\ndeclare var parent: Window;\ndeclare var performance: Performance;\ndeclare var personalbar: BarProp;\ndeclare var screen: Screen;\ndeclare var screenLeft: number;\ndeclare var screenTop: number;\ndeclare var screenX: number;\ndeclare var screenY: number;\ndeclare var scrollX: number;\ndeclare var scrollY: number;\ndeclare var scrollbars: BarProp;\ndeclare var self: Window;\ndeclare var speechSynthesis: SpeechSynthesis;\ndeclare var status: string;\ndeclare var statusbar: BarProp;\ndeclare var styleMedia: StyleMedia;\ndeclare var toolbar: BarProp;\ndeclare var top: Window;\ndeclare var window: Window;\ndeclare function alert(message?: any): void;\ndeclare function blur(): void;\ndeclare function cancelAnimationFrame(handle: number): void;\ndeclare function captureEvents(): void;\ndeclare function close(): void;\ndeclare function confirm(message?: string): boolean;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\ndeclare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\ndeclare function focus(): void;\ndeclare function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\ndeclare function getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\ndeclare function getSelection(): Selection;\ndeclare function matchMedia(mediaQuery: string): MediaQueryList;\ndeclare function moveBy(x?: number, y?: number): void;\ndeclare function moveTo(x?: number, y?: number): void;\ndeclare function msWriteProfilerMark(profilerMarkName: string): void;\ndeclare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\ndeclare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\ndeclare function prompt(message?: string, _default?: string): string | null;\ndeclare function releaseEvents(): void;\ndeclare function requestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function resizeBy(x?: number, y?: number): void;\ndeclare function resizeTo(x?: number, y?: number): void;\ndeclare function scroll(options?: ScrollToOptions): void;\ndeclare function scroll(x?: number, y?: number): void;\ndeclare function scrollBy(options?: ScrollToOptions): void;\ndeclare function scrollBy(x?: number, y?: number): void;\ndeclare function scrollTo(options?: ScrollToOptions): void;\ndeclare function scrollTo(x?: number, y?: number): void;\ndeclare function stop(): void;\ndeclare function webkitCancelAnimationFrame(handle: number): void;\ndeclare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function toString(): string;\ndeclare function dispatchEvent(evt: Event): boolean;\ndeclare function clearInterval(handle?: number): void;\ndeclare function clearTimeout(handle?: number): void;\ndeclare function setInterval(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setInterval(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function setTimeout(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function clearImmediate(handle: number): void;\ndeclare function setImmediate(handler: (...args: any[]) => void): number;\ndeclare function setImmediate(handler: any, ...args: any[]): number;\ndeclare var sessionStorage: Storage;\ndeclare var localStorage: Storage;\ndeclare var console: Console;\ndeclare var onpointercancel: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerdown: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerenter: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerleave: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointermove: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerout: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerover: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerup: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onwheel: ((this: Window, ev: WheelEvent) => any) | null;\ndeclare var indexedDB: IDBFactory;\ndeclare function atob(encodedString: string): string;\ndeclare function btoa(rawString: string): string;\ndeclare function fetch(input?: Request | string, init?: RequestInit): Promise;\ndeclare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\ndeclare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\ndeclare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\ntype ScrollBehavior = \"auto\" | \"instant\" | \"smooth\";\ntype ScrollLogicalPosition = \"start\" | \"center\" | \"end\" | \"nearest\";\ntype MouseWheelEvent = WheelEvent;\ntype ScrollRestoration = \"auto\" | \"manual\";\ntype FormDataEntryValue = string | File;\ntype InsertPosition = \"beforebegin\" | \"afterbegin\" | \"beforeend\" | \"afterend\";\ntype HeadersInit = Headers | string[][] | { [key: string]: string };\ntype OrientationLockType = \"any\" | \"natural\" | \"portrait\" | \"landscape\" | \"portrait-primary\" | \"portrait-secondary\" | \"landscape-primary\"| \"landscape-secondary\";\ntype IDBValidKey = number | string | Date | IDBArrayKey;\ntype AlgorithmIdentifier = string | Algorithm;\ntype MutationRecordType = \"attributes\" | \"characterData\" | \"childList\";\ntype AAGUID = string;\ntype BodyInit = any;\ntype ByteString = string;\ntype ConstrainBoolean = boolean | ConstrainBooleanParameters;\ntype ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;\ntype ConstrainDouble = number | ConstrainDoubleRange;\ntype ConstrainLong = number | ConstrainLongRange;\ntype CryptoOperationData = ArrayBufferView;\ntype GLbitfield = number;\ntype GLboolean = boolean;\ntype GLbyte = number;\ntype GLclampf = number;\ntype GLenum = number;\ntype GLfloat = number;\ntype GLint = number;\ntype GLintptr = number;\ntype GLshort = number;\ntype GLsizei = number;\ntype GLsizeiptr = number;\ntype GLubyte = number;\ntype GLuint = number;\ntype GLushort = number;\ntype IDBKeyPath = string;\ntype MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload;\ntype MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent;\ntype MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload;\ntype RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete;\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\ntype RequestInfo = Request | string;\ntype USVString = string;\ntype payloadtype = number;\ntype BufferSource = ArrayBuffer | ArrayBufferView;\ntype ClientTypes = \"window\" | \"worker\" | \"sharedworker\" | \"all\";\ntype AppendMode = \"segments\" | \"sequence\";\ntype AudioContextLatencyCategory = \"balanced\" | \"interactive\" | \"playback\";\ntype AudioContextState = \"suspended\" | \"running\" | \"closed\";\ntype BinaryType = \"blob\" | \"arraybuffer\";\ntype BiquadFilterType = \"lowpass\" | \"highpass\" | \"bandpass\" | \"lowshelf\" | \"highshelf\" | \"peaking\" | \"notch\" | \"allpass\";\ntype CanPlayTypeResult = \"\" | \"maybe\" | \"probably\";\ntype CanvasFillRule = \"nonzero\" | \"evenodd\";\ntype ChannelCountMode = \"max\" | \"clamped-max\" | \"explicit\";\ntype ChannelInterpretation = \"speakers\" | \"discrete\";\ntype DisplayCaptureSurfaceType = \"monitor\" | \"window\" | \"application\" | \"browser\";\ntype DistanceModelType = \"linear\" | \"inverse\" | \"exponential\";\ntype EndOfStreamError = \"network\" | \"decode\";\ntype ExpandGranularity = \"character\" | \"word\" | \"sentence\" | \"textedit\";\ntype GamepadHand = \"\" | \"left\" | \"right\";\ntype GamepadHapticActuatorType = \"vibration\";\ntype GamepadInputEmulationType = \"mouse\" | \"keyboard\" | \"gamepad\";\ntype GamepadMappingType = \"\" | \"standard\";\ntype IDBCursorDirection = \"next\" | \"nextunique\" | \"prev\" | \"prevunique\";\ntype IDBRequestReadyState = \"pending\" | \"done\";\ntype IDBTransactionMode = \"readonly\" | \"readwrite\" | \"versionchange\";\ntype KeyFormat = \"raw\" | \"spki\" | \"pkcs8\" | \"jwk\";\ntype KeyType = \"public\" | \"private\" | \"secret\";\ntype KeyUsage = \"encrypt\" | \"decrypt\" | \"sign\" | \"verify\" | \"deriveKey\" | \"deriveBits\" | \"wrapKey\" | \"unwrapKey\";\ntype ListeningState = \"inactive\" | \"active\" | \"disambiguation\";\ntype MSCredentialType = \"FIDO_2_0\";\ntype MSIceAddrType = \"os\" | \"stun\" | \"turn\" | \"peer-derived\";\ntype MSIceType = \"failed\" | \"direct\" | \"relay\";\ntype MSStatsType = \"description\" | \"localclientevent\" | \"inbound-network\" | \"outbound-network\" | \"inbound-payload\" | \"outbound-payload\" | \"transportdiagnostics\";\ntype MSTransportType = \"Embedded\" | \"USB\" | \"NFC\" | \"BT\";\ntype MSWebViewPermissionState = \"unknown\" | \"defer\" | \"allow\" | \"deny\";\ntype MSWebViewPermissionType = \"geolocation\" | \"unlimitedIndexedDBQuota\" | \"media\" | \"pointerlock\" | \"webnotifications\";\ntype MediaDeviceKind = \"audioinput\" | \"audiooutput\" | \"videoinput\";\ntype MediaKeyMessageType = \"license-request\" | \"license-renewal\" | \"license-release\" | \"individualization-request\";\ntype MediaKeySessionType = \"temporary\" | \"persistent-license\" | \"persistent-release-message\";\ntype MediaKeyStatus = \"usable\" | \"expired\" | \"output-downscaled\" | \"output-not-allowed\" | \"status-pending\" | \"internal-error\";\ntype MediaKeysRequirement = \"required\" | \"optional\" | \"not-allowed\";\ntype MediaStreamTrackState = \"live\" | \"ended\";\ntype NavigationReason = \"up\" | \"down\" | \"left\" | \"right\";\ntype NavigationType = \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\";\ntype NotificationDirection = \"auto\" | \"ltr\" | \"rtl\";\ntype NotificationPermission = \"default\" | \"denied\" | \"granted\";\ntype OscillatorType = \"sine\" | \"square\" | \"sawtooth\" | \"triangle\" | \"custom\";\ntype OverSampleType = \"none\" | \"2x\" | \"4x\";\ntype PanningModelType = \"equalpower\" | \"HRTF\";\ntype PaymentComplete = \"success\" | \"fail\" | \"unknown\";\ntype PaymentShippingType = \"shipping\" | \"delivery\" | \"pickup\";\ntype PushEncryptionKeyName = \"p256dh\" | \"auth\";\ntype PushPermissionState = \"granted\" | \"denied\" | \"prompt\";\ntype RTCBundlePolicy = \"balanced\" | \"max-compat\" | \"max-bundle\";\ntype RTCDegradationPreference = \"maintain-framerate\" | \"maintain-resolution\" | \"balanced\";\ntype RTCDtlsRole = \"auto\" | \"client\" | \"server\";\ntype RTCDtlsTransportState = \"new\" | \"connecting\" | \"connected\" | \"closed\";\ntype RTCIceCandidateType = \"host\" | \"srflx\" | \"prflx\" | \"relay\";\ntype RTCIceComponent = \"RTP\" | \"RTCP\";\ntype RTCIceConnectionState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"failed\" | \"disconnected\" | \"closed\";\ntype RTCIceGatherPolicy = \"all\" | \"nohost\" | \"relay\";\ntype RTCIceGathererState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceGatheringState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceProtocol = \"udp\" | \"tcp\";\ntype RTCIceRole = \"controlling\" | \"controlled\";\ntype RTCIceTcpCandidateType = \"active\" | \"passive\" | \"so\";\ntype RTCIceTransportPolicy = \"none\" | \"relay\" | \"all\";\ntype RTCIceTransportState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"disconnected\" | \"closed\";\ntype RTCSdpType = \"offer\" | \"pranswer\" | \"answer\";\ntype RTCSignalingState = \"stable\" | \"have-local-offer\" | \"have-remote-offer\" | \"have-local-pranswer\" | \"have-remote-pranswer\" | \"closed\";\ntype RTCStatsIceCandidatePairState = \"frozen\" | \"waiting\" | \"inprogress\" | \"failed\" | \"succeeded\" | \"cancelled\";\ntype RTCStatsIceCandidateType = \"host\" | \"serverreflexive\" | \"peerreflexive\" | \"relayed\";\ntype RTCStatsType = \"inboundrtp\" | \"outboundrtp\" | \"session\" | \"datachannel\" | \"track\" | \"transport\" | \"candidatepair\" | \"localcandidate\" | \"remotecandidate\";\ntype ReadyState = \"closed\" | \"open\" | \"ended\";\ntype ReferrerPolicy = \"\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-only\" | \"origin-when-cross-origin\" | \"unsafe-url\";\ntype RequestCache = \"default\" | \"no-store\" | \"reload\" | \"no-cache\" | \"force-cache\";\ntype RequestCredentials = \"omit\" | \"same-origin\" | \"include\";\ntype RequestDestination = \"\" | \"document\" | \"sharedworker\" | \"subresource\" | \"unknown\" | \"worker\";\ntype RequestMode = \"navigate\" | \"same-origin\" | \"no-cors\" | \"cors\";\ntype RequestRedirect = \"follow\" | \"error\" | \"manual\";\ntype RequestType = \"\" | \"audio\" | \"font\" | \"image\" | \"script\" | \"style\" | \"track\" | \"video\";\ntype ResponseType = \"basic\" | \"cors\" | \"default\" | \"error\" | \"opaque\" | \"opaqueredirect\";\ntype ScopedCredentialType = \"ScopedCred\";\ntype ServiceWorkerState = \"installing\" | \"installed\" | \"activating\" | \"activated\" | \"redundant\";\ntype TextTrackKind = \"subtitles\" | \"captions\" | \"descriptions\" | \"chapters\" | \"metadata\";\ntype TextTrackMode = \"disabled\" | \"hidden\" | \"showing\";\ntype Transport = \"usb\" | \"nfc\" | \"ble\";\ntype VRDisplayEventReason = \"mounted\" | \"navigation\" | \"requested\" | \"unmounted\";\ntype VREye = \"left\" | \"right\";\ntype VideoFacingModeEnum = \"user\" | \"environment\" | \"left\" | \"right\";\ntype VisibilityState = \"hidden\" | \"visible\" | \"prerender\" | \"unloaded\";\ntype XMLHttpRequestResponseType = \"\" | \"arraybuffer\" | \"blob\" | \"document\" | \"json\" | \"text\";\n\n\n/////////////////////////////\n/// WorkerGlobalScope APIs\n/////////////////////////////\n// These are only available in a Web Worker\ndeclare function importScripts(...urls: string[]): void;\n\n\n\n\n/////////////////////////////\n/// Windows Script Host APIS\n/////////////////////////////\n\n\ninterface ActiveXObject {\n new (s: string): any;\n}\ndeclare var ActiveXObject: ActiveXObject;\n\ninterface ITextWriter {\n Write(s: string): void;\n WriteLine(s: string): void;\n Close(): void;\n}\n\ninterface TextStreamBase {\n /**\n * The column number of the current character position in an input stream.\n */\n Column: number;\n\n /**\n * The current line number in an input stream.\n */\n Line: number;\n\n /**\n * Closes a text stream.\n * It is not necessary to close standard streams; they close automatically when the process ends. If\n * you close a standard stream, be aware that any other pointers to that standard stream become invalid.\n */\n Close(): void;\n}\n\ninterface TextStreamWriter extends TextStreamBase {\n /**\n * Sends a string to an output stream.\n */\n Write(s: string): void;\n\n /**\n * Sends a specified number of blank lines (newline characters) to an output stream.\n */\n WriteBlankLines(intLines: number): void;\n\n /**\n * Sends a string followed by a newline character to an output stream.\n */\n WriteLine(s: string): void;\n}\n\ninterface TextStreamReader extends TextStreamBase {\n /**\n * Returns a specified number of characters from an input stream, starting at the current pointer position.\n * Does not return until the ENTER key is pressed.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n Read(characters: number): string;\n\n /**\n * Returns all characters from an input stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadAll(): string;\n\n /**\n * Returns an entire line from an input stream.\n * Although this method extracts the newline character, it does not add it to the returned string.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadLine(): string;\n\n /**\n * Skips a specified number of characters when reading from an input text stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)\n */\n Skip(characters: number): void;\n\n /**\n * Skips the next line when reading from an input text stream.\n * Can only be used on a stream in reading mode, not writing or appending mode.\n */\n SkipLine(): void;\n\n /**\n * Indicates whether the stream pointer position is at the end of a line.\n */\n AtEndOfLine: boolean;\n\n /**\n * Indicates whether the stream pointer position is at the end of a stream.\n */\n AtEndOfStream: boolean;\n}\n\ndeclare var WScript: {\n /**\n * Outputs text to either a message box (under WScript.exe) or the command console window followed by\n * a newline (under CScript.exe).\n */\n Echo(s: any): void;\n\n /**\n * Exposes the write-only error output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdErr: TextStreamWriter;\n\n /**\n * Exposes the write-only output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdOut: TextStreamWriter;\n Arguments: { length: number; Item(n: number): string; };\n\n /**\n * The full path of the currently running script.\n */\n ScriptFullName: string;\n\n /**\n * Forces the script to stop immediately, with an optional exit code.\n */\n Quit(exitCode?: number): number;\n\n /**\n * The Windows Script Host build version number.\n */\n BuildVersion: number;\n\n /**\n * Fully qualified path of the host executable.\n */\n FullName: string;\n\n /**\n * Gets/sets the script mode - interactive(true) or batch(false).\n */\n Interactive: boolean;\n\n /**\n * The name of the host executable (WScript.exe or CScript.exe).\n */\n Name: string;\n\n /**\n * Path of the directory containing the host executable.\n */\n Path: string;\n\n /**\n * The filename of the currently running script.\n */\n ScriptName: string;\n\n /**\n * Exposes the read-only input stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdIn: TextStreamReader;\n\n /**\n * Windows Script Host version\n */\n Version: string;\n\n /**\n * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.\n */\n ConnectObject(objEventSource: any, strPrefix: string): void;\n\n /**\n * Creates a COM object.\n * @param strProgiID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n CreateObject(strProgID: string, strPrefix?: string): any;\n\n /**\n * Disconnects a COM object from its event sources.\n */\n DisconnectObject(obj: any): void;\n\n /**\n * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.\n * @param strPathname Fully qualified path to the file containing the object persisted to disk.\n * For objects in memory, pass a zero-length string.\n * @param strProgID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;\n\n /**\n * Suspends script execution for a specified length of time, then continues execution.\n * @param intTime Interval (in milliseconds) to suspend script execution.\n */\n Sleep(intTime: number): void;\n};\n\n/**\n * Represents an Automation SAFEARRAY\n */\ndeclare class SafeArray {\n private constructor();\n private SafeArray_typekey: SafeArray;\n}\n\n/**\n * Allows enumerating over a COM collection, which may not have indexed item access.\n */\ninterface Enumerator {\n /**\n * Returns true if the current item is the last one in the collection, or the collection is empty,\n * or the current item is undefined.\n */\n atEnd(): boolean;\n\n /**\n * Returns the current item in the collection\n */\n item(): T;\n\n /**\n * Resets the current item in the collection to the first item. If there are no items in the collection,\n * the current item is set to undefined.\n */\n moveFirst(): void;\n\n /**\n * Moves the current item to the next item in the collection. If the enumerator is at the end of\n * the collection or the collection is empty, the current item is set to undefined.\n */\n moveNext(): void;\n}\n\ninterface EnumeratorConstructor {\n new (safearray: SafeArray): Enumerator;\n new (collection: { Item(index: any): T }): Enumerator;\n new (collection: any): Enumerator;\n}\n\ndeclare var Enumerator: EnumeratorConstructor;\n\n/**\n * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.\n */\ninterface VBArray {\n /**\n * Returns the number of dimensions (1-based).\n */\n dimensions(): number;\n\n /**\n * Takes an index for each dimension in the array, and returns the item at the corresponding location.\n */\n getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;\n\n /**\n * Returns the smallest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n lbound(dimension?: number): number;\n\n /**\n * Returns the largest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n ubound(dimension?: number): number;\n\n /**\n * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,\n * each successive dimension is appended to the end of the array.\n * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]\n */\n toArray(): T[];\n}\n\ninterface VBArrayConstructor {\n new (safeArray: SafeArray): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ndeclare class VarDate {\n private constructor();\n private VarDate_typekey: VarDate;\n}\n\ninterface DateConstructor {\n new (vd: VarDate): Date;\n}\n\ninterface Date {\n getVarDate: () => VarDate;\n}\n\n\n/// \n\ninterface DOMTokenList {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface Headers {\n [Symbol.iterator](): IterableIterator<[string, string]>;\n /**\n * Returns an iterator allowing to go through all key/value pairs contained in this object.\n */\n entries(): IterableIterator<[string, string]>;\n /**\n * Returns an iterator allowing to go through all keys f the key/value pairs contained in this object.\n */\n keys(): IterableIterator;\n /**\n * Returns an iterator allowing to go through all values of the key/value pairs contained in this object.\n */\n values(): IterableIterator;\n}\n\ninterface NodeList {\n /**\n * Returns an array of key, value pairs for every entry in the list\n */\n entries(): IterableIterator<[number, Node]>;\n /**\n * Performs the specified action for each node in an list.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: Node, index: number, listObj: NodeList) => void, thisArg?: any): void;\n /**\n * Returns an list of keys in the list\n */\n keys(): IterableIterator;\n\n /**\n * Returns an list of values in the list\n */\n values(): IterableIterator;\n\n\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface NodeListOf {\n\n /**\n * Returns an array of key, value pairs for every entry in the list\n */\n entries(): IterableIterator<[number, TNode]>;\n\n /**\n * Performs the specified action for each node in an list.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the list.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: TNode, index: number, listObj: NodeListOf) => void, thisArg?: any): void;\n /**\n * Returns an list of keys in the list\n */\n keys(): IterableIterator;\n /**\n * Returns an list of values in the list\n */\n values(): IterableIterator;\n\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface HTMLCollectionBase {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface HTMLCollectionOf {\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface FormData {\n /**\n * Returns an array of key, value pairs for every entry in the list\n */\n entries(): IterableIterator<[string, string | File]>;\n /**\n * Returns a list of keys in the list\n */\n keys(): IterableIterator;\n /**\n * Returns a list of values in the list\n */\n values(): IterableIterator;\n\n [Symbol.iterator](): IterableIterator;\n}\n\ninterface URLSearchParams {\n /**\n * Returns an array of key, value pairs for every entry in the search params\n */\n entries(): IterableIterator<[string, string]>;\n /**\n * Returns a list of keys in the search params\n */\n keys(): IterableIterator;\n /**\n * Returns a list of values in the search params\n */\n values(): IterableIterator;\n /**\n * iterate over key/value pairs\n */\n [Symbol.iterator](): IterableIterator<[string, string]>;\n}\n"; diff --git a/src/lib/lib-ts.ts b/src/lib/lib-ts.ts index 96672db9..44505104 100644 --- a/src/lib/lib-ts.ts +++ b/src/lib/lib-ts.ts @@ -3,4 +3,4 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -export const contents = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n\n/////////////////////////////\n/// ECMAScript APIs\n/////////////////////////////\n\ndeclare const NaN: number;\ndeclare const Infinity: number;\n\n/**\n * Evaluates JavaScript code and executes it.\n * @param x A String value that contains valid JavaScript code.\n */\ndeclare function eval(x: string): any;\n\n/**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\ndeclare function parseInt(s: string, radix?: number): number;\n\n/**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\ndeclare function parseFloat(string: string): number;\n\n/**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\n * @param number A numeric value.\n */\ndeclare function isNaN(number: number): boolean;\n\n/**\n * Determines whether a supplied number is finite.\n * @param number Any numeric value.\n */\ndeclare function isFinite(number: number): boolean;\n\n/**\n * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\n * @param encodedURI A value representing an encoded URI.\n */\ndeclare function decodeURI(encodedURI: string): string;\n\n/**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n * @param encodedURIComponent A value representing an encoded URI component.\n */\ndeclare function decodeURIComponent(encodedURIComponent: string): string;\n\n/**\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\n * @param uri A value representing an encoded URI.\n */\ndeclare function encodeURI(uri: string): string;\n\n/**\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\n * @param uriComponent A value representing an encoded URI component.\n */\ndeclare function encodeURIComponent(uriComponent: string): string;\n\n/**\n * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\n * @param string A string value\n */\ndeclare function escape(string: string): string;\n\n/**\n * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\n * @param string A string value\n */\ndeclare function unescape(string: string): string;\n\ninterface PropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n value?: any;\n writable?: boolean;\n get?(): any;\n set?(v: any): void;\n}\n\ninterface PropertyDescriptorMap {\n [s: string]: PropertyDescriptor;\n}\n\ninterface Object {\n /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\n constructor: Function;\n\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns a date converted to a string using the current locale. */\n toLocaleString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): Object;\n\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: string): boolean;\n\n /**\n * Determines whether an object exists in another object's prototype chain.\n * @param v Another object whose prototype chain is to be checked.\n */\n isPrototypeOf(v: Object): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: string): boolean;\n}\n\ninterface ObjectConstructor {\n new(value?: any): Object;\n (): any;\n (value: any): any;\n\n /** A reference to the prototype for a class of objects. */\n readonly prototype: Object;\n\n /**\n * Returns the prototype of an object.\n * @param o The object that references the prototype.\n */\n getPrototypeOf(o: any): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor | undefined;\n\n /**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\n getOwnPropertyNames(o: any): string[];\n\n /**\n * Creates an object that has the specified prototype or that has null prototype.\n * @param o Object to use as a prototype. May be null.\n */\n create(o: object | null): any;\n\n /**\n * Creates an object that has the specified prototype, and that optionally contains specified properties.\n * @param o Object to use as a prototype. May be null\n * @param properties JavaScript object that contains one or more property descriptors.\n */\n create(o: object | null, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\n */\n defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any;\n\n /**\n * Adds one or more properties to an object, and/or modifies attributes of existing properties.\n * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\n * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\n */\n defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n seal(o: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(a: T[]): ReadonlyArray;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(f: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(o: T): Readonly;\n\n /**\n * Prevents the addition of new properties to an object.\n * @param o Object to make non-extensible.\n */\n preventExtensions(o: T): T;\n\n /**\n * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isSealed(o: any): boolean;\n\n /**\n * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isFrozen(o: any): boolean;\n\n /**\n * Returns a value that indicates whether new properties can be added to an object.\n * @param o Object to test.\n */\n isExtensible(o: any): boolean;\n\n /**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n keys(o: {}): string[];\n}\n\n/**\n * Provides functionality common to all JavaScript objects.\n */\ndeclare const Object: ObjectConstructor;\n\n/**\n * Creates a new function.\n */\ninterface Function {\n /**\n * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\n * @param thisArg The object to be used as the this object.\n * @param argArray A set of arguments to be passed to the function.\n */\n apply(this: Function, thisArg: any, argArray?: any): any;\n\n /**\n * Calls a method of an object, substituting another object for the current object.\n * @param thisArg The object to be used as the current object.\n * @param argArray A list of arguments to be passed to the method.\n */\n call(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg An object to which the this keyword can refer inside the new function.\n * @param argArray A list of arguments to be passed to the new function.\n */\n bind(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /** Returns a string representation of a function. */\n toString(): string;\n\n prototype: any;\n readonly length: number;\n\n // Non-standard extensions\n arguments: any;\n caller: Function;\n}\n\ninterface FunctionConstructor {\n /**\n * Creates a new function.\n * @param args A list of arguments the function accepts.\n */\n new(...args: string[]): Function;\n (...args: string[]): Function;\n readonly prototype: Function;\n}\n\ndeclare const Function: FunctionConstructor;\n\ninterface IArguments {\n [index: number]: any;\n length: number;\n callee: Function;\n}\n\ninterface String {\n /** Returns a string representation of a string. */\n toString(): string;\n\n /**\n * Returns the character at the specified index.\n * @param pos The zero-based index of the desired character.\n */\n charAt(pos: number): string;\n\n /**\n * Returns the Unicode value of the character at the specified location.\n * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\n */\n charCodeAt(index: number): number;\n\n /**\n * Returns a string that contains the concatenation of two or more strings.\n * @param strings The strings to append to the end of the string.\n */\n concat(...strings: string[]): string;\n\n /**\n * Returns the position of the first occurrence of a substring.\n * @param searchString The substring to search for in the string\n * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\n */\n indexOf(searchString: string, position?: number): number;\n\n /**\n * Returns the last occurrence of a substring in the string.\n * @param searchString The substring to search for.\n * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\n */\n lastIndexOf(searchString: string, position?: number): number;\n\n /**\n * Determines whether two strings are equivalent in the current locale.\n * @param that String to compare to target string\n */\n localeCompare(that: string): number;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A variable name or string literal containing the regular expression pattern and flags.\n */\n match(regexp: string | RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string | RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param regexp The regular expression pattern and applicable flags.\n */\n search(regexp: string | RegExp): number;\n\n /**\n * Returns a section of a string.\n * @param start The index to the beginning of the specified portion of stringObj.\n * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\n * If this value is not specified, the substring continues to the end of stringObj.\n */\n slice(start?: number, end?: number): string;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(separator: string | RegExp, limit?: number): string[];\n\n /**\n * Returns the substring at the specified location within a String object.\n * @param start The zero-based index number indicating the beginning of the substring.\n * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\n * If end is omitted, the characters from start through the end of the original string are returned.\n */\n substring(start: number, end?: number): string;\n\n /** Converts all the alphabetic characters in a string to lowercase. */\n toLowerCase(): string;\n\n /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\n toLocaleLowerCase(): string;\n\n /** Converts all the alphabetic characters in a string to uppercase. */\n toUpperCase(): string;\n\n /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\n toLocaleUpperCase(): string;\n\n /** Removes the leading and trailing white space and line terminator characters from a string. */\n trim(): string;\n\n /** Returns the length of a String object. */\n readonly length: number;\n\n // IE extensions\n /**\n * Gets a substring beginning at the specified location and having the specified length.\n * @param from The starting position of the desired substring. The index of the first character in the string is zero.\n * @param length The number of characters to include in the returned substring.\n */\n substr(from: number, length?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): string;\n\n readonly [index: number]: string;\n}\n\ninterface StringConstructor {\n new(value?: any): String;\n (value?: any): string;\n readonly prototype: String;\n fromCharCode(...codes: number[]): string;\n}\n\n/**\n * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\n */\ndeclare const String: StringConstructor;\n\ninterface Boolean {\n /** Returns the primitive value of the specified object. */\n valueOf(): boolean;\n}\n\ninterface BooleanConstructor {\n new(value?: any): Boolean;\n (value?: any): boolean;\n readonly prototype: Boolean;\n}\n\ndeclare const Boolean: BooleanConstructor;\n\ninterface Number {\n /**\n * Returns a string representation of an object.\n * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\n */\n toString(radix?: number): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toFixed(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toExponential(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\n */\n toPrecision(precision?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): number;\n}\n\ninterface NumberConstructor {\n new(value?: any): Number;\n (value?: any): number;\n readonly prototype: Number;\n\n /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\n readonly MAX_VALUE: number;\n\n /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\n readonly MIN_VALUE: number;\n\n /**\n * A value that is not a number.\n * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\n */\n readonly NaN: number;\n\n /**\n * A value that is less than the largest negative number that can be represented in JavaScript.\n * JavaScript displays NEGATIVE_INFINITY values as -infinity.\n */\n readonly NEGATIVE_INFINITY: number;\n\n /**\n * A value greater than the largest number that can be represented in JavaScript.\n * JavaScript displays POSITIVE_INFINITY values as infinity.\n */\n readonly POSITIVE_INFINITY: number;\n}\n\n/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\ndeclare const Number: NumberConstructor;\n\ninterface TemplateStringsArray extends ReadonlyArray {\n readonly raw: ReadonlyArray;\n}\n\ninterface Math {\n /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\n readonly E: number;\n /** The natural logarithm of 10. */\n readonly LN10: number;\n /** The natural logarithm of 2. */\n readonly LN2: number;\n /** The base-2 logarithm of e. */\n readonly LOG2E: number;\n /** The base-10 logarithm of e. */\n readonly LOG10E: number;\n /** Pi. This is the ratio of the circumference of a circle to its diameter. */\n readonly PI: number;\n /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\n readonly SQRT1_2: number;\n /** The square root of 2. */\n readonly SQRT2: number;\n /**\n * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\n * For example, the absolute value of -5 is the same as the absolute value of 5.\n * @param x A numeric expression for which the absolute value is needed.\n */\n abs(x: number): number;\n /**\n * Returns the arc cosine (or inverse cosine) of a number.\n * @param x A numeric expression.\n */\n acos(x: number): number;\n /**\n * Returns the arcsine of a number.\n * @param x A numeric expression.\n */\n asin(x: number): number;\n /**\n * Returns the arctangent of a number.\n * @param x A numeric expression for which the arctangent is needed.\n */\n atan(x: number): number;\n /**\n * Returns the angle (in radians) from the X axis to a point.\n * @param y A numeric expression representing the cartesian y-coordinate.\n * @param x A numeric expression representing the cartesian x-coordinate.\n */\n atan2(y: number, x: number): number;\n /**\n * Returns the smallest integer greater than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n ceil(x: number): number;\n /**\n * Returns the cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cos(x: number): number;\n /**\n * Returns e (the base of natural logarithms) raised to a power.\n * @param x A numeric expression representing the power of e.\n */\n exp(x: number): number;\n /**\n * Returns the greatest integer less than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n floor(x: number): number;\n /**\n * Returns the natural logarithm (base e) of a number.\n * @param x A numeric expression.\n */\n log(x: number): number;\n /**\n * Returns the larger of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n max(...values: number[]): number;\n /**\n * Returns the smaller of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n min(...values: number[]): number;\n /**\n * Returns the value of a base expression taken to a specified power.\n * @param x The base value of the expression.\n * @param y The exponent value of the expression.\n */\n pow(x: number, y: number): number;\n /** Returns a pseudorandom number between 0 and 1. */\n random(): number;\n /**\n * Returns a supplied numeric expression rounded to the nearest number.\n * @param x The value to be rounded to the nearest number.\n */\n round(x: number): number;\n /**\n * Returns the sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sin(x: number): number;\n /**\n * Returns the square root of a number.\n * @param x A numeric expression.\n */\n sqrt(x: number): number;\n /**\n * Returns the tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tan(x: number): number;\n}\n/** An intrinsic object that provides basic mathematics functionality and constants. */\ndeclare const Math: Math;\n\n/** Enables basic storage and retrieval of dates and times. */\ninterface Date {\n /** Returns a string representation of a date. The format of the string depends on the locale. */\n toString(): string;\n /** Returns a date as a string value. */\n toDateString(): string;\n /** Returns a time as a string value. */\n toTimeString(): string;\n /** Returns a value as a string value appropriate to the host environment's current locale. */\n toLocaleString(): string;\n /** Returns a date as a string value appropriate to the host environment's current locale. */\n toLocaleDateString(): string;\n /** Returns a time as a string value appropriate to the host environment's current locale. */\n toLocaleTimeString(): string;\n /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\n valueOf(): number;\n /** Gets the time value in milliseconds. */\n getTime(): number;\n /** Gets the year, using local time. */\n getFullYear(): number;\n /** Gets the year using Universal Coordinated Time (UTC). */\n getUTCFullYear(): number;\n /** Gets the month, using local time. */\n getMonth(): number;\n /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\n getUTCMonth(): number;\n /** Gets the day-of-the-month, using local time. */\n getDate(): number;\n /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\n getUTCDate(): number;\n /** Gets the day of the week, using local time. */\n getDay(): number;\n /** Gets the day of the week using Universal Coordinated Time (UTC). */\n getUTCDay(): number;\n /** Gets the hours in a date, using local time. */\n getHours(): number;\n /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\n getUTCHours(): number;\n /** Gets the minutes of a Date object, using local time. */\n getMinutes(): number;\n /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\n getUTCMinutes(): number;\n /** Gets the seconds of a Date object, using local time. */\n getSeconds(): number;\n /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCSeconds(): number;\n /** Gets the milliseconds of a Date, using local time. */\n getMilliseconds(): number;\n /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCMilliseconds(): number;\n /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\n getTimezoneOffset(): number;\n /**\n * Sets the date and time value in the Date object.\n * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\n */\n setTime(time: number): number;\n /**\n * Sets the milliseconds value in the Date object using local time.\n * @param ms A numeric value equal to the millisecond value.\n */\n setMilliseconds(ms: number): number;\n /**\n * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\n * @param ms A numeric value equal to the millisecond value.\n */\n setUTCMilliseconds(ms: number): number;\n\n /**\n * Sets the seconds value in the Date object using local time.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setSeconds(sec: number, ms?: number): number;\n /**\n * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCSeconds(sec: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using local time.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the hour value in the Date object using local time.\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the numeric day-of-the-month value of the Date object using local time.\n * @param date A numeric value equal to the day of the month.\n */\n setDate(date: number): number;\n /**\n * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\n * @param date A numeric value equal to the day of the month.\n */\n setUTCDate(date: number): number;\n /**\n * Sets the month value in the Date object using local time.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\n */\n setMonth(month: number, date?: number): number;\n /**\n * Sets the month value in the Date object using Universal Coordinated Time (UTC).\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\n */\n setUTCMonth(month: number, date?: number): number;\n /**\n * Sets the year of the Date object using local time.\n * @param year A numeric value for the year.\n * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\n * @param date A numeric value equal for the day of the month.\n */\n setFullYear(year: number, month?: number, date?: number): number;\n /**\n * Sets the year value in the Date object using Universal Coordinated Time (UTC).\n * @param year A numeric value equal to the year.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\n * @param date A numeric value equal to the day of the month.\n */\n setUTCFullYear(year: number, month?: number, date?: number): number;\n /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\n toUTCString(): string;\n /** Returns a date as a string value in ISO format. */\n toISOString(): string;\n /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\n toJSON(key?: any): string;\n}\n\ninterface DateConstructor {\n new(): Date;\n new(value: number): Date;\n new(value: string): Date;\n new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\n (): string;\n readonly prototype: Date;\n /**\n * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\n * @param s A date string\n */\n parse(s: string): number;\n /**\n * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\n * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as an number between 0 and 11 (January to December).\n * @param date The date as an number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.\n * @param ms An number from 0 to 999 that specifies the milliseconds.\n */\n UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\n now(): number;\n}\n\ndeclare const Date: DateConstructor;\n\ninterface RegExpMatchArray extends Array {\n index?: number;\n input?: string;\n}\n\ninterface RegExpExecArray extends Array {\n index: number;\n input: string;\n}\n\ninterface RegExp {\n /**\n * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\n * @param string The String object or string literal on which to perform the search.\n */\n exec(string: string): RegExpExecArray | null;\n\n /**\n * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\n * @param string String on which to perform the search.\n */\n test(string: string): boolean;\n\n /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\n readonly source: string;\n\n /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\n readonly global: boolean;\n\n /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\n readonly ignoreCase: boolean;\n\n /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\n readonly multiline: boolean;\n\n lastIndex: number;\n\n // Non-standard extensions\n compile(): this;\n}\n\ninterface RegExpConstructor {\n new(pattern: RegExp | string): RegExp;\n new(pattern: string, flags?: string): RegExp;\n (pattern: RegExp | string): RegExp;\n (pattern: string, flags?: string): RegExp;\n readonly prototype: RegExp;\n\n // Non-standard extensions\n $1: string;\n $2: string;\n $3: string;\n $4: string;\n $5: string;\n $6: string;\n $7: string;\n $8: string;\n $9: string;\n lastMatch: string;\n}\n\ndeclare const RegExp: RegExpConstructor;\n\ninterface Error {\n name: string;\n message: string;\n stack?: string;\n}\n\ninterface ErrorConstructor {\n new(message?: string): Error;\n (message?: string): Error;\n readonly prototype: Error;\n}\n\ndeclare const Error: ErrorConstructor;\n\ninterface EvalError extends Error {\n}\n\ninterface EvalErrorConstructor {\n new(message?: string): EvalError;\n (message?: string): EvalError;\n readonly prototype: EvalError;\n}\n\ndeclare const EvalError: EvalErrorConstructor;\n\ninterface RangeError extends Error {\n}\n\ninterface RangeErrorConstructor {\n new(message?: string): RangeError;\n (message?: string): RangeError;\n readonly prototype: RangeError;\n}\n\ndeclare const RangeError: RangeErrorConstructor;\n\ninterface ReferenceError extends Error {\n}\n\ninterface ReferenceErrorConstructor {\n new(message?: string): ReferenceError;\n (message?: string): ReferenceError;\n readonly prototype: ReferenceError;\n}\n\ndeclare const ReferenceError: ReferenceErrorConstructor;\n\ninterface SyntaxError extends Error {\n}\n\ninterface SyntaxErrorConstructor {\n new(message?: string): SyntaxError;\n (message?: string): SyntaxError;\n readonly prototype: SyntaxError;\n}\n\ndeclare const SyntaxError: SyntaxErrorConstructor;\n\ninterface TypeError extends Error {\n}\n\ninterface TypeErrorConstructor {\n new(message?: string): TypeError;\n (message?: string): TypeError;\n readonly prototype: TypeError;\n}\n\ndeclare const TypeError: TypeErrorConstructor;\n\ninterface URIError extends Error {\n}\n\ninterface URIErrorConstructor {\n new(message?: string): URIError;\n (message?: string): URIError;\n readonly prototype: URIError;\n}\n\ndeclare const URIError: URIErrorConstructor;\n\ninterface JSON {\n /**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n * @param text A valid JSON string.\n * @param reviver A function that transforms the results. This function is called for each member of the object.\n * If a member contains nested objects, the nested objects are transformed before the parent object is.\n */\n parse(text: string, reviver?: (key: any, value: any) => any): any;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\n}\n\n/**\n * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\n */\ndeclare const JSON: JSON;\n\n\n/////////////////////////////\n/// ECMAScript Array API (specially handled by compiler)\n/////////////////////////////\n\ninterface ReadonlyArray {\n /**\n * Gets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n readonly length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n\n readonly [n: number]: T;\n}\n\ninterface ConcatArray {\n readonly length: number;\n readonly [n: number]: T;\n join(separator?: string): string;\n slice(start?: number, end?: number): T[];\n}\n\ninterface Array {\n /**\n * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using thier toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Appends new elements to an array, and returns the new length of the array.\n * @param items New elements of the Array.\n */\n push(...items: T[]): number;\n /**\n * Removes the last element from an array and returns it.\n */\n pop(): T | undefined;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Reverses the elements in an Array.\n */\n reverse(): T[];\n /**\n * Removes the first element from an array and returns it.\n */\n shift(): T | undefined;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: T, b: T) => number): this;\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n */\n splice(start: number, deleteCount?: number): T[];\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @param items Elements to insert into the array in place of the deleted elements.\n */\n splice(start: number, deleteCount: number, ...items: T[]): T[];\n /**\n * Inserts new elements at the start of an array.\n * @param items Elements to insert at the start of the Array.\n */\n unshift(...items: T[]): number;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n\n [n: number]: T;\n}\n\ninterface ArrayConstructor {\n new(arrayLength?: number): any[];\n new (arrayLength: number): T[];\n new (...items: T[]): T[];\n (arrayLength?: number): any[];\n (arrayLength: number): T[];\n (...items: T[]): T[];\n isArray(arg: any): arg is Array;\n readonly prototype: Array;\n}\n\ndeclare const Array: ArrayConstructor;\n\ninterface TypedPropertyDescriptor {\n enumerable?: boolean;\n configurable?: boolean;\n writable?: boolean;\n value?: T;\n get?: () => T;\n set?: (value: T) => void;\n}\n\ndeclare type ClassDecorator = (target: TFunction) => TFunction | void;\ndeclare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\ndeclare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;\ndeclare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\n\ndeclare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike;\n\ninterface PromiseLike {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike;\n}\n\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}\n\ninterface ArrayLike {\n readonly length: number;\n readonly [n: number]: T;\n}\n\n/**\n * Make all properties in T optional\n */\ntype Partial = {\n [P in keyof T]?: T[P];\n};\n\n/**\n * Make all properties in T readonly\n */\ntype Readonly = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * From T pick a set of properties K\n */\ntype Pick = {\n [P in K]: T[P];\n};\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype Record = {\n [P in K]: T;\n};\n\n/**\n * Marker for contextual 'this' type\n */\ninterface ThisType { }\n\n/**\n * Represents a raw buffer of binary data, which is used to store data for the\n * different typed arrays. ArrayBuffers cannot be read from or written to directly,\n * but can be passed to a typed array or DataView Object to interpret the raw\n * buffer as needed.\n */\ninterface ArrayBuffer {\n /**\n * Read-only. The length of the ArrayBuffer (in bytes).\n */\n readonly byteLength: number;\n\n /**\n * Returns a section of an ArrayBuffer.\n */\n slice(begin: number, end?: number): ArrayBuffer;\n}\n\n/**\n * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\n */\ninterface ArrayBufferTypes {\n ArrayBuffer: ArrayBuffer;\n}\ntype ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\n\ninterface ArrayBufferConstructor {\n readonly prototype: ArrayBuffer;\n new(byteLength: number): ArrayBuffer;\n isView(arg: any): arg is ArrayBufferView;\n}\ndeclare const ArrayBuffer: ArrayBufferConstructor;\n\ninterface ArrayBufferView {\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n byteOffset: number;\n}\n\ninterface DataView {\n readonly buffer: ArrayBuffer;\n readonly byteLength: number;\n readonly byteOffset: number;\n /**\n * Gets the Float32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Float64 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat64(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Int8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt8(byteOffset: number): number;\n\n /**\n * Gets the Int16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt16(byteOffset: number, littleEndian?: boolean): number;\n /**\n * Gets the Int32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint8(byteOffset: number): number;\n\n /**\n * Gets the Uint16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Float64 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setInt8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Int16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setUint8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Uint16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n\ninterface DataViewConstructor {\n new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\n}\ndeclare const DataView: DataViewConstructor;\n\n/**\n * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Int8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\ninterface Int8ArrayConstructor {\n readonly prototype: Int8Array;\n new(length: number): Int8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\n\n\n}\ndeclare const Int8Array: Int8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ArrayConstructor {\n readonly prototype: Uint8Array;\n new(length: number): Uint8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\n\n}\ndeclare const Uint8Array: Uint8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\n * If the requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8ClampedArray {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8ClampedArray;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8ClampedArray;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8ClampedArray;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ClampedArrayConstructor {\n readonly prototype: Uint8ClampedArray;\n new(length: number): Uint8ClampedArray;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8ClampedArray;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\ndeclare const Uint8ClampedArray: Uint8ClampedArrayConstructor;\n\n/**\n * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int16ArrayConstructor {\n readonly prototype: Int16Array;\n new(length: number): Int16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\n\n\n}\ndeclare const Int16Array: Int16ArrayConstructor;\n\n/**\n * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint16ArrayConstructor {\n readonly prototype: Uint16Array;\n new(length: number): Uint16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\n\n\n}\ndeclare const Uint16Array: Uint16ArrayConstructor;\n/**\n * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int32ArrayConstructor {\n readonly prototype: Int32Array;\n new(length: number): Int32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\n\n}\ndeclare const Int32Array: Int32ArrayConstructor;\n\n/**\n * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint32ArrayConstructor {\n readonly prototype: Uint32Array;\n new(length: number): Uint32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\n\n}\ndeclare const Uint32Array: Uint32ArrayConstructor;\n\n/**\n * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float32ArrayConstructor {\n readonly prototype: Float32Array;\n new(length: number): Float32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\n\n\n}\ndeclare const Float32Array: Float32ArrayConstructor;\n\n/**\n * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Float64Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float64Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float64Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float64Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float64ArrayConstructor {\n readonly prototype: Float64Array;\n new(length: number): Float64Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\n\n}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare namespace Intl {\n interface CollatorOptions {\n usage?: string;\n localeMatcher?: string;\n numeric?: boolean;\n caseFirst?: string;\n sensitivity?: string;\n ignorePunctuation?: boolean;\n }\n\n interface ResolvedCollatorOptions {\n locale: string;\n usage: string;\n sensitivity: string;\n ignorePunctuation: boolean;\n collation: string;\n caseFirst: string;\n numeric: boolean;\n }\n\n interface Collator {\n compare(x: string, y: string): number;\n resolvedOptions(): ResolvedCollatorOptions;\n }\n var Collator: {\n new(locales?: string | string[], options?: CollatorOptions): Collator;\n (locales?: string | string[], options?: CollatorOptions): Collator;\n supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\n };\n\n interface NumberFormatOptions {\n localeMatcher?: string;\n style?: string;\n currency?: string;\n currencyDisplay?: string;\n useGrouping?: boolean;\n minimumIntegerDigits?: number;\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n }\n\n interface ResolvedNumberFormatOptions {\n locale: string;\n numberingSystem: string;\n style: string;\n currency?: string;\n currencyDisplay?: string;\n minimumIntegerDigits: number;\n minimumFractionDigits: number;\n maximumFractionDigits: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n useGrouping: boolean;\n }\n\n interface NumberFormat {\n format(value: number): string;\n resolvedOptions(): ResolvedNumberFormatOptions;\n }\n var NumberFormat: {\n new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\n };\n\n interface DateTimeFormatOptions {\n localeMatcher?: string;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n formatMatcher?: string;\n hour12?: boolean;\n timeZone?: string;\n }\n\n interface ResolvedDateTimeFormatOptions {\n locale: string;\n calendar: string;\n numberingSystem: string;\n timeZone: string;\n hour12?: boolean;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n }\n\n interface DateTimeFormat {\n format(date?: Date | number): string;\n resolvedOptions(): ResolvedDateTimeFormatOptions;\n }\n var DateTimeFormat: {\n new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\n };\n}\n\ninterface String {\n /**\n * Determines whether two strings are equivalent in the current or specified locale.\n * @param that String to compare to target string\n * @param locales A locale string or array of locale strings 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. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\n */\n localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\n}\n\ninterface Number {\n /**\n * Converts a number to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n}\n\ninterface Date {\n /**\n * Converts a date and time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n /**\n * Converts a date to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n\n /**\n * Converts a time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n}\n\n\n\n/////////////////////////////\n/// DOM APIs\n/////////////////////////////\n\ninterface Account {\n displayName: string;\n id: string;\n imageURL?: string;\n name?: string;\n rpDisplayName: string;\n}\n\ninterface Algorithm {\n name: string;\n}\n\ninterface AnimationEventInit extends EventInit {\n animationName?: string;\n elapsedTime?: number;\n}\n\ninterface AssertionOptions {\n allowList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: USVString;\n timeoutSeconds?: number;\n}\n\ninterface CacheQueryOptions {\n cacheName?: string;\n ignoreMethod?: boolean;\n ignoreSearch?: boolean;\n ignoreVary?: boolean;\n}\n\ninterface ClientData {\n challenge: string;\n extensions?: WebAuthnExtensions;\n hashAlg: string | Algorithm;\n origin: string;\n rpId: string;\n tokenBinding?: string;\n}\n\ninterface CloseEventInit extends EventInit {\n code?: number;\n reason?: string;\n wasClean?: boolean;\n}\n\ninterface CompositionEventInit extends UIEventInit {\n data?: string;\n}\n\ninterface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface ConstrainBooleanParameters {\n exact?: boolean;\n ideal?: boolean;\n}\n\ninterface ConstrainDOMStringParameters {\n exact?: string | string[];\n ideal?: string | string[];\n}\n\ninterface ConstrainDoubleRange extends DoubleRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainLongRange extends LongRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainVideoFacingModeParameters {\n exact?: VideoFacingModeEnum | VideoFacingModeEnum[];\n ideal?: VideoFacingModeEnum | VideoFacingModeEnum[];\n}\n\ninterface CustomEventInit extends EventInit {\n detail?: T;\n}\n\ninterface DeviceAccelerationDict {\n x?: number | null;\n y?: number | null;\n z?: number | null;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceMotionEventInit extends EventInit {\n acceleration?: DeviceAccelerationDict | null;\n accelerationIncludingGravity?: DeviceAccelerationDict | null;\n interval?: number | null;\n rotationRate?: DeviceRotationRateDict | null;\n}\n\ninterface DeviceOrientationEventInit extends EventInit {\n absolute?: boolean;\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DOMRectInit {\n height?: number;\n width?: number;\n x?: number;\n y?: number;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface ErrorEventInit extends EventInit {\n colno?: number;\n error?: any;\n filename?: string;\n lineno?: number;\n message?: string;\n}\n\ninterface EventInit {\n scoped?: boolean;\n bubbles?: boolean;\n cancelable?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n altKey?: boolean;\n ctrlKey?: boolean;\n metaKey?: boolean;\n modifierAltGraph?: boolean;\n modifierCapsLock?: boolean;\n modifierFn?: boolean;\n modifierFnLock?: boolean;\n modifierHyper?: boolean;\n modifierNumLock?: boolean;\n modifierOS?: boolean;\n modifierScrollLock?: boolean;\n modifierSuper?: boolean;\n modifierSymbol?: boolean;\n modifierSymbolLock?: boolean;\n shiftKey?: boolean;\n}\n\ninterface ExceptionInformation {\n domain?: string | null;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget | null;\n}\n\ninterface FocusNavigationEventInit extends EventInit {\n navigationReason?: string | null;\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface FocusNavigationOrigin {\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface GamepadEventInit extends EventInit {\n gamepad?: Gamepad | null;\n}\n\ninterface GetNotificationOptions {\n tag?: string;\n}\n\ninterface HashChangeEventInit extends EventInit {\n newURL?: string | null;\n oldURL?: string | null;\n}\n\ninterface IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: string | string[];\n}\n\ninterface IntersectionObserverEntryInit {\n isIntersecting: boolean;\n boundingClientRect: DOMRectInit;\n intersectionRect: DOMRectInit;\n rootBounds: DOMRectInit;\n target: Element;\n time: number;\n}\n\ninterface IntersectionObserverInit {\n root?: Element | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface KeyAlgorithm {\n name?: string;\n}\n\ninterface KeyboardEventInit extends EventModifierInit {\n code?: string;\n key?: string;\n location?: number;\n repeat?: boolean;\n}\n\ninterface LongRange {\n max?: number;\n min?: number;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initData?: ArrayBuffer | null;\n initDataType?: string;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n message?: ArrayBuffer | null;\n messageType?: MediaKeyMessageType;\n}\n\ninterface MediaKeySystemConfiguration {\n audioCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: MediaKeysRequirement;\n initDataTypes?: string[];\n persistentState?: MediaKeysRequirement;\n videoCapabilities?: MediaKeySystemMediaCapability[];\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n audio?: boolean | MediaTrackConstraints;\n video?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError | null;\n}\n\ninterface MediaStreamEventInit extends EventInit {\n stream?: MediaStream;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack | null;\n}\n\ninterface MediaTrackCapabilities {\n aspectRatio?: number | DoubleRange;\n deviceId?: string;\n echoCancellation?: boolean[];\n facingMode?: string;\n frameRate?: number | DoubleRange;\n groupId?: string;\n height?: number | LongRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n volume?: number | DoubleRange;\n width?: number | LongRange;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackConstraintSet {\n aspectRatio?: number | ConstrainDoubleRange;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n echoCancelation?: boolean | ConstrainBooleanParameters;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n frameRate?: number | ConstrainDoubleRange;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n height?: number | ConstrainLongRange;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n volume?: number | ConstrainDoubleRange;\n width?: number | ConstrainLongRange;\n}\n\ninterface MediaTrackSettings {\n aspectRatio?: number;\n deviceId?: string;\n echoCancellation?: boolean;\n facingMode?: string;\n frameRate?: number;\n groupId?: string;\n height?: number;\n sampleRate?: number;\n sampleSize?: number;\n volume?: number;\n width?: number;\n}\n\ninterface MediaTrackSupportedConstraints {\n aspectRatio?: boolean;\n deviceId?: boolean;\n echoCancellation?: boolean;\n facingMode?: boolean;\n frameRate?: boolean;\n groupId?: boolean;\n height?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n volume?: boolean;\n width?: boolean;\n}\n\ninterface MessageEventInit extends EventInit {\n lastEventId?: string;\n channel?: string;\n data?: any;\n origin?: string;\n ports?: MessagePort[];\n source?: Window;\n}\n\ninterface MouseEventInit extends EventModifierInit {\n button?: number;\n buttons?: number;\n clientX?: number;\n clientY?: number;\n relatedTarget?: EventTarget | null;\n screenX?: number;\n screenY?: number;\n}\n\ninterface MSAccountInfo {\n accountImageUri?: string;\n accountName?: string;\n rpDisplayName: string;\n userDisplayName: string;\n userId?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n cpuInsufficientEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceHowlingEventCount?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n networkDelayEventRatio?: number;\n networkSendQualityEventRatio?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n burstLossLength1?: number;\n burstLossLength2?: number;\n burstLossLength3?: number;\n burstLossLength4?: number;\n burstLossLength5?: number;\n burstLossLength6?: number;\n burstLossLength7?: number;\n burstLossLength8OrHigher?: number;\n fecRecvDistance1?: number;\n fecRecvDistance2?: number;\n fecRecvDistance3?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\n packetReorderRatio?: number;\n ratioCompressedSamplesAvg?: number;\n ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvNoiseLevelCh1?: number;\n recvSignalLevelCh1?: number;\n renderLoopbackSignalLevel?: number;\n renderNoiseLevel?: number;\n renderSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n audioFECUsed?: boolean;\n samplingRate?: number;\n sendMutePercent?: number;\n signal?: MSAudioSendSignal;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendNoiseLevelCh1?: number;\n sendSignalLevelCh1?: number;\n}\n\ninterface MSConnectivity {\n iceType?: MSIceType;\n iceWarningFlags?: MSIceWarningFlags;\n relayAddress?: MSRelayAddress;\n}\n\ninterface MSCredentialFilter {\n accept?: MSCredentialSpec[];\n}\n\ninterface MSCredentialParameters {\n type?: MSCredentialType;\n}\n\ninterface MSCredentialSpec {\n id?: string;\n type: MSCredentialType;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n deviceDevName?: string;\n localAddr?: MSIPAddressInfo;\n networkconnectivity?: MSNetworkConnectivityInfo;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n transport?: RTCIceProtocol;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: AAGUID[];\n}\n\ninterface MSIceWarningFlags {\n allocationMessageIntegrityFailed?: boolean;\n alternateServerReceived?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n fipsAllocationFailure?: boolean;\n multipleRelayServersAttempted?: boolean;\n noRelayServersConfigured?: boolean;\n portRangeExhausted?: boolean;\n pseudoTLSFailure?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n turnTcpTimedOut?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n manufacturerMacAddrMask?: string;\n port?: number;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkBandwidthLowEventRatio?: number;\n networkReceiveQualityEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n delay?: MSDelay;\n jitter?: MSJitter;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n linkspeed?: number;\n networkConnectionDetails?: string;\n vpn?: boolean;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: boolean;\n interfaceTypeWireless?: boolean;\n interfaceTypeWWAN?: boolean;\n}\n\ninterface MSOutboundNetwork extends MSNetwork {\n appliedBandwidthLimit?: number;\n}\n\ninterface MSPacketLoss {\n lossRate?: number;\n lossRateMax?: number;\n}\n\ninterface MSPayloadBase extends RTCStats {\n payloadDescription?: string;\n}\n\ninterface MSPortRange {\n max?: number;\n min?: number;\n}\n\ninterface MSRelayAddress {\n port?: number;\n relayAddress?: string;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n allocationTimeInMs?: number;\n baseAddress?: string;\n baseInterface?: MSNetworkInterfaceType;\n iceRole?: RTCIceRole;\n iceWarningFlags?: MSIceWarningFlags;\n interfaces?: MSNetworkInterfaceType;\n localAddress?: string;\n localAddrType?: MSIceAddrType;\n localInterface?: MSNetworkInterfaceType;\n localMR?: string;\n localMRTCPPort?: number;\n localSite?: string;\n msRtcEngineVersion?: string;\n networkName?: string;\n numConsentReqReceived?: number;\n numConsentReqSent?: number;\n numConsentRespReceived?: number;\n numConsentRespSent?: number;\n portRangeMax?: number;\n portRangeMin?: number;\n protocol?: RTCIceProtocol;\n remoteAddress?: string;\n remoteAddrType?: MSIceAddrType;\n remoteMR?: string;\n remoteMRTCPPort?: number;\n remoteSite?: string;\n rtpRtcpMux?: boolean;\n stunVer?: number;\n}\n\ninterface MSUtilization {\n bandwidthEstimation?: number;\n bandwidthEstimationAvg?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationStdDev?: number;\n packets?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n durationSeconds?: number;\n resolution?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n recvBitRateAverage?: number;\n recvBitRateMaximum?: number;\n recvCodecType?: string;\n recvFpsHarmonicAverage?: number;\n recvFrameRateAverage?: number;\n recvNumResSwitches?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvReorderBufferReorderedPackets?: number;\n recvResolutionHeight?: number;\n recvResolutionWidth?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n reorderBufferTotalPackets?: number;\n videoFrameLossRate?: number;\n videoPostFECPLR?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n h720Quality?: number;\n vgaQuality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendBitRateAverage?: number;\n sendBitRateMaximum?: number;\n sendFrameRateAverage?: number;\n sendResolutionHeight?: number;\n sendResolutionWidth?: number;\n sendVideoStreamsMax?: number;\n}\n\ninterface MsZoomToOptions {\n animate?: string;\n contentX?: number;\n contentY?: number;\n scaleFactor?: number;\n viewportX?: string | null;\n viewportY?: string | null;\n}\n\ninterface MutationObserverInit {\n attributeFilter?: string[];\n attributeOldValue?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n characterDataOldValue?: boolean;\n childList?: boolean;\n subtree?: boolean;\n}\n\ninterface NotificationOptions {\n body?: string;\n dir?: NotificationDirection;\n icon?: string;\n lang?: string;\n tag?: string;\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface PaymentCurrencyAmount {\n currency: string;\n currencySystem?: string;\n value: string;\n}\n\ninterface PaymentDetails {\n displayItems?: PaymentItem[];\n error?: string;\n modifiers?: PaymentDetailsModifier[];\n shippingOptions?: PaymentShippingOption[];\n total?: PaymentItem;\n}\n\ninterface PaymentDetailsModifier {\n additionalDisplayItems?: PaymentItem[];\n data?: any;\n supportedMethods: string | string[];\n total?: PaymentItem;\n}\n\ninterface PaymentItem {\n amount: PaymentCurrencyAmount;\n label: string;\n pending?: boolean;\n}\n\ninterface PaymentMethodData {\n data?: any;\n supportedMethods: string | string[];\n}\n\ninterface PaymentOptions {\n requestPayerEmail?: boolean;\n requestPayerName?: boolean;\n requestPayerPhone?: boolean;\n requestShipping?: boolean;\n shippingType?: string;\n}\n\ninterface PaymentRequestUpdateEventInit extends EventInit {\n}\n\ninterface PaymentShippingOption {\n amount: PaymentCurrencyAmount;\n id: string;\n label: string;\n selected?: boolean;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PointerEventInit extends MouseEventInit {\n height?: number;\n isPrimary?: boolean;\n pointerId?: number;\n pointerType?: string;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n width?: number;\n}\n\ninterface PopStateEventInit extends EventInit {\n state?: any;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n maximumAge?: number;\n timeout?: number;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface PushSubscriptionOptionsInit {\n applicationServerKey?: BufferSource | null;\n userVisibleOnly?: boolean;\n}\n\ninterface RegistrationOptions {\n scope?: string;\n}\n\ninterface RequestInit {\n signal?: AbortSignal;\n body?: Blob | BufferSource | FormData | string | null;\n cache?: RequestCache;\n credentials?: RequestCredentials;\n headers?: HeadersInit;\n integrity?: string;\n keepalive?: boolean;\n method?: string;\n mode?: RequestMode;\n redirect?: RequestRedirect;\n referrer?: string;\n referrerPolicy?: ReferrerPolicy;\n window?: any;\n}\n\ninterface ResponseInit {\n headers?: HeadersInit;\n status?: number;\n statusText?: string;\n}\n\ninterface RTCConfiguration {\n bundlePolicy?: RTCBundlePolicy;\n iceServers?: RTCIceServer[];\n iceTransportPolicy?: RTCIceTransportPolicy;\n peerIdentity?: string;\n}\n\ninterface RTCDtlsFingerprint {\n algorithm?: string;\n value?: string;\n}\n\ninterface RTCDtlsParameters {\n fingerprints?: RTCDtlsFingerprint[];\n role?: RTCDtlsRole;\n}\n\ninterface RTCDTMFToneChangeEventInit extends EventInit {\n tone?: string;\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n addressSourceUrl?: string;\n candidateType?: RTCStatsIceCandidateType;\n ipAddress?: string;\n portNumber?: number;\n priority?: number;\n transport?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidateDictionary {\n foundation?: string;\n ip?: string;\n msMTurnSessionId?: string;\n port?: number;\n priority?: number;\n protocol?: RTCIceProtocol;\n relatedAddress?: string;\n relatedPort?: number;\n tcpType?: RTCIceTcpCandidateType;\n type?: RTCIceCandidateType;\n}\n\ninterface RTCIceCandidateInit {\n candidate?: string;\n sdpMid?: string;\n sdpMLineIndex?: number;\n}\n\ninterface RTCIceCandidatePair {\n local?: RTCIceCandidateDictionary;\n remote?: RTCIceCandidateDictionary;\n}\n\ninterface RTCIceCandidatePairStats extends RTCStats {\n availableIncomingBitrate?: number;\n availableOutgoingBitrate?: number;\n bytesReceived?: number;\n bytesSent?: number;\n localCandidateId?: string;\n nominated?: boolean;\n priority?: number;\n readable?: boolean;\n remoteCandidateId?: string;\n roundTripTime?: number;\n state?: RTCStatsIceCandidatePairState;\n transportId?: string;\n writable?: boolean;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: RTCIceGatherPolicy;\n iceservers?: RTCIceServer[];\n portRange?: MSPortRange;\n}\n\ninterface RTCIceParameters {\n iceLite?: boolean | null;\n password?: string;\n usernameFragment?: string;\n}\n\ninterface RTCIceServer {\n credential?: string | null;\n urls?: any;\n username?: string | null;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n bytesReceived?: number;\n fractionLost?: number;\n jitter?: number;\n packetsLost?: number;\n packetsReceived?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n frameHeight?: number;\n framesCorrupted?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesPerSecond?: number;\n framesReceived?: number;\n framesSent?: number;\n frameWidth?: number;\n remoteSource?: boolean;\n ssrcIds?: string[];\n trackIdentifier?: string;\n}\n\ninterface RTCOfferOptions {\n iceRestart?: boolean;\n offerToReceiveAudio?: number;\n offerToReceiveVideo?: number;\n voiceActivityDetection?: boolean;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n bytesSent?: number;\n packetsSent?: number;\n roundTripTime?: number;\n targetBitrate?: number;\n}\n\ninterface RTCPeerConnectionIceEventInit extends EventInit {\n candidate?: RTCIceCandidate;\n}\n\ninterface RTCRtcpFeedback {\n parameter?: string;\n type?: string;\n}\n\ninterface RTCRtcpParameters {\n cname?: string;\n mux?: boolean;\n reducedSize?: boolean;\n ssrc?: number;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n fecMechanisms?: string[];\n headerExtensions?: RTCRtpHeaderExtension[];\n}\n\ninterface RTCRtpCodecCapability {\n clockRate?: number;\n kind?: string;\n maxptime?: number;\n maxSpatialLayers?: number;\n maxTemporalLayers?: number;\n name?: string;\n numChannels?: number;\n options?: any;\n parameters?: any;\n preferredPayloadType?: number;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n clockRate?: number;\n maxptime?: number;\n name?: string;\n numChannels?: number;\n parameters?: any;\n payloadType?: any;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n}\n\ninterface RTCRtpContributingSource {\n audioLevel?: number;\n csrc?: number;\n timestamp?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n active?: boolean;\n codecPayloadType?: number;\n dependencyEncodingIds?: string[];\n encodingId?: string;\n fec?: RTCRtpFecParameters;\n framerateScale?: number;\n maxBitrate?: number;\n maxFramerate?: number;\n minQuality?: number;\n priority?: number;\n resolutionScale?: number;\n rtx?: RTCRtpRtxParameters;\n ssrc?: number;\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n mechanism?: string;\n ssrc?: number;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n preferredEncrypt?: boolean;\n preferredId?: number;\n uri?: string;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n encrypt?: boolean;\n id?: number;\n uri?: string;\n}\n\ninterface RTCRtpParameters {\n codecs?: RTCRtpCodecParameters[];\n degradationPreference?: RTCDegradationPreference;\n encodings?: RTCRtpEncodingParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n muxId?: string;\n rtcp?: RTCRtcpParameters;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n associateStatsId?: string;\n codecId?: string;\n firCount?: number;\n isRemote?: boolean;\n mediaTrackId?: string;\n nackCount?: number;\n pliCount?: number;\n sliCount?: number;\n ssrc?: string;\n transportId?: string;\n}\n\ninterface RTCRtpUnhandled {\n muxId?: string;\n payloadType?: number;\n ssrc?: number;\n}\n\ninterface RTCSessionDescriptionInit {\n sdp?: string;\n type?: RTCSdpType;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiLength?: number;\n mkiValue?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n tag?: number;\n}\n\ninterface RTCSsrcRange {\n max?: number;\n min?: number;\n}\n\ninterface RTCStats {\n id?: string;\n msType?: MSStatsType;\n timestamp?: number;\n type?: RTCStatsType;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n activeConnection?: boolean;\n bytesReceived?: number;\n bytesSent?: number;\n localCertificateId?: string;\n remoteCertificateId?: string;\n rtcpTransportStatsId?: string;\n selectedCandidatePairId?: string;\n}\n\ninterface ScopedCredentialDescriptor {\n id: BufferSource;\n transports?: Transport[];\n type: ScopedCredentialType;\n}\n\ninterface ScopedCredentialOptions {\n excludeList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: USVString;\n timeoutSeconds?: number;\n}\n\ninterface ScopedCredentialParameters {\n algorithm: string | Algorithm;\n type: ScopedCredentialType;\n}\n\ninterface ServiceWorkerMessageEventInit extends EventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[] | null;\n source?: ServiceWorker | MessagePort | null;\n}\n\ninterface SpeechSynthesisEventInit extends EventInit {\n charIndex?: number;\n elapsedTime?: number;\n name?: string;\n utterance?: SpeechSynthesisUtterance | null;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n detailURI?: string | null;\n explanationString?: string | null;\n siteName?: string | null;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface TrackEventInit extends EventInit {\n track?: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ninterface TransitionEventInit extends EventInit {\n elapsedTime?: number;\n propertyName?: string;\n}\n\ninterface UIEventInit extends EventInit {\n detail?: number;\n view?: Window | null;\n}\n\ninterface WebAuthnExtensions {\n}\n\ninterface WebGLContextAttributes {\n failIfMajorPerformanceCaveat?: boolean;\n alpha?: boolean;\n antialias?: boolean;\n depth?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n stencil?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaMode?: number;\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n}\n\ninterface EventListener {\n (evt: Event): void;\n}\n\ninterface WebKitEntriesCallback {\n (evt: Event): void;\n}\n\ninterface WebKitErrorCallback {\n (evt: Event): void;\n}\n\ninterface WebKitFileCallback {\n (evt: Event): void;\n}\n\ninterface AnalyserNode extends AudioNode {\n fftSize: number;\n readonly frequencyBinCount: number;\n maxDecibels: number;\n minDecibels: number;\n smoothingTimeConstant: number;\n getByteFrequencyData(array: Uint8Array): void;\n getByteTimeDomainData(array: Uint8Array): void;\n getFloatFrequencyData(array: Float32Array): void;\n getFloatTimeDomainData(array: Float32Array): void;\n}\n\ndeclare var AnalyserNode: {\n prototype: AnalyserNode;\n new(): AnalyserNode;\n};\n\ninterface ANGLE_instanced_arrays {\n drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;\n drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;\n vertexAttribDivisorANGLE(index: number, divisor: number): void;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n}\n\ndeclare var ANGLE_instanced_arrays: {\n prototype: ANGLE_instanced_arrays;\n new(): ANGLE_instanced_arrays;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n};\n\ninterface AnimationEvent extends Event {\n readonly animationName: string;\n readonly elapsedTime: number;\n initAnimationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, animationNameArg: string, elapsedTimeArg: number): void;\n}\n\ndeclare var AnimationEvent: {\n prototype: AnimationEvent;\n new(typeArg: string, eventInitDict?: AnimationEventInit): AnimationEvent;\n};\n\ninterface ApplicationCacheEventMap {\n \"cached\": Event;\n \"checking\": Event;\n \"downloading\": Event;\n \"error\": Event;\n \"noupdate\": Event;\n \"obsolete\": Event;\n \"progress\": ProgressEvent;\n \"updateready\": Event;\n}\n\ninterface ApplicationCache extends EventTarget {\n oncached: (this: ApplicationCache, ev: Event) => any;\n onchecking: (this: ApplicationCache, ev: Event) => any;\n ondownloading: (this: ApplicationCache, ev: Event) => any;\n onerror: (this: ApplicationCache, ev: Event) => any;\n onnoupdate: (this: ApplicationCache, ev: Event) => any;\n onobsolete: (this: ApplicationCache, ev: Event) => any;\n onprogress: (this: ApplicationCache, ev: ProgressEvent) => any;\n onupdateready: (this: ApplicationCache, ev: Event) => any;\n readonly status: number;\n abort(): void;\n swapCache(): void;\n update(): void;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ApplicationCache: {\n prototype: ApplicationCache;\n new(): ApplicationCache;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n};\n\ninterface Attr extends Node {\n readonly name: string;\n readonly ownerElement: Element;\n readonly prefix: string | null;\n readonly specified: boolean;\n value: string;\n}\n\ndeclare var Attr: {\n prototype: Attr;\n new(): Attr;\n};\n\ninterface AudioBuffer {\n readonly duration: number;\n readonly length: number;\n readonly numberOfChannels: number;\n readonly sampleRate: number;\n copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;\n copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;\n getChannelData(channel: number): Float32Array;\n}\n\ndeclare var AudioBuffer: {\n prototype: AudioBuffer;\n new(): AudioBuffer;\n};\n\ninterface AudioBufferSourceNodeEventMap {\n \"ended\": MediaStreamErrorEvent;\n}\n\ninterface AudioBufferSourceNode extends AudioNode {\n buffer: AudioBuffer | null;\n readonly detune: AudioParam;\n loop: boolean;\n loopEnd: number;\n loopStart: number;\n onended: (this: AudioBufferSourceNode, ev: MediaStreamErrorEvent) => any;\n readonly playbackRate: AudioParam;\n start(when?: number, offset?: number, duration?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioBufferSourceNode: {\n prototype: AudioBufferSourceNode;\n new(): AudioBufferSourceNode;\n};\n\ninterface AudioContextEventMap {\n \"statechange\": Event;\n}\n\ninterface AudioContextBase extends EventTarget {\n readonly currentTime: number;\n readonly destination: AudioDestinationNode;\n readonly listener: AudioListener;\n onstatechange: (this: AudioContext, ev: Event) => any;\n readonly sampleRate: number;\n readonly state: AudioContextState;\n close(): Promise;\n createAnalyser(): AnalyserNode;\n createBiquadFilter(): BiquadFilterNode;\n createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;\n createBufferSource(): AudioBufferSourceNode;\n createChannelMerger(numberOfInputs?: number): ChannelMergerNode;\n createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;\n createConvolver(): ConvolverNode;\n createDelay(maxDelayTime?: number): DelayNode;\n createDynamicsCompressor(): DynamicsCompressorNode;\n createGain(): GainNode;\n createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode;\n createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;\n createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;\n createOscillator(): OscillatorNode;\n createPanner(): PannerNode;\n createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave;\n createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;\n createStereoPanner(): StereoPannerNode;\n createWaveShaper(): WaveShaperNode;\n decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise;\n resume(): Promise;\n addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface AudioContext extends AudioContextBase {\n suspend(): Promise;\n}\n\ndeclare var AudioContext: {\n prototype: AudioContext;\n new(): AudioContext;\n};\n\ninterface AudioDestinationNode extends AudioNode {\n readonly maxChannelCount: number;\n}\n\ndeclare var AudioDestinationNode: {\n prototype: AudioDestinationNode;\n new(): AudioDestinationNode;\n};\n\ninterface AudioListener {\n dopplerFactor: number;\n speedOfSound: number;\n setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;\n setPosition(x: number, y: number, z: number): void;\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var AudioListener: {\n prototype: AudioListener;\n new(): AudioListener;\n};\n\ninterface AudioNode extends EventTarget {\n channelCount: number;\n channelCountMode: ChannelCountMode;\n channelInterpretation: ChannelInterpretation;\n readonly context: AudioContext;\n readonly numberOfInputs: number;\n readonly numberOfOutputs: number;\n connect(destination: AudioNode, output?: number, input?: number): AudioNode;\n connect(destination: AudioParam, output?: number): void;\n disconnect(output?: number): void;\n disconnect(destination: AudioNode, output?: number, input?: number): void;\n disconnect(destination: AudioParam, output?: number): void;\n}\n\ndeclare var AudioNode: {\n prototype: AudioNode;\n new(): AudioNode;\n};\n\ninterface AudioParam {\n readonly defaultValue: number;\n value: number;\n cancelScheduledValues(startTime: number): AudioParam;\n exponentialRampToValueAtTime(value: number, endTime: number): AudioParam;\n linearRampToValueAtTime(value: number, endTime: number): AudioParam;\n setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam;\n setValueAtTime(value: number, startTime: number): AudioParam;\n setValueCurveAtTime(values: Float32Array, startTime: number, duration: number): AudioParam;\n}\n\ndeclare var AudioParam: {\n prototype: AudioParam;\n new(): AudioParam;\n};\n\ninterface AudioProcessingEvent extends Event {\n readonly inputBuffer: AudioBuffer;\n readonly outputBuffer: AudioBuffer;\n readonly playbackTime: number;\n}\n\ndeclare var AudioProcessingEvent: {\n prototype: AudioProcessingEvent;\n new(): AudioProcessingEvent;\n};\n\ninterface AudioTrack {\n enabled: boolean;\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var AudioTrack: {\n prototype: AudioTrack;\n new(): AudioTrack;\n};\n\ninterface AudioTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface AudioTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: (this: AudioTrackList, ev: TrackEvent) => any;\n onchange: (this: AudioTrackList, ev: Event) => any;\n onremovetrack: (this: AudioTrackList, ev: TrackEvent) => any;\n getTrackById(id: string): AudioTrack | null;\n item(index: number): AudioTrack;\n addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: AudioTrack;\n}\n\ndeclare var AudioTrackList: {\n prototype: AudioTrackList;\n new(): AudioTrackList;\n};\n\ninterface BarProp {\n readonly visible: boolean;\n}\n\ndeclare var BarProp: {\n prototype: BarProp;\n new(): BarProp;\n};\n\ninterface BeforeUnloadEvent extends Event {\n returnValue: any;\n}\n\ndeclare var BeforeUnloadEvent: {\n prototype: BeforeUnloadEvent;\n new(): BeforeUnloadEvent;\n};\n\ninterface BiquadFilterNode extends AudioNode {\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n readonly gain: AudioParam;\n readonly Q: AudioParam;\n type: BiquadFilterType;\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var BiquadFilterNode: {\n prototype: BiquadFilterNode;\n new(): BiquadFilterNode;\n};\n\ninterface Blob {\n readonly size: number;\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n slice(start?: number, end?: number, contentType?: string): Blob;\n}\n\ndeclare var Blob: {\n prototype: Blob;\n new (blobParts?: any[], options?: BlobPropertyBag): Blob;\n};\n\ninterface Cache {\n add(request: RequestInfo): Promise;\n addAll(requests: RequestInfo[]): Promise;\n delete(request: RequestInfo, options?: CacheQueryOptions): Promise;\n keys(request?: RequestInfo, options?: CacheQueryOptions): Promise;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n matchAll(request?: RequestInfo, options?: CacheQueryOptions): Promise;\n put(request: RequestInfo, response: Response): Promise;\n}\n\ndeclare var Cache: {\n prototype: Cache;\n new(): Cache;\n};\n\ninterface CacheStorage {\n delete(cacheName: string): Promise;\n has(cacheName: string): Promise;\n keys(): Promise;\n match(request: RequestInfo, options?: CacheQueryOptions): Promise;\n open(cacheName: string): Promise;\n}\n\ndeclare var CacheStorage: {\n prototype: CacheStorage;\n new(): CacheStorage;\n};\n\ninterface CanvasGradient {\n addColorStop(offset: number, color: string): void;\n}\n\ndeclare var CanvasGradient: {\n prototype: CanvasGradient;\n new(): CanvasGradient;\n};\n\ninterface CanvasPattern {\n setTransform(matrix: SVGMatrix): void;\n}\n\ndeclare var CanvasPattern: {\n prototype: CanvasPattern;\n new(): CanvasPattern;\n};\n\ninterface CanvasRenderingContext2D extends Object, CanvasPathMethods {\n readonly canvas: HTMLCanvasElement;\n fillStyle: string | CanvasGradient | CanvasPattern;\n font: string;\n globalAlpha: number;\n globalCompositeOperation: string;\n imageSmoothingEnabled: boolean;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n msFillRule: CanvasFillRule;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n textAlign: string;\n textBaseline: string;\n mozImageSmoothingEnabled: boolean;\n webkitImageSmoothingEnabled: boolean;\n oImageSmoothingEnabled: boolean;\n beginPath(): void;\n clearRect(x: number, y: number, w: number, h: number): void;\n clip(fillRule?: CanvasFillRule): void;\n clip(path: Path2D, fillRule?: CanvasFillRule): void;\n createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;\n createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;\n drawFocusIfNeeded(element: Element): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void;\n fill(fillRule?: CanvasFillRule): void;\n fill(path: Path2D, fillRule?: CanvasFillRule): void;\n fillRect(x: number, y: number, w: number, h: number): void;\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\n getLineDash(): number[];\n isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\n measureText(text: string): TextMetrics;\n putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;\n restore(): void;\n rotate(angle: number): void;\n save(): void;\n scale(x: number, y: number): void;\n setLineDash(segments: number[]): void;\n setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n stroke(path?: Path2D): void;\n strokeRect(x: number, y: number, w: number, h: number): void;\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\n transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n translate(x: number, y: number): void;\n}\n\ndeclare var CanvasRenderingContext2D: {\n prototype: CanvasRenderingContext2D;\n new(): CanvasRenderingContext2D;\n};\n\ninterface CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\n};\n\ninterface ChannelMergerNode extends AudioNode {\n}\n\ndeclare var ChannelMergerNode: {\n prototype: ChannelMergerNode;\n new(): ChannelMergerNode;\n};\n\ninterface ChannelSplitterNode extends AudioNode {\n}\n\ndeclare var ChannelSplitterNode: {\n prototype: ChannelSplitterNode;\n new(): ChannelSplitterNode;\n};\n\ninterface CharacterData extends Node, ChildNode {\n data: string;\n readonly length: number;\n appendData(arg: string): void;\n deleteData(offset: number, count: number): void;\n insertData(offset: number, arg: string): void;\n replaceData(offset: number, count: number, arg: string): void;\n substringData(offset: number, count: number): string;\n}\n\ndeclare var CharacterData: {\n prototype: CharacterData;\n new(): CharacterData;\n};\n\ninterface ClientRect {\n bottom: number;\n readonly height: number;\n left: number;\n right: number;\n top: number;\n readonly width: number;\n}\n\ndeclare var ClientRect: {\n prototype: ClientRect;\n new(): ClientRect;\n};\n\ninterface ClientRectList {\n readonly length: number;\n item(index: number): ClientRect;\n [index: number]: ClientRect;\n}\n\ndeclare var ClientRectList: {\n prototype: ClientRectList;\n new(): ClientRectList;\n};\n\ninterface ClipboardEvent extends Event {\n readonly clipboardData: DataTransfer;\n}\n\ndeclare var ClipboardEvent: {\n prototype: ClipboardEvent;\n new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;\n};\n\ninterface CloseEvent extends Event {\n readonly code: number;\n readonly reason: string;\n readonly wasClean: boolean;\n initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;\n}\n\ndeclare var CloseEvent: {\n prototype: CloseEvent;\n new(typeArg: string, eventInitDict?: CloseEventInit): CloseEvent;\n};\n\ninterface Comment extends CharacterData {\n text: string;\n}\n\ndeclare var Comment: {\n prototype: Comment;\n new(): Comment;\n};\n\ninterface CompositionEvent extends UIEvent {\n readonly data: string;\n readonly locale: string;\n initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;\n}\n\ndeclare var CompositionEvent: {\n prototype: CompositionEvent;\n new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;\n};\n\ninterface Console {\n assert(test?: boolean, message?: string, ...optionalParams: any[]): void;\n clear(): void;\n count(countTitle?: string): void;\n debug(message?: any, ...optionalParams: any[]): void;\n dir(value?: any, ...optionalParams: any[]): void;\n dirxml(value: any): void;\n error(message?: any, ...optionalParams: any[]): void;\n exception(message?: string, ...optionalParams: any[]): void;\n group(groupTitle?: string, ...optionalParams: any[]): void;\n groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;\n groupEnd(): void;\n info(message?: any, ...optionalParams: any[]): void;\n log(message?: any, ...optionalParams: any[]): void;\n msIsIndependentlyComposed(element: Element): boolean;\n profile(reportName?: string): void;\n profileEnd(): void;\n select(element: Element): void;\n table(...data: any[]): void;\n time(timerName?: string): void;\n timeEnd(timerName?: string): void;\n trace(message?: any, ...optionalParams: any[]): void;\n warn(message?: any, ...optionalParams: any[]): void;\n}\n\ndeclare var Console: {\n prototype: Console;\n new(): Console;\n};\n\ninterface ConvolverNode extends AudioNode {\n buffer: AudioBuffer | null;\n normalize: boolean;\n}\n\ndeclare var ConvolverNode: {\n prototype: ConvolverNode;\n new(): ConvolverNode;\n};\n\ninterface Coordinates {\n readonly accuracy: number;\n readonly altitude: number | null;\n readonly altitudeAccuracy: number | null;\n readonly heading: number | null;\n readonly latitude: number;\n readonly longitude: number;\n readonly speed: number | null;\n}\n\ndeclare var Coordinates: {\n prototype: Coordinates;\n new(): Coordinates;\n};\n\ninterface Crypto extends Object, RandomSource {\n readonly subtle: SubtleCrypto;\n}\n\ndeclare var Crypto: {\n prototype: Crypto;\n new(): Crypto;\n};\n\ninterface CryptoKey {\n readonly algorithm: KeyAlgorithm;\n readonly extractable: boolean;\n readonly type: string;\n readonly usages: string[];\n}\n\ndeclare var CryptoKey: {\n prototype: CryptoKey;\n new(): CryptoKey;\n};\n\ninterface CryptoKeyPair {\n privateKey: CryptoKey;\n publicKey: CryptoKey;\n}\n\ndeclare var CryptoKeyPair: {\n prototype: CryptoKeyPair;\n new(): CryptoKeyPair;\n};\n\ninterface CSS {\n supports(property: string, value?: string): boolean;\n}\ndeclare var CSS: CSS;\n\ninterface CSSConditionRule extends CSSGroupingRule {\n conditionText: string;\n}\n\ndeclare var CSSConditionRule: {\n prototype: CSSConditionRule;\n new(): CSSConditionRule;\n};\n\ninterface CSSFontFaceRule extends CSSRule {\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSFontFaceRule: {\n prototype: CSSFontFaceRule;\n new(): CSSFontFaceRule;\n};\n\ninterface CSSGroupingRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n deleteRule(index: number): void;\n insertRule(rule: string, index: number): number;\n}\n\ndeclare var CSSGroupingRule: {\n prototype: CSSGroupingRule;\n new(): CSSGroupingRule;\n};\n\ninterface CSSImportRule extends CSSRule {\n readonly href: string;\n readonly media: MediaList;\n readonly styleSheet: CSSStyleSheet;\n}\n\ndeclare var CSSImportRule: {\n prototype: CSSImportRule;\n new(): CSSImportRule;\n};\n\ninterface CSSKeyframeRule extends CSSRule {\n keyText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSKeyframeRule: {\n prototype: CSSKeyframeRule;\n new(): CSSKeyframeRule;\n};\n\ninterface CSSKeyframesRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n name: string;\n appendRule(rule: string): void;\n deleteRule(rule: string): void;\n findRule(rule: string): CSSKeyframeRule;\n}\n\ndeclare var CSSKeyframesRule: {\n prototype: CSSKeyframesRule;\n new(): CSSKeyframesRule;\n};\n\ninterface CSSMediaRule extends CSSConditionRule {\n readonly media: MediaList;\n}\n\ndeclare var CSSMediaRule: {\n prototype: CSSMediaRule;\n new(): CSSMediaRule;\n};\n\ninterface CSSNamespaceRule extends CSSRule {\n readonly namespaceURI: string;\n readonly prefix: string;\n}\n\ndeclare var CSSNamespaceRule: {\n prototype: CSSNamespaceRule;\n new(): CSSNamespaceRule;\n};\n\ninterface CSSPageRule extends CSSRule {\n readonly pseudoClass: string;\n readonly selector: string;\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSPageRule: {\n prototype: CSSPageRule;\n new(): CSSPageRule;\n};\n\ninterface CSSRule {\n cssText: string;\n readonly parentRule: CSSRule;\n readonly parentStyleSheet: CSSStyleSheet;\n readonly type: number;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n}\n\ndeclare var CSSRule: {\n prototype: CSSRule;\n new(): CSSRule;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n};\n\ninterface CSSRuleList {\n readonly length: number;\n item(index: number): CSSRule;\n [index: number]: CSSRule;\n}\n\ndeclare var CSSRuleList: {\n prototype: CSSRuleList;\n new(): CSSRuleList;\n};\n\ninterface CSSStyleDeclaration {\n alignContent: string | null;\n alignItems: string | null;\n alignmentBaseline: string | null;\n alignSelf: string | null;\n animation: string | null;\n animationDelay: string | null;\n animationDirection: string | null;\n animationDuration: string | null;\n animationFillMode: string | null;\n animationIterationCount: string | null;\n animationName: string | null;\n animationPlayState: string | null;\n animationTimingFunction: string | null;\n backfaceVisibility: string | null;\n background: string | null;\n backgroundAttachment: string | null;\n backgroundClip: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n backgroundOrigin: string | null;\n backgroundPosition: string | null;\n backgroundPositionX: string | null;\n backgroundPositionY: string | null;\n backgroundRepeat: string | null;\n backgroundSize: string | null;\n baselineShift: string | null;\n border: string | null;\n borderBottom: string | null;\n borderBottomColor: string | null;\n borderBottomLeftRadius: string | null;\n borderBottomRightRadius: string | null;\n borderBottomStyle: string | null;\n borderBottomWidth: string | null;\n borderCollapse: string | null;\n borderColor: string | null;\n borderImage: string | null;\n borderImageOutset: string | null;\n borderImageRepeat: string | null;\n borderImageSlice: string | null;\n borderImageSource: string | null;\n borderImageWidth: string | null;\n borderLeft: string | null;\n borderLeftColor: string | null;\n borderLeftStyle: string | null;\n borderLeftWidth: string | null;\n borderRadius: string | null;\n borderRight: string | null;\n borderRightColor: string | null;\n borderRightStyle: string | null;\n borderRightWidth: string | null;\n borderSpacing: string | null;\n borderStyle: string | null;\n borderTop: string | null;\n borderTopColor: string | null;\n borderTopLeftRadius: string | null;\n borderTopRightRadius: string | null;\n borderTopStyle: string | null;\n borderTopWidth: string | null;\n borderWidth: string | null;\n bottom: string | null;\n boxShadow: string | null;\n boxSizing: string | null;\n breakAfter: string | null;\n breakBefore: string | null;\n breakInside: string | null;\n captionSide: string | null;\n clear: string | null;\n clip: string | null;\n clipPath: string | null;\n clipRule: string | null;\n color: string | null;\n colorInterpolationFilters: string | null;\n columnCount: any;\n columnFill: string | null;\n columnGap: any;\n columnRule: string | null;\n columnRuleColor: any;\n columnRuleStyle: string | null;\n columnRuleWidth: any;\n columns: string | null;\n columnSpan: string | null;\n columnWidth: any;\n content: string | null;\n counterIncrement: string | null;\n counterReset: string | null;\n cssFloat: string | null;\n cssText: string;\n cursor: string | null;\n direction: string | null;\n display: string | null;\n dominantBaseline: string | null;\n emptyCells: string | null;\n enableBackground: string | null;\n fill: string | null;\n fillOpacity: string | null;\n fillRule: string | null;\n filter: string | null;\n flex: string | null;\n flexBasis: string | null;\n flexDirection: string | null;\n flexFlow: string | null;\n flexGrow: string | null;\n flexShrink: string | null;\n flexWrap: string | null;\n floodColor: string | null;\n floodOpacity: string | null;\n font: string | null;\n fontFamily: string | null;\n fontFeatureSettings: string | null;\n fontSize: string | null;\n fontSizeAdjust: string | null;\n fontStretch: string | null;\n fontStyle: string | null;\n fontVariant: string | null;\n fontWeight: string | null;\n glyphOrientationHorizontal: string | null;\n glyphOrientationVertical: string | null;\n height: string | null;\n imeMode: string | null;\n justifyContent: string | null;\n kerning: string | null;\n layoutGrid: string | null;\n layoutGridChar: string | null;\n layoutGridLine: string | null;\n layoutGridMode: string | null;\n layoutGridType: string | null;\n left: string | null;\n readonly length: number;\n letterSpacing: string | null;\n lightingColor: string | null;\n lineBreak: string | null;\n lineHeight: string | null;\n listStyle: string | null;\n listStyleImage: string | null;\n listStylePosition: string | null;\n listStyleType: string | null;\n margin: string | null;\n marginBottom: string | null;\n marginLeft: string | null;\n marginRight: string | null;\n marginTop: string | null;\n marker: string | null;\n markerEnd: string | null;\n markerMid: string | null;\n markerStart: string | null;\n mask: string | null;\n maxHeight: string | null;\n maxWidth: string | null;\n minHeight: string | null;\n minWidth: string | null;\n msContentZoomChaining: string | null;\n msContentZooming: string | null;\n msContentZoomLimit: string | null;\n msContentZoomLimitMax: any;\n msContentZoomLimitMin: any;\n msContentZoomSnap: string | null;\n msContentZoomSnapPoints: string | null;\n msContentZoomSnapType: string | null;\n msFlowFrom: string | null;\n msFlowInto: string | null;\n msFontFeatureSettings: string | null;\n msGridColumn: any;\n msGridColumnAlign: string | null;\n msGridColumns: string | null;\n msGridColumnSpan: any;\n msGridRow: any;\n msGridRowAlign: string | null;\n msGridRows: string | null;\n msGridRowSpan: any;\n msHighContrastAdjust: string | null;\n msHyphenateLimitChars: string | null;\n msHyphenateLimitLines: any;\n msHyphenateLimitZone: any;\n msHyphens: string | null;\n msImeAlign: string | null;\n msOverflowStyle: string | null;\n msScrollChaining: string | null;\n msScrollLimit: string | null;\n msScrollLimitXMax: any;\n msScrollLimitXMin: any;\n msScrollLimitYMax: any;\n msScrollLimitYMin: any;\n msScrollRails: string | null;\n msScrollSnapPointsX: string | null;\n msScrollSnapPointsY: string | null;\n msScrollSnapType: string | null;\n msScrollSnapX: string | null;\n msScrollSnapY: string | null;\n msScrollTranslation: string | null;\n msTextCombineHorizontal: string | null;\n msTextSizeAdjust: any;\n msTouchAction: string | null;\n msTouchSelect: string | null;\n msUserSelect: string | null;\n msWrapFlow: string;\n msWrapMargin: any;\n msWrapThrough: string;\n opacity: string | null;\n order: string | null;\n orphans: string | null;\n outline: string | null;\n outlineColor: string | null;\n outlineOffset: string | null;\n outlineStyle: string | null;\n outlineWidth: string | null;\n overflow: string | null;\n overflowX: string | null;\n overflowY: string | null;\n padding: string | null;\n paddingBottom: string | null;\n paddingLeft: string | null;\n paddingRight: string | null;\n paddingTop: string | null;\n pageBreakAfter: string | null;\n pageBreakBefore: string | null;\n pageBreakInside: string | null;\n readonly parentRule: CSSRule;\n perspective: string | null;\n perspectiveOrigin: string | null;\n pointerEvents: string | null;\n position: string | null;\n quotes: string | null;\n right: string | null;\n rotate: string | null;\n rubyAlign: string | null;\n rubyOverhang: string | null;\n rubyPosition: string | null;\n scale: string | null;\n stopColor: string | null;\n stopOpacity: string | null;\n stroke: string | null;\n strokeDasharray: string | null;\n strokeDashoffset: string | null;\n strokeLinecap: string | null;\n strokeLinejoin: string | null;\n strokeMiterlimit: string | null;\n strokeOpacity: string | null;\n strokeWidth: string | null;\n tableLayout: string | null;\n textAlign: string | null;\n textAlignLast: string | null;\n textAnchor: string | null;\n textDecoration: string | null;\n textIndent: string | null;\n textJustify: string | null;\n textKashida: string | null;\n textKashidaSpace: string | null;\n textOverflow: string | null;\n textShadow: string | null;\n textTransform: string | null;\n textUnderlinePosition: string | null;\n top: string | null;\n touchAction: string | null;\n transform: string | null;\n transformOrigin: string | null;\n transformStyle: string | null;\n transition: string | null;\n transitionDelay: string | null;\n transitionDuration: string | null;\n transitionProperty: string | null;\n transitionTimingFunction: string | null;\n translate: string | null;\n unicodeBidi: string | null;\n verticalAlign: string | null;\n visibility: string | null;\n webkitAlignContent: string | null;\n webkitAlignItems: string | null;\n webkitAlignSelf: string | null;\n webkitAnimation: string | null;\n webkitAnimationDelay: string | null;\n webkitAnimationDirection: string | null;\n webkitAnimationDuration: string | null;\n webkitAnimationFillMode: string | null;\n webkitAnimationIterationCount: string | null;\n webkitAnimationName: string | null;\n webkitAnimationPlayState: string | null;\n webkitAnimationTimingFunction: string | null;\n webkitAppearance: string | null;\n webkitBackfaceVisibility: string | null;\n webkitBackgroundClip: string | null;\n webkitBackgroundOrigin: string | null;\n webkitBackgroundSize: string | null;\n webkitBorderBottomLeftRadius: string | null;\n webkitBorderBottomRightRadius: string | null;\n webkitBorderImage: string | null;\n webkitBorderRadius: string | null;\n webkitBorderTopLeftRadius: string | null;\n webkitBorderTopRightRadius: string | null;\n webkitBoxAlign: string | null;\n webkitBoxDirection: string | null;\n webkitBoxFlex: string | null;\n webkitBoxOrdinalGroup: string | null;\n webkitBoxOrient: string | null;\n webkitBoxPack: string | null;\n webkitBoxSizing: string | null;\n webkitColumnBreakAfter: string | null;\n webkitColumnBreakBefore: string | null;\n webkitColumnBreakInside: string | null;\n webkitColumnCount: any;\n webkitColumnGap: any;\n webkitColumnRule: string | null;\n webkitColumnRuleColor: any;\n webkitColumnRuleStyle: string | null;\n webkitColumnRuleWidth: any;\n webkitColumns: string | null;\n webkitColumnSpan: string | null;\n webkitColumnWidth: any;\n webkitFilter: string | null;\n webkitFlex: string | null;\n webkitFlexBasis: string | null;\n webkitFlexDirection: string | null;\n webkitFlexFlow: string | null;\n webkitFlexGrow: string | null;\n webkitFlexShrink: string | null;\n webkitFlexWrap: string | null;\n webkitJustifyContent: string | null;\n webkitOrder: string | null;\n webkitPerspective: string | null;\n webkitPerspectiveOrigin: string | null;\n webkitTapHighlightColor: string | null;\n webkitTextFillColor: string | null;\n webkitTextSizeAdjust: any;\n webkitTextStroke: string | null;\n webkitTextStrokeColor: string | null;\n webkitTextStrokeWidth: string | null;\n webkitTransform: string | null;\n webkitTransformOrigin: string | null;\n webkitTransformStyle: string | null;\n webkitTransition: string | null;\n webkitTransitionDelay: string | null;\n webkitTransitionDuration: string | null;\n webkitTransitionProperty: string | null;\n webkitTransitionTimingFunction: string | null;\n webkitUserModify: string | null;\n webkitUserSelect: string | null;\n webkitWritingMode: string | null;\n whiteSpace: string | null;\n widows: string | null;\n width: string | null;\n wordBreak: string | null;\n wordSpacing: string | null;\n wordWrap: string | null;\n writingMode: string | null;\n zIndex: string | null;\n zoom: string | null;\n resize: string | null;\n userSelect: string | null;\n getPropertyPriority(propertyName: string): string;\n getPropertyValue(propertyName: string): string;\n item(index: number): string;\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string | null, priority?: string): void;\n [index: number]: string;\n}\n\ndeclare var CSSStyleDeclaration: {\n prototype: CSSStyleDeclaration;\n new(): CSSStyleDeclaration;\n};\n\ninterface CSSStyleRule extends CSSRule {\n readonly readOnly: boolean;\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSStyleRule: {\n prototype: CSSStyleRule;\n new(): CSSStyleRule;\n};\n\ninterface CSSStyleSheet extends StyleSheet {\n readonly cssRules: CSSRuleList;\n cssText: string;\n readonly id: string;\n readonly imports: StyleSheetList;\n readonly isAlternate: boolean;\n readonly isPrefAlternate: boolean;\n readonly ownerRule: CSSRule;\n readonly owningElement: Element;\n readonly pages: StyleSheetPageList;\n readonly readOnly: boolean;\n readonly rules: CSSRuleList;\n addImport(bstrURL: string, lIndex?: number): number;\n addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;\n addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;\n deleteRule(index?: number): void;\n insertRule(rule: string, index?: number): number;\n removeImport(lIndex: number): void;\n removeRule(lIndex: number): void;\n}\n\ndeclare var CSSStyleSheet: {\n prototype: CSSStyleSheet;\n new(): CSSStyleSheet;\n};\n\ninterface CSSSupportsRule extends CSSConditionRule {\n}\n\ndeclare var CSSSupportsRule: {\n prototype: CSSSupportsRule;\n new(): CSSSupportsRule;\n};\n\ninterface CustomEvent extends Event {\n readonly detail: T;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;\n}\n\ndeclare var CustomEvent: {\n prototype: CustomEvent;\n new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;\n};\n\ninterface DataCue extends TextTrackCue {\n data: ArrayBuffer;\n addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var DataCue: {\n prototype: DataCue;\n new(): DataCue;\n};\n\ninterface DataTransfer {\n dropEffect: string;\n effectAllowed: string;\n readonly files: FileList;\n readonly items: DataTransferItemList;\n readonly types: string[];\n clearData(format?: string): boolean;\n getData(format: string): string;\n setData(format: string, data: string): boolean;\n setDragImage(image: Element, x: number, y: number): void;\n}\n\ndeclare var DataTransfer: {\n prototype: DataTransfer;\n new(): DataTransfer;\n};\n\ninterface DataTransferItem {\n readonly kind: string;\n readonly type: string;\n getAsFile(): File | null;\n getAsString(_callback: FunctionStringCallback | null): void;\n webkitGetAsEntry(): any;\n}\n\ndeclare var DataTransferItem: {\n prototype: DataTransferItem;\n new(): DataTransferItem;\n};\n\ninterface DataTransferItemList {\n readonly length: number;\n add(data: File): DataTransferItem | null;\n clear(): void;\n item(index: number): DataTransferItem;\n remove(index: number): void;\n [index: number]: DataTransferItem;\n}\n\ndeclare var DataTransferItemList: {\n prototype: DataTransferItemList;\n new(): DataTransferItemList;\n};\n\ninterface DeferredPermissionRequest {\n readonly id: number;\n readonly type: MSWebViewPermissionType;\n readonly uri: string;\n allow(): void;\n deny(): void;\n}\n\ndeclare var DeferredPermissionRequest: {\n prototype: DeferredPermissionRequest;\n new(): DeferredPermissionRequest;\n};\n\ninterface DelayNode extends AudioNode {\n readonly delayTime: AudioParam;\n}\n\ndeclare var DelayNode: {\n prototype: DelayNode;\n new(): DelayNode;\n};\n\ninterface DeviceAcceleration {\n readonly x: number | null;\n readonly y: number | null;\n readonly z: number | null;\n}\n\ndeclare var DeviceAcceleration: {\n prototype: DeviceAcceleration;\n new(): DeviceAcceleration;\n};\n\ninterface DeviceLightEvent extends Event {\n readonly value: number;\n}\n\ndeclare var DeviceLightEvent: {\n prototype: DeviceLightEvent;\n new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;\n};\n\ninterface DeviceMotionEvent extends Event {\n readonly acceleration: DeviceAcceleration | null;\n readonly accelerationIncludingGravity: DeviceAcceleration | null;\n readonly interval: number | null;\n readonly rotationRate: DeviceRotationRate | null;\n initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void;\n}\n\ndeclare var DeviceMotionEvent: {\n prototype: DeviceMotionEvent;\n new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent;\n};\n\ninterface DeviceOrientationEvent extends Event {\n readonly absolute: boolean;\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void;\n}\n\ndeclare var DeviceOrientationEvent: {\n prototype: DeviceOrientationEvent;\n new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent;\n};\n\ninterface DeviceRotationRate {\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n}\n\ndeclare var DeviceRotationRate: {\n prototype: DeviceRotationRate;\n new(): DeviceRotationRate;\n};\n\ninterface DocumentEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"activate\": UIEvent;\n \"beforeactivate\": UIEvent;\n \"beforedeactivate\": UIEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": UIEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": MediaStreamErrorEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"fullscreenchange\": Event;\n \"fullscreenerror\": Event;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": UIEvent;\n \"MSGestureChange\": MSGestureEvent;\n \"MSGestureDoubleTap\": MSGestureEvent;\n \"MSGestureEnd\": MSGestureEvent;\n \"MSGestureHold\": MSGestureEvent;\n \"MSGestureStart\": MSGestureEvent;\n \"MSGestureTap\": MSGestureEvent;\n \"MSInertiaStart\": MSGestureEvent;\n \"MSManipulationStateChanged\": MSManipulationEvent;\n \"MSPointerCancel\": MSPointerEvent;\n \"MSPointerDown\": MSPointerEvent;\n \"MSPointerEnter\": MSPointerEvent;\n \"MSPointerLeave\": MSPointerEvent;\n \"MSPointerMove\": MSPointerEvent;\n \"MSPointerOut\": MSPointerEvent;\n \"MSPointerOver\": MSPointerEvent;\n \"MSPointerUp\": MSPointerEvent;\n \"mssitemodejumplistitemremoved\": MSSiteModeEvent;\n \"msthumbnailclick\": MSSiteModeEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"pointerlockchange\": Event;\n \"pointerlockerror\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectionchange\": Event;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"stop\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": TouchEvent;\n \"touchend\": TouchEvent;\n \"touchmove\": TouchEvent;\n \"touchstart\": TouchEvent;\n \"volumechange\": Event;\n \"waiting\": Event;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEvent, ParentNode, DocumentOrShadowRoot {\n /**\n * Gets the object that has the focus when the parent document has focus.\n */\n readonly activeElement: Element;\n /**\n * Sets or gets the color of all active links in the document.\n */\n alinkColor: string;\n /**\n * Returns a reference to the collection of elements contained by the object.\n */\n readonly all: HTMLAllCollection;\n /**\n * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.\n */\n anchors: HTMLCollectionOf;\n /**\n * Retrieves a collection of all applet objects in the document.\n */\n applets: HTMLCollectionOf;\n /**\n * Deprecated. Sets or retrieves a value that indicates the background color behind the object.\n */\n bgColor: string;\n /**\n * Specifies the beginning and end of the document body.\n */\n body: HTMLElement;\n readonly characterSet: string;\n /**\n * Gets or sets the character set used to encode the object.\n */\n charset: string;\n /**\n * Gets a value that indicates whether standards-compliant mode is switched on for the object.\n */\n readonly compatMode: string;\n cookie: string;\n readonly currentScript: HTMLScriptElement | SVGScriptElement | null;\n readonly defaultView: Window;\n /**\n * Sets or gets a value that indicates whether the document can be edited.\n */\n designMode: string;\n /**\n * Sets or retrieves a value that indicates the reading order of the object.\n */\n dir: string;\n /**\n * Gets an object representing the document type declaration associated with the current document.\n */\n readonly doctype: DocumentType;\n /**\n * Gets a reference to the root node of the document.\n */\n documentElement: HTMLElement;\n /**\n * Sets or gets the security domain of the document.\n */\n domain: string;\n /**\n * Retrieves a collection of all embed objects in the document.\n */\n embeds: HTMLCollectionOf;\n /**\n * Sets or gets the foreground (text) color of the document.\n */\n fgColor: string;\n /**\n * Retrieves a collection, in source order, of all form objects in the document.\n */\n forms: HTMLCollectionOf;\n readonly fullscreenElement: Element | null;\n readonly fullscreenEnabled: boolean;\n readonly head: HTMLHeadElement;\n readonly hidden: boolean;\n /**\n * Retrieves a collection, in source order, of img objects in the document.\n */\n images: HTMLCollectionOf;\n /**\n * Gets the implementation object of the current document.\n */\n readonly implementation: DOMImplementation;\n /**\n * Returns the character encoding used to create the webpage that is loaded into the document object.\n */\n readonly inputEncoding: string | null;\n /**\n * Gets the date that the page was last modified, if the page supplies one.\n */\n readonly lastModified: string;\n /**\n * Sets or gets the color of the document links.\n */\n linkColor: string;\n /**\n * Retrieves a collection of all a objects that specify the href property and all area objects in the document.\n */\n links: HTMLCollectionOf;\n /**\n * Contains information about the current URL.\n */\n readonly location: Location;\n msCapsLockWarningOff: boolean;\n msCSSOMElementFloatMetrics: boolean;\n /**\n * Fires when the user aborts the download.\n * @param ev The event.\n */\n onabort: (this: Document, ev: UIEvent) => any;\n /**\n * Fires when the object is set as the active element.\n * @param ev The event.\n */\n onactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires immediately before the object is set as the active element.\n * @param ev The event.\n */\n onbeforeactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires immediately before the activeElement is changed from the current object to another object in the parent document.\n * @param ev The event.\n */\n onbeforedeactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires when the object loses the input focus.\n * @param ev The focus event.\n */\n onblur: (this: Document, ev: FocusEvent) => any;\n /**\n * Occurs when playback is possible, but would require further buffering.\n * @param ev The event.\n */\n oncanplay: (this: Document, ev: Event) => any;\n oncanplaythrough: (this: Document, ev: Event) => any;\n /**\n * Fires when the contents of the object or selection have changed.\n * @param ev The event.\n */\n onchange: (this: Document, ev: Event) => any;\n /**\n * Fires when the user clicks the left mouse button on the object\n * @param ev The mouse event.\n */\n onclick: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user clicks the right mouse button in the client area, opening the context menu.\n * @param ev The mouse event.\n */\n oncontextmenu: (this: Document, ev: PointerEvent) => any;\n /**\n * Fires when the user double-clicks the object.\n * @param ev The mouse event.\n */\n ondblclick: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the activeElement is changed from the current object to another object in the parent document.\n * @param ev The UI Event\n */\n ondeactivate: (this: Document, ev: UIEvent) => any;\n /**\n * Fires on the source object continuously during a drag operation.\n * @param ev The event.\n */\n ondrag: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the source object when the user releases the mouse at the close of a drag operation.\n * @param ev The event.\n */\n ondragend: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the target element when the user drags the object to a valid drop target.\n * @param ev The drag event.\n */\n ondragenter: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\n * @param ev The drag event.\n */\n ondragleave: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the target element continuously while the user drags the object over a valid drop target.\n * @param ev The event.\n */\n ondragover: (this: Document, ev: DragEvent) => any;\n /**\n * Fires on the source object when the user starts to drag a text selection or selected object.\n * @param ev The event.\n */\n ondragstart: (this: Document, ev: DragEvent) => any;\n ondrop: (this: Document, ev: DragEvent) => any;\n /**\n * Occurs when the duration attribute is updated.\n * @param ev The event.\n */\n ondurationchange: (this: Document, ev: Event) => any;\n /**\n * Occurs when the media element is reset to its initial state.\n * @param ev The event.\n */\n onemptied: (this: Document, ev: Event) => any;\n /**\n * Occurs when the end of playback is reached.\n * @param ev The event\n */\n onended: (this: Document, ev: MediaStreamErrorEvent) => any;\n /**\n * Fires when an error occurs during object loading.\n * @param ev The event.\n */\n onerror: (this: Document, ev: ErrorEvent) => any;\n /**\n * Fires when the object receives focus.\n * @param ev The event.\n */\n onfocus: (this: Document, ev: FocusEvent) => any;\n onfullscreenchange: (this: Document, ev: Event) => any;\n onfullscreenerror: (this: Document, ev: Event) => any;\n oninput: (this: Document, ev: Event) => any;\n oninvalid: (this: Document, ev: Event) => any;\n /**\n * Fires when the user presses a key.\n * @param ev The keyboard event\n */\n onkeydown: (this: Document, ev: KeyboardEvent) => any;\n /**\n * Fires when the user presses an alphanumeric key.\n * @param ev The event.\n */\n onkeypress: (this: Document, ev: KeyboardEvent) => any;\n /**\n * Fires when the user releases a key.\n * @param ev The keyboard event\n */\n onkeyup: (this: Document, ev: KeyboardEvent) => any;\n /**\n * Fires immediately after the browser loads the object.\n * @param ev The event.\n */\n onload: (this: Document, ev: Event) => any;\n /**\n * Occurs when media data is loaded at the current playback position.\n * @param ev The event.\n */\n onloadeddata: (this: Document, ev: Event) => any;\n /**\n * Occurs when the duration and dimensions of the media have been determined.\n * @param ev The event.\n */\n onloadedmetadata: (this: Document, ev: Event) => any;\n /**\n * Occurs when Internet Explorer begins looking for media data.\n * @param ev The event.\n */\n onloadstart: (this: Document, ev: Event) => any;\n /**\n * Fires when the user clicks the object with either mouse button.\n * @param ev The mouse event.\n */\n onmousedown: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user moves the mouse over the object.\n * @param ev The mouse event.\n */\n onmousemove: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user moves the mouse pointer outside the boundaries of the object.\n * @param ev The mouse event.\n */\n onmouseout: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user moves the mouse pointer into the object.\n * @param ev The mouse event.\n */\n onmouseover: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the user releases a mouse button while the mouse is over the object.\n * @param ev The mouse event.\n */\n onmouseup: (this: Document, ev: MouseEvent) => any;\n /**\n * Fires when the wheel button is rotated.\n * @param ev The mouse event\n */\n onmousewheel: (this: Document, ev: WheelEvent) => any;\n onmscontentzoom: (this: Document, ev: UIEvent) => any;\n onmsgesturechange: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturedoubletap: (this: Document, ev: MSGestureEvent) => any;\n onmsgestureend: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturehold: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturestart: (this: Document, ev: MSGestureEvent) => any;\n onmsgesturetap: (this: Document, ev: MSGestureEvent) => any;\n onmsinertiastart: (this: Document, ev: MSGestureEvent) => any;\n onmsmanipulationstatechanged: (this: Document, ev: MSManipulationEvent) => any;\n onmspointercancel: (this: Document, ev: MSPointerEvent) => any;\n onmspointerdown: (this: Document, ev: MSPointerEvent) => any;\n onmspointerenter: (this: Document, ev: MSPointerEvent) => any;\n onmspointerleave: (this: Document, ev: MSPointerEvent) => any;\n onmspointermove: (this: Document, ev: MSPointerEvent) => any;\n onmspointerout: (this: Document, ev: MSPointerEvent) => any;\n onmspointerover: (this: Document, ev: MSPointerEvent) => any;\n onmspointerup: (this: Document, ev: MSPointerEvent) => any;\n /**\n * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmssitemodejumplistitemremoved: (this: Document, ev: MSSiteModeEvent) => any;\n /**\n * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmsthumbnailclick: (this: Document, ev: MSSiteModeEvent) => any;\n /**\n * Occurs when playback is paused.\n * @param ev The event.\n */\n onpause: (this: Document, ev: Event) => any;\n /**\n * Occurs when the play method is requested.\n * @param ev The event.\n */\n onplay: (this: Document, ev: Event) => any;\n /**\n * Occurs when the audio or video has started playing.\n * @param ev The event.\n */\n onplaying: (this: Document, ev: Event) => any;\n onpointerlockchange: (this: Document, ev: Event) => any;\n onpointerlockerror: (this: Document, ev: Event) => any;\n /**\n * Occurs to indicate progress while downloading media data.\n * @param ev The event.\n */\n onprogress: (this: Document, ev: ProgressEvent) => any;\n /**\n * Occurs when the playback rate is increased or decreased.\n * @param ev The event.\n */\n onratechange: (this: Document, ev: Event) => any;\n /**\n * Fires when the state of the object has changed.\n * @param ev The event\n */\n onreadystatechange: (this: Document, ev: Event) => any;\n /**\n * Fires when the user resets a form.\n * @param ev The event.\n */\n onreset: (this: Document, ev: Event) => any;\n /**\n * Fires when the user repositions the scroll box in the scroll bar on the object.\n * @param ev The event.\n */\n onscroll: (this: Document, ev: UIEvent) => any;\n /**\n * Occurs when the seek operation ends.\n * @param ev The event.\n */\n onseeked: (this: Document, ev: Event) => any;\n /**\n * Occurs when the current playback position is moved.\n * @param ev The event.\n */\n onseeking: (this: Document, ev: Event) => any;\n /**\n * Fires when the current selection changes.\n * @param ev The event.\n */\n onselect: (this: Document, ev: UIEvent) => any;\n /**\n * Fires when the selection state of a document changes.\n * @param ev The event.\n */\n onselectionchange: (this: Document, ev: Event) => any;\n onselectstart: (this: Document, ev: Event) => any;\n /**\n * Occurs when the download has stopped.\n * @param ev The event.\n */\n onstalled: (this: Document, ev: Event) => any;\n /**\n * Fires when the user clicks the Stop button or leaves the Web page.\n * @param ev The event.\n */\n onstop: (this: Document, ev: Event) => any;\n onsubmit: (this: Document, ev: Event) => any;\n /**\n * Occurs if the load operation has been intentionally halted.\n * @param ev The event.\n */\n onsuspend: (this: Document, ev: Event) => any;\n /**\n * Occurs to indicate the current playback position.\n * @param ev The event.\n */\n ontimeupdate: (this: Document, ev: Event) => any;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n /**\n * Occurs when the volume is changed, or playback is muted or unmuted.\n * @param ev The event.\n */\n onvolumechange: (this: Document, ev: Event) => any;\n /**\n * Occurs when playback stops because the next frame of a video resource is not available.\n * @param ev The event.\n */\n onwaiting: (this: Document, ev: Event) => any;\n onwebkitfullscreenchange: (this: Document, ev: Event) => any;\n onwebkitfullscreenerror: (this: Document, ev: Event) => any;\n plugins: HTMLCollectionOf;\n readonly pointerLockElement: Element;\n /**\n * Retrieves a value that indicates the current state of the object.\n */\n readonly readyState: string;\n /**\n * Gets the URL of the location that referred the user to the current page.\n */\n readonly referrer: string;\n /**\n * Gets the root svg element in the document hierarchy.\n */\n readonly rootElement: SVGSVGElement;\n /**\n * Retrieves a collection of all script objects in the document.\n */\n scripts: HTMLCollectionOf;\n readonly scrollingElement: Element | null;\n /**\n * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\n */\n readonly styleSheets: StyleSheetList;\n /**\n * Contains the title of the document.\n */\n title: string;\n /**\n * Sets or gets the URL for the current document.\n */\n readonly URL: string;\n /**\n * Gets the URL for the document, stripped of any character encoding.\n */\n readonly URLUnencoded: string;\n readonly visibilityState: VisibilityState;\n /**\n * Sets or gets the color of the links that the user has visited.\n */\n vlinkColor: string;\n readonly webkitCurrentFullScreenElement: Element | null;\n readonly webkitFullscreenElement: Element | null;\n readonly webkitFullscreenEnabled: boolean;\n readonly webkitIsFullScreen: boolean;\n readonly xmlEncoding: string | null;\n xmlStandalone: boolean;\n /**\n * Gets or sets the version attribute specified in the declaration of an XML document.\n */\n xmlVersion: string | null;\n adoptNode(source: T): T;\n captureEvents(): void;\n caretRangeFromPoint(x: number, y: number): Range;\n clear(): void;\n /**\n * Closes an output stream and forces the sent data to display.\n */\n close(): void;\n /**\n * Creates an attribute object with a specified name.\n * @param name String that sets the attribute object's name.\n */\n createAttribute(name: string): Attr;\n createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr;\n createCDATASection(data: string): CDATASection;\n /**\n * Creates a comment object with the specified data.\n * @param data Sets the comment object's data.\n */\n createComment(data: string): Comment;\n /**\n * Creates a new document.\n */\n createDocumentFragment(): DocumentFragment;\n /**\n * Creates an instance of the element for the specified tag.\n * @param tagName The name of an element.\n */\n createElement(tagName: K): HTMLElementTagNameMap[K];\n createElement(tagName: string): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"a\"): SVGAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"circle\"): SVGCircleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"clipPath\"): SVGClipPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"componentTransferFunction\"): SVGComponentTransferFunctionElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"defs\"): SVGDefsElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"desc\"): SVGDescElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"ellipse\"): SVGEllipseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feBlend\"): SVGFEBlendElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feColorMatrix\"): SVGFEColorMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComponentTransfer\"): SVGFEComponentTransferElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComposite\"): SVGFECompositeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feConvolveMatrix\"): SVGFEConvolveMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDiffuseLighting\"): SVGFEDiffuseLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDisplacementMap\"): SVGFEDisplacementMapElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDistantLight\"): SVGFEDistantLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFlood\"): SVGFEFloodElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncA\"): SVGFEFuncAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncB\"): SVGFEFuncBElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncG\"): SVGFEFuncGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncR\"): SVGFEFuncRElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feGaussianBlur\"): SVGFEGaussianBlurElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feImage\"): SVGFEImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMerge\"): SVGFEMergeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMergeNode\"): SVGFEMergeNodeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMorphology\"): SVGFEMorphologyElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feOffset\"): SVGFEOffsetElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"fePointLight\"): SVGFEPointLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpecularLighting\"): SVGFESpecularLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpotLight\"): SVGFESpotLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTile\"): SVGFETileElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTurbulence\"): SVGFETurbulenceElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"filter\"): SVGFilterElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"foreignObject\"): SVGForeignObjectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"g\"): SVGGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"image\"): SVGImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"gradient\"): SVGGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"line\"): SVGLineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"linearGradient\"): SVGLinearGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"marker\"): SVGMarkerElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"mask\"): SVGMaskElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"path\"): SVGPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"metadata\"): SVGMetadataElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"pattern\"): SVGPatternElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polygon\"): SVGPolygonElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polyline\"): SVGPolylineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"radialGradient\"): SVGRadialGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"rect\"): SVGRectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"svg\"): SVGSVGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"script\"): SVGScriptElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"stop\"): SVGStopElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"style\"): SVGStyleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"switch\"): SVGSwitchElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"symbol\"): SVGSymbolElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"tspan\"): SVGTSpanElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textContent\"): SVGTextContentElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"text\"): SVGTextElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPath\"): SVGTextPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPositioning\"): SVGTextPositioningElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"title\"): SVGTitleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"use\"): SVGUseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"view\"): SVGViewElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: string): SVGElement;\n createElementNS(namespaceURI: string | null, qualifiedName: string): Element;\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list\n * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;\n createNSResolver(nodeResolver: Node): XPathNSResolver;\n createProcessingInstruction(target: string, data: string): ProcessingInstruction;\n /**\n * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.\n */\n createRange(): Range;\n /**\n * Creates a text string from the specified value.\n * @param data String that specifies the nodeValue property of the text node.\n */\n createTextNode(data: string): Text;\n createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;\n createTouchList(...touches: Touch[]): TouchList;\n /**\n * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.\n * @param filter A custom NodeFilter function to use.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;\n /**\n * Returns the element for the specified x coordinate and the specified y coordinate.\n * @param x The x-offset\n * @param y The y-offset\n */\n elementFromPoint(x: number, y: number): Element;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n /**\n * Executes a command on the current document, current selection, or the given range.\n * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.\n * @param showUI Display the user interface, defaults to false.\n * @param value Value to assign.\n */\n execCommand(commandId: string, showUI?: boolean, value?: any): boolean;\n /**\n * Displays help information for the given command identifier.\n * @param commandId Displays help information for the given command identifier.\n */\n execCommandShowHelp(commandId: string): boolean;\n exitFullscreen(): void;\n exitPointerLock(): void;\n /**\n * Causes the element to receive the focus and executes the code specified by the onfocus event.\n */\n focus(): void;\n /**\n * Returns a reference to the first object with the specified value of the ID or NAME attribute.\n * @param elementId String that specifies the ID value. Case-insensitive.\n */\n getElementById(elementId: string): HTMLElement | null;\n getElementsByClassName(classNames: string): HTMLCollectionOf;\n /**\n * Gets a collection of objects based on the value of the NAME or ID attribute.\n * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.\n */\n getElementsByName(elementName: string): NodeListOf;\n /**\n * Retrieves a collection of objects based on the specified element name.\n * @param name Specifies the name of an element.\n */\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n /**\n * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.\n */\n getSelection(): Selection;\n /**\n * Gets a value indicating whether the object currently has focus.\n */\n hasFocus(): boolean;\n importNode(importedNode: T, deep: boolean): T;\n msElementsFromPoint(x: number, y: number): NodeListOf;\n msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf;\n /**\n * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.\n * @param url Specifies a MIME type for the document.\n * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.\n * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, \"fullscreen=yes, toolbar=yes\"). The following values are supported.\n * @param replace Specifies whether the existing entry for the document is replaced in the history list.\n */\n open(url?: string, name?: string, features?: string, replace?: boolean): Document;\n /**\n * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.\n * @param commandId Specifies a command identifier.\n */\n queryCommandEnabled(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandIndeterm(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates the current state of the command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandState(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the current command is supported on the current range.\n * @param commandId Specifies a command identifier.\n */\n queryCommandSupported(commandId: string): boolean;\n /**\n * Retrieves the string associated with a command.\n * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.\n */\n queryCommandText(commandId: string): string;\n /**\n * Returns the current value of the document, range, or current selection for the given command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandValue(commandId: string): string;\n releaseEvents(): void;\n /**\n * Allows updating the print settings for the page.\n */\n updateSettings(): void;\n webkitCancelFullScreen(): void;\n webkitExitFullscreen(): void;\n /**\n * Writes one or more HTML expressions to a document in the specified window.\n * @param content Specifies the text and HTML tags to write.\n */\n write(...content: string[]): void;\n /**\n * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.\n * @param content The text and HTML tags to write.\n */\n writeln(...content: string[]): void;\n addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Document: {\n prototype: Document;\n new(): Document;\n};\n\ninterface DocumentFragment extends Node, NodeSelector, ParentNode {\n getElementById(elementId: string): HTMLElement | null;\n}\n\ndeclare var DocumentFragment: {\n prototype: DocumentFragment;\n new(): DocumentFragment;\n};\n\ninterface DocumentType extends Node, ChildNode {\n readonly entities: NamedNodeMap;\n readonly internalSubset: string | null;\n readonly name: string;\n readonly notations: NamedNodeMap;\n readonly publicId: string;\n readonly systemId: string;\n}\n\ndeclare var DocumentType: {\n prototype: DocumentType;\n new(): DocumentType;\n};\n\ninterface DOMError {\n readonly name: string;\n toString(): string;\n}\n\ndeclare var DOMError: {\n prototype: DOMError;\n new(): DOMError;\n};\n\ninterface DOMException {\n readonly code: number;\n readonly message: string;\n readonly name: string;\n toString(): string;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n}\n\ndeclare var DOMException: {\n prototype: DOMException;\n new(message?: string, name?: string): DOMException;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n};\n\ninterface DOMImplementation {\n createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document;\n createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;\n createHTMLDocument(title: string): Document;\n hasFeature(feature: string | null, version: string | null): boolean;\n}\n\ndeclare var DOMImplementation: {\n prototype: DOMImplementation;\n new(): DOMImplementation;\n};\n\ninterface DOMParser {\n parseFromString(source: string, mimeType: string): Document;\n}\n\ndeclare var DOMParser: {\n prototype: DOMParser;\n new(): DOMParser;\n};\n\ninterface DOMSettableTokenList extends DOMTokenList {\n value: string;\n}\n\ndeclare var DOMSettableTokenList: {\n prototype: DOMSettableTokenList;\n new(): DOMSettableTokenList;\n};\n\ninterface DOMStringList {\n readonly length: number;\n contains(str: string): boolean;\n item(index: number): string | null;\n [index: number]: string;\n}\n\ndeclare var DOMStringList: {\n prototype: DOMStringList;\n new(): DOMStringList;\n};\n\ninterface DOMStringMap {\n [name: string]: string | undefined;\n}\n\ndeclare var DOMStringMap: {\n prototype: DOMStringMap;\n new(): DOMStringMap;\n};\n\ninterface DOMTokenList {\n readonly length: number;\n add(...token: string[]): void;\n contains(token: string): boolean;\n item(index: number): string;\n remove(...token: string[]): void;\n toggle(token: string, force?: boolean): boolean;\n toString(): string;\n [index: number]: string;\n}\n\ndeclare var DOMTokenList: {\n prototype: DOMTokenList;\n new(): DOMTokenList;\n};\n\ninterface DragEvent extends MouseEvent {\n readonly dataTransfer: DataTransfer;\n initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void;\n msConvertURL(file: File, targetType: string, targetURL?: string): void;\n}\n\ndeclare var DragEvent: {\n prototype: DragEvent;\n new(type: \"drag\" | \"dragend\" | \"dragenter\" | \"dragexit\" | \"dragleave\" | \"dragover\" | \"dragstart\" | \"drop\", dragEventInit?: { dataTransfer?: DataTransfer }): DragEvent;\n};\n\ninterface DynamicsCompressorNode extends AudioNode {\n readonly attack: AudioParam;\n readonly knee: AudioParam;\n readonly ratio: AudioParam;\n readonly reduction: number;\n readonly release: AudioParam;\n readonly threshold: AudioParam;\n}\n\ndeclare var DynamicsCompressorNode: {\n prototype: DynamicsCompressorNode;\n new(): DynamicsCompressorNode;\n};\n\ninterface ElementEventMap extends GlobalEventHandlersEventMap {\n \"ariarequest\": Event;\n \"command\": Event;\n \"gotpointercapture\": PointerEvent;\n \"lostpointercapture\": PointerEvent;\n \"MSGestureChange\": MSGestureEvent;\n \"MSGestureDoubleTap\": MSGestureEvent;\n \"MSGestureEnd\": MSGestureEvent;\n \"MSGestureHold\": MSGestureEvent;\n \"MSGestureStart\": MSGestureEvent;\n \"MSGestureTap\": MSGestureEvent;\n \"MSGotPointerCapture\": MSPointerEvent;\n \"MSInertiaStart\": MSGestureEvent;\n \"MSLostPointerCapture\": MSPointerEvent;\n \"MSPointerCancel\": MSPointerEvent;\n \"MSPointerDown\": MSPointerEvent;\n \"MSPointerEnter\": MSPointerEvent;\n \"MSPointerLeave\": MSPointerEvent;\n \"MSPointerMove\": MSPointerEvent;\n \"MSPointerOut\": MSPointerEvent;\n \"MSPointerOver\": MSPointerEvent;\n \"MSPointerUp\": MSPointerEvent;\n \"touchcancel\": TouchEvent;\n \"touchend\": TouchEvent;\n \"touchmove\": TouchEvent;\n \"touchstart\": TouchEvent;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Element extends Node, GlobalEventHandlers, ElementTraversal, NodeSelector, ChildNode, ParentNode {\n readonly classList: DOMTokenList;\n className: string;\n readonly clientHeight: number;\n readonly clientLeft: number;\n readonly clientTop: number;\n readonly clientWidth: number;\n id: string;\n innerHTML: string;\n msContentZoomFactor: number;\n readonly msRegionOverflow: string;\n onariarequest: (this: Element, ev: Event) => any;\n oncommand: (this: Element, ev: Event) => any;\n ongotpointercapture: (this: Element, ev: PointerEvent) => any;\n onlostpointercapture: (this: Element, ev: PointerEvent) => any;\n onmsgesturechange: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturedoubletap: (this: Element, ev: MSGestureEvent) => any;\n onmsgestureend: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturehold: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturestart: (this: Element, ev: MSGestureEvent) => any;\n onmsgesturetap: (this: Element, ev: MSGestureEvent) => any;\n onmsgotpointercapture: (this: Element, ev: MSPointerEvent) => any;\n onmsinertiastart: (this: Element, ev: MSGestureEvent) => any;\n onmslostpointercapture: (this: Element, ev: MSPointerEvent) => any;\n onmspointercancel: (this: Element, ev: MSPointerEvent) => any;\n onmspointerdown: (this: Element, ev: MSPointerEvent) => any;\n onmspointerenter: (this: Element, ev: MSPointerEvent) => any;\n onmspointerleave: (this: Element, ev: MSPointerEvent) => any;\n onmspointermove: (this: Element, ev: MSPointerEvent) => any;\n onmspointerout: (this: Element, ev: MSPointerEvent) => any;\n onmspointerover: (this: Element, ev: MSPointerEvent) => any;\n onmspointerup: (this: Element, ev: MSPointerEvent) => any;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n onwebkitfullscreenchange: (this: Element, ev: Event) => any;\n onwebkitfullscreenerror: (this: Element, ev: Event) => any;\n outerHTML: string;\n readonly prefix: string | null;\n readonly scrollHeight: number;\n scrollLeft: number;\n scrollTop: number;\n readonly scrollWidth: number;\n readonly tagName: string;\n readonly assignedSlot: HTMLSlotElement | null;\n slot: string;\n readonly shadowRoot: ShadowRoot | null;\n getAttribute(name: string): string | null;\n getAttributeNode(name: string): Attr | null;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null;\n getAttributeNS(namespaceURI: string, localName: string): string;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n hasAttribute(name: string): boolean;\n hasAttributeNS(namespaceURI: string, localName: string): boolean;\n msGetRegionContent(): MSRangeCollection;\n msGetUntransformedBounds(): ClientRect;\n msMatchesSelector(selectors: string): boolean;\n msReleasePointerCapture(pointerId: number): void;\n msSetPointerCapture(pointerId: number): void;\n msZoomTo(args: MsZoomToOptions): void;\n releasePointerCapture(pointerId: number): void;\n removeAttribute(qualifiedName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n removeAttributeNS(namespaceURI: string, localName: string): void;\n requestFullscreen(): void;\n requestPointerLock(): void;\n setAttribute(name: string, value: string): void;\n setAttributeNode(newAttr: Attr): Attr;\n setAttributeNodeNS(newAttr: Attr): Attr;\n setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;\n setPointerCapture(pointerId: number): void;\n webkitMatchesSelector(selectors: string): boolean;\n webkitRequestFullscreen(): void;\n webkitRequestFullScreen(): void;\n getElementsByClassName(classNames: string): NodeListOf;\n matches(selector: string): boolean;\n closest(selector: K): HTMLElementTagNameMap[K] | null;\n closest(selector: K): SVGElementTagNameMap[K] | null;\n closest(selector: string): Element | null;\n scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;\n scroll(options?: ScrollToOptions): void;\n scroll(x: number, y: number): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x: number, y: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x: number, y: number): void;\n insertAdjacentElement(position: InsertPosition, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: InsertPosition, html: string): void;\n insertAdjacentText(where: InsertPosition, text: string): void;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Element: {\n prototype: Element;\n new(): Element;\n};\n\ninterface ErrorEvent extends Event {\n readonly colno: number;\n readonly error: any;\n readonly filename: string;\n readonly lineno: number;\n readonly message: string;\n initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void;\n}\n\ndeclare var ErrorEvent: {\n prototype: ErrorEvent;\n new(type: string, errorEventInitDict?: ErrorEventInit): ErrorEvent;\n};\n\ninterface Event {\n readonly bubbles: boolean;\n readonly cancelable: boolean;\n cancelBubble: boolean;\n readonly currentTarget: EventTarget;\n readonly defaultPrevented: boolean;\n readonly eventPhase: number;\n readonly isTrusted: boolean;\n returnValue: boolean;\n readonly srcElement: Element | null;\n readonly target: EventTarget;\n readonly timeStamp: number;\n readonly type: string;\n readonly scoped: boolean;\n initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean): void;\n preventDefault(): void;\n stopImmediatePropagation(): void;\n stopPropagation(): void;\n deepPath(): EventTarget[];\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n}\n\ndeclare var Event: {\n prototype: Event;\n new(typeArg: string, eventInitDict?: EventInit): Event;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n};\n\ninterface EventTarget {\n addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n dispatchEvent(evt: Event): boolean;\n removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var EventTarget: {\n prototype: EventTarget;\n new(): EventTarget;\n};\n\ninterface EXT_frag_depth {\n}\n\ndeclare var EXT_frag_depth: {\n prototype: EXT_frag_depth;\n new(): EXT_frag_depth;\n};\n\ninterface EXT_texture_filter_anisotropic {\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n}\n\ndeclare var EXT_texture_filter_anisotropic: {\n prototype: EXT_texture_filter_anisotropic;\n new(): EXT_texture_filter_anisotropic;\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n};\n\ninterface ExtensionScriptApis {\n extensionIdToShortId(extensionId: string): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean): void;\n genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n getExtensionId(): string;\n registerGenericFunctionCallbackHandler(callbackHandler: any): void;\n registerGenericPersistentCallbackHandler(callbackHandler: any): void;\n}\n\ndeclare var ExtensionScriptApis: {\n prototype: ExtensionScriptApis;\n new(): ExtensionScriptApis;\n};\n\ninterface External {\n}\n\ndeclare var External: {\n prototype: External;\n new(): External;\n};\n\ninterface File extends Blob {\n readonly lastModifiedDate: Date;\n readonly name: string;\n readonly webkitRelativePath: string;\n readonly lastModified: number;\n}\n\ndeclare var File: {\n prototype: File;\n new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;\n};\n\ninterface FileList {\n readonly length: number;\n item(index: number): File;\n [index: number]: File;\n}\n\ndeclare var FileList: {\n prototype: FileList;\n new(): FileList;\n};\n\ninterface FileReader extends EventTarget, MSBaseReader {\n readonly error: DOMError;\n readAsArrayBuffer(blob: Blob): void;\n readAsBinaryString(blob: Blob): void;\n readAsDataURL(blob: Blob): void;\n readAsText(blob: Blob, encoding?: string): void;\n addEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: FileReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var FileReader: {\n prototype: FileReader;\n new(): FileReader;\n};\n\ninterface FocusEvent extends UIEvent {\n readonly relatedTarget: EventTarget;\n initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;\n}\n\ndeclare var FocusEvent: {\n prototype: FocusEvent;\n new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent;\n};\n\ninterface FocusNavigationEvent extends Event {\n readonly navigationReason: NavigationReason;\n readonly originHeight: number;\n readonly originLeft: number;\n readonly originTop: number;\n readonly originWidth: number;\n requestFocus(): void;\n}\n\ndeclare var FocusNavigationEvent: {\n prototype: FocusNavigationEvent;\n new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent;\n};\n\ninterface FormData {\n append(name: string, value: string | Blob, fileName?: string): void;\n delete(name: string): void;\n get(name: string): FormDataEntryValue | null;\n getAll(name: string): FormDataEntryValue[];\n has(name: string): boolean;\n set(name: string, value: string | Blob, fileName?: string): void;\n}\n\ndeclare var FormData: {\n prototype: FormData;\n new (form?: HTMLFormElement): FormData;\n};\n\ninterface GainNode extends AudioNode {\n readonly gain: AudioParam;\n}\n\ndeclare var GainNode: {\n prototype: GainNode;\n new(): GainNode;\n};\n\ninterface Gamepad {\n readonly axes: number[];\n readonly buttons: GamepadButton[];\n readonly connected: boolean;\n readonly id: string;\n readonly index: number;\n readonly mapping: string;\n readonly timestamp: number;\n}\n\ndeclare var Gamepad: {\n prototype: Gamepad;\n new(): Gamepad;\n};\n\ninterface GamepadButton {\n readonly pressed: boolean;\n readonly value: number;\n}\n\ndeclare var GamepadButton: {\n prototype: GamepadButton;\n new(): GamepadButton;\n};\n\ninterface GamepadEvent extends Event {\n readonly gamepad: Gamepad;\n}\n\ndeclare var GamepadEvent: {\n prototype: GamepadEvent;\n new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent;\n};\n\ninterface Geolocation {\n clearWatch(watchId: number): void;\n getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;\n watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;\n}\n\ndeclare var Geolocation: {\n prototype: Geolocation;\n new(): Geolocation;\n};\n\ninterface HashChangeEvent extends Event {\n readonly newURL: string | null;\n readonly oldURL: string | null;\n}\n\ndeclare var HashChangeEvent: {\n prototype: HashChangeEvent;\n new(typeArg: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\n};\n\ninterface Headers {\n append(name: string, value: string): void;\n delete(name: string): void;\n forEach(callback: ForEachCallback): void;\n get(name: string): string | null;\n has(name: string): boolean;\n set(name: string, value: string): void;\n}\n\ndeclare var Headers: {\n prototype: Headers;\n new(init?: HeadersInit): Headers;\n};\n\ninterface History {\n readonly length: number;\n readonly state: any;\n scrollRestoration: ScrollRestoration;\n back(): void;\n forward(): void;\n go(delta?: number): void;\n pushState(data: any, title: string, url?: string | null): void;\n replaceState(data: any, title: string, url?: string | null): void;\n}\n\ndeclare var History: {\n prototype: History;\n new(): History;\n};\n\ninterface HTMLAllCollection {\n readonly length: number;\n item(nameOrIndex?: string): HTMLCollection | Element | null;\n namedItem(name: string): HTMLCollection | Element | null;\n [index: number]: Element;\n}\n\ndeclare var HTMLAllCollection: {\n prototype: HTMLAllCollection;\n new(): HTMLAllCollection;\n};\n\ninterface HTMLAnchorElement extends HTMLElement {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n coords: string;\n download: string;\n /**\n * Contains the anchor portion of the URL including the hash sign (#).\n */\n hash: string;\n /**\n * Contains the hostname and port values of the URL.\n */\n host: string;\n /**\n * Contains the hostname of a URL.\n */\n hostname: string;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n Methods: string;\n readonly mimeType: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n name: string;\n readonly nameProp: string;\n /**\n * Contains the pathname of the URL.\n */\n pathname: string;\n /**\n * Sets or retrieves the port number associated with a URL.\n */\n port: string;\n /**\n * Contains the protocol of the URL.\n */\n protocol: string;\n readonly protocolLong: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rev: string;\n /**\n * Sets or retrieves the substring of the href property that follows the question mark.\n */\n search: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n type: string;\n urn: string;\n /**\n * Returns a string representation of an object.\n */\n toString(): string;\n addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n};\n\ninterface HTMLAppletElement extends HTMLElement {\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Gets or sets the optional alternative HTML script to execute if the object fails to load.\n */\n altHtml: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n archive: string;\n /**\n * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.\n */\n readonly BaseHref: string;\n border: string;\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n codeBase: string;\n /**\n * Sets or retrieves the Internet media type for the code associated with the object.\n */\n codeType: string;\n /**\n * Address of a pointer to the document this page or frame contains. If there is no document, then null will be returned.\n */\n readonly contentDocument: Document;\n /**\n * Sets or retrieves the URL that references the data of the object.\n */\n data: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own declare functionality for the object.\n */\n declare: boolean;\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hspace: number;\n /**\n * Sets or retrieves the shape of the object.\n */\n name: string;\n object: string | null;\n /**\n * Sets or retrieves a message to be displayed while an object is loading.\n */\n standby: string;\n /**\n * Returns the content type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n vspace: number;\n width: number;\n addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAppletElement: {\n prototype: HTMLAppletElement;\n new(): HTMLAppletElement;\n};\n\ninterface HTMLAreaElement extends HTMLElement {\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n coords: string;\n download: string;\n /**\n * Sets or retrieves the subsection of the href property that follows the number sign (#).\n */\n hash: string;\n /**\n * Sets or retrieves the hostname and port number of the location or URL.\n */\n host: string;\n /**\n * Sets or retrieves the host name part of the location or URL.\n */\n hostname: string;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or gets whether clicks in this region cause action.\n */\n noHref: boolean;\n /**\n * Sets or retrieves the file name or path specified by the object.\n */\n pathname: string;\n /**\n * Sets or retrieves the port number associated with a URL.\n */\n port: string;\n /**\n * Sets or retrieves the protocol portion of a URL.\n */\n protocol: string;\n rel: string;\n /**\n * Sets or retrieves the substring of the href property that follows the question mark.\n */\n search: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Returns a string representation of an object.\n */\n toString(): string;\n addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAreaElement: {\n prototype: HTMLAreaElement;\n new(): HTMLAreaElement;\n};\n\ninterface HTMLAreasCollection extends HTMLCollectionBase {\n}\n\ndeclare var HTMLAreasCollection: {\n prototype: HTMLAreasCollection;\n new(): HTMLAreasCollection;\n};\n\ninterface HTMLAudioElement extends HTMLMediaElement {\n addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAudioElement: {\n prototype: HTMLAudioElement;\n new(): HTMLAudioElement;\n};\n\ninterface HTMLBaseElement extends HTMLElement {\n /**\n * Gets or sets the baseline URL on which relative links are based.\n */\n href: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseElement: {\n prototype: HTMLBaseElement;\n new(): HTMLBaseElement;\n};\n\ninterface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n face: string;\n /**\n * Sets or retrieves the font size of the object.\n */\n size: number;\n addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseFontElement: {\n prototype: HTMLBaseFontElement;\n new(): HTMLBaseFontElement;\n};\n\ninterface HTMLBodyElementEventMap extends HTMLElementEventMap {\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"load\": Event;\n \"message\": MessageEvent;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"popstate\": PopStateEvent;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"storage\": StorageEvent;\n \"unload\": Event;\n}\n\ninterface HTMLBodyElement extends HTMLElement {\n aLink: any;\n background: string;\n bgColor: any;\n bgProperties: string;\n link: any;\n noWrap: boolean;\n onafterprint: (this: HTMLBodyElement, ev: Event) => any;\n onbeforeprint: (this: HTMLBodyElement, ev: Event) => any;\n onbeforeunload: (this: HTMLBodyElement, ev: BeforeUnloadEvent) => any;\n onhashchange: (this: HTMLBodyElement, ev: HashChangeEvent) => any;\n onmessage: (this: HTMLBodyElement, ev: MessageEvent) => any;\n onoffline: (this: HTMLBodyElement, ev: Event) => any;\n ononline: (this: HTMLBodyElement, ev: Event) => any;\n onorientationchange: (this: HTMLBodyElement, ev: Event) => any;\n onpagehide: (this: HTMLBodyElement, ev: PageTransitionEvent) => any;\n onpageshow: (this: HTMLBodyElement, ev: PageTransitionEvent) => any;\n onpopstate: (this: HTMLBodyElement, ev: PopStateEvent) => any;\n onresize: (this: HTMLBodyElement, ev: UIEvent) => any;\n onstorage: (this: HTMLBodyElement, ev: StorageEvent) => any;\n onunload: (this: HTMLBodyElement, ev: Event) => any;\n text: any;\n vLink: any;\n addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBodyElement: {\n prototype: HTMLBodyElement;\n new(): HTMLBodyElement;\n};\n\ninterface HTMLBRElement extends HTMLElement {\n /**\n * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.\n */\n clear: string;\n addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBRElement: {\n prototype: HTMLBRElement;\n new(): HTMLBRElement;\n};\n\ninterface HTMLButtonElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: string;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n status: any;\n /**\n * Gets the classification and default behavior of the button.\n */\n type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the default or selected value of the control.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLButtonElement: {\n prototype: HTMLButtonElement;\n new(): HTMLButtonElement;\n};\n\ninterface HTMLCanvasElement extends HTMLElement {\n /**\n * Gets or sets the height of a canvas element on a document.\n */\n height: number;\n /**\n * Gets or sets the width of a canvas element on a document.\n */\n width: number;\n /**\n * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.\n * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext(\"2d\"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext(\"experimental-webgl\");\n */\n getContext(contextId: \"2d\", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null;\n getContext(contextId: \"webgl\" | \"experimental-webgl\", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;\n getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;\n /**\n * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.\n */\n msToBlob(): Blob;\n /**\n * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.\n * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.\n */\n toDataURL(type?: string, ...args: any[]): string;\n toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void;\n addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLCanvasElement: {\n prototype: HTMLCanvasElement;\n new(): HTMLCanvasElement;\n};\n\ninterface HTMLCollectionBase {\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Retrieves an object from various collections.\n */\n item(index: number): Element;\n [index: number]: Element;\n}\n\ninterface HTMLCollection extends HTMLCollectionBase {\n /**\n * Retrieves a select object or an object from an options collection.\n */\n namedItem(name: string): Element | null;\n}\n\ndeclare var HTMLCollection: {\n prototype: HTMLCollection;\n new(): HTMLCollection;\n};\n\ninterface HTMLDataElement extends HTMLElement {\n value: string;\n addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataElement: {\n prototype: HTMLDataElement;\n new(): HTMLDataElement;\n};\n\ninterface HTMLDataListElement extends HTMLElement {\n options: HTMLCollectionOf;\n addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataListElement: {\n prototype: HTMLDataListElement;\n new(): HTMLDataListElement;\n};\n\ninterface HTMLDirectoryElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDirectoryElement: {\n prototype: HTMLDirectoryElement;\n new(): HTMLDirectoryElement;\n};\n\ninterface HTMLDivElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n noWrap: boolean;\n addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDivElement: {\n prototype: HTMLDivElement;\n new(): HTMLDivElement;\n};\n\ninterface HTMLDListElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDListElement: {\n prototype: HTMLDListElement;\n new(): HTMLDListElement;\n};\n\ninterface HTMLDocument extends Document {\n addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDocument: {\n prototype: HTMLDocument;\n new(): HTMLDocument;\n};\n\ninterface HTMLElementEventMap extends ElementEventMap {\n \"abort\": UIEvent;\n \"activate\": UIEvent;\n \"beforeactivate\": UIEvent;\n \"beforecopy\": ClipboardEvent;\n \"beforecut\": ClipboardEvent;\n \"beforedeactivate\": UIEvent;\n \"beforepaste\": ClipboardEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"copy\": ClipboardEvent;\n \"cuechange\": Event;\n \"cut\": ClipboardEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": UIEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": MediaStreamErrorEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": UIEvent;\n \"MSManipulationStateChanged\": MSManipulationEvent;\n \"paste\": ClipboardEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface HTMLElement extends Element {\n accessKey: string;\n readonly children: HTMLCollection;\n contentEditable: string;\n readonly dataset: DOMStringMap;\n dir: string;\n draggable: boolean;\n hidden: boolean;\n hideFocus: boolean;\n innerText: string;\n readonly isContentEditable: boolean;\n lang: string;\n readonly offsetHeight: number;\n readonly offsetLeft: number;\n readonly offsetParent: Element;\n readonly offsetTop: number;\n readonly offsetWidth: number;\n onabort: (this: HTMLElement, ev: UIEvent) => any;\n onactivate: (this: HTMLElement, ev: UIEvent) => any;\n onbeforeactivate: (this: HTMLElement, ev: UIEvent) => any;\n onbeforecopy: (this: HTMLElement, ev: ClipboardEvent) => any;\n onbeforecut: (this: HTMLElement, ev: ClipboardEvent) => any;\n onbeforedeactivate: (this: HTMLElement, ev: UIEvent) => any;\n onbeforepaste: (this: HTMLElement, ev: ClipboardEvent) => any;\n onblur: (this: HTMLElement, ev: FocusEvent) => any;\n oncanplay: (this: HTMLElement, ev: Event) => any;\n oncanplaythrough: (this: HTMLElement, ev: Event) => any;\n onchange: (this: HTMLElement, ev: Event) => any;\n onclick: (this: HTMLElement, ev: MouseEvent) => any;\n oncontextmenu: (this: HTMLElement, ev: PointerEvent) => any;\n oncopy: (this: HTMLElement, ev: ClipboardEvent) => any;\n oncuechange: (this: HTMLElement, ev: Event) => any;\n oncut: (this: HTMLElement, ev: ClipboardEvent) => any;\n ondblclick: (this: HTMLElement, ev: MouseEvent) => any;\n ondeactivate: (this: HTMLElement, ev: UIEvent) => any;\n ondrag: (this: HTMLElement, ev: DragEvent) => any;\n ondragend: (this: HTMLElement, ev: DragEvent) => any;\n ondragenter: (this: HTMLElement, ev: DragEvent) => any;\n ondragleave: (this: HTMLElement, ev: DragEvent) => any;\n ondragover: (this: HTMLElement, ev: DragEvent) => any;\n ondragstart: (this: HTMLElement, ev: DragEvent) => any;\n ondrop: (this: HTMLElement, ev: DragEvent) => any;\n ondurationchange: (this: HTMLElement, ev: Event) => any;\n onemptied: (this: HTMLElement, ev: Event) => any;\n onended: (this: HTMLElement, ev: MediaStreamErrorEvent) => any;\n onerror: (this: HTMLElement, ev: ErrorEvent) => any;\n onfocus: (this: HTMLElement, ev: FocusEvent) => any;\n oninput: (this: HTMLElement, ev: Event) => any;\n oninvalid: (this: HTMLElement, ev: Event) => any;\n onkeydown: (this: HTMLElement, ev: KeyboardEvent) => any;\n onkeypress: (this: HTMLElement, ev: KeyboardEvent) => any;\n onkeyup: (this: HTMLElement, ev: KeyboardEvent) => any;\n onload: (this: HTMLElement, ev: Event) => any;\n onloadeddata: (this: HTMLElement, ev: Event) => any;\n onloadedmetadata: (this: HTMLElement, ev: Event) => any;\n onloadstart: (this: HTMLElement, ev: Event) => any;\n onmousedown: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseenter: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseleave: (this: HTMLElement, ev: MouseEvent) => any;\n onmousemove: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseout: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseover: (this: HTMLElement, ev: MouseEvent) => any;\n onmouseup: (this: HTMLElement, ev: MouseEvent) => any;\n onmousewheel: (this: HTMLElement, ev: WheelEvent) => any;\n onmscontentzoom: (this: HTMLElement, ev: UIEvent) => any;\n onmsmanipulationstatechanged: (this: HTMLElement, ev: MSManipulationEvent) => any;\n onpaste: (this: HTMLElement, ev: ClipboardEvent) => any;\n onpause: (this: HTMLElement, ev: Event) => any;\n onplay: (this: HTMLElement, ev: Event) => any;\n onplaying: (this: HTMLElement, ev: Event) => any;\n onprogress: (this: HTMLElement, ev: ProgressEvent) => any;\n onratechange: (this: HTMLElement, ev: Event) => any;\n onreset: (this: HTMLElement, ev: Event) => any;\n onscroll: (this: HTMLElement, ev: UIEvent) => any;\n onseeked: (this: HTMLElement, ev: Event) => any;\n onseeking: (this: HTMLElement, ev: Event) => any;\n onselect: (this: HTMLElement, ev: UIEvent) => any;\n onselectstart: (this: HTMLElement, ev: Event) => any;\n onstalled: (this: HTMLElement, ev: Event) => any;\n onsubmit: (this: HTMLElement, ev: Event) => any;\n onsuspend: (this: HTMLElement, ev: Event) => any;\n ontimeupdate: (this: HTMLElement, ev: Event) => any;\n onvolumechange: (this: HTMLElement, ev: Event) => any;\n onwaiting: (this: HTMLElement, ev: Event) => any;\n outerText: string;\n spellcheck: boolean;\n readonly style: CSSStyleDeclaration;\n tabIndex: number;\n title: string;\n blur(): void;\n click(): void;\n dragDrop(): boolean;\n focus(): void;\n msGetInputContext(): MSInputMethodContext;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLElement: {\n prototype: HTMLElement;\n new(): HTMLElement;\n};\n\ninterface HTMLEmbedElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hidden: any;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Retrieves the palette used for the embedded document.\n */\n readonly palette: string;\n /**\n * Retrieves the URL of the plug-in used to view an embedded document.\n */\n readonly pluginspage: string;\n readonly readyState: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the height and width units of the embed object.\n */\n units: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLEmbedElement: {\n prototype: HTMLEmbedElement;\n new(): HTMLEmbedElement;\n};\n\ninterface HTMLFieldSetElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n name: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFieldSetElement: {\n prototype: HTMLFieldSetElement;\n new(): HTMLFieldSetElement;\n};\n\ninterface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n face: string;\n addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFontElement: {\n prototype: HTMLFontElement;\n new(): HTMLFontElement;\n};\n\ninterface HTMLFormControlsCollection extends HTMLCollectionBase {\n namedItem(name: string): HTMLCollection | Element | null;\n}\n\ndeclare var HTMLFormControlsCollection: {\n prototype: HTMLFormControlsCollection;\n new(): HTMLFormControlsCollection;\n};\n\ninterface HTMLFormElement extends HTMLElement {\n /**\n * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.\n */\n acceptCharset: string;\n /**\n * Sets or retrieves the URL to which the form content is sent for processing.\n */\n action: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Retrieves a collection, in source order, of all controls in a given form.\n */\n readonly elements: HTMLFormControlsCollection;\n /**\n * Sets or retrieves the MIME encoding for the form.\n */\n encoding: string;\n /**\n * Sets or retrieves the encoding type for the form.\n */\n enctype: string;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Sets or retrieves how to send the form data to the server.\n */\n method: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Designates a form that is not validated when submitted.\n */\n noValidate: boolean;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a form object or an object from an elements collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): any;\n /**\n * Retrieves a form object or an object from an elements collection.\n */\n namedItem(name: string): any;\n /**\n * Fires when the user resets a form.\n */\n reset(): void;\n /**\n * Fires when a FORM is about to be submitted.\n */\n submit(): void;\n reportValidity(): boolean;\n reportValidity(): boolean;\n addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLFormElement: {\n prototype: HTMLFormElement;\n new(): HTMLFormElement;\n};\n\ninterface HTMLFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document;\n /**\n * Retrieves the object of the specified.\n */\n readonly contentWindow: Window;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string | number;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n name: string;\n /**\n * Sets or retrieves whether the user can resize the frame.\n */\n noResize: boolean;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string | number;\n addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameElement: {\n prototype: HTMLFrameElement;\n new(): HTMLFrameElement;\n};\n\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap {\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"load\": Event;\n \"message\": MessageEvent;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"popstate\": PopStateEvent;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"storage\": StorageEvent;\n \"unload\": Event;\n}\n\ninterface HTMLFrameSetElement extends HTMLElement {\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Sets or retrieves the frame widths of the object.\n */\n cols: string;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n name: string;\n onafterprint: (this: HTMLFrameSetElement, ev: Event) => any;\n onbeforeprint: (this: HTMLFrameSetElement, ev: Event) => any;\n onbeforeunload: (this: HTMLFrameSetElement, ev: BeforeUnloadEvent) => any;\n onhashchange: (this: HTMLFrameSetElement, ev: HashChangeEvent) => any;\n onmessage: (this: HTMLFrameSetElement, ev: MessageEvent) => any;\n onoffline: (this: HTMLFrameSetElement, ev: Event) => any;\n ononline: (this: HTMLFrameSetElement, ev: Event) => any;\n onorientationchange: (this: HTMLFrameSetElement, ev: Event) => any;\n onpagehide: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any;\n onpageshow: (this: HTMLFrameSetElement, ev: PageTransitionEvent) => any;\n onpopstate: (this: HTMLFrameSetElement, ev: PopStateEvent) => any;\n onresize: (this: HTMLFrameSetElement, ev: UIEvent) => any;\n onstorage: (this: HTMLFrameSetElement, ev: StorageEvent) => any;\n onunload: (this: HTMLFrameSetElement, ev: Event) => any;\n /**\n * Sets or retrieves the frame heights of the object.\n */\n rows: string;\n addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameSetElement: {\n prototype: HTMLFrameSetElement;\n new(): HTMLFrameSetElement;\n};\n\ninterface HTMLHeadElement extends HTMLElement {\n profile: string;\n addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadElement: {\n prototype: HTMLHeadElement;\n new(): HTMLHeadElement;\n};\n\ninterface HTMLHeadingElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n align: string;\n addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadingElement: {\n prototype: HTMLHeadingElement;\n new(): HTMLHeadingElement;\n};\n\ninterface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.\n */\n noShade: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n};\n\ninterface HTMLHtmlElement extends HTMLElement {\n /**\n * Sets or retrieves the DTD version that governs the current document.\n */\n version: string;\n addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHtmlElement: {\n prototype: HTMLHtmlElement;\n new(): HTMLHtmlElement;\n};\n\ninterface HTMLIFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLIFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n allowFullscreen: boolean;\n allowPaymentRequest: boolean;\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document;\n /**\n * Retrieves the object of the specified.\n */\n readonly contentWindow: Window;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /**\n * Sets or retrieves the horizontal margin for the object.\n */\n hspace: number;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n name: string;\n /**\n * Sets or retrieves whether the user can resize the frame.\n */\n noResize: boolean;\n readonly sandbox: DOMSettableTokenList;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Sets or retrives the content of the page that is to contain.\n */\n srcdoc: string;\n addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLIFrameElement: {\n prototype: HTMLIFrameElement;\n new(): HTMLIFrameElement;\n};\n\ninterface HTMLImageElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Retrieves whether the object is fully loaded.\n */\n readonly complete: boolean;\n crossOrigin: string | null;\n readonly currentSrc: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n hspace: number;\n /**\n * Sets or retrieves whether the image is a server-side image map.\n */\n isMap: boolean;\n /**\n * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.\n */\n longDesc: string;\n lowsrc: string;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * The original height of the image resource before sizing.\n */\n readonly naturalHeight: number;\n /**\n * The original width of the image resource before sizing.\n */\n readonly naturalWidth: number;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n readonly x: number;\n readonly y: number;\n msGetAsCastingSource(): any;\n addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLImageElement: {\n prototype: HTMLImageElement;\n new(): HTMLImageElement;\n};\n\ninterface HTMLInputElement extends HTMLElement {\n /**\n * Sets or retrieves a comma-separated list of content types.\n */\n accept: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n border: string;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n checked: boolean;\n /**\n * Retrieves whether the object is fully loaded.\n */\n readonly complete: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n defaultChecked: boolean;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Returns a FileList object on a file type input object.\n */\n readonly files: FileList | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: string;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n hspace: number;\n indeterminate: boolean;\n /**\n * Specifies the ID of a pre-defined datalist of options for an input element.\n */\n readonly list: HTMLElement;\n /**\n * Defines the maximum acceptable value for an input element with type=\"number\".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.\n */\n max: string;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n /**\n * Defines the minimum acceptable value for an input element with type=\"number\". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.\n */\n min: string;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a string containing a regular expression that the user's input must match.\n */\n pattern: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n selectionDirection: string;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number;\n size: number;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n status: boolean;\n /**\n * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.\n */\n step: string;\n /**\n * Returns the content type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns the value of the data at the cursor's current position.\n */\n value: string;\n valueAsDate: Date;\n /**\n * Returns the input field value as a number.\n */\n valueAsNumber: number;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n vspace: number;\n webkitdirectory: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n minLength: number;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Makes the selection equal to the current object.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n /**\n * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.\n * @param n Value to decrement the value by.\n */\n stepDown(n?: number): void;\n /**\n * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.\n * @param n Value to increment the value by.\n */\n stepUp(n?: number): void;\n addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\n};\n\ninterface HTMLLabelElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the object to which the given label object is assigned.\n */\n htmlFor: string;\n readonly control: HTMLInputElement | null;\n addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLabelElement: {\n prototype: HTMLLabelElement;\n new(): HTMLLabelElement;\n};\n\ninterface HTMLLegendElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n align: string;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLegendElement: {\n prototype: HTMLLegendElement;\n new(): HTMLLegendElement;\n};\n\ninterface HTMLLIElement extends HTMLElement {\n type: string;\n /**\n * Sets or retrieves the value of a list item.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\n};\n\ninterface HTMLLinkElement extends HTMLElement, LinkStyle {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n disabled: boolean;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rev: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n import?: Document;\n integrity: string;\n addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLinkElement: {\n prototype: HTMLLinkElement;\n new(): HTMLLinkElement;\n};\n\ninterface HTMLMapElement extends HTMLElement {\n /**\n * Retrieves a collection of the area objects defined for the given map object.\n */\n readonly areas: HTMLAreasCollection;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMapElement: {\n prototype: HTMLMapElement;\n new(): HTMLMapElement;\n};\n\ninterface HTMLMarqueeElementEventMap extends HTMLElementEventMap {\n \"bounce\": Event;\n \"finish\": Event;\n \"start\": Event;\n}\n\ninterface HTMLMarqueeElement extends HTMLElement {\n behavior: string;\n bgColor: any;\n direction: string;\n height: string;\n hspace: number;\n loop: number;\n onbounce: (this: HTMLMarqueeElement, ev: Event) => any;\n onfinish: (this: HTMLMarqueeElement, ev: Event) => any;\n onstart: (this: HTMLMarqueeElement, ev: Event) => any;\n scrollAmount: number;\n scrollDelay: number;\n trueSpeed: boolean;\n vspace: number;\n width: string;\n start(): void;\n stop(): void;\n addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMarqueeElement: {\n prototype: HTMLMarqueeElement;\n new(): HTMLMarqueeElement;\n};\n\ninterface HTMLMediaElementEventMap extends HTMLElementEventMap {\n \"encrypted\": MediaEncryptedEvent;\n \"msneedkey\": MSMediaKeyNeededEvent;\n}\n\ninterface HTMLMediaElement extends HTMLElement {\n /**\n * Returns an AudioTrackList object with the audio tracks for a given video element.\n */\n readonly audioTracks: AudioTrackList;\n /**\n * Gets or sets a value that indicates whether to start playing the media automatically.\n */\n autoplay: boolean;\n /**\n * Gets a collection of buffered time ranges.\n */\n readonly buffered: TimeRanges;\n /**\n * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).\n */\n controls: boolean;\n crossOrigin: string | null;\n /**\n * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.\n */\n readonly currentSrc: string;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n currentTime: number;\n defaultMuted: boolean;\n /**\n * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.\n */\n defaultPlaybackRate: number;\n /**\n * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.\n */\n readonly duration: number;\n /**\n * Gets information about whether the playback has ended or not.\n */\n readonly ended: boolean;\n /**\n * Returns an object representing the current error state of the audio or video element.\n */\n readonly error: MediaError;\n /**\n * Gets or sets a flag to specify whether playback should restart after it completes.\n */\n loop: boolean;\n readonly mediaKeys: MediaKeys | null;\n /**\n * Specifies the purpose of the audio or video media, such as background audio or alerts.\n */\n msAudioCategory: string;\n /**\n * Specifies the output device id that the audio will be sent to.\n */\n msAudioDeviceType: string;\n readonly msGraphicsTrustStatus: MSGraphicsTrust;\n /**\n * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element.\n */\n readonly msKeys: MSMediaKeys;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Specifies whether or not to enable low-latency playback on the media element.\n */\n msRealTime: boolean;\n /**\n * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.\n */\n muted: boolean;\n /**\n * Gets the current network activity for the element.\n */\n readonly networkState: number;\n onencrypted: (this: HTMLMediaElement, ev: MediaEncryptedEvent) => any;\n onmsneedkey: (this: HTMLMediaElement, ev: MSMediaKeyNeededEvent) => any;\n /**\n * Gets a flag that specifies whether playback is paused.\n */\n readonly paused: boolean;\n /**\n * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.\n */\n playbackRate: number;\n /**\n * Gets TimeRanges for the current media resource that has been played.\n */\n readonly played: TimeRanges;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n preload: string;\n readyState: number;\n /**\n * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.\n */\n readonly seekable: TimeRanges;\n /**\n * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource.\n */\n readonly seeking: boolean;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcObject: MediaStream | null;\n readonly textTracks: TextTrackList;\n readonly videoTracks: VideoTrackList;\n /**\n * Gets or sets the volume level for audio portions of the media element.\n */\n volume: number;\n addTextTrack(kind: string, label?: string, language?: string): TextTrack;\n /**\n * Returns a string that specifies whether the client can play a given media resource type.\n */\n canPlayType(type: string): string;\n /**\n * Resets the audio or video object and loads a new media resource.\n */\n load(): void;\n /**\n * Clears all effects from the media pipeline.\n */\n msClearEffects(): void;\n msGetAsCastingSource(): any;\n /**\n * Inserts the specified audio effect into media pipeline.\n */\n msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n msSetMediaKeys(mediaKeys: MSMediaKeys): void;\n /**\n * Specifies the media protection manager for a given media pipeline.\n */\n msSetMediaProtectionManager(mediaProtectionManager?: any): void;\n /**\n * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.\n */\n pause(): void;\n /**\n * Loads and starts playback of a media resource.\n */\n play(): Promise;\n setMediaKeys(mediaKeys: MediaKeys | null): Promise;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMediaElement: {\n prototype: HTMLMediaElement;\n new(): HTMLMediaElement;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n};\n\ninterface HTMLMenuElement extends HTMLElement {\n compact: boolean;\n type: string;\n addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMenuElement: {\n prototype: HTMLMenuElement;\n new(): HTMLMenuElement;\n};\n\ninterface HTMLMetaElement extends HTMLElement {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n /**\n * Gets or sets meta-information to associate with httpEquiv or name.\n */\n content: string;\n /**\n * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.\n */\n httpEquiv: string;\n /**\n * Sets or retrieves the value specified in the content attribute of the meta object.\n */\n name: string;\n /**\n * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.\n */\n scheme: string;\n /**\n * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.\n */\n url: string;\n addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMetaElement: {\n prototype: HTMLMetaElement;\n new(): HTMLMetaElement;\n};\n\ninterface HTMLMeterElement extends HTMLElement {\n high: number;\n low: number;\n max: number;\n min: number;\n optimum: number;\n value: number;\n addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMeterElement: {\n prototype: HTMLMeterElement;\n new(): HTMLMeterElement;\n};\n\ninterface HTMLModElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n /**\n * Sets or retrieves the date and time of a modification to the object.\n */\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\n};\n\ninterface HTMLObjectElement extends HTMLElement, GetSVGDocument {\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Gets or sets the optional alternative HTML script to execute if the object fails to load.\n */\n altHtml: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n archive: string;\n /**\n * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.\n */\n readonly BaseHref: string;\n border: string;\n /**\n * Sets or retrieves the URL of the file containing the compiled Java class.\n */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n codeBase: string;\n /**\n * Sets or retrieves the Internet media type for the code associated with the object.\n */\n codeType: string;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document;\n /**\n * Sets or retrieves the URL that references the data of the object.\n */\n data: string;\n declare: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hspace: number;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly readyState: number;\n /**\n * Sets or retrieves a message to be displayed while an object is loading.\n */\n standby: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n typemustmatch: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\n};\n\ninterface HTMLOListElement extends HTMLElement {\n compact: boolean;\n /**\n * The starting number.\n */\n start: number;\n type: string;\n addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOListElement: {\n prototype: HTMLOListElement;\n new(): HTMLOListElement;\n};\n\ninterface HTMLOptGroupElement extends HTMLElement {\n /**\n * Sets or retrieves the status of an option.\n */\n defaultSelected: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the ordinal position of an option in a list box.\n */\n readonly index: number;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n /**\n * Sets or retrieves whether the option in the list box is the default item.\n */\n selected: boolean;\n /**\n * Sets or retrieves the text string specified by the option tag.\n */\n readonly text: string;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptGroupElement: {\n prototype: HTMLOptGroupElement;\n new(): HTMLOptGroupElement;\n};\n\ninterface HTMLOptionElement extends HTMLElement {\n /**\n * Sets or retrieves the status of an option.\n */\n defaultSelected: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the ordinal position of an option in a list box.\n */\n readonly index: number;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n /**\n * Sets or retrieves whether the option in the list box is the default item.\n */\n selected: boolean;\n /**\n * Sets or retrieves the text string specified by the option tag.\n */\n text: string;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptionElement: {\n prototype: HTMLOptionElement;\n new(): HTMLOptionElement;\n};\n\ninterface HTMLOptionsCollection extends HTMLCollectionOf {\n length: number;\n selectedIndex: number;\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number): void;\n remove(index: number): void;\n}\n\ndeclare var HTMLOptionsCollection: {\n prototype: HTMLOptionsCollection;\n new(): HTMLOptionsCollection;\n};\n\ninterface HTMLOutputElement extends HTMLElement {\n defaultValue: string;\n readonly form: HTMLFormElement | null;\n readonly htmlFor: DOMSettableTokenList;\n name: string;\n readonly type: string;\n readonly validationMessage: string;\n readonly validity: ValidityState;\n value: string;\n readonly willValidate: boolean;\n checkValidity(): boolean;\n reportValidity(): boolean;\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOutputElement: {\n prototype: HTMLOutputElement;\n new(): HTMLOutputElement;\n};\n\ninterface HTMLParagraphElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n clear: string;\n addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParagraphElement: {\n prototype: HTMLParagraphElement;\n new(): HTMLParagraphElement;\n};\n\ninterface HTMLParamElement extends HTMLElement {\n /**\n * Sets or retrieves the name of an input parameter for an element.\n */\n name: string;\n /**\n * Sets or retrieves the content type of the resource designated by the value attribute.\n */\n type: string;\n /**\n * Sets or retrieves the value of an input parameter for an element.\n */\n value: string;\n /**\n * Sets or retrieves the data type of the value attribute.\n */\n valueType: string;\n addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParamElement: {\n prototype: HTMLParamElement;\n new(): HTMLParamElement;\n};\n\ninterface HTMLPictureElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPictureElement: {\n prototype: HTMLPictureElement;\n new(): HTMLPictureElement;\n};\n\ninterface HTMLPreElement extends HTMLElement {\n /**\n * Sets or gets a value that you can use to implement your own width functionality for the object.\n */\n width: number;\n addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPreElement: {\n prototype: HTMLPreElement;\n new(): HTMLPreElement;\n};\n\ninterface HTMLProgressElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Defines the maximum, or \"done\" value for a progress element.\n */\n max: number;\n /**\n * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).\n */\n readonly position: number;\n /**\n * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLProgressElement: {\n prototype: HTMLProgressElement;\n new(): HTMLProgressElement;\n};\n\ninterface HTMLQuoteElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLQuoteElement: {\n prototype: HTMLQuoteElement;\n new(): HTMLQuoteElement;\n};\n\ninterface HTMLScriptElement extends HTMLElement {\n async: boolean;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n crossOrigin: string | null;\n /**\n * Sets or retrieves the status of the script.\n */\n defer: boolean;\n /**\n * Sets or retrieves the event for which the script is written.\n */\n event: string;\n /**\n * Sets or retrieves the object that is bound to the event script.\n */\n htmlFor: string;\n /**\n * Retrieves the URL to an external file that contains the source code or data.\n */\n src: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n /**\n * Sets or retrieves the MIME type for the associated scripting engine.\n */\n type: string;\n integrity: string;\n addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLScriptElement: {\n prototype: HTMLScriptElement;\n new(): HTMLScriptElement;\n};\n\ninterface HTMLSelectElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n length: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly options: HTMLOptionsCollection;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the index of the selected option in a select object.\n */\n selectedIndex: number;\n selectedOptions: HTMLCollectionOf;\n /**\n * Sets or retrieves the number of rows in the list box.\n */\n size: number;\n /**\n * Retrieves the type of select control based on the value of the MULTIPLE attribute.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Adds an element to the areas, controlRange, or options collection.\n * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.\n * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.\n */\n add(element: HTMLElement, before?: HTMLElement | number): void;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): any;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.\n */\n namedItem(name: string): any;\n /**\n * Removes an element from the collection.\n * @param index Number that specifies the zero-based index of the element to remove from the collection.\n */\n remove(index?: number): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLSelectElement: {\n prototype: HTMLSelectElement;\n new(): HTMLSelectElement;\n};\n\ninterface HTMLSourceElement extends HTMLElement {\n /**\n * Gets or sets the intended media type of the media source.\n */\n media: string;\n msKeySystem: string;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Gets or sets the MIME type of a media resource.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSourceElement: {\n prototype: HTMLSourceElement;\n new(): HTMLSourceElement;\n};\n\ninterface HTMLSpanElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSpanElement: {\n prototype: HTMLSpanElement;\n new(): HTMLSpanElement;\n};\n\ninterface HTMLStyleElement extends HTMLElement, LinkStyle {\n disabled: boolean;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Retrieves the CSS language in which the style sheet is written.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLStyleElement: {\n prototype: HTMLStyleElement;\n new(): HTMLStyleElement;\n};\n\ninterface HTMLTableCaptionElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the caption or legend.\n */\n align: string;\n /**\n * Sets or retrieves whether the caption appears at the top or bottom of the table.\n */\n vAlign: string;\n addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCaptionElement: {\n prototype: HTMLTableCaptionElement;\n new(): HTMLTableCaptionElement;\n};\n\ninterface HTMLTableCellElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves abbreviated text for the object.\n */\n abbr: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n /**\n * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.\n */\n axis: string;\n bgColor: any;\n /**\n * Retrieves the position of the object in the cells collection of a row.\n */\n readonly cellIndex: number;\n /**\n * Sets or retrieves the number columns in the table that the object should span.\n */\n colSpan: number;\n /**\n * Sets or retrieves a list of header cells that provide information for the object.\n */\n headers: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: any;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n noWrap: boolean;\n /**\n * Sets or retrieves how many rows in a table the cell should span.\n */\n rowSpan: number;\n /**\n * Sets or retrieves the group of cells in a table to which the object's information applies.\n */\n scope: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCellElement: {\n prototype: HTMLTableCellElement;\n new(): HTMLTableCellElement;\n};\n\ninterface HTMLTableColElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves the alignment of the object relative to the display or table.\n */\n align: string;\n /**\n * Sets or retrieves the number of columns in the group.\n */\n span: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: any;\n addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableColElement: {\n prototype: HTMLTableColElement;\n new(): HTMLTableColElement;\n};\n\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\n addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableDataCellElement: {\n prototype: HTMLTableDataCellElement;\n new(): HTMLTableDataCellElement;\n};\n\ninterface HTMLTableElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n align: string;\n bgColor: any;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Retrieves the caption object of a table.\n */\n caption: HTMLTableCaptionElement;\n /**\n * Sets or retrieves the amount of space between the border of the cell and the content of the cell.\n */\n cellPadding: string;\n /**\n * Sets or retrieves the amount of space between cells in a table.\n */\n cellSpacing: string;\n /**\n * Sets or retrieves the number of columns in the table.\n */\n cols: number;\n /**\n * Sets or retrieves the way the border frame around the table is displayed.\n */\n frame: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: any;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: HTMLCollectionOf;\n /**\n * Sets or retrieves which dividing lines (inner borders) are displayed.\n */\n rules: string;\n /**\n * Sets or retrieves a description and/or structure of the object.\n */\n summary: string;\n /**\n * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.\n */\n tBodies: HTMLCollectionOf;\n /**\n * Retrieves the tFoot object of the table.\n */\n tFoot: HTMLTableSectionElement;\n /**\n * Retrieves the tHead object of the table.\n */\n tHead: HTMLTableSectionElement;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Creates an empty caption element in the table.\n */\n createCaption(): HTMLTableCaptionElement;\n /**\n * Creates an empty tBody element in the table.\n */\n createTBody(): HTMLTableSectionElement;\n /**\n * Creates an empty tFoot element in the table.\n */\n createTFoot(): HTMLTableSectionElement;\n /**\n * Returns the tHead element object if successful, or null otherwise.\n */\n createTHead(): HTMLTableSectionElement;\n /**\n * Deletes the caption element and its contents from the table.\n */\n deleteCaption(): void;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Deletes the tFoot element and its contents from the table.\n */\n deleteTFoot(): void;\n /**\n * Deletes the tHead element and its contents from the table.\n */\n deleteTHead(): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableElement: {\n prototype: HTMLTableElement;\n new(): HTMLTableElement;\n};\n\ninterface HTMLTableHeaderCellElement extends HTMLTableCellElement {\n /**\n * Sets or retrieves the group of cells in a table to which the object's information applies.\n */\n scope: string;\n addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableHeaderCellElement: {\n prototype: HTMLTableHeaderCellElement;\n new(): HTMLTableHeaderCellElement;\n};\n\ninterface HTMLTableRowElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n bgColor: any;\n /**\n * Retrieves a collection of all cells in the table row.\n */\n cells: HTMLCollectionOf;\n /**\n * Sets or retrieves the height of the object.\n */\n height: any;\n /**\n * Retrieves the position of the object in the rows collection for the table.\n */\n readonly rowIndex: number;\n /**\n * Retrieves the position of the object in the collection.\n */\n readonly sectionRowIndex: number;\n /**\n * Removes the specified cell from the table row, as well as from the cells collection.\n * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.\n */\n deleteCell(index?: number): void;\n /**\n * Creates a new cell in the table row, and adds the cell to the cells collection.\n * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.\n */\n insertCell(index?: number): HTMLTableDataCellElement;\n addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableRowElement: {\n prototype: HTMLTableRowElement;\n new(): HTMLTableRowElement;\n};\n\ninterface HTMLTableSectionElement extends HTMLElement, HTMLTableAlignment {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n align: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: HTMLCollectionOf;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableSectionElement: {\n prototype: HTMLTableSectionElement;\n new(): HTMLTableSectionElement;\n};\n\ninterface HTMLTemplateElement extends HTMLElement {\n readonly content: DocumentFragment;\n addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTemplateElement: {\n prototype: HTMLTemplateElement;\n new(): HTMLTemplateElement;\n};\n\ninterface HTMLTextAreaElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n cols: number;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n /**\n * Sets or retrieves the value indicated whether the content of the object is read-only.\n */\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: number;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number;\n /**\n * Sets or retrieves the value indicating whether the control is selected.\n */\n status: any;\n /**\n * Retrieves the type of control.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Retrieves or sets the text in the entry field of the textArea element.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Sets or retrieves how to handle wordwrapping in the object.\n */\n wrap: string;\n minLength: number;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Highlights the input area of a form element.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTextAreaElement: {\n prototype: HTMLTextAreaElement;\n new(): HTMLTextAreaElement;\n};\n\ninterface HTMLTimeElement extends HTMLElement {\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTimeElement: {\n prototype: HTMLTimeElement;\n new(): HTMLTimeElement;\n};\n\ninterface HTMLTitleElement extends HTMLElement {\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTitleElement: {\n prototype: HTMLTitleElement;\n new(): HTMLTitleElement;\n};\n\ninterface HTMLTrackElement extends HTMLElement {\n default: boolean;\n kind: string;\n label: string;\n readonly readyState: number;\n src: string;\n srclang: string;\n readonly track: TextTrack;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTrackElement: {\n prototype: HTMLTrackElement;\n new(): HTMLTrackElement;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n};\n\ninterface HTMLUListElement extends HTMLElement {\n compact: boolean;\n type: string;\n addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUListElement: {\n prototype: HTMLUListElement;\n new(): HTMLUListElement;\n};\n\ninterface HTMLUnknownElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUnknownElement: {\n prototype: HTMLUnknownElement;\n new(): HTMLUnknownElement;\n};\n\ninterface HTMLVideoElementEventMap extends HTMLMediaElementEventMap {\n \"MSVideoFormatChanged\": Event;\n \"MSVideoFrameStepCompleted\": Event;\n \"MSVideoOptimalLayoutChanged\": Event;\n}\n\ninterface HTMLVideoElement extends HTMLMediaElement {\n /**\n * Gets or sets the height of the video element.\n */\n height: number;\n msHorizontalMirror: boolean;\n readonly msIsLayoutOptimalForPlayback: boolean;\n readonly msIsStereo3D: boolean;\n msStereo3DPackingMode: string;\n msStereo3DRenderMode: string;\n msZoom: boolean;\n onMSVideoFormatChanged: (this: HTMLVideoElement, ev: Event) => any;\n onMSVideoFrameStepCompleted: (this: HTMLVideoElement, ev: Event) => any;\n onMSVideoOptimalLayoutChanged: (this: HTMLVideoElement, ev: Event) => any;\n /**\n * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.\n */\n poster: string;\n /**\n * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoHeight: number;\n /**\n * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoWidth: number;\n readonly webkitDisplayingFullscreen: boolean;\n readonly webkitSupportsFullscreen: boolean;\n /**\n * Gets or sets the width of the video element.\n */\n width: number;\n getVideoPlaybackQuality(): VideoPlaybackQuality;\n msFrameStep(forward: boolean): void;\n msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void;\n webkitEnterFullscreen(): void;\n webkitEnterFullScreen(): void;\n webkitExitFullscreen(): void;\n webkitExitFullScreen(): void;\n addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\n};\n\ninterface IDBCursor {\n readonly direction: IDBCursorDirection;\n key: IDBKeyRange | IDBValidKey;\n readonly primaryKey: any;\n source: IDBObjectStore | IDBIndex;\n advance(count: number): void;\n continue(key?: IDBKeyRange | IDBValidKey): void;\n delete(): IDBRequest;\n update(value: any): IDBRequest;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n}\n\ndeclare var IDBCursor: {\n prototype: IDBCursor;\n new(): IDBCursor;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n};\n\ninterface IDBCursorWithValue extends IDBCursor {\n readonly value: any;\n}\n\ndeclare var IDBCursorWithValue: {\n prototype: IDBCursorWithValue;\n new(): IDBCursorWithValue;\n};\n\ninterface IDBDatabaseEventMap {\n \"abort\": Event;\n \"error\": Event;\n}\n\ninterface IDBDatabase extends EventTarget {\n readonly name: string;\n readonly objectStoreNames: DOMStringList;\n onabort: (this: IDBDatabase, ev: Event) => any;\n onerror: (this: IDBDatabase, ev: Event) => any;\n version: number;\n onversionchange: (ev: IDBVersionChangeEvent) => any;\n close(): void;\n createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;\n deleteObjectStore(name: string): void;\n transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;\n addEventListener(type: \"versionchange\", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: \"versionchange\", listener: (this: IDBDatabase, ev: IDBVersionChangeEvent) => any, options?: boolean | EventListenerOptions): void;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBDatabase: {\n prototype: IDBDatabase;\n new(): IDBDatabase;\n};\n\ninterface IDBFactory {\n cmp(first: any, second: any): number;\n deleteDatabase(name: string): IDBOpenDBRequest;\n open(name: string, version?: number): IDBOpenDBRequest;\n}\n\ndeclare var IDBFactory: {\n prototype: IDBFactory;\n new(): IDBFactory;\n};\n\ninterface IDBIndex {\n keyPath: string | string[];\n readonly name: string;\n readonly objectStore: IDBObjectStore;\n readonly unique: boolean;\n multiEntry: boolean;\n count(key?: IDBKeyRange | IDBValidKey): IDBRequest;\n get(key: IDBKeyRange | IDBValidKey): IDBRequest;\n getKey(key: IDBKeyRange | IDBValidKey): IDBRequest;\n openCursor(range?: IDBKeyRange | IDBValidKey, direction?: IDBCursorDirection): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | IDBValidKey, direction?: IDBCursorDirection): IDBRequest;\n}\n\ndeclare var IDBIndex: {\n prototype: IDBIndex;\n new(): IDBIndex;\n};\n\ninterface IDBKeyRange {\n readonly lower: any;\n readonly lowerOpen: boolean;\n readonly upper: any;\n readonly upperOpen: boolean;\n}\n\ndeclare var IDBKeyRange: {\n prototype: IDBKeyRange;\n new(): IDBKeyRange;\n bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;\n lowerBound(lower: any, open?: boolean): IDBKeyRange;\n only(value: any): IDBKeyRange;\n upperBound(upper: any, open?: boolean): IDBKeyRange;\n};\n\ninterface IDBObjectStore {\n readonly indexNames: DOMStringList;\n keyPath: string | string[];\n readonly name: string;\n readonly transaction: IDBTransaction;\n autoIncrement: boolean;\n add(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest;\n clear(): IDBRequest;\n count(key?: IDBKeyRange | IDBValidKey): IDBRequest;\n createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;\n delete(key: IDBKeyRange | IDBValidKey): IDBRequest;\n deleteIndex(indexName: string): void;\n get(key: any): IDBRequest;\n index(name: string): IDBIndex;\n openCursor(range?: IDBKeyRange | IDBValidKey, direction?: IDBCursorDirection): IDBRequest;\n put(value: any, key?: IDBKeyRange | IDBValidKey): IDBRequest;\n}\n\ndeclare var IDBObjectStore: {\n prototype: IDBObjectStore;\n new(): IDBObjectStore;\n};\n\ninterface IDBOpenDBRequestEventMap extends IDBRequestEventMap {\n \"blocked\": Event;\n \"upgradeneeded\": IDBVersionChangeEvent;\n}\n\ninterface IDBOpenDBRequest extends IDBRequest {\n onblocked: (this: IDBOpenDBRequest, ev: Event) => any;\n onupgradeneeded: (this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any;\n addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBOpenDBRequest: {\n prototype: IDBOpenDBRequest;\n new(): IDBOpenDBRequest;\n};\n\ninterface IDBRequestEventMap {\n \"error\": Event;\n \"success\": Event;\n}\n\ninterface IDBRequest extends EventTarget {\n readonly error: DOMException;\n onerror: (this: IDBRequest, ev: Event) => any;\n onsuccess: (this: IDBRequest, ev: Event) => any;\n readonly readyState: IDBRequestReadyState;\n readonly result: any;\n source: IDBObjectStore | IDBIndex | IDBCursor;\n readonly transaction: IDBTransaction;\n addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBRequest: {\n prototype: IDBRequest;\n new(): IDBRequest;\n};\n\ninterface IDBTransactionEventMap {\n \"abort\": Event;\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface IDBTransaction extends EventTarget {\n readonly db: IDBDatabase;\n readonly error: DOMException;\n readonly mode: IDBTransactionMode;\n onabort: (this: IDBTransaction, ev: Event) => any;\n oncomplete: (this: IDBTransaction, ev: Event) => any;\n onerror: (this: IDBTransaction, ev: Event) => any;\n abort(): void;\n objectStore(name: string): IDBObjectStore;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBTransaction: {\n prototype: IDBTransaction;\n new(): IDBTransaction;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n};\n\ninterface IDBVersionChangeEvent extends Event {\n readonly newVersion: number | null;\n readonly oldVersion: number;\n}\n\ndeclare var IDBVersionChangeEvent: {\n prototype: IDBVersionChangeEvent;\n new(): IDBVersionChangeEvent;\n};\n\ninterface IIRFilterNode extends AudioNode {\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var IIRFilterNode: {\n prototype: IIRFilterNode;\n new(): IIRFilterNode;\n};\n\ninterface ImageData {\n data: Uint8ClampedArray;\n readonly height: number;\n readonly width: number;\n}\n\ndeclare var ImageData: {\n prototype: ImageData;\n new(width: number, height: number): ImageData;\n new(array: Uint8ClampedArray, width: number, height: number): ImageData;\n};\n\ninterface IntersectionObserver {\n readonly root: Element | null;\n readonly rootMargin: string;\n readonly thresholds: number[];\n disconnect(): void;\n observe(target: Element): void;\n takeRecords(): IntersectionObserverEntry[];\n unobserve(target: Element): void;\n}\n\ndeclare var IntersectionObserver: {\n prototype: IntersectionObserver;\n new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;\n};\n\ninterface IntersectionObserverEntry {\n readonly boundingClientRect: ClientRect | DOMRect;\n readonly intersectionRatio: number;\n readonly intersectionRect: ClientRect | DOMRect;\n readonly rootBounds: ClientRect | DOMRect;\n readonly target: Element;\n readonly time: number;\n readonly isIntersecting: boolean;\n}\n\ndeclare var IntersectionObserverEntry: {\n prototype: IntersectionObserverEntry;\n new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;\n};\n\ninterface KeyboardEvent extends UIEvent {\n readonly altKey: boolean;\n readonly char: string | null;\n readonly charCode: number;\n readonly ctrlKey: boolean;\n readonly key: string;\n readonly keyCode: number;\n readonly locale: string;\n readonly location: number;\n readonly metaKey: boolean;\n readonly repeat: boolean;\n readonly shiftKey: boolean;\n readonly which: number;\n readonly code: string;\n getModifierState(keyArg: string): boolean;\n initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n}\n\ndeclare var KeyboardEvent: {\n prototype: KeyboardEvent;\n new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n};\n\ninterface ListeningStateChangedEvent extends Event {\n readonly label: string;\n readonly state: ListeningState;\n}\n\ndeclare var ListeningStateChangedEvent: {\n prototype: ListeningStateChangedEvent;\n new(): ListeningStateChangedEvent;\n};\n\ninterface Location {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n assign(url: string): void;\n reload(forcedReload?: boolean): void;\n replace(url: string): void;\n toString(): string;\n}\n\ndeclare var Location: {\n prototype: Location;\n new(): Location;\n};\n\ninterface LongRunningScriptDetectedEvent extends Event {\n readonly executionTime: number;\n stopPageScriptExecution: boolean;\n}\n\ndeclare var LongRunningScriptDetectedEvent: {\n prototype: LongRunningScriptDetectedEvent;\n new(): LongRunningScriptDetectedEvent;\n};\n\ninterface MediaDeviceInfo {\n readonly deviceId: string;\n readonly groupId: string;\n readonly kind: MediaDeviceKind;\n readonly label: string;\n}\n\ndeclare var MediaDeviceInfo: {\n prototype: MediaDeviceInfo;\n new(): MediaDeviceInfo;\n};\n\ninterface MediaDevicesEventMap {\n \"devicechange\": Event;\n}\n\ninterface MediaDevices extends EventTarget {\n ondevicechange: (this: MediaDevices, ev: Event) => any;\n enumerateDevices(): Promise;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): Promise;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaDevices: {\n prototype: MediaDevices;\n new(): MediaDevices;\n};\n\ninterface MediaElementAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaElementAudioSourceNode: {\n prototype: MediaElementAudioSourceNode;\n new(): MediaElementAudioSourceNode;\n};\n\ninterface MediaEncryptedEvent extends Event {\n readonly initData: ArrayBuffer | null;\n readonly initDataType: string;\n}\n\ndeclare var MediaEncryptedEvent: {\n prototype: MediaEncryptedEvent;\n new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;\n};\n\ninterface MediaError {\n readonly code: number;\n readonly msExtendedCode: number;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n}\n\ndeclare var MediaError: {\n prototype: MediaError;\n new(): MediaError;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n};\n\ninterface MediaKeyMessageEvent extends Event {\n readonly message: ArrayBuffer;\n readonly messageType: MediaKeyMessageType;\n}\n\ndeclare var MediaKeyMessageEvent: {\n prototype: MediaKeyMessageEvent;\n new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;\n};\n\ninterface MediaKeys {\n createSession(sessionType?: MediaKeySessionType): MediaKeySession;\n setServerCertificate(serverCertificate: BufferSource): Promise;\n}\n\ndeclare var MediaKeys: {\n prototype: MediaKeys;\n new(): MediaKeys;\n};\n\ninterface MediaKeySession extends EventTarget {\n readonly closed: Promise;\n readonly expiration: number;\n readonly keyStatuses: MediaKeyStatusMap;\n readonly sessionId: string;\n close(): Promise;\n generateRequest(initDataType: string, initData: BufferSource): Promise;\n load(sessionId: string): Promise;\n remove(): Promise;\n update(response: BufferSource): Promise;\n}\n\ndeclare var MediaKeySession: {\n prototype: MediaKeySession;\n new(): MediaKeySession;\n};\n\ninterface MediaKeyStatusMap {\n readonly size: number;\n forEach(callback: ForEachCallback): void;\n get(keyId: BufferSource): MediaKeyStatus;\n has(keyId: BufferSource): boolean;\n}\n\ndeclare var MediaKeyStatusMap: {\n prototype: MediaKeyStatusMap;\n new(): MediaKeyStatusMap;\n};\n\ninterface MediaKeySystemAccess {\n readonly keySystem: string;\n createMediaKeys(): Promise;\n getConfiguration(): MediaKeySystemConfiguration;\n}\n\ndeclare var MediaKeySystemAccess: {\n prototype: MediaKeySystemAccess;\n new(): MediaKeySystemAccess;\n};\n\ninterface MediaList {\n readonly length: number;\n mediaText: string;\n appendMedium(newMedium: string): void;\n deleteMedium(oldMedium: string): void;\n item(index: number): string;\n toString(): string;\n [index: number]: string;\n}\n\ndeclare var MediaList: {\n prototype: MediaList;\n new(): MediaList;\n};\n\ninterface MediaQueryList {\n readonly matches: boolean;\n readonly media: string;\n addListener(listener: MediaQueryListListener): void;\n removeListener(listener: MediaQueryListListener): void;\n}\n\ndeclare var MediaQueryList: {\n prototype: MediaQueryList;\n new(): MediaQueryList;\n};\n\ninterface MediaSource extends EventTarget {\n readonly activeSourceBuffers: SourceBufferList;\n duration: number;\n readonly readyState: string;\n readonly sourceBuffers: SourceBufferList;\n addSourceBuffer(type: string): SourceBuffer;\n endOfStream(error?: number): void;\n removeSourceBuffer(sourceBuffer: SourceBuffer): void;\n}\n\ndeclare var MediaSource: {\n prototype: MediaSource;\n new(): MediaSource;\n isTypeSupported(type: string): boolean;\n};\n\ninterface MediaStreamEventMap {\n \"active\": Event;\n \"addtrack\": MediaStreamTrackEvent;\n \"inactive\": Event;\n \"removetrack\": MediaStreamTrackEvent;\n}\n\ninterface MediaStream extends EventTarget {\n readonly active: boolean;\n readonly id: string;\n onactive: (this: MediaStream, ev: Event) => any;\n onaddtrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any;\n oninactive: (this: MediaStream, ev: Event) => any;\n onremovetrack: (this: MediaStream, ev: MediaStreamTrackEvent) => any;\n addTrack(track: MediaStreamTrack): void;\n clone(): MediaStream;\n getAudioTracks(): MediaStreamTrack[];\n getTrackById(trackId: string): MediaStreamTrack | null;\n getTracks(): MediaStreamTrack[];\n getVideoTracks(): MediaStreamTrack[];\n removeTrack(track: MediaStreamTrack): void;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStream: {\n prototype: MediaStream;\n new(streamOrTracks?: MediaStream | MediaStreamTrack[]): MediaStream;\n};\n\ninterface MediaStreamAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaStreamAudioSourceNode: {\n prototype: MediaStreamAudioSourceNode;\n new(): MediaStreamAudioSourceNode;\n};\n\ninterface MediaStreamError {\n readonly constraintName: string | null;\n readonly message: string | null;\n readonly name: string;\n}\n\ndeclare var MediaStreamError: {\n prototype: MediaStreamError;\n new(): MediaStreamError;\n};\n\ninterface MediaStreamErrorEvent extends Event {\n readonly error: MediaStreamError | null;\n}\n\ndeclare var MediaStreamErrorEvent: {\n prototype: MediaStreamErrorEvent;\n new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\n};\n\ninterface MediaStreamEvent extends Event {\n readonly stream: MediaStream | null;\n}\n\ndeclare var MediaStreamEvent: {\n prototype: MediaStreamEvent;\n new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent;\n};\n\ninterface MediaStreamTrackEventMap {\n \"ended\": MediaStreamErrorEvent;\n \"mute\": Event;\n \"overconstrained\": MediaStreamErrorEvent;\n \"unmute\": Event;\n}\n\ninterface MediaStreamTrack extends EventTarget {\n enabled: boolean;\n readonly id: string;\n readonly kind: string;\n readonly label: string;\n readonly muted: boolean;\n onended: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any;\n onmute: (this: MediaStreamTrack, ev: Event) => any;\n onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any;\n onunmute: (this: MediaStreamTrack, ev: Event) => any;\n readonly readonly: boolean;\n readonly readyState: MediaStreamTrackState;\n readonly remote: boolean;\n applyConstraints(constraints: MediaTrackConstraints): Promise;\n clone(): MediaStreamTrack;\n getCapabilities(): MediaTrackCapabilities;\n getConstraints(): MediaTrackConstraints;\n getSettings(): MediaTrackSettings;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStreamTrack: {\n prototype: MediaStreamTrack;\n new(): MediaStreamTrack;\n};\n\ninterface MediaStreamTrackEvent extends Event {\n readonly track: MediaStreamTrack;\n}\n\ndeclare var MediaStreamTrackEvent: {\n prototype: MediaStreamTrackEvent;\n new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent;\n};\n\ninterface MessageChannel {\n readonly port1: MessagePort;\n readonly port2: MessagePort;\n}\n\ndeclare var MessageChannel: {\n prototype: MessageChannel;\n new(): MessageChannel;\n};\n\ninterface MessageEvent extends Event {\n readonly data: any;\n readonly origin: string;\n readonly ports: any;\n readonly source: Window;\n initMessageEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, dataArg: any, originArg: string, lastEventIdArg: string, sourceArg: Window): void;\n}\n\ndeclare var MessageEvent: {\n prototype: MessageEvent;\n new(type: string, eventInitDict?: MessageEventInit): MessageEvent;\n};\n\ninterface MessagePortEventMap {\n \"message\": MessageEvent;\n}\n\ninterface MessagePort extends EventTarget {\n onmessage: (this: MessagePort, ev: MessageEvent) => any;\n close(): void;\n postMessage(message?: any, transfer?: any[]): void;\n start(): void;\n addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MessagePort: {\n prototype: MessagePort;\n new(): MessagePort;\n};\n\ninterface MimeType {\n readonly description: string;\n readonly enabledPlugin: Plugin;\n readonly suffixes: string;\n readonly type: string;\n}\n\ndeclare var MimeType: {\n prototype: MimeType;\n new(): MimeType;\n};\n\ninterface MimeTypeArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(type: string): Plugin;\n [index: number]: Plugin;\n}\n\ndeclare var MimeTypeArray: {\n prototype: MimeTypeArray;\n new(): MimeTypeArray;\n};\n\ninterface MouseEvent extends UIEvent {\n readonly altKey: boolean;\n readonly button: number;\n readonly buttons: number;\n readonly clientX: number;\n readonly clientY: number;\n readonly ctrlKey: boolean;\n readonly fromElement: Element;\n readonly layerX: number;\n readonly layerY: number;\n readonly metaKey: boolean;\n readonly movementX: number;\n readonly movementY: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly relatedTarget: EventTarget;\n readonly screenX: number;\n readonly screenY: number;\n readonly shiftKey: boolean;\n readonly toElement: Element;\n readonly which: number;\n readonly x: number;\n readonly y: number;\n getModifierState(keyArg: string): boolean;\n initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void;\n}\n\ndeclare var MouseEvent: {\n prototype: MouseEvent;\n new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;\n};\n\ninterface MSApp {\n clearTemporaryWebDataAsync(): MSAppAsyncOperation;\n createBlobFromRandomAccessStream(type: string, seeker: any): Blob;\n createDataPackage(object: any): any;\n createDataPackageFromSelection(): any;\n createFileFromStorageFile(storageFile: any): File;\n createStreamFromInputStream(type: string, inputStream: any): MSStream;\n execAsyncAtPriority(asynchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): void;\n execAtPriority(synchronousCallback: MSExecAtPriorityFunctionCallback, priority: string, ...args: any[]): any;\n getCurrentPriority(): string;\n getHtmlPrintDocumentSourceAsync(htmlDoc: any): Promise;\n getViewId(view: any): any;\n isTaskScheduledAtPriorityOrHigher(priority: string): boolean;\n pageHandlesAllApplicationActivations(enabled: boolean): void;\n suppressSubdownloadCredentialPrompts(suppress: boolean): void;\n terminateApp(exceptionObject: any): void;\n readonly CURRENT: string;\n readonly HIGH: string;\n readonly IDLE: string;\n readonly NORMAL: string;\n}\ndeclare var MSApp: MSApp;\n\ninterface MSAppAsyncOperationEventMap {\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface MSAppAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSAppAsyncOperation, ev: Event) => any;\n onerror: (this: MSAppAsyncOperation, ev: Event) => any;\n readonly readyState: number;\n readonly result: any;\n start(): void;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n addEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSAppAsyncOperation, ev: MSAppAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSAppAsyncOperation: {\n prototype: MSAppAsyncOperation;\n new(): MSAppAsyncOperation;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n};\n\ninterface MSAssertion {\n readonly id: string;\n readonly type: MSCredentialType;\n}\n\ndeclare var MSAssertion: {\n prototype: MSAssertion;\n new(): MSAssertion;\n};\n\ninterface MSBlobBuilder {\n append(data: any, endings?: string): void;\n getBlob(contentType?: string): Blob;\n}\n\ndeclare var MSBlobBuilder: {\n prototype: MSBlobBuilder;\n new(): MSBlobBuilder;\n};\n\ninterface MSCredentials {\n getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise;\n makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise;\n}\n\ndeclare var MSCredentials: {\n prototype: MSCredentials;\n new(): MSCredentials;\n};\n\ninterface MSFIDOCredentialAssertion extends MSAssertion {\n readonly algorithm: string | Algorithm;\n readonly attestation: any;\n readonly publicKey: string;\n readonly transportHints: MSTransportType[];\n}\n\ndeclare var MSFIDOCredentialAssertion: {\n prototype: MSFIDOCredentialAssertion;\n new(): MSFIDOCredentialAssertion;\n};\n\ninterface MSFIDOSignature {\n readonly authnrData: string;\n readonly clientData: string;\n readonly signature: string;\n}\n\ndeclare var MSFIDOSignature: {\n prototype: MSFIDOSignature;\n new(): MSFIDOSignature;\n};\n\ninterface MSFIDOSignatureAssertion extends MSAssertion {\n readonly signature: MSFIDOSignature;\n}\n\ndeclare var MSFIDOSignatureAssertion: {\n prototype: MSFIDOSignatureAssertion;\n new(): MSFIDOSignatureAssertion;\n};\n\ninterface MSGesture {\n target: Element;\n addPointer(pointerId: number): void;\n stop(): void;\n}\n\ndeclare var MSGesture: {\n prototype: MSGesture;\n new(): MSGesture;\n};\n\ninterface MSGestureEvent extends UIEvent {\n readonly clientX: number;\n readonly clientY: number;\n readonly expansion: number;\n readonly gestureObject: any;\n readonly hwTimestamp: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly rotation: number;\n readonly scale: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly translationX: number;\n readonly translationY: number;\n readonly velocityAngular: number;\n readonly velocityExpansion: number;\n readonly velocityX: number;\n readonly velocityY: number;\n initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n}\n\ndeclare var MSGestureEvent: {\n prototype: MSGestureEvent;\n new(): MSGestureEvent;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n};\n\ninterface MSGraphicsTrust {\n readonly constrictionActive: boolean;\n readonly status: string;\n}\n\ndeclare var MSGraphicsTrust: {\n prototype: MSGraphicsTrust;\n new(): MSGraphicsTrust;\n};\n\ninterface MSHTMLWebViewElement extends HTMLElement {\n readonly canGoBack: boolean;\n readonly canGoForward: boolean;\n readonly containsFullScreenElement: boolean;\n readonly documentTitle: string;\n height: number;\n readonly settings: MSWebViewSettings;\n src: string;\n width: number;\n addWebAllowedObject(name: string, applicationObject: any): void;\n buildLocalStreamUri(contentIdentifier: string, relativePath: string): string;\n capturePreviewToBlobAsync(): MSWebViewAsyncOperation;\n captureSelectedContentToDataPackageAsync(): MSWebViewAsyncOperation;\n getDeferredPermissionRequestById(id: number): DeferredPermissionRequest;\n getDeferredPermissionRequests(): DeferredPermissionRequest[];\n goBack(): void;\n goForward(): void;\n invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation;\n navigate(uri: string): void;\n navigateFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\n navigateToLocalStreamUri(source: string, streamResolver: any): void;\n navigateToString(contents: string): void;\n navigateWithHttpRequestMessage(requestMessage: any): void;\n refresh(): void;\n stop(): void;\n addEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSHTMLWebViewElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSHTMLWebViewElement: {\n prototype: MSHTMLWebViewElement;\n new(): MSHTMLWebViewElement;\n};\n\ninterface MSInputMethodContextEventMap {\n \"MSCandidateWindowHide\": Event;\n \"MSCandidateWindowShow\": Event;\n \"MSCandidateWindowUpdate\": Event;\n}\n\ninterface MSInputMethodContext extends EventTarget {\n readonly compositionEndOffset: number;\n readonly compositionStartOffset: number;\n oncandidatewindowhide: (this: MSInputMethodContext, ev: Event) => any;\n oncandidatewindowshow: (this: MSInputMethodContext, ev: Event) => any;\n oncandidatewindowupdate: (this: MSInputMethodContext, ev: Event) => any;\n readonly target: HTMLElement;\n getCandidateWindowClientRect(): ClientRect;\n getCompositionAlternatives(): string[];\n hasComposition(): boolean;\n isCandidateWindowVisible(): boolean;\n addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSInputMethodContext: {\n prototype: MSInputMethodContext;\n new(): MSInputMethodContext;\n};\n\ninterface MSManipulationEvent extends UIEvent {\n readonly currentState: number;\n readonly inertiaDestinationX: number;\n readonly inertiaDestinationY: number;\n readonly lastState: number;\n initMSManipulationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, lastState: number, currentState: number): void;\n readonly MS_MANIPULATION_STATE_ACTIVE: number;\n readonly MS_MANIPULATION_STATE_CANCELLED: number;\n readonly MS_MANIPULATION_STATE_COMMITTED: number;\n readonly MS_MANIPULATION_STATE_DRAGGING: number;\n readonly MS_MANIPULATION_STATE_INERTIA: number;\n readonly MS_MANIPULATION_STATE_PRESELECT: number;\n readonly MS_MANIPULATION_STATE_SELECTING: number;\n readonly MS_MANIPULATION_STATE_STOPPED: number;\n}\n\ndeclare var MSManipulationEvent: {\n prototype: MSManipulationEvent;\n new(): MSManipulationEvent;\n readonly MS_MANIPULATION_STATE_ACTIVE: number;\n readonly MS_MANIPULATION_STATE_CANCELLED: number;\n readonly MS_MANIPULATION_STATE_COMMITTED: number;\n readonly MS_MANIPULATION_STATE_DRAGGING: number;\n readonly MS_MANIPULATION_STATE_INERTIA: number;\n readonly MS_MANIPULATION_STATE_PRESELECT: number;\n readonly MS_MANIPULATION_STATE_SELECTING: number;\n readonly MS_MANIPULATION_STATE_STOPPED: number;\n};\n\ninterface MSMediaKeyError {\n readonly code: number;\n readonly systemCode: number;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n}\n\ndeclare var MSMediaKeyError: {\n prototype: MSMediaKeyError;\n new(): MSMediaKeyError;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n};\n\ninterface MSMediaKeyMessageEvent extends Event {\n readonly destinationURL: string | null;\n readonly message: Uint8Array;\n}\n\ndeclare var MSMediaKeyMessageEvent: {\n prototype: MSMediaKeyMessageEvent;\n new(): MSMediaKeyMessageEvent;\n};\n\ninterface MSMediaKeyNeededEvent extends Event {\n readonly initData: Uint8Array | null;\n}\n\ndeclare var MSMediaKeyNeededEvent: {\n prototype: MSMediaKeyNeededEvent;\n new(): MSMediaKeyNeededEvent;\n};\n\ninterface MSMediaKeys {\n readonly keySystem: string;\n createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array): MSMediaKeySession;\n}\n\ndeclare var MSMediaKeys: {\n prototype: MSMediaKeys;\n new(keySystem: string): MSMediaKeys;\n isTypeSupported(keySystem: string, type?: string): boolean;\n isTypeSupportedWithFeatures(keySystem: string, type?: string): string;\n};\n\ninterface MSMediaKeySession extends EventTarget {\n readonly error: MSMediaKeyError | null;\n readonly keySystem: string;\n readonly sessionId: string;\n close(): void;\n update(key: Uint8Array): void;\n}\n\ndeclare var MSMediaKeySession: {\n prototype: MSMediaKeySession;\n new(): MSMediaKeySession;\n};\n\ninterface MSPointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var MSPointerEvent: {\n prototype: MSPointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;\n};\n\ninterface MSRangeCollection {\n readonly length: number;\n item(index: number): Range;\n [index: number]: Range;\n}\n\ndeclare var MSRangeCollection: {\n prototype: MSRangeCollection;\n new(): MSRangeCollection;\n};\n\ninterface MSSiteModeEvent extends Event {\n readonly actionURL: string;\n readonly buttonID: number;\n}\n\ndeclare var MSSiteModeEvent: {\n prototype: MSSiteModeEvent;\n new(): MSSiteModeEvent;\n};\n\ninterface MSStream {\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n}\n\ndeclare var MSStream: {\n prototype: MSStream;\n new(): MSStream;\n};\n\ninterface MSStreamReader extends EventTarget, MSBaseReader {\n readonly error: DOMError;\n readAsArrayBuffer(stream: MSStream, size?: number): void;\n readAsBinaryString(stream: MSStream, size?: number): void;\n readAsBlob(stream: MSStream, size?: number): void;\n readAsDataURL(stream: MSStream, size?: number): void;\n readAsText(stream: MSStream, encoding?: string, size?: number): void;\n addEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSStreamReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSStreamReader: {\n prototype: MSStreamReader;\n new(): MSStreamReader;\n};\n\ninterface MSWebViewAsyncOperationEventMap {\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface MSWebViewAsyncOperation extends EventTarget {\n readonly error: DOMError;\n oncomplete: (this: MSWebViewAsyncOperation, ev: Event) => any;\n onerror: (this: MSWebViewAsyncOperation, ev: Event) => any;\n readonly readyState: number;\n readonly result: any;\n readonly target: MSHTMLWebViewElement;\n readonly type: number;\n start(): void;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;\n readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;\n readonly TYPE_INVOKE_SCRIPT: number;\n addEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSWebViewAsyncOperation, ev: MSWebViewAsyncOperationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSWebViewAsyncOperation: {\n prototype: MSWebViewAsyncOperation;\n new(): MSWebViewAsyncOperation;\n readonly COMPLETED: number;\n readonly ERROR: number;\n readonly STARTED: number;\n readonly TYPE_CAPTURE_PREVIEW_TO_RANDOM_ACCESS_STREAM: number;\n readonly TYPE_CREATE_DATA_PACKAGE_FROM_SELECTION: number;\n readonly TYPE_INVOKE_SCRIPT: number;\n};\n\ninterface MSWebViewSettings {\n isIndexedDBEnabled: boolean;\n isJavaScriptEnabled: boolean;\n}\n\ndeclare var MSWebViewSettings: {\n prototype: MSWebViewSettings;\n new(): MSWebViewSettings;\n};\n\ninterface MutationEvent extends Event {\n readonly attrChange: number;\n readonly attrName: string;\n readonly newValue: string;\n readonly prevValue: string;\n readonly relatedNode: Node;\n initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n}\n\ndeclare var MutationEvent: {\n prototype: MutationEvent;\n new(): MutationEvent;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n};\n\ninterface MutationObserver {\n disconnect(): void;\n observe(target: Node, options: MutationObserverInit): void;\n takeRecords(): MutationRecord[];\n}\n\ndeclare var MutationObserver: {\n prototype: MutationObserver;\n new(callback: MutationCallback): MutationObserver;\n};\n\ninterface MutationRecord {\n readonly addedNodes: NodeList;\n readonly attributeName: string | null;\n readonly attributeNamespace: string | null;\n readonly nextSibling: Node | null;\n readonly oldValue: string | null;\n readonly previousSibling: Node | null;\n readonly removedNodes: NodeList;\n readonly target: Node;\n readonly type: string;\n}\n\ndeclare var MutationRecord: {\n prototype: MutationRecord;\n new(): MutationRecord;\n};\n\ninterface NamedNodeMap {\n readonly length: number;\n getNamedItem(name: string): Attr;\n getNamedItemNS(namespaceURI: string | null, localName: string | null): Attr;\n item(index: number): Attr;\n removeNamedItem(name: string): Attr;\n removeNamedItemNS(namespaceURI: string | null, localName: string | null): Attr;\n setNamedItem(arg: Attr): Attr;\n setNamedItemNS(arg: Attr): Attr;\n [index: number]: Attr;\n}\n\ndeclare var NamedNodeMap: {\n prototype: NamedNodeMap;\n new(): NamedNodeMap;\n};\n\ninterface NavigationCompletedEvent extends NavigationEvent {\n readonly isSuccess: boolean;\n readonly webErrorStatus: number;\n}\n\ndeclare var NavigationCompletedEvent: {\n prototype: NavigationCompletedEvent;\n new(): NavigationCompletedEvent;\n};\n\ninterface NavigationEvent extends Event {\n readonly uri: string;\n}\n\ndeclare var NavigationEvent: {\n prototype: NavigationEvent;\n new(): NavigationEvent;\n};\n\ninterface NavigationEventWithReferrer extends NavigationEvent {\n readonly referer: string;\n}\n\ndeclare var NavigationEventWithReferrer: {\n prototype: NavigationEventWithReferrer;\n new(): NavigationEventWithReferrer;\n};\n\ninterface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia {\n readonly authentication: WebAuthentication;\n readonly cookieEnabled: boolean;\n gamepadInputEmulation: GamepadInputEmulationType;\n readonly language: string;\n readonly maxTouchPoints: number;\n readonly mimeTypes: MimeTypeArray;\n readonly msManipulationViewsEnabled: boolean;\n readonly msMaxTouchPoints: number;\n readonly msPointerEnabled: boolean;\n readonly plugins: PluginArray;\n readonly pointerEnabled: boolean;\n readonly serviceWorker: ServiceWorkerContainer;\n readonly webdriver: boolean;\n readonly doNotTrack: string | null;\n readonly hardwareConcurrency: number;\n readonly languages: string[];\n getGamepads(): Gamepad[];\n javaEnabled(): boolean;\n msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\n requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise;\n vibrate(pattern: number | number[]): boolean;\n}\n\ndeclare var Navigator: {\n prototype: Navigator;\n new(): Navigator;\n};\n\ninterface Node extends EventTarget {\n readonly attributes: NamedNodeMap;\n readonly baseURI: string | null;\n readonly childNodes: NodeList;\n readonly firstChild: Node | null;\n readonly lastChild: Node | null;\n readonly localName: string | null;\n readonly namespaceURI: string | null;\n readonly nextSibling: Node | null;\n readonly nodeName: string;\n readonly nodeType: number;\n nodeValue: string | null;\n readonly ownerDocument: Document;\n readonly parentElement: HTMLElement | null;\n readonly parentNode: Node | null;\n readonly previousSibling: Node | null;\n textContent: string | null;\n appendChild(newChild: T): T;\n cloneNode(deep?: boolean): Node;\n compareDocumentPosition(other: Node): number;\n contains(child: Node): boolean;\n hasAttributes(): boolean;\n hasChildNodes(): boolean;\n insertBefore(newChild: T, refChild: Node | null): T;\n isDefaultNamespace(namespaceURI: string | null): boolean;\n isEqualNode(arg: Node): boolean;\n isSameNode(other: Node): boolean;\n lookupNamespaceURI(prefix: string | null): string | null;\n lookupPrefix(namespaceURI: string | null): string | null;\n normalize(): void;\n removeChild(oldChild: T): T;\n replaceChild(newChild: Node, oldChild: T): T;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n}\n\ndeclare var Node: {\n prototype: Node;\n new(): Node;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n};\n\ninterface NodeFilter {\n acceptNode(n: Node): number;\n}\n\ndeclare var NodeFilter: {\n readonly FILTER_ACCEPT: number;\n readonly FILTER_REJECT: number;\n readonly FILTER_SKIP: number;\n readonly SHOW_ALL: number;\n readonly SHOW_ATTRIBUTE: number;\n readonly SHOW_CDATA_SECTION: number;\n readonly SHOW_COMMENT: number;\n readonly SHOW_DOCUMENT: number;\n readonly SHOW_DOCUMENT_FRAGMENT: number;\n readonly SHOW_DOCUMENT_TYPE: number;\n readonly SHOW_ELEMENT: number;\n readonly SHOW_ENTITY: number;\n readonly SHOW_ENTITY_REFERENCE: number;\n readonly SHOW_NOTATION: number;\n readonly SHOW_PROCESSING_INSTRUCTION: number;\n readonly SHOW_TEXT: number;\n};\n\ninterface NodeIterator {\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter;\n readonly root: Node;\n readonly whatToShow: number;\n detach(): void;\n nextNode(): Node;\n previousNode(): Node;\n}\n\ndeclare var NodeIterator: {\n prototype: NodeIterator;\n new(): NodeIterator;\n};\n\ninterface NodeList {\n readonly length: number;\n item(index: number): Node;\n [index: number]: Node;\n}\n\ndeclare var NodeList: {\n prototype: NodeList;\n new(): NodeList;\n};\n\ninterface NotificationEventMap {\n \"click\": Event;\n \"close\": Event;\n \"error\": Event;\n \"show\": Event;\n}\n\ninterface Notification extends EventTarget {\n readonly body: string;\n readonly dir: NotificationDirection;\n readonly icon: string;\n readonly lang: string;\n onclick: (this: Notification, ev: Event) => any;\n onclose: (this: Notification, ev: Event) => any;\n onerror: (this: Notification, ev: Event) => any;\n onshow: (this: Notification, ev: Event) => any;\n readonly permission: NotificationPermission;\n readonly tag: string;\n readonly title: string;\n close(): void;\n addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Notification: {\n prototype: Notification;\n new(title: string, options?: NotificationOptions): Notification;\n requestPermission(callback?: NotificationPermissionCallback): Promise;\n};\n\ninterface OES_element_index_uint {\n}\n\ndeclare var OES_element_index_uint: {\n prototype: OES_element_index_uint;\n new(): OES_element_index_uint;\n};\n\ninterface OES_standard_derivatives {\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n}\n\ndeclare var OES_standard_derivatives: {\n prototype: OES_standard_derivatives;\n new(): OES_standard_derivatives;\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n};\n\ninterface OES_texture_float {\n}\n\ndeclare var OES_texture_float: {\n prototype: OES_texture_float;\n new(): OES_texture_float;\n};\n\ninterface OES_texture_float_linear {\n}\n\ndeclare var OES_texture_float_linear: {\n prototype: OES_texture_float_linear;\n new(): OES_texture_float_linear;\n};\n\ninterface OES_texture_half_float {\n readonly HALF_FLOAT_OES: number;\n}\n\ndeclare var OES_texture_half_float: {\n prototype: OES_texture_half_float;\n new(): OES_texture_half_float;\n readonly HALF_FLOAT_OES: number;\n};\n\ninterface OES_texture_half_float_linear {\n}\n\ndeclare var OES_texture_half_float_linear: {\n prototype: OES_texture_half_float_linear;\n new(): OES_texture_half_float_linear;\n};\n\ninterface OfflineAudioCompletionEvent extends Event {\n readonly renderedBuffer: AudioBuffer;\n}\n\ndeclare var OfflineAudioCompletionEvent: {\n prototype: OfflineAudioCompletionEvent;\n new(): OfflineAudioCompletionEvent;\n};\n\ninterface OfflineAudioContextEventMap extends AudioContextEventMap {\n \"complete\": OfflineAudioCompletionEvent;\n}\n\ninterface OfflineAudioContext extends AudioContextBase {\n readonly length: number;\n oncomplete: (this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any;\n startRendering(): Promise;\n suspend(suspendTime: number): Promise;\n addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OfflineAudioContext: {\n prototype: OfflineAudioContext;\n new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;\n};\n\ninterface OscillatorNodeEventMap {\n \"ended\": MediaStreamErrorEvent;\n}\n\ninterface OscillatorNode extends AudioNode {\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any;\n type: OscillatorType;\n setPeriodicWave(periodicWave: PeriodicWave): void;\n start(when?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OscillatorNode: {\n prototype: OscillatorNode;\n new(): OscillatorNode;\n};\n\ninterface OverflowEvent extends UIEvent {\n readonly horizontalOverflow: boolean;\n readonly orient: number;\n readonly verticalOverflow: boolean;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n}\n\ndeclare var OverflowEvent: {\n prototype: OverflowEvent;\n new(): OverflowEvent;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n};\n\ninterface PageTransitionEvent extends Event {\n readonly persisted: boolean;\n}\n\ndeclare var PageTransitionEvent: {\n prototype: PageTransitionEvent;\n new(): PageTransitionEvent;\n};\n\ninterface PannerNode extends AudioNode {\n coneInnerAngle: number;\n coneOuterAngle: number;\n coneOuterGain: number;\n distanceModel: DistanceModelType;\n maxDistance: number;\n panningModel: PanningModelType;\n refDistance: number;\n rolloffFactor: number;\n setOrientation(x: number, y: number, z: number): void;\n setPosition(x: number, y: number, z: number): void;\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var PannerNode: {\n prototype: PannerNode;\n new(): PannerNode;\n};\n\ninterface Path2D extends Object, CanvasPathMethods {\n}\n\ndeclare var Path2D: {\n prototype: Path2D;\n new(path?: Path2D): Path2D;\n};\n\ninterface PaymentAddress {\n readonly addressLine: string[];\n readonly city: string;\n readonly country: string;\n readonly dependentLocality: string;\n readonly languageCode: string;\n readonly organization: string;\n readonly phone: string;\n readonly postalCode: string;\n readonly recipient: string;\n readonly region: string;\n readonly sortingCode: string;\n toJSON(): any;\n}\n\ndeclare var PaymentAddress: {\n prototype: PaymentAddress;\n new(): PaymentAddress;\n};\n\ninterface PaymentRequestEventMap {\n \"shippingaddresschange\": Event;\n \"shippingoptionchange\": Event;\n}\n\ninterface PaymentRequest extends EventTarget {\n onshippingaddresschange: (this: PaymentRequest, ev: Event) => any;\n onshippingoptionchange: (this: PaymentRequest, ev: Event) => any;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n readonly shippingType: PaymentShippingType | null;\n abort(): Promise;\n show(): Promise;\n addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var PaymentRequest: {\n prototype: PaymentRequest;\n new(methodData: PaymentMethodData[], details: PaymentDetails, options?: PaymentOptions): PaymentRequest;\n};\n\ninterface PaymentRequestUpdateEvent extends Event {\n updateWith(d: Promise): void;\n}\n\ndeclare var PaymentRequestUpdateEvent: {\n prototype: PaymentRequestUpdateEvent;\n new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;\n};\n\ninterface PaymentResponse {\n readonly details: any;\n readonly methodName: string;\n readonly payerEmail: string | null;\n readonly payerName: string | null;\n readonly payerPhone: string | null;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n complete(result?: PaymentComplete): Promise;\n toJSON(): any;\n}\n\ndeclare var PaymentResponse: {\n prototype: PaymentResponse;\n new(): PaymentResponse;\n};\n\ninterface Performance {\n readonly navigation: PerformanceNavigation;\n readonly timing: PerformanceTiming;\n clearMarks(markName?: string): void;\n clearMeasures(measureName?: string): void;\n clearResourceTimings(): void;\n getEntries(): any;\n getEntriesByName(name: string, entryType?: string): any;\n getEntriesByType(entryType: string): any;\n getMarks(markName?: string): any;\n getMeasures(measureName?: string): any;\n mark(markName: string): void;\n measure(measureName: string, startMarkName?: string, endMarkName?: string): void;\n now(): number;\n setResourceTimingBufferSize(maxSize: number): void;\n toJSON(): any;\n}\n\ndeclare var Performance: {\n prototype: Performance;\n new(): Performance;\n};\n\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n}\n\ndeclare var PerformanceEntry: {\n prototype: PerformanceEntry;\n new(): PerformanceEntry;\n};\n\ninterface PerformanceMark extends PerformanceEntry {\n}\n\ndeclare var PerformanceMark: {\n prototype: PerformanceMark;\n new(): PerformanceMark;\n};\n\ninterface PerformanceMeasure extends PerformanceEntry {\n}\n\ndeclare var PerformanceMeasure: {\n prototype: PerformanceMeasure;\n new(): PerformanceMeasure;\n};\n\ninterface PerformanceNavigation {\n readonly redirectCount: number;\n readonly type: number;\n toJSON(): any;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n}\n\ndeclare var PerformanceNavigation: {\n prototype: PerformanceNavigation;\n new(): PerformanceNavigation;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n};\n\ninterface PerformanceNavigationTiming extends PerformanceEntry {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly domLoading: number;\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly navigationStart: number;\n readonly redirectCount: number;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly type: NavigationType;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n}\n\ndeclare var PerformanceNavigationTiming: {\n prototype: PerformanceNavigationTiming;\n new(): PerformanceNavigationTiming;\n};\n\ninterface PerformanceResourceTiming extends PerformanceEntry {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly fetchStart: number;\n readonly initiatorType: string;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n}\n\ndeclare var PerformanceResourceTiming: {\n prototype: PerformanceResourceTiming;\n new(): PerformanceResourceTiming;\n};\n\ninterface PerformanceTiming {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly domLoading: number;\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly msFirstPaint: number;\n readonly navigationStart: number;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n readonly secureConnectionStart: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceTiming: {\n prototype: PerformanceTiming;\n new(): PerformanceTiming;\n};\n\ninterface PerfWidgetExternal {\n readonly activeNetworkRequestCount: number;\n readonly averageFrameTime: number;\n readonly averagePaintTime: number;\n readonly extraInformationEnabled: boolean;\n readonly independentRenderingEnabled: boolean;\n readonly irDisablingContentString: string;\n readonly irStatusAvailable: boolean;\n readonly maxCpuSpeed: number;\n readonly paintRequestsPerSecond: number;\n readonly performanceCounter: number;\n readonly performanceCounterFrequency: number;\n addEventListener(eventType: string, callback: Function): void;\n getMemoryUsage(): number;\n getProcessCpuUsage(): number;\n getRecentCpuUsage(last: number | null): any;\n getRecentFrames(last: number | null): any;\n getRecentMemoryUsage(last: number | null): any;\n getRecentPaintRequests(last: number | null): any;\n removeEventListener(eventType: string, callback: Function): void;\n repositionWindow(x: number, y: number): void;\n resizeWindow(width: number, height: number): void;\n}\n\ndeclare var PerfWidgetExternal: {\n prototype: PerfWidgetExternal;\n new(): PerfWidgetExternal;\n};\n\ninterface PeriodicWave {\n}\n\ndeclare var PeriodicWave: {\n prototype: PeriodicWave;\n new(): PeriodicWave;\n};\n\ninterface PermissionRequest extends DeferredPermissionRequest {\n readonly state: MSWebViewPermissionState;\n defer(): void;\n}\n\ndeclare var PermissionRequest: {\n prototype: PermissionRequest;\n new(): PermissionRequest;\n};\n\ninterface PermissionRequestedEvent extends Event {\n readonly permissionRequest: PermissionRequest;\n}\n\ndeclare var PermissionRequestedEvent: {\n prototype: PermissionRequestedEvent;\n new(): PermissionRequestedEvent;\n};\n\ninterface Plugin {\n readonly description: string;\n readonly filename: string;\n readonly length: number;\n readonly name: string;\n readonly version: string;\n item(index: number): MimeType;\n namedItem(type: string): MimeType;\n [index: number]: MimeType;\n}\n\ndeclare var Plugin: {\n prototype: Plugin;\n new(): Plugin;\n};\n\ninterface PluginArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(name: string): Plugin;\n refresh(reload?: boolean): void;\n [index: number]: Plugin;\n}\n\ndeclare var PluginArray: {\n prototype: PluginArray;\n new(): PluginArray;\n};\n\ninterface PointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var PointerEvent: {\n prototype: PointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent;\n};\n\ninterface PopStateEvent extends Event {\n readonly state: any;\n initPopStateEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, stateArg: any): void;\n}\n\ndeclare var PopStateEvent: {\n prototype: PopStateEvent;\n new(typeArg: string, eventInitDict?: PopStateEventInit): PopStateEvent;\n};\n\ninterface Position {\n readonly coords: Coordinates;\n readonly timestamp: number;\n}\n\ndeclare var Position: {\n prototype: Position;\n new(): Position;\n};\n\ninterface PositionError {\n readonly code: number;\n readonly message: string;\n toString(): string;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n}\n\ndeclare var PositionError: {\n prototype: PositionError;\n new(): PositionError;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n};\n\ninterface ProcessingInstruction extends CharacterData {\n readonly target: string;\n}\n\ndeclare var ProcessingInstruction: {\n prototype: ProcessingInstruction;\n new(): ProcessingInstruction;\n};\n\ninterface ProgressEvent extends Event {\n readonly lengthComputable: boolean;\n readonly loaded: number;\n readonly total: number;\n initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void;\n}\n\ndeclare var ProgressEvent: {\n prototype: ProgressEvent;\n new(type: string, eventInitDict?: ProgressEventInit): ProgressEvent;\n};\n\ninterface PushManager {\n getSubscription(): Promise;\n permissionState(options?: PushSubscriptionOptionsInit): Promise;\n subscribe(options?: PushSubscriptionOptionsInit): Promise;\n}\n\ndeclare var PushManager: {\n prototype: PushManager;\n new(): PushManager;\n};\n\ninterface PushSubscription {\n readonly endpoint: USVString;\n readonly options: PushSubscriptionOptions;\n getKey(name: PushEncryptionKeyName): ArrayBuffer | null;\n toJSON(): any;\n unsubscribe(): Promise;\n}\n\ndeclare var PushSubscription: {\n prototype: PushSubscription;\n new(): PushSubscription;\n};\n\ninterface PushSubscriptionOptions {\n readonly applicationServerKey: ArrayBuffer | null;\n readonly userVisibleOnly: boolean;\n}\n\ndeclare var PushSubscriptionOptions: {\n prototype: PushSubscriptionOptions;\n new(): PushSubscriptionOptions;\n};\n\ninterface Range {\n readonly collapsed: boolean;\n readonly commonAncestorContainer: Node;\n readonly endContainer: Node;\n readonly endOffset: number;\n readonly startContainer: Node;\n readonly startOffset: number;\n cloneContents(): DocumentFragment;\n cloneRange(): Range;\n collapse(toStart: boolean): void;\n compareBoundaryPoints(how: number, sourceRange: Range): number;\n createContextualFragment(fragment: string): DocumentFragment;\n deleteContents(): void;\n detach(): void;\n expand(Unit: ExpandGranularity): boolean;\n extractContents(): DocumentFragment;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n insertNode(newNode: Node): void;\n selectNode(refNode: Node): void;\n selectNodeContents(refNode: Node): void;\n setEnd(refNode: Node, offset: number): void;\n setEndAfter(refNode: Node): void;\n setEndBefore(refNode: Node): void;\n setStart(refNode: Node, offset: number): void;\n setStartAfter(refNode: Node): void;\n setStartBefore(refNode: Node): void;\n surroundContents(newParent: Node): void;\n toString(): string;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n}\n\ndeclare var Range: {\n prototype: Range;\n new(): Range;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n};\n\ninterface ReadableStream {\n readonly locked: boolean;\n cancel(): Promise;\n getReader(): ReadableStreamReader;\n}\n\ndeclare var ReadableStream: {\n prototype: ReadableStream;\n new(): ReadableStream;\n};\n\ninterface ReadableStreamReader {\n cancel(): Promise;\n read(): Promise;\n releaseLock(): void;\n}\n\ndeclare var ReadableStreamReader: {\n prototype: ReadableStreamReader;\n new(): ReadableStreamReader;\n};\n\ninterface Request extends Object, Body {\n readonly cache: RequestCache;\n readonly credentials: RequestCredentials;\n readonly destination: RequestDestination;\n readonly headers: Headers;\n readonly integrity: string;\n readonly keepalive: boolean;\n readonly method: string;\n readonly mode: RequestMode;\n readonly redirect: RequestRedirect;\n readonly referrer: string;\n readonly referrerPolicy: ReferrerPolicy;\n readonly type: RequestType;\n readonly url: string;\n readonly signal: AbortSignal;\n clone(): Request;\n}\n\ndeclare var Request: {\n prototype: Request;\n new(input: Request | string, init?: RequestInit): Request;\n};\n\ninterface Response extends Object, Body {\n readonly body: ReadableStream | null;\n readonly headers: Headers;\n readonly ok: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly type: ResponseType;\n readonly url: string;\n readonly redirected: boolean;\n clone(): Response;\n}\n\ndeclare var Response: {\n prototype: Response;\n new(body?: any, init?: ResponseInit): Response;\n error: () => Response;\n redirect: (url: string, status?: number) => Response;\n};\n\ninterface RTCDtlsTransportEventMap {\n \"dtlsstatechange\": RTCDtlsTransportStateChangedEvent;\n \"error\": Event;\n}\n\ninterface RTCDtlsTransport extends RTCStatsProvider {\n ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null;\n onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null;\n readonly state: RTCDtlsTransportState;\n readonly transport: RTCIceTransport;\n getLocalParameters(): RTCDtlsParameters;\n getRemoteCertificates(): ArrayBuffer[];\n getRemoteParameters(): RTCDtlsParameters | null;\n start(remoteParameters: RTCDtlsParameters): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtlsTransport: {\n prototype: RTCDtlsTransport;\n new(transport: RTCIceTransport): RTCDtlsTransport;\n};\n\ninterface RTCDtlsTransportStateChangedEvent extends Event {\n readonly state: RTCDtlsTransportState;\n}\n\ndeclare var RTCDtlsTransportStateChangedEvent: {\n prototype: RTCDtlsTransportStateChangedEvent;\n new(): RTCDtlsTransportStateChangedEvent;\n};\n\ninterface RTCDtmfSenderEventMap {\n \"tonechange\": RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDtmfSender extends EventTarget {\n readonly canInsertDTMF: boolean;\n readonly duration: number;\n readonly interToneGap: number;\n ontonechange: (this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any;\n readonly sender: RTCRtpSender;\n readonly toneBuffer: string;\n insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\n addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtmfSender: {\n prototype: RTCDtmfSender;\n new(sender: RTCRtpSender): RTCDtmfSender;\n};\n\ninterface RTCDTMFToneChangeEvent extends Event {\n readonly tone: string;\n}\n\ndeclare var RTCDTMFToneChangeEvent: {\n prototype: RTCDTMFToneChangeEvent;\n new(typeArg: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\n};\n\ninterface RTCIceCandidate {\n candidate: string | null;\n sdpMid: string | null;\n sdpMLineIndex: number | null;\n toJSON(): any;\n}\n\ndeclare var RTCIceCandidate: {\n prototype: RTCIceCandidate;\n new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate;\n};\n\ninterface RTCIceCandidatePairChangedEvent extends Event {\n readonly pair: RTCIceCandidatePair;\n}\n\ndeclare var RTCIceCandidatePairChangedEvent: {\n prototype: RTCIceCandidatePairChangedEvent;\n new(): RTCIceCandidatePairChangedEvent;\n};\n\ninterface RTCIceGathererEventMap {\n \"error\": Event;\n \"localcandidate\": RTCIceGathererEvent;\n}\n\ninterface RTCIceGatherer extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n onerror: ((this: RTCIceGatherer, ev: Event) => any) | null;\n onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\n createAssociatedGatherer(): RTCIceGatherer;\n getLocalCandidates(): RTCIceCandidateDictionary[];\n getLocalParameters(): RTCIceParameters;\n addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceGatherer: {\n prototype: RTCIceGatherer;\n new(options: RTCIceGatherOptions): RTCIceGatherer;\n};\n\ninterface RTCIceGathererEvent extends Event {\n readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete;\n}\n\ndeclare var RTCIceGathererEvent: {\n prototype: RTCIceGathererEvent;\n new(): RTCIceGathererEvent;\n};\n\ninterface RTCIceTransportEventMap {\n \"candidatepairchange\": RTCIceCandidatePairChangedEvent;\n \"icestatechange\": RTCIceTransportStateChangedEvent;\n}\n\ninterface RTCIceTransport extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n readonly iceGatherer: RTCIceGatherer | null;\n oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null;\n onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null;\n readonly role: RTCIceRole;\n readonly state: RTCIceTransportState;\n addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void;\n createAssociatedTransport(): RTCIceTransport;\n getNominatedCandidatePair(): RTCIceCandidatePair | null;\n getRemoteCandidates(): RTCIceCandidateDictionary[];\n getRemoteParameters(): RTCIceParameters | null;\n setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void;\n start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceTransport: {\n prototype: RTCIceTransport;\n new(): RTCIceTransport;\n};\n\ninterface RTCIceTransportStateChangedEvent extends Event {\n readonly state: RTCIceTransportState;\n}\n\ndeclare var RTCIceTransportStateChangedEvent: {\n prototype: RTCIceTransportStateChangedEvent;\n new(): RTCIceTransportStateChangedEvent;\n};\n\ninterface RTCPeerConnectionEventMap {\n \"addstream\": MediaStreamEvent;\n \"icecandidate\": RTCPeerConnectionIceEvent;\n \"iceconnectionstatechange\": Event;\n \"icegatheringstatechange\": Event;\n \"negotiationneeded\": Event;\n \"removestream\": MediaStreamEvent;\n \"signalingstatechange\": Event;\n}\n\ninterface RTCPeerConnection extends EventTarget {\n readonly canTrickleIceCandidates: boolean | null;\n readonly iceConnectionState: RTCIceConnectionState;\n readonly iceGatheringState: RTCIceGatheringState;\n readonly localDescription: RTCSessionDescription | null;\n onaddstream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any;\n onicecandidate: (this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any;\n oniceconnectionstatechange: (this: RTCPeerConnection, ev: Event) => any;\n onicegatheringstatechange: (this: RTCPeerConnection, ev: Event) => any;\n onnegotiationneeded: (this: RTCPeerConnection, ev: Event) => any;\n onremovestream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any;\n onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any;\n readonly remoteDescription: RTCSessionDescription | null;\n readonly signalingState: RTCSignalingState;\n addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n addStream(stream: MediaStream): void;\n close(): void;\n createAnswer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n createOffer(successCallback?: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise;\n getConfiguration(): RTCConfiguration;\n getLocalStreams(): MediaStream[];\n getRemoteStreams(): MediaStream[];\n getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n getStreamById(streamId: string): MediaStream | null;\n removeStream(stream: MediaStream): void;\n setLocalDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n setRemoteDescription(description: RTCSessionDescription, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCPeerConnection: {\n prototype: RTCPeerConnection;\n new(configuration: RTCConfiguration): RTCPeerConnection;\n};\n\ninterface RTCPeerConnectionIceEvent extends Event {\n readonly candidate: RTCIceCandidate;\n}\n\ndeclare var RTCPeerConnectionIceEvent: {\n prototype: RTCPeerConnectionIceEvent;\n new(type: string, eventInitDict: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent;\n};\n\ninterface RTCRtpReceiverEventMap {\n \"error\": Event;\n}\n\ninterface RTCRtpReceiver extends RTCStatsProvider {\n onerror: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack | null;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n getContributingSources(): RTCRtpContributingSource[];\n receive(parameters: RTCRtpParameters): void;\n requestSendCSRC(csrc: number): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpReceiver: {\n prototype: RTCRtpReceiver;\n new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCRtpSenderEventMap {\n \"error\": Event;\n \"ssrcconflict\": RTCSsrcConflictEvent;\n}\n\ninterface RTCRtpSender extends RTCStatsProvider {\n onerror: ((this: RTCRtpSender, ev: Event) => any) | null;\n onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n send(parameters: RTCRtpParameters): void;\n setTrack(track: MediaStreamTrack): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpSender: {\n prototype: RTCRtpSender;\n new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCSessionDescription {\n sdp: string | null;\n type: RTCSdpType | null;\n toJSON(): any;\n}\n\ndeclare var RTCSessionDescription: {\n prototype: RTCSessionDescription;\n new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;\n};\n\ninterface RTCSrtpSdesTransportEventMap {\n \"error\": Event;\n}\n\ninterface RTCSrtpSdesTransport extends EventTarget {\n onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null;\n readonly transport: RTCIceTransport;\n addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCSrtpSdesTransport: {\n prototype: RTCSrtpSdesTransport;\n new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport;\n getLocalParameters(): RTCSrtpSdesParameters[];\n};\n\ninterface RTCSsrcConflictEvent extends Event {\n readonly ssrc: number;\n}\n\ndeclare var RTCSsrcConflictEvent: {\n prototype: RTCSsrcConflictEvent;\n new(): RTCSsrcConflictEvent;\n};\n\ninterface RTCStatsProvider extends EventTarget {\n getStats(): Promise;\n msGetStats(): Promise;\n}\n\ndeclare var RTCStatsProvider: {\n prototype: RTCStatsProvider;\n new(): RTCStatsProvider;\n};\n\ninterface ScopedCredential {\n readonly id: ArrayBuffer;\n readonly type: ScopedCredentialType;\n}\n\ndeclare var ScopedCredential: {\n prototype: ScopedCredential;\n new(): ScopedCredential;\n};\n\ninterface ScopedCredentialInfo {\n readonly credential: ScopedCredential;\n readonly publicKey: CryptoKey;\n}\n\ndeclare var ScopedCredentialInfo: {\n prototype: ScopedCredentialInfo;\n new(): ScopedCredentialInfo;\n};\n\ninterface ScreenEventMap {\n \"MSOrientationChange\": Event;\n}\n\ninterface Screen extends EventTarget {\n readonly availHeight: number;\n readonly availWidth: number;\n bufferDepth: number;\n readonly colorDepth: number;\n readonly deviceXDPI: number;\n readonly deviceYDPI: number;\n readonly fontSmoothingEnabled: boolean;\n readonly height: number;\n readonly logicalXDPI: number;\n readonly logicalYDPI: number;\n readonly msOrientation: string;\n onmsorientationchange: (this: Screen, ev: Event) => any;\n readonly pixelDepth: number;\n readonly systemXDPI: number;\n readonly systemYDPI: number;\n readonly width: number;\n msLockOrientation(orientations: string | string[]): boolean;\n msUnlockOrientation(): void;\n addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Screen: {\n prototype: Screen;\n new(): Screen;\n};\n\ninterface ScriptNotifyEvent extends Event {\n readonly callingUri: string;\n readonly value: string;\n}\n\ndeclare var ScriptNotifyEvent: {\n prototype: ScriptNotifyEvent;\n new(): ScriptNotifyEvent;\n};\n\ninterface ScriptProcessorNodeEventMap {\n \"audioprocess\": AudioProcessingEvent;\n}\n\ninterface ScriptProcessorNode extends AudioNode {\n readonly bufferSize: number;\n onaudioprocess: (this: ScriptProcessorNode, ev: AudioProcessingEvent) => any;\n addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ScriptProcessorNode: {\n prototype: ScriptProcessorNode;\n new(): ScriptProcessorNode;\n};\n\ninterface Selection {\n readonly anchorNode: Node;\n readonly anchorOffset: number;\n readonly baseNode: Node;\n readonly baseOffset: number;\n readonly extentNode: Node;\n readonly extentOffset: number;\n readonly focusNode: Node;\n readonly focusOffset: number;\n readonly isCollapsed: boolean;\n readonly rangeCount: number;\n readonly type: string;\n addRange(range: Range): void;\n collapse(parentNode: Node, offset: number): void;\n collapseToEnd(): void;\n collapseToStart(): void;\n containsNode(node: Node, partlyContained: boolean): boolean;\n deleteFromDocument(): void;\n empty(): void;\n extend(newNode: Node, offset: number): void;\n getRangeAt(index: number): Range;\n removeAllRanges(): void;\n removeRange(range: Range): void;\n selectAllChildren(parentNode: Node): void;\n setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;\n setPosition(parentNode: Node, offset: number): void;\n toString(): string;\n}\n\ndeclare var Selection: {\n prototype: Selection;\n new(): Selection;\n};\n\ninterface ServiceWorkerEventMap extends AbstractWorkerEventMap {\n \"statechange\": Event;\n}\n\ninterface ServiceWorker extends EventTarget, AbstractWorker {\n onstatechange: (this: ServiceWorker, ev: Event) => any;\n readonly scriptURL: USVString;\n readonly state: ServiceWorkerState;\n postMessage(message: any, transfer?: any[]): void;\n addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorker: {\n prototype: ServiceWorker;\n new(): ServiceWorker;\n};\n\ninterface ServiceWorkerContainerEventMap {\n \"controllerchange\": Event;\n \"message\": ServiceWorkerMessageEvent;\n}\n\ninterface ServiceWorkerContainer extends EventTarget {\n readonly controller: ServiceWorker | null;\n oncontrollerchange: (this: ServiceWorkerContainer, ev: Event) => any;\n onmessage: (this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any;\n readonly ready: Promise;\n getRegistration(clientURL?: USVString): Promise;\n getRegistrations(): Promise;\n register(scriptURL: USVString, options?: RegistrationOptions): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerContainer: {\n prototype: ServiceWorkerContainer;\n new(): ServiceWorkerContainer;\n};\n\ninterface ServiceWorkerMessageEvent extends Event {\n readonly data: any;\n readonly lastEventId: string;\n readonly origin: string;\n readonly ports: MessagePort[] | null;\n readonly source: ServiceWorker | MessagePort | null;\n}\n\ndeclare var ServiceWorkerMessageEvent: {\n prototype: ServiceWorkerMessageEvent;\n new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent;\n};\n\ninterface ServiceWorkerRegistrationEventMap {\n \"updatefound\": Event;\n}\n\ninterface ServiceWorkerRegistration extends EventTarget {\n readonly active: ServiceWorker | null;\n readonly installing: ServiceWorker | null;\n onupdatefound: (this: ServiceWorkerRegistration, ev: Event) => any;\n readonly pushManager: PushManager;\n readonly scope: USVString;\n readonly sync: SyncManager;\n readonly waiting: ServiceWorker | null;\n getNotifications(filter?: GetNotificationOptions): Promise;\n showNotification(title: string, options?: NotificationOptions): Promise;\n unregister(): Promise;\n update(): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerRegistration: {\n prototype: ServiceWorkerRegistration;\n new(): ServiceWorkerRegistration;\n};\n\ninterface SourceBuffer extends EventTarget {\n appendWindowEnd: number;\n appendWindowStart: number;\n readonly audioTracks: AudioTrackList;\n readonly buffered: TimeRanges;\n mode: AppendMode;\n timestampOffset: number;\n readonly updating: boolean;\n readonly videoTracks: VideoTrackList;\n abort(): void;\n appendBuffer(data: ArrayBuffer | ArrayBufferView): void;\n appendStream(stream: MSStream, maxSize?: number): void;\n remove(start: number, end: number): void;\n}\n\ndeclare var SourceBuffer: {\n prototype: SourceBuffer;\n new(): SourceBuffer;\n};\n\ninterface SourceBufferList extends EventTarget {\n readonly length: number;\n item(index: number): SourceBuffer;\n [index: number]: SourceBuffer;\n}\n\ndeclare var SourceBufferList: {\n prototype: SourceBufferList;\n new(): SourceBufferList;\n};\n\ninterface SpeechSynthesisEventMap {\n \"voiceschanged\": Event;\n}\n\ninterface SpeechSynthesis extends EventTarget {\n onvoiceschanged: (this: SpeechSynthesis, ev: Event) => any;\n readonly paused: boolean;\n readonly pending: boolean;\n readonly speaking: boolean;\n cancel(): void;\n getVoices(): SpeechSynthesisVoice[];\n pause(): void;\n resume(): void;\n speak(utterance: SpeechSynthesisUtterance): void;\n addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesis: {\n prototype: SpeechSynthesis;\n new(): SpeechSynthesis;\n};\n\ninterface SpeechSynthesisEvent extends Event {\n readonly charIndex: number;\n readonly elapsedTime: number;\n readonly name: string;\n readonly utterance: SpeechSynthesisUtterance | null;\n}\n\ndeclare var SpeechSynthesisEvent: {\n prototype: SpeechSynthesisEvent;\n new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent;\n};\n\ninterface SpeechSynthesisUtteranceEventMap {\n \"boundary\": Event;\n \"end\": Event;\n \"error\": Event;\n \"mark\": Event;\n \"pause\": Event;\n \"resume\": Event;\n \"start\": Event;\n}\n\ninterface SpeechSynthesisUtterance extends EventTarget {\n lang: string;\n onboundary: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onend: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onerror: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onmark: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onpause: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onresume: (this: SpeechSynthesisUtterance, ev: Event) => any;\n onstart: (this: SpeechSynthesisUtterance, ev: Event) => any;\n pitch: number;\n rate: number;\n text: string;\n voice: SpeechSynthesisVoice;\n volume: number;\n addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesisUtterance: {\n prototype: SpeechSynthesisUtterance;\n new(text?: string): SpeechSynthesisUtterance;\n};\n\ninterface SpeechSynthesisVoice {\n readonly default: boolean;\n readonly lang: string;\n readonly localService: boolean;\n readonly name: string;\n readonly voiceURI: string;\n}\n\ndeclare var SpeechSynthesisVoice: {\n prototype: SpeechSynthesisVoice;\n new(): SpeechSynthesisVoice;\n};\n\ninterface StereoPannerNode extends AudioNode {\n readonly pan: AudioParam;\n}\n\ndeclare var StereoPannerNode: {\n prototype: StereoPannerNode;\n new(): StereoPannerNode;\n};\n\ninterface Storage {\n readonly length: number;\n clear(): void;\n getItem(key: string): string | null;\n key(index: number): string | null;\n removeItem(key: string): void;\n setItem(key: string, data: string): void;\n [key: string]: any;\n [index: number]: string;\n}\n\ndeclare var Storage: {\n prototype: Storage;\n new(): Storage;\n};\n\ninterface StorageEvent extends Event {\n readonly url: string;\n key?: string;\n oldValue?: string;\n newValue?: string;\n storageArea?: Storage;\n}\n\ndeclare var StorageEvent: {\n prototype: StorageEvent;\n new (type: string, eventInitDict?: StorageEventInit): StorageEvent;\n};\n\ninterface StyleMedia {\n readonly type: string;\n matchMedium(mediaquery: string): boolean;\n}\n\ndeclare var StyleMedia: {\n prototype: StyleMedia;\n new(): StyleMedia;\n};\n\ninterface StyleSheet {\n disabled: boolean;\n readonly href: string;\n readonly media: MediaList;\n readonly ownerNode: Node;\n readonly parentStyleSheet: StyleSheet;\n readonly title: string;\n readonly type: string;\n}\n\ndeclare var StyleSheet: {\n prototype: StyleSheet;\n new(): StyleSheet;\n};\n\ninterface StyleSheetList {\n readonly length: number;\n item(index?: number): StyleSheet;\n [index: number]: StyleSheet;\n}\n\ndeclare var StyleSheetList: {\n prototype: StyleSheetList;\n new(): StyleSheetList;\n};\n\ninterface StyleSheetPageList {\n readonly length: number;\n item(index: number): CSSPageRule;\n [index: number]: CSSPageRule;\n}\n\ndeclare var StyleSheetPageList: {\n prototype: StyleSheetPageList;\n new(): StyleSheetPageList;\n};\n\ninterface SubtleCrypto {\n decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike;\n deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike;\n deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n digest(algorithm: AlgorithmIdentifier, data: BufferSource): PromiseLike;\n encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: BufferSource): PromiseLike;\n exportKey(format: \"jwk\", key: CryptoKey): PromiseLike;\n exportKey(format: \"raw\" | \"pkcs8\" | \"spki\", key: CryptoKey): PromiseLike;\n exportKey(format: string, key: CryptoKey): PromiseLike;\n generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"jwk\", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"raw\" | \"pkcs8\" | \"spki\", keyData: BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: string, keyData: JsonWebKey | BufferSource, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: BufferSource): PromiseLike;\n unwrapKey(format: string, wrappedKey: BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier, unwrappedKeyAlgorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: string[]): PromiseLike;\n verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: BufferSource, data: BufferSource): PromiseLike;\n wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier): PromiseLike;\n}\n\ndeclare var SubtleCrypto: {\n prototype: SubtleCrypto;\n new(): SubtleCrypto;\n};\n\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAElement: {\n prototype: SVGAElement;\n new(): SVGAElement;\n};\n\ninterface SVGAngle {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n}\n\ndeclare var SVGAngle: {\n prototype: SVGAngle;\n new(): SVGAngle;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n};\n\ninterface SVGAnimatedAngle {\n readonly animVal: SVGAngle;\n readonly baseVal: SVGAngle;\n}\n\ndeclare var SVGAnimatedAngle: {\n prototype: SVGAnimatedAngle;\n new(): SVGAnimatedAngle;\n};\n\ninterface SVGAnimatedBoolean {\n readonly animVal: boolean;\n baseVal: boolean;\n}\n\ndeclare var SVGAnimatedBoolean: {\n prototype: SVGAnimatedBoolean;\n new(): SVGAnimatedBoolean;\n};\n\ninterface SVGAnimatedEnumeration {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedEnumeration: {\n prototype: SVGAnimatedEnumeration;\n new(): SVGAnimatedEnumeration;\n};\n\ninterface SVGAnimatedInteger {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedInteger: {\n prototype: SVGAnimatedInteger;\n new(): SVGAnimatedInteger;\n};\n\ninterface SVGAnimatedLength {\n readonly animVal: SVGLength;\n readonly baseVal: SVGLength;\n}\n\ndeclare var SVGAnimatedLength: {\n prototype: SVGAnimatedLength;\n new(): SVGAnimatedLength;\n};\n\ninterface SVGAnimatedLengthList {\n readonly animVal: SVGLengthList;\n readonly baseVal: SVGLengthList;\n}\n\ndeclare var SVGAnimatedLengthList: {\n prototype: SVGAnimatedLengthList;\n new(): SVGAnimatedLengthList;\n};\n\ninterface SVGAnimatedNumber {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedNumber: {\n prototype: SVGAnimatedNumber;\n new(): SVGAnimatedNumber;\n};\n\ninterface SVGAnimatedNumberList {\n readonly animVal: SVGNumberList;\n readonly baseVal: SVGNumberList;\n}\n\ndeclare var SVGAnimatedNumberList: {\n prototype: SVGAnimatedNumberList;\n new(): SVGAnimatedNumberList;\n};\n\ninterface SVGAnimatedPreserveAspectRatio {\n readonly animVal: SVGPreserveAspectRatio;\n readonly baseVal: SVGPreserveAspectRatio;\n}\n\ndeclare var SVGAnimatedPreserveAspectRatio: {\n prototype: SVGAnimatedPreserveAspectRatio;\n new(): SVGAnimatedPreserveAspectRatio;\n};\n\ninterface SVGAnimatedRect {\n readonly animVal: SVGRect;\n readonly baseVal: SVGRect;\n}\n\ndeclare var SVGAnimatedRect: {\n prototype: SVGAnimatedRect;\n new(): SVGAnimatedRect;\n};\n\ninterface SVGAnimatedString {\n readonly animVal: string;\n baseVal: string;\n}\n\ndeclare var SVGAnimatedString: {\n prototype: SVGAnimatedString;\n new(): SVGAnimatedString;\n};\n\ninterface SVGAnimatedTransformList {\n readonly animVal: SVGTransformList;\n readonly baseVal: SVGTransformList;\n}\n\ndeclare var SVGAnimatedTransformList: {\n prototype: SVGAnimatedTransformList;\n new(): SVGAnimatedTransformList;\n};\n\ninterface SVGCircleElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGCircleElement: {\n prototype: SVGCircleElement;\n new(): SVGCircleElement;\n};\n\ninterface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes {\n readonly clipPathUnits: SVGAnimatedEnumeration;\n addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGClipPathElement: {\n prototype: SVGClipPathElement;\n new(): SVGClipPathElement;\n};\n\ninterface SVGComponentTransferFunctionElement extends SVGElement {\n readonly amplitude: SVGAnimatedNumber;\n readonly exponent: SVGAnimatedNumber;\n readonly intercept: SVGAnimatedNumber;\n readonly offset: SVGAnimatedNumber;\n readonly slope: SVGAnimatedNumber;\n readonly tableValues: SVGAnimatedNumberList;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGComponentTransferFunctionElement: {\n prototype: SVGComponentTransferFunctionElement;\n new(): SVGComponentTransferFunctionElement;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n};\n\ninterface SVGDefsElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDefsElement: {\n prototype: SVGDefsElement;\n new(): SVGDefsElement;\n};\n\ninterface SVGDescElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDescElement: {\n prototype: SVGDescElement;\n new(): SVGDescElement;\n};\n\ninterface SVGElementEventMap extends ElementEventMap {\n \"click\": MouseEvent;\n \"dblclick\": MouseEvent;\n \"focusin\": FocusEvent;\n \"focusout\": FocusEvent;\n \"load\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n}\n\ninterface SVGElement extends Element {\n className: any;\n onclick: (this: SVGElement, ev: MouseEvent) => any;\n ondblclick: (this: SVGElement, ev: MouseEvent) => any;\n onfocusin: (this: SVGElement, ev: FocusEvent) => any;\n onfocusout: (this: SVGElement, ev: FocusEvent) => any;\n onload: (this: SVGElement, ev: Event) => any;\n onmousedown: (this: SVGElement, ev: MouseEvent) => any;\n onmousemove: (this: SVGElement, ev: MouseEvent) => any;\n onmouseout: (this: SVGElement, ev: MouseEvent) => any;\n onmouseover: (this: SVGElement, ev: MouseEvent) => any;\n onmouseup: (this: SVGElement, ev: MouseEvent) => any;\n readonly ownerSVGElement: SVGSVGElement;\n readonly style: CSSStyleDeclaration;\n readonly viewportElement: SVGElement;\n xmlbase: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGElement: {\n prototype: SVGElement;\n new(): SVGElement;\n};\n\ninterface SVGElementInstance extends EventTarget {\n readonly childNodes: SVGElementInstanceList;\n readonly correspondingElement: SVGElement;\n readonly correspondingUseElement: SVGUseElement;\n readonly firstChild: SVGElementInstance;\n readonly lastChild: SVGElementInstance;\n readonly nextSibling: SVGElementInstance;\n readonly parentNode: SVGElementInstance;\n readonly previousSibling: SVGElementInstance;\n}\n\ndeclare var SVGElementInstance: {\n prototype: SVGElementInstance;\n new(): SVGElementInstance;\n};\n\ninterface SVGElementInstanceList {\n readonly length: number;\n item(index: number): SVGElementInstance;\n}\n\ndeclare var SVGElementInstanceList: {\n prototype: SVGElementInstanceList;\n new(): SVGElementInstanceList;\n};\n\ninterface SVGEllipseElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGEllipseElement: {\n prototype: SVGEllipseElement;\n new(): SVGEllipseElement;\n};\n\ninterface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly mode: SVGAnimatedEnumeration;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEBlendElement: {\n prototype: SVGFEBlendElement;\n new(): SVGFEBlendElement;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n};\n\ninterface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly type: SVGAnimatedEnumeration;\n readonly values: SVGAnimatedNumberList;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEColorMatrixElement: {\n prototype: SVGFEColorMatrixElement;\n new(): SVGFEColorMatrixElement;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEComponentTransferElement: {\n prototype: SVGFEComponentTransferElement;\n new(): SVGFEComponentTransferElement;\n};\n\ninterface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly k1: SVGAnimatedNumber;\n readonly k2: SVGAnimatedNumber;\n readonly k3: SVGAnimatedNumber;\n readonly k4: SVGAnimatedNumber;\n readonly operator: SVGAnimatedEnumeration;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFECompositeElement: {\n prototype: SVGFECompositeElement;\n new(): SVGFECompositeElement;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n};\n\ninterface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly bias: SVGAnimatedNumber;\n readonly divisor: SVGAnimatedNumber;\n readonly edgeMode: SVGAnimatedEnumeration;\n readonly in1: SVGAnimatedString;\n readonly kernelMatrix: SVGAnimatedNumberList;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly orderX: SVGAnimatedInteger;\n readonly orderY: SVGAnimatedInteger;\n readonly preserveAlpha: SVGAnimatedBoolean;\n readonly targetX: SVGAnimatedInteger;\n readonly targetY: SVGAnimatedInteger;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEConvolveMatrixElement: {\n prototype: SVGFEConvolveMatrixElement;\n new(): SVGFEConvolveMatrixElement;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n};\n\ninterface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly diffuseConstant: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDiffuseLightingElement: {\n prototype: SVGFEDiffuseLightingElement;\n new(): SVGFEDiffuseLightingElement;\n};\n\ninterface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly scale: SVGAnimatedNumber;\n readonly xChannelSelector: SVGAnimatedEnumeration;\n readonly yChannelSelector: SVGAnimatedEnumeration;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDisplacementMapElement: {\n prototype: SVGFEDisplacementMapElement;\n new(): SVGFEDisplacementMapElement;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n};\n\ninterface SVGFEDistantLightElement extends SVGElement {\n readonly azimuth: SVGAnimatedNumber;\n readonly elevation: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDistantLightElement: {\n prototype: SVGFEDistantLightElement;\n new(): SVGFEDistantLightElement;\n};\n\ninterface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFloodElement: {\n prototype: SVGFEFloodElement;\n new(): SVGFEFloodElement;\n};\n\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncAElement: {\n prototype: SVGFEFuncAElement;\n new(): SVGFEFuncAElement;\n};\n\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncBElement: {\n prototype: SVGFEFuncBElement;\n new(): SVGFEFuncBElement;\n};\n\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncGElement: {\n prototype: SVGFEFuncGElement;\n new(): SVGFEFuncGElement;\n};\n\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncRElement: {\n prototype: SVGFEFuncRElement;\n new(): SVGFEFuncRElement;\n};\n\ninterface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly stdDeviationX: SVGAnimatedNumber;\n readonly stdDeviationY: SVGAnimatedNumber;\n setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;\n addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEGaussianBlurElement: {\n prototype: SVGFEGaussianBlurElement;\n new(): SVGFEGaussianBlurElement;\n};\n\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEImageElement: {\n prototype: SVGFEImageElement;\n new(): SVGFEImageElement;\n};\n\ninterface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeElement: {\n prototype: SVGFEMergeElement;\n new(): SVGFEMergeElement;\n};\n\ninterface SVGFEMergeNodeElement extends SVGElement {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeNodeElement: {\n prototype: SVGFEMergeNodeElement;\n new(): SVGFEMergeNodeElement;\n};\n\ninterface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly operator: SVGAnimatedEnumeration;\n readonly radiusX: SVGAnimatedNumber;\n readonly radiusY: SVGAnimatedNumber;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMorphologyElement: {\n prototype: SVGFEMorphologyElement;\n new(): SVGFEMorphologyElement;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n};\n\ninterface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly dx: SVGAnimatedNumber;\n readonly dy: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEOffsetElement: {\n prototype: SVGFEOffsetElement;\n new(): SVGFEOffsetElement;\n};\n\ninterface SVGFEPointLightElement extends SVGElement {\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEPointLightElement: {\n prototype: SVGFEPointLightElement;\n new(): SVGFEPointLightElement;\n};\n\ninterface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly specularConstant: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpecularLightingElement: {\n prototype: SVGFESpecularLightingElement;\n new(): SVGFESpecularLightingElement;\n};\n\ninterface SVGFESpotLightElement extends SVGElement {\n readonly limitingConeAngle: SVGAnimatedNumber;\n readonly pointsAtX: SVGAnimatedNumber;\n readonly pointsAtY: SVGAnimatedNumber;\n readonly pointsAtZ: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpotLightElement: {\n prototype: SVGFESpotLightElement;\n new(): SVGFESpotLightElement;\n};\n\ninterface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETileElement: {\n prototype: SVGFETileElement;\n new(): SVGFETileElement;\n};\n\ninterface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly baseFrequencyX: SVGAnimatedNumber;\n readonly baseFrequencyY: SVGAnimatedNumber;\n readonly numOctaves: SVGAnimatedInteger;\n readonly seed: SVGAnimatedNumber;\n readonly stitchTiles: SVGAnimatedEnumeration;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETurbulenceElement: {\n prototype: SVGFETurbulenceElement;\n new(): SVGFETurbulenceElement;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n readonly filterResX: SVGAnimatedInteger;\n readonly filterResY: SVGAnimatedInteger;\n readonly filterUnits: SVGAnimatedEnumeration;\n readonly height: SVGAnimatedLength;\n readonly primitiveUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n setFilterRes(filterResX: number, filterResY: number): void;\n addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFilterElement: {\n prototype: SVGFilterElement;\n new(): SVGFilterElement;\n};\n\ninterface SVGForeignObjectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGForeignObjectElement: {\n prototype: SVGForeignObjectElement;\n new(): SVGForeignObjectElement;\n};\n\ninterface SVGGElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGElement: {\n prototype: SVGGElement;\n new(): SVGGElement;\n};\n\ninterface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n readonly gradientTransform: SVGAnimatedTransformList;\n readonly gradientUnits: SVGAnimatedEnumeration;\n readonly spreadMethod: SVGAnimatedEnumeration;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGradientElement: {\n prototype: SVGGradientElement;\n new(): SVGGradientElement;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n};\n\ninterface SVGGraphicsElement extends SVGElement, SVGTests {\n readonly farthestViewportElement: SVGElement;\n readonly nearestViewportElement: SVGElement;\n readonly transform: SVGAnimatedTransformList;\n getBBox(): SVGRect;\n getCTM(): SVGMatrix;\n getScreenCTM(): SVGMatrix;\n getTransformToElement(element: SVGElement): SVGMatrix;\n addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGraphicsElement: {\n prototype: SVGGraphicsElement;\n new(): SVGGraphicsElement;\n};\n\ninterface SVGImageElement extends SVGGraphicsElement, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGImageElement: {\n prototype: SVGImageElement;\n new(): SVGImageElement;\n};\n\ninterface SVGLength {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n}\n\ndeclare var SVGLength: {\n prototype: SVGLength;\n new(): SVGLength;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n};\n\ninterface SVGLengthList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGLength): SVGLength;\n clear(): void;\n getItem(index: number): SVGLength;\n initialize(newItem: SVGLength): SVGLength;\n insertItemBefore(newItem: SVGLength, index: number): SVGLength;\n removeItem(index: number): SVGLength;\n replaceItem(newItem: SVGLength, index: number): SVGLength;\n}\n\ndeclare var SVGLengthList: {\n prototype: SVGLengthList;\n new(): SVGLengthList;\n};\n\ninterface SVGLinearGradientElement extends SVGGradientElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLinearGradientElement: {\n prototype: SVGLinearGradientElement;\n new(): SVGLinearGradientElement;\n};\n\ninterface SVGLineElement extends SVGGraphicsElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLineElement: {\n prototype: SVGLineElement;\n new(): SVGLineElement;\n};\n\ninterface SVGMarkerElement extends SVGElement, SVGFitToViewBox {\n readonly markerHeight: SVGAnimatedLength;\n readonly markerUnits: SVGAnimatedEnumeration;\n readonly markerWidth: SVGAnimatedLength;\n readonly orientAngle: SVGAnimatedAngle;\n readonly orientType: SVGAnimatedEnumeration;\n readonly refX: SVGAnimatedLength;\n readonly refY: SVGAnimatedLength;\n setOrientToAngle(angle: SVGAngle): void;\n setOrientToAuto(): void;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMarkerElement: {\n prototype: SVGMarkerElement;\n new(): SVGMarkerElement;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n};\n\ninterface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes {\n readonly height: SVGAnimatedLength;\n readonly maskContentUnits: SVGAnimatedEnumeration;\n readonly maskUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMaskElement: {\n prototype: SVGMaskElement;\n new(): SVGMaskElement;\n};\n\ninterface SVGMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n flipX(): SVGMatrix;\n flipY(): SVGMatrix;\n inverse(): SVGMatrix;\n multiply(secondMatrix: SVGMatrix): SVGMatrix;\n rotate(angle: number): SVGMatrix;\n rotateFromVector(x: number, y: number): SVGMatrix;\n scale(scaleFactor: number): SVGMatrix;\n scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix;\n skewX(angle: number): SVGMatrix;\n skewY(angle: number): SVGMatrix;\n translate(x: number, y: number): SVGMatrix;\n}\n\ndeclare var SVGMatrix: {\n prototype: SVGMatrix;\n new(): SVGMatrix;\n};\n\ninterface SVGMetadataElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMetadataElement: {\n prototype: SVGMetadataElement;\n new(): SVGMetadataElement;\n};\n\ninterface SVGNumber {\n value: number;\n}\n\ndeclare var SVGNumber: {\n prototype: SVGNumber;\n new(): SVGNumber;\n};\n\ninterface SVGNumberList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGNumber): SVGNumber;\n clear(): void;\n getItem(index: number): SVGNumber;\n initialize(newItem: SVGNumber): SVGNumber;\n insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;\n removeItem(index: number): SVGNumber;\n replaceItem(newItem: SVGNumber, index: number): SVGNumber;\n}\n\ndeclare var SVGNumberList: {\n prototype: SVGNumberList;\n new(): SVGNumberList;\n};\n\ninterface SVGPathElement extends SVGGraphicsElement {\n readonly pathSegList: SVGPathSegList;\n createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;\n createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;\n createSVGPathSegClosePath(): SVGPathSegClosePath;\n createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;\n createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;\n createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;\n createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;\n createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;\n createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;\n createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;\n createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;\n createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;\n createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;\n createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;\n createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;\n createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;\n createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;\n createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;\n createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;\n getPathSegAtLength(distance: number): number;\n getPointAtLength(distance: number): SVGPoint;\n getTotalLength(): number;\n addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPathElement: {\n prototype: SVGPathElement;\n new(): SVGPathElement;\n};\n\ninterface SVGPathSeg {\n readonly pathSegType: number;\n readonly pathSegTypeAsLetter: string;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n}\n\ndeclare var SVGPathSeg: {\n prototype: SVGPathSeg;\n new(): SVGPathSeg;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n};\n\ninterface SVGPathSegArcAbs extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcAbs: {\n prototype: SVGPathSegArcAbs;\n new(): SVGPathSegArcAbs;\n};\n\ninterface SVGPathSegArcRel extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcRel: {\n prototype: SVGPathSegArcRel;\n new(): SVGPathSegArcRel;\n};\n\ninterface SVGPathSegClosePath extends SVGPathSeg {\n}\n\ndeclare var SVGPathSegClosePath: {\n prototype: SVGPathSegClosePath;\n new(): SVGPathSegClosePath;\n};\n\ninterface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicAbs: {\n prototype: SVGPathSegCurvetoCubicAbs;\n new(): SVGPathSegCurvetoCubicAbs;\n};\n\ninterface SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicRel: {\n prototype: SVGPathSegCurvetoCubicRel;\n new(): SVGPathSegCurvetoCubicRel;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothAbs: {\n prototype: SVGPathSegCurvetoCubicSmoothAbs;\n new(): SVGPathSegCurvetoCubicSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothRel: {\n prototype: SVGPathSegCurvetoCubicSmoothRel;\n new(): SVGPathSegCurvetoCubicSmoothRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticAbs: {\n prototype: SVGPathSegCurvetoQuadraticAbs;\n new(): SVGPathSegCurvetoQuadraticAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticRel: {\n prototype: SVGPathSegCurvetoQuadraticRel;\n new(): SVGPathSegCurvetoQuadraticRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothAbs: {\n prototype: SVGPathSegCurvetoQuadraticSmoothAbs;\n new(): SVGPathSegCurvetoQuadraticSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothRel: {\n prototype: SVGPathSegCurvetoQuadraticSmoothRel;\n new(): SVGPathSegCurvetoQuadraticSmoothRel;\n};\n\ninterface SVGPathSegLinetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoAbs: {\n prototype: SVGPathSegLinetoAbs;\n new(): SVGPathSegLinetoAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalAbs: {\n prototype: SVGPathSegLinetoHorizontalAbs;\n new(): SVGPathSegLinetoHorizontalAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalRel: {\n prototype: SVGPathSegLinetoHorizontalRel;\n new(): SVGPathSegLinetoHorizontalRel;\n};\n\ninterface SVGPathSegLinetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoRel: {\n prototype: SVGPathSegLinetoRel;\n new(): SVGPathSegLinetoRel;\n};\n\ninterface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalAbs: {\n prototype: SVGPathSegLinetoVerticalAbs;\n new(): SVGPathSegLinetoVerticalAbs;\n};\n\ninterface SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalRel: {\n prototype: SVGPathSegLinetoVerticalRel;\n new(): SVGPathSegLinetoVerticalRel;\n};\n\ninterface SVGPathSegList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPathSeg): SVGPathSeg;\n clear(): void;\n getItem(index: number): SVGPathSeg;\n initialize(newItem: SVGPathSeg): SVGPathSeg;\n insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;\n removeItem(index: number): SVGPathSeg;\n replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;\n}\n\ndeclare var SVGPathSegList: {\n prototype: SVGPathSegList;\n new(): SVGPathSegList;\n};\n\ninterface SVGPathSegMovetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoAbs: {\n prototype: SVGPathSegMovetoAbs;\n new(): SVGPathSegMovetoAbs;\n};\n\ninterface SVGPathSegMovetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoRel: {\n prototype: SVGPathSegMovetoRel;\n new(): SVGPathSegMovetoRel;\n};\n\ninterface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly patternContentUnits: SVGAnimatedEnumeration;\n readonly patternTransform: SVGAnimatedTransformList;\n readonly patternUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPatternElement: {\n prototype: SVGPatternElement;\n new(): SVGPatternElement;\n};\n\ninterface SVGPoint {\n x: number;\n y: number;\n matrixTransform(matrix: SVGMatrix): SVGPoint;\n}\n\ndeclare var SVGPoint: {\n prototype: SVGPoint;\n new(): SVGPoint;\n};\n\ninterface SVGPointList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPoint): SVGPoint;\n clear(): void;\n getItem(index: number): SVGPoint;\n initialize(newItem: SVGPoint): SVGPoint;\n insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;\n removeItem(index: number): SVGPoint;\n replaceItem(newItem: SVGPoint, index: number): SVGPoint;\n}\n\ndeclare var SVGPointList: {\n prototype: SVGPointList;\n new(): SVGPointList;\n};\n\ninterface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolygonElement: {\n prototype: SVGPolygonElement;\n new(): SVGPolygonElement;\n};\n\ninterface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolylineElement: {\n prototype: SVGPolylineElement;\n new(): SVGPolylineElement;\n};\n\ninterface SVGPreserveAspectRatio {\n align: number;\n meetOrSlice: number;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n}\n\ndeclare var SVGPreserveAspectRatio: {\n prototype: SVGPreserveAspectRatio;\n new(): SVGPreserveAspectRatio;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n};\n\ninterface SVGRadialGradientElement extends SVGGradientElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly fx: SVGAnimatedLength;\n readonly fy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRadialGradientElement: {\n prototype: SVGRadialGradientElement;\n new(): SVGRadialGradientElement;\n};\n\ninterface SVGRect {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var SVGRect: {\n prototype: SVGRect;\n new(): SVGRect;\n};\n\ninterface SVGRectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRectElement: {\n prototype: SVGRectElement;\n new(): SVGRectElement;\n};\n\ninterface SVGScriptElement extends SVGElement, SVGURIReference {\n type: string;\n addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGScriptElement: {\n prototype: SVGScriptElement;\n new(): SVGScriptElement;\n};\n\ninterface SVGStopElement extends SVGElement {\n readonly offset: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStopElement: {\n prototype: SVGStopElement;\n new(): SVGStopElement;\n};\n\ninterface SVGStringList {\n readonly numberOfItems: number;\n appendItem(newItem: string): string;\n clear(): void;\n getItem(index: number): string;\n initialize(newItem: string): string;\n insertItemBefore(newItem: string, index: number): string;\n removeItem(index: number): string;\n replaceItem(newItem: string, index: number): string;\n}\n\ndeclare var SVGStringList: {\n prototype: SVGStringList;\n new(): SVGStringList;\n};\n\ninterface SVGStyleElement extends SVGElement {\n disabled: boolean;\n media: string;\n title: string;\n type: string;\n addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStyleElement: {\n prototype: SVGStyleElement;\n new(): SVGStyleElement;\n};\n\ninterface SVGSVGElementEventMap extends SVGElementEventMap {\n \"SVGAbort\": Event;\n \"SVGError\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"SVGUnload\": Event;\n \"SVGZoom\": SVGZoomEvent;\n}\n\ninterface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan {\n contentScriptType: string;\n contentStyleType: string;\n currentScale: number;\n readonly currentTranslate: SVGPoint;\n readonly height: SVGAnimatedLength;\n onabort: (this: SVGSVGElement, ev: Event) => any;\n onerror: (this: SVGSVGElement, ev: Event) => any;\n onresize: (this: SVGSVGElement, ev: UIEvent) => any;\n onscroll: (this: SVGSVGElement, ev: UIEvent) => any;\n onunload: (this: SVGSVGElement, ev: Event) => any;\n onzoom: (this: SVGSVGElement, ev: SVGZoomEvent) => any;\n readonly pixelUnitToMillimeterX: number;\n readonly pixelUnitToMillimeterY: number;\n readonly screenPixelToMillimeterX: number;\n readonly screenPixelToMillimeterY: number;\n readonly viewport: SVGRect;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n checkEnclosure(element: SVGElement, rect: SVGRect): boolean;\n checkIntersection(element: SVGElement, rect: SVGRect): boolean;\n createSVGAngle(): SVGAngle;\n createSVGLength(): SVGLength;\n createSVGMatrix(): SVGMatrix;\n createSVGNumber(): SVGNumber;\n createSVGPoint(): SVGPoint;\n createSVGRect(): SVGRect;\n createSVGTransform(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n deselectAll(): void;\n forceRedraw(): void;\n getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;\n getCurrentTime(): number;\n getElementById(elementId: string): Element;\n getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n pauseAnimations(): void;\n setCurrentTime(seconds: number): void;\n suspendRedraw(maxWaitMilliseconds: number): number;\n unpauseAnimations(): void;\n unsuspendRedraw(suspendHandleID: number): void;\n unsuspendRedrawAll(): void;\n addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSVGElement: {\n prototype: SVGSVGElement;\n new(): SVGSVGElement;\n};\n\ninterface SVGSwitchElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSwitchElement: {\n prototype: SVGSwitchElement;\n new(): SVGSwitchElement;\n};\n\ninterface SVGSymbolElement extends SVGElement, SVGFitToViewBox {\n addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSymbolElement: {\n prototype: SVGSymbolElement;\n new(): SVGSymbolElement;\n};\n\ninterface SVGTextContentElement extends SVGGraphicsElement {\n readonly lengthAdjust: SVGAnimatedEnumeration;\n readonly textLength: SVGAnimatedLength;\n getCharNumAtPosition(point: SVGPoint): number;\n getComputedTextLength(): number;\n getEndPositionOfChar(charnum: number): SVGPoint;\n getExtentOfChar(charnum: number): SVGRect;\n getNumberOfChars(): number;\n getRotationOfChar(charnum: number): number;\n getStartPositionOfChar(charnum: number): SVGPoint;\n getSubStringLength(charnum: number, nchars: number): number;\n selectSubString(charnum: number, nchars: number): void;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextContentElement: {\n prototype: SVGTextContentElement;\n new(): SVGTextContentElement;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n};\n\ninterface SVGTextElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextElement: {\n prototype: SVGTextElement;\n new(): SVGTextElement;\n};\n\ninterface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {\n readonly method: SVGAnimatedEnumeration;\n readonly spacing: SVGAnimatedEnumeration;\n readonly startOffset: SVGAnimatedLength;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPathElement: {\n prototype: SVGTextPathElement;\n new(): SVGTextPathElement;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n};\n\ninterface SVGTextPositioningElement extends SVGTextContentElement {\n readonly dx: SVGAnimatedLengthList;\n readonly dy: SVGAnimatedLengthList;\n readonly rotate: SVGAnimatedNumberList;\n readonly x: SVGAnimatedLengthList;\n readonly y: SVGAnimatedLengthList;\n addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPositioningElement: {\n prototype: SVGTextPositioningElement;\n new(): SVGTextPositioningElement;\n};\n\ninterface SVGTitleElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTitleElement: {\n prototype: SVGTitleElement;\n new(): SVGTitleElement;\n};\n\ninterface SVGTransform {\n readonly angle: number;\n readonly matrix: SVGMatrix;\n readonly type: number;\n setMatrix(matrix: SVGMatrix): void;\n setRotate(angle: number, cx: number, cy: number): void;\n setScale(sx: number, sy: number): void;\n setSkewX(angle: number): void;\n setSkewY(angle: number): void;\n setTranslate(tx: number, ty: number): void;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n}\n\ndeclare var SVGTransform: {\n prototype: SVGTransform;\n new(): SVGTransform;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n};\n\ninterface SVGTransformList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGTransform): SVGTransform;\n clear(): void;\n consolidate(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n getItem(index: number): SVGTransform;\n initialize(newItem: SVGTransform): SVGTransform;\n insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;\n removeItem(index: number): SVGTransform;\n replaceItem(newItem: SVGTransform, index: number): SVGTransform;\n}\n\ndeclare var SVGTransformList: {\n prototype: SVGTransformList;\n new(): SVGTransformList;\n};\n\ninterface SVGTSpanElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\n};\n\ninterface SVGUnitTypes {\n readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\n readonly SVG_UNIT_TYPE_UNKNOWN: number;\n readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\n}\ndeclare var SVGUnitTypes: SVGUnitTypes;\n\ninterface SVGUseElement extends SVGGraphicsElement, SVGURIReference {\n readonly animatedInstanceRoot: SVGElementInstance;\n readonly height: SVGAnimatedLength;\n readonly instanceRoot: SVGElementInstance;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGUseElement: {\n prototype: SVGUseElement;\n new(): SVGUseElement;\n};\n\ninterface SVGViewElement extends SVGElement, SVGZoomAndPan, SVGFitToViewBox {\n readonly viewTarget: SVGStringList;\n addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGViewElement: {\n prototype: SVGViewElement;\n new(): SVGViewElement;\n};\n\ninterface SVGZoomAndPan {\n readonly zoomAndPan: number;\n}\n\ndeclare var SVGZoomAndPan: {\n readonly SVG_ZOOMANDPAN_DISABLE: number;\n readonly SVG_ZOOMANDPAN_MAGNIFY: number;\n readonly SVG_ZOOMANDPAN_UNKNOWN: number;\n};\n\ninterface SVGZoomEvent extends UIEvent {\n readonly newScale: number;\n readonly newTranslate: SVGPoint;\n readonly previousScale: number;\n readonly previousTranslate: SVGPoint;\n readonly zoomRectScreen: SVGRect;\n}\n\ndeclare var SVGZoomEvent: {\n prototype: SVGZoomEvent;\n new(): SVGZoomEvent;\n};\n\ninterface SyncManager {\n getTags(): Promise;\n register(tag: string): Promise;\n}\n\ndeclare var SyncManager: {\n prototype: SyncManager;\n new(): SyncManager;\n};\n\ninterface Text extends CharacterData {\n readonly wholeText: string;\n readonly assignedSlot: HTMLSlotElement | null;\n splitText(offset: number): Text;\n}\n\ndeclare var Text: {\n prototype: Text;\n new(data?: string): Text;\n};\n\ninterface TextEvent extends UIEvent {\n readonly data: string;\n readonly inputMethod: number;\n readonly locale: string;\n initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n}\n\ndeclare var TextEvent: {\n prototype: TextEvent;\n new(): TextEvent;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n};\n\ninterface TextMetrics {\n readonly width: number;\n}\n\ndeclare var TextMetrics: {\n prototype: TextMetrics;\n new(): TextMetrics;\n};\n\ninterface TextTrackEventMap {\n \"cuechange\": Event;\n \"error\": Event;\n \"load\": Event;\n}\n\ninterface TextTrack extends EventTarget {\n readonly activeCues: TextTrackCueList;\n readonly cues: TextTrackCueList;\n readonly inBandMetadataTrackDispatchType: string;\n readonly kind: string;\n readonly label: string;\n readonly language: string;\n mode: any;\n oncuechange: (this: TextTrack, ev: Event) => any;\n onerror: (this: TextTrack, ev: Event) => any;\n onload: (this: TextTrack, ev: Event) => any;\n readonly readyState: number;\n addCue(cue: TextTrackCue): void;\n removeCue(cue: TextTrackCue): void;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrack: {\n prototype: TextTrack;\n new(): TextTrack;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n};\n\ninterface TextTrackCueEventMap {\n \"enter\": Event;\n \"exit\": Event;\n}\n\ninterface TextTrackCue extends EventTarget {\n endTime: number;\n id: string;\n onenter: (this: TextTrackCue, ev: Event) => any;\n onexit: (this: TextTrackCue, ev: Event) => any;\n pauseOnExit: boolean;\n startTime: number;\n text: string;\n readonly track: TextTrack;\n getCueAsHTML(): DocumentFragment;\n addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrackCue: {\n prototype: TextTrackCue;\n new(startTime: number, endTime: number, text: string): TextTrackCue;\n};\n\ninterface TextTrackCueList {\n readonly length: number;\n getCueById(id: string): TextTrackCue;\n item(index: number): TextTrackCue;\n [index: number]: TextTrackCue;\n}\n\ndeclare var TextTrackCueList: {\n prototype: TextTrackCueList;\n new(): TextTrackCueList;\n};\n\ninterface TextTrackListEventMap {\n \"addtrack\": TrackEvent;\n}\n\ninterface TextTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null;\n item(index: number): TextTrack;\n addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: TextTrack;\n}\n\ndeclare var TextTrackList: {\n prototype: TextTrackList;\n new(): TextTrackList;\n};\n\ninterface TimeRanges {\n readonly length: number;\n end(index: number): number;\n start(index: number): number;\n}\n\ndeclare var TimeRanges: {\n prototype: TimeRanges;\n new(): TimeRanges;\n};\n\ninterface Touch {\n readonly clientX: number;\n readonly clientY: number;\n readonly identifier: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly target: EventTarget;\n}\n\ndeclare var Touch: {\n prototype: Touch;\n new(): Touch;\n};\n\ninterface TouchEvent extends UIEvent {\n readonly altKey: boolean;\n readonly changedTouches: TouchList;\n readonly charCode: number;\n readonly ctrlKey: boolean;\n readonly keyCode: number;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly targetTouches: TouchList;\n readonly touches: TouchList;\n readonly which: number;\n}\n\ndeclare var TouchEvent: {\n prototype: TouchEvent;\n new(type: string, touchEventInit?: TouchEventInit): TouchEvent;\n};\n\ninterface TouchList {\n readonly length: number;\n item(index: number): Touch | null;\n [index: number]: Touch;\n}\n\ndeclare var TouchList: {\n prototype: TouchList;\n new(): TouchList;\n};\n\ninterface TrackEvent extends Event {\n readonly track: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ndeclare var TrackEvent: {\n prototype: TrackEvent;\n new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent;\n};\n\ninterface TransitionEvent extends Event {\n readonly elapsedTime: number;\n readonly propertyName: string;\n initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void;\n}\n\ndeclare var TransitionEvent: {\n prototype: TransitionEvent;\n new(typeArg: string, eventInitDict?: TransitionEventInit): TransitionEvent;\n};\n\ninterface TreeWalker {\n currentNode: Node;\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter;\n readonly root: Node;\n readonly whatToShow: number;\n firstChild(): Node;\n lastChild(): Node;\n nextNode(): Node;\n nextSibling(): Node;\n parentNode(): Node;\n previousNode(): Node;\n previousSibling(): Node;\n}\n\ndeclare var TreeWalker: {\n prototype: TreeWalker;\n new(): TreeWalker;\n};\n\ninterface UIEvent extends Event {\n readonly detail: number;\n readonly view: Window;\n initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void;\n}\n\ndeclare var UIEvent: {\n prototype: UIEvent;\n new(typeArg: string, eventInitDict?: UIEventInit): UIEvent;\n};\n\ninterface UnviewableContentIdentifiedEvent extends NavigationEventWithReferrer {\n readonly mediaType: string;\n}\n\ndeclare var UnviewableContentIdentifiedEvent: {\n prototype: UnviewableContentIdentifiedEvent;\n new(): UnviewableContentIdentifiedEvent;\n};\n\ninterface URL {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n password: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n username: string;\n readonly searchParams: URLSearchParams;\n toString(): string;\n}\n\ndeclare var URL: {\n prototype: URL;\n new(url: string, base?: string | URL): URL;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n};\n\ninterface ValidityState {\n readonly badInput: boolean;\n readonly customError: boolean;\n readonly patternMismatch: boolean;\n readonly rangeOverflow: boolean;\n readonly rangeUnderflow: boolean;\n readonly stepMismatch: boolean;\n readonly tooLong: boolean;\n readonly typeMismatch: boolean;\n readonly valid: boolean;\n readonly valueMissing: boolean;\n readonly tooShort: boolean;\n}\n\ndeclare var ValidityState: {\n prototype: ValidityState;\n new(): ValidityState;\n};\n\ninterface VideoPlaybackQuality {\n readonly corruptedVideoFrames: number;\n readonly creationTime: number;\n readonly droppedVideoFrames: number;\n readonly totalFrameDelay: number;\n readonly totalVideoFrames: number;\n}\n\ndeclare var VideoPlaybackQuality: {\n prototype: VideoPlaybackQuality;\n new(): VideoPlaybackQuality;\n};\n\ninterface VideoTrack {\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n selected: boolean;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var VideoTrack: {\n prototype: VideoTrack;\n new(): VideoTrack;\n};\n\ninterface VideoTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface VideoTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: (this: VideoTrackList, ev: TrackEvent) => any;\n onchange: (this: VideoTrackList, ev: Event) => any;\n onremovetrack: (this: VideoTrackList, ev: TrackEvent) => any;\n readonly selectedIndex: number;\n getTrackById(id: string): VideoTrack | null;\n item(index: number): VideoTrack;\n addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\n};\n\ninterface WaveShaperNode extends AudioNode {\n curve: Float32Array | null;\n oversample: OverSampleType;\n}\n\ndeclare var WaveShaperNode: {\n prototype: WaveShaperNode;\n new(): WaveShaperNode;\n};\n\ninterface WebAuthentication {\n getAssertion(assertionChallenge: BufferSource, options?: AssertionOptions): Promise;\n makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: BufferSource, options?: ScopedCredentialOptions): Promise;\n}\n\ndeclare var WebAuthentication: {\n prototype: WebAuthentication;\n new(): WebAuthentication;\n};\n\ninterface WebAuthnAssertion {\n readonly authenticatorData: ArrayBuffer;\n readonly clientData: ArrayBuffer;\n readonly credential: ScopedCredential;\n readonly signature: ArrayBuffer;\n}\n\ndeclare var WebAuthnAssertion: {\n prototype: WebAuthnAssertion;\n new(): WebAuthnAssertion;\n};\n\ninterface WEBGL_compressed_texture_s3tc {\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n}\n\ndeclare var WEBGL_compressed_texture_s3tc: {\n prototype: WEBGL_compressed_texture_s3tc;\n new(): WEBGL_compressed_texture_s3tc;\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n};\n\ninterface WEBGL_debug_renderer_info {\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n}\n\ndeclare var WEBGL_debug_renderer_info: {\n prototype: WEBGL_debug_renderer_info;\n new(): WEBGL_debug_renderer_info;\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n};\n\ninterface WEBGL_depth_texture {\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n}\n\ndeclare var WEBGL_depth_texture: {\n prototype: WEBGL_depth_texture;\n new(): WEBGL_depth_texture;\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n};\n\ninterface WebGLActiveInfo {\n readonly name: string;\n readonly size: number;\n readonly type: number;\n}\n\ndeclare var WebGLActiveInfo: {\n prototype: WebGLActiveInfo;\n new(): WebGLActiveInfo;\n};\n\ninterface WebGLBuffer extends WebGLObject {\n}\n\ndeclare var WebGLBuffer: {\n prototype: WebGLBuffer;\n new(): WebGLBuffer;\n};\n\ninterface WebGLContextEvent extends Event {\n readonly statusMessage: string;\n}\n\ndeclare var WebGLContextEvent: {\n prototype: WebGLContextEvent;\n new(typeArg: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent;\n};\n\ninterface WebGLFramebuffer extends WebGLObject {\n}\n\ndeclare var WebGLFramebuffer: {\n prototype: WebGLFramebuffer;\n new(): WebGLFramebuffer;\n};\n\ninterface WebGLObject {\n}\n\ndeclare var WebGLObject: {\n prototype: WebGLObject;\n new(): WebGLObject;\n};\n\ninterface WebGLProgram extends WebGLObject {\n}\n\ndeclare var WebGLProgram: {\n prototype: WebGLProgram;\n new(): WebGLProgram;\n};\n\ninterface WebGLRenderbuffer extends WebGLObject {\n}\n\ndeclare var WebGLRenderbuffer: {\n prototype: WebGLRenderbuffer;\n new(): WebGLRenderbuffer;\n};\n\ninterface WebGLRenderingContext {\n readonly canvas: HTMLCanvasElement;\n readonly drawingBufferHeight: number;\n readonly drawingBufferWidth: number;\n activeTexture(texture: number): void;\n attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void;\n bindBuffer(target: number, buffer: WebGLBuffer | null): void;\n bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void;\n bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void;\n bindTexture(target: number, texture: WebGLTexture | null): void;\n blendColor(red: number, green: number, blue: number, alpha: number): void;\n blendEquation(mode: number): void;\n blendEquationSeparate(modeRGB: number, modeAlpha: number): void;\n blendFunc(sfactor: number, dfactor: number): void;\n blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;\n bufferData(target: number, size: number | ArrayBufferView | ArrayBuffer, usage: number): void;\n bufferSubData(target: number, offset: number, data: ArrayBufferView | ArrayBuffer): void;\n checkFramebufferStatus(target: number): number;\n clear(mask: number): void;\n clearColor(red: number, green: number, blue: number, alpha: number): void;\n clearDepth(depth: number): void;\n clearStencil(s: number): void;\n colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;\n compileShader(shader: WebGLShader | null): void;\n compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: ArrayBufferView): void;\n compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: ArrayBufferView): void;\n copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;\n copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;\n createBuffer(): WebGLBuffer | null;\n createFramebuffer(): WebGLFramebuffer | null;\n createProgram(): WebGLProgram | null;\n createRenderbuffer(): WebGLRenderbuffer | null;\n createShader(type: number): WebGLShader | null;\n createTexture(): WebGLTexture | null;\n cullFace(mode: number): void;\n deleteBuffer(buffer: WebGLBuffer | null): void;\n deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;\n deleteProgram(program: WebGLProgram | null): void;\n deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;\n deleteShader(shader: WebGLShader | null): void;\n deleteTexture(texture: WebGLTexture | null): void;\n depthFunc(func: number): void;\n depthMask(flag: boolean): void;\n depthRange(zNear: number, zFar: number): void;\n detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n disable(cap: number): void;\n disableVertexAttribArray(index: number): void;\n drawArrays(mode: number, first: number, count: number): void;\n drawElements(mode: number, count: number, type: number, offset: number): void;\n enable(cap: number): void;\n enableVertexAttribArray(index: number): void;\n finish(): void;\n flush(): void;\n framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void;\n framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void;\n frontFace(mode: number): void;\n generateMipmap(target: number): void;\n getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null;\n getAttribLocation(program: WebGLProgram | null, name: string): number;\n getBufferParameter(target: number, pname: number): any;\n getContextAttributes(): WebGLContextAttributes;\n getError(): number;\n getExtension(extensionName: \"EXT_blend_minmax\"): EXT_blend_minmax | null;\n getExtension(extensionName: \"EXT_texture_filter_anisotropic\"): EXT_texture_filter_anisotropic | null;\n getExtension(extensionName: \"EXT_frag_depth\"): EXT_frag_depth | null;\n getExtension(extensionName: \"EXT_shader_texture_lod\"): EXT_shader_texture_lod | null;\n getExtension(extensionName: \"EXT_sRGB\"): EXT_sRGB | null;\n getExtension(extensionName: \"OES_vertex_array_object\"): OES_vertex_array_object | null;\n getExtension(extensionName: \"WEBGL_color_buffer_float\"): WEBGL_color_buffer_float | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_astc\"): WEBGL_compressed_texture_astc | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc_srgb\"): WEBGL_compressed_texture_s3tc_srgb | null;\n getExtension(extensionName: \"WEBGL_debug_shaders\"): WEBGL_debug_shaders | null;\n getExtension(extensionName: \"WEBGL_draw_buffers\"): WEBGL_draw_buffers | null;\n getExtension(extensionName: \"WEBGL_lose_context\"): WEBGL_lose_context | null;\n getExtension(extensionName: \"WEBGL_depth_texture\"): WEBGL_depth_texture | null;\n getExtension(extensionName: \"WEBGL_debug_renderer_info\"): WEBGL_debug_renderer_info | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc\"): WEBGL_compressed_texture_s3tc | null;\n getExtension(extensionName: \"OES_texture_half_float_linear\"): OES_texture_half_float_linear | null;\n getExtension(extensionName: \"OES_texture_half_float\"): OES_texture_half_float | null;\n getExtension(extensionName: \"OES_texture_float_linear\"): OES_texture_float_linear | null;\n getExtension(extensionName: \"OES_texture_float\"): OES_texture_float | null;\n getExtension(extensionName: \"OES_standard_derivatives\"): OES_standard_derivatives | null;\n getExtension(extensionName: \"OES_element_index_uint\"): OES_element_index_uint | null;\n getExtension(extensionName: \"ANGLE_instanced_arrays\"): ANGLE_instanced_arrays | null;\n getExtension(extensionName: string): any;\n getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any;\n getParameter(pname: number): any;\n getProgramInfoLog(program: WebGLProgram | null): string | null;\n getProgramParameter(program: WebGLProgram | null, pname: number): any;\n getRenderbufferParameter(target: number, pname: number): any;\n getShaderInfoLog(shader: WebGLShader | null): string | null;\n getShaderParameter(shader: WebGLShader | null, pname: number): any;\n getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null;\n getShaderSource(shader: WebGLShader | null): string | null;\n getSupportedExtensions(): string[] | null;\n getTexParameter(target: number, pname: number): any;\n getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any;\n getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null;\n getVertexAttrib(index: number, pname: number): any;\n getVertexAttribOffset(index: number, pname: number): number;\n hint(target: number, mode: number): void;\n isBuffer(buffer: WebGLBuffer | null): boolean;\n isContextLost(): boolean;\n isEnabled(cap: number): boolean;\n isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean;\n isProgram(program: WebGLProgram | null): boolean;\n isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean;\n isShader(shader: WebGLShader | null): boolean;\n isTexture(texture: WebGLTexture | null): boolean;\n lineWidth(width: number): void;\n linkProgram(program: WebGLProgram | null): void;\n pixelStorei(pname: number, param: number | boolean): void;\n polygonOffset(factor: number, units: number): void;\n readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;\n sampleCoverage(value: number, invert: boolean): void;\n scissor(x: number, y: number, width: number, height: number): void;\n shaderSource(shader: WebGLShader | null, source: string): void;\n stencilFunc(func: number, ref: number, mask: number): void;\n stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void;\n stencilMask(mask: number): void;\n stencilMaskSeparate(face: number, mask: number): void;\n stencilOp(fail: number, zfail: number, zpass: number): void;\n stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;\n texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n texParameterf(target: number, pname: number, param: number): void;\n texParameteri(target: number, pname: number, param: number): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n uniform1f(location: WebGLUniformLocation | null, x: number): void;\n uniform1fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform1i(location: WebGLUniformLocation | null, x: number): void;\n uniform1iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4fv(location: WebGLUniformLocation, v: Float32Array | number[]): void;\n uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4iv(location: WebGLUniformLocation, v: Int32Array | number[]): void;\n uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;\n uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;\n uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | number[]): void;\n useProgram(program: WebGLProgram | null): void;\n validateProgram(program: WebGLProgram | null): void;\n vertexAttrib1f(indx: number, x: number): void;\n vertexAttrib1fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib2f(indx: number, x: number, y: number): void;\n vertexAttrib2fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib3f(indx: number, x: number, y: number, z: number): void;\n vertexAttrib3fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;\n vertexAttrib4fv(indx: number, values: Float32Array | number[]): void;\n vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;\n viewport(x: number, y: number, width: number, height: number): void;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NO_ERROR: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB5_A1: number;\n readonly RGB565: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly TRIANGLES: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n}\n\ndeclare var WebGLRenderingContext: {\n prototype: WebGLRenderingContext;\n new(): WebGLRenderingContext;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NO_ERROR: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB5_A1: number;\n readonly RGB565: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly TRIANGLES: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n};\n\ninterface WebGLShader extends WebGLObject {\n}\n\ndeclare var WebGLShader: {\n prototype: WebGLShader;\n new(): WebGLShader;\n};\n\ninterface WebGLShaderPrecisionFormat {\n readonly precision: number;\n readonly rangeMax: number;\n readonly rangeMin: number;\n}\n\ndeclare var WebGLShaderPrecisionFormat: {\n prototype: WebGLShaderPrecisionFormat;\n new(): WebGLShaderPrecisionFormat;\n};\n\ninterface WebGLTexture extends WebGLObject {\n}\n\ndeclare var WebGLTexture: {\n prototype: WebGLTexture;\n new(): WebGLTexture;\n};\n\ninterface WebGLUniformLocation {\n}\n\ndeclare var WebGLUniformLocation: {\n prototype: WebGLUniformLocation;\n new(): WebGLUniformLocation;\n};\n\ninterface WebKitCSSMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n m11: number;\n m12: number;\n m13: number;\n m14: number;\n m21: number;\n m22: number;\n m23: number;\n m24: number;\n m31: number;\n m32: number;\n m33: number;\n m34: number;\n m41: number;\n m42: number;\n m43: number;\n m44: number;\n inverse(): WebKitCSSMatrix;\n multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix;\n rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix;\n rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix;\n scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix;\n setMatrixValue(value: string): void;\n skewX(angle: number): WebKitCSSMatrix;\n skewY(angle: number): WebKitCSSMatrix;\n toString(): string;\n translate(x: number, y: number, z?: number): WebKitCSSMatrix;\n}\n\ndeclare var WebKitCSSMatrix: {\n prototype: WebKitCSSMatrix;\n new(text?: string): WebKitCSSMatrix;\n};\n\ninterface WebKitDirectoryEntry extends WebKitEntry {\n createReader(): WebKitDirectoryReader;\n}\n\ndeclare var WebKitDirectoryEntry: {\n prototype: WebKitDirectoryEntry;\n new(): WebKitDirectoryEntry;\n};\n\ninterface WebKitDirectoryReader {\n readEntries(successCallback: WebKitEntriesCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitDirectoryReader: {\n prototype: WebKitDirectoryReader;\n new(): WebKitDirectoryReader;\n};\n\ninterface WebKitEntry {\n readonly filesystem: WebKitFileSystem;\n readonly fullPath: string;\n readonly isDirectory: boolean;\n readonly isFile: boolean;\n readonly name: string;\n}\n\ndeclare var WebKitEntry: {\n prototype: WebKitEntry;\n new(): WebKitEntry;\n};\n\ninterface WebKitFileEntry extends WebKitEntry {\n file(successCallback: WebKitFileCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitFileEntry: {\n prototype: WebKitFileEntry;\n new(): WebKitFileEntry;\n};\n\ninterface WebKitFileSystem {\n readonly name: string;\n readonly root: WebKitDirectoryEntry;\n}\n\ndeclare var WebKitFileSystem: {\n prototype: WebKitFileSystem;\n new(): WebKitFileSystem;\n};\n\ninterface WebKitPoint {\n x: number;\n y: number;\n}\n\ndeclare var WebKitPoint: {\n prototype: WebKitPoint;\n new(x?: number, y?: number): WebKitPoint;\n};\n\ninterface webkitRTCPeerConnection extends RTCPeerConnection {\n addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var webkitRTCPeerConnection: {\n prototype: webkitRTCPeerConnection;\n new(configuration: RTCConfiguration): webkitRTCPeerConnection;\n};\n\ninterface WebSocketEventMap {\n \"close\": CloseEvent;\n \"error\": Event;\n \"message\": MessageEvent;\n \"open\": Event;\n}\n\ninterface WebSocket extends EventTarget {\n binaryType: string;\n readonly bufferedAmount: number;\n readonly extensions: string;\n onclose: (this: WebSocket, ev: CloseEvent) => any;\n onerror: (this: WebSocket, ev: Event) => any;\n onmessage: (this: WebSocket, ev: MessageEvent) => any;\n onopen: (this: WebSocket, ev: Event) => any;\n readonly protocol: string;\n readonly readyState: number;\n readonly url: string;\n close(code?: number, reason?: string): void;\n send(data: any): void;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var WebSocket: {\n prototype: WebSocket;\n new(url: string, protocols?: string | string[]): WebSocket;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n};\n\ninterface WheelEvent extends MouseEvent {\n readonly deltaMode: number;\n readonly deltaX: number;\n readonly deltaY: number;\n readonly deltaZ: number;\n readonly wheelDelta: number;\n readonly wheelDeltaX: number;\n readonly wheelDeltaY: number;\n getCurrentPoint(element: Element): void;\n initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n}\n\ndeclare var WheelEvent: {\n prototype: WheelEvent;\n new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n};\n\ninterface WindowEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"compassneedscalibration\": Event;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"devicelight\": DeviceLightEvent;\n \"devicemotion\": DeviceMotionEvent;\n \"deviceorientation\": DeviceOrientationEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": MediaStreamErrorEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"message\": MessageEvent;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSGestureChange\": MSGestureEvent;\n \"MSGestureDoubleTap\": MSGestureEvent;\n \"MSGestureEnd\": MSGestureEvent;\n \"MSGestureHold\": MSGestureEvent;\n \"MSGestureStart\": MSGestureEvent;\n \"MSGestureTap\": MSGestureEvent;\n \"MSInertiaStart\": MSGestureEvent;\n \"MSPointerCancel\": MSPointerEvent;\n \"MSPointerDown\": MSPointerEvent;\n \"MSPointerEnter\": MSPointerEvent;\n \"MSPointerLeave\": MSPointerEvent;\n \"MSPointerMove\": MSPointerEvent;\n \"MSPointerOut\": MSPointerEvent;\n \"MSPointerOver\": MSPointerEvent;\n \"MSPointerUp\": MSPointerEvent;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"popstate\": PopStateEvent;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": ProgressEvent;\n \"reset\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"stalled\": Event;\n \"storage\": StorageEvent;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": TouchEvent;\n \"touchend\": TouchEvent;\n \"touchmove\": TouchEvent;\n \"touchstart\": TouchEvent;\n \"unload\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch {\n readonly applicationCache: ApplicationCache;\n readonly caches: CacheStorage;\n readonly clientInformation: Navigator;\n readonly closed: boolean;\n readonly crypto: Crypto;\n defaultStatus: string;\n readonly devicePixelRatio: number;\n readonly document: Document;\n readonly doNotTrack: string;\n event: Event | undefined;\n readonly external: External;\n readonly frameElement: Element;\n readonly frames: Window;\n readonly history: History;\n readonly innerHeight: number;\n readonly innerWidth: number;\n readonly isSecureContext: boolean;\n readonly length: number;\n readonly location: Location;\n readonly locationbar: BarProp;\n readonly menubar: BarProp;\n readonly msContentScript: ExtensionScriptApis;\n readonly msCredentials: MSCredentials;\n name: string;\n readonly navigator: Navigator;\n offscreenBuffering: string | boolean;\n onabort: (this: Window, ev: UIEvent) => any;\n onafterprint: (this: Window, ev: Event) => any;\n onbeforeprint: (this: Window, ev: Event) => any;\n onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any;\n onblur: (this: Window, ev: FocusEvent) => any;\n oncanplay: (this: Window, ev: Event) => any;\n oncanplaythrough: (this: Window, ev: Event) => any;\n onchange: (this: Window, ev: Event) => any;\n onclick: (this: Window, ev: MouseEvent) => any;\n oncompassneedscalibration: (this: Window, ev: Event) => any;\n oncontextmenu: (this: Window, ev: PointerEvent) => any;\n ondblclick: (this: Window, ev: MouseEvent) => any;\n ondevicelight: (this: Window, ev: DeviceLightEvent) => any;\n ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any;\n ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any;\n ondrag: (this: Window, ev: DragEvent) => any;\n ondragend: (this: Window, ev: DragEvent) => any;\n ondragenter: (this: Window, ev: DragEvent) => any;\n ondragleave: (this: Window, ev: DragEvent) => any;\n ondragover: (this: Window, ev: DragEvent) => any;\n ondragstart: (this: Window, ev: DragEvent) => any;\n ondrop: (this: Window, ev: DragEvent) => any;\n ondurationchange: (this: Window, ev: Event) => any;\n onemptied: (this: Window, ev: Event) => any;\n onended: (this: Window, ev: MediaStreamErrorEvent) => any;\n onerror: ErrorEventHandler;\n onfocus: (this: Window, ev: FocusEvent) => any;\n onhashchange: (this: Window, ev: HashChangeEvent) => any;\n oninput: (this: Window, ev: Event) => any;\n oninvalid: (this: Window, ev: Event) => any;\n onkeydown: (this: Window, ev: KeyboardEvent) => any;\n onkeypress: (this: Window, ev: KeyboardEvent) => any;\n onkeyup: (this: Window, ev: KeyboardEvent) => any;\n onload: (this: Window, ev: Event) => any;\n onloadeddata: (this: Window, ev: Event) => any;\n onloadedmetadata: (this: Window, ev: Event) => any;\n onloadstart: (this: Window, ev: Event) => any;\n onmessage: (this: Window, ev: MessageEvent) => any;\n onmousedown: (this: Window, ev: MouseEvent) => any;\n onmouseenter: (this: Window, ev: MouseEvent) => any;\n onmouseleave: (this: Window, ev: MouseEvent) => any;\n onmousemove: (this: Window, ev: MouseEvent) => any;\n onmouseout: (this: Window, ev: MouseEvent) => any;\n onmouseover: (this: Window, ev: MouseEvent) => any;\n onmouseup: (this: Window, ev: MouseEvent) => any;\n onmousewheel: (this: Window, ev: WheelEvent) => any;\n onmsgesturechange: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any;\n onmsgestureend: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturehold: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturestart: (this: Window, ev: MSGestureEvent) => any;\n onmsgesturetap: (this: Window, ev: MSGestureEvent) => any;\n onmsinertiastart: (this: Window, ev: MSGestureEvent) => any;\n onmspointercancel: (this: Window, ev: MSPointerEvent) => any;\n onmspointerdown: (this: Window, ev: MSPointerEvent) => any;\n onmspointerenter: (this: Window, ev: MSPointerEvent) => any;\n onmspointerleave: (this: Window, ev: MSPointerEvent) => any;\n onmspointermove: (this: Window, ev: MSPointerEvent) => any;\n onmspointerout: (this: Window, ev: MSPointerEvent) => any;\n onmspointerover: (this: Window, ev: MSPointerEvent) => any;\n onmspointerup: (this: Window, ev: MSPointerEvent) => any;\n onoffline: (this: Window, ev: Event) => any;\n ononline: (this: Window, ev: Event) => any;\n onorientationchange: (this: Window, ev: Event) => any;\n onpagehide: (this: Window, ev: PageTransitionEvent) => any;\n onpageshow: (this: Window, ev: PageTransitionEvent) => any;\n onpause: (this: Window, ev: Event) => any;\n onplay: (this: Window, ev: Event) => any;\n onplaying: (this: Window, ev: Event) => any;\n onpopstate: (this: Window, ev: PopStateEvent) => any;\n onprogress: (this: Window, ev: ProgressEvent) => any;\n onratechange: (this: Window, ev: Event) => any;\n onreadystatechange: (this: Window, ev: ProgressEvent) => any;\n onreset: (this: Window, ev: Event) => any;\n onresize: (this: Window, ev: UIEvent) => any;\n onscroll: (this: Window, ev: UIEvent) => any;\n onseeked: (this: Window, ev: Event) => any;\n onseeking: (this: Window, ev: Event) => any;\n onselect: (this: Window, ev: UIEvent) => any;\n onstalled: (this: Window, ev: Event) => any;\n onstorage: (this: Window, ev: StorageEvent) => any;\n onsubmit: (this: Window, ev: Event) => any;\n onsuspend: (this: Window, ev: Event) => any;\n ontimeupdate: (this: Window, ev: Event) => any;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n onunload: (this: Window, ev: Event) => any;\n onvolumechange: (this: Window, ev: Event) => any;\n onwaiting: (this: Window, ev: Event) => any;\n opener: any;\n orientation: string | number;\n readonly outerHeight: number;\n readonly outerWidth: number;\n readonly pageXOffset: number;\n readonly pageYOffset: number;\n readonly parent: Window;\n readonly performance: Performance;\n readonly personalbar: BarProp;\n readonly screen: Screen;\n readonly screenLeft: number;\n readonly screenTop: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly scrollbars: BarProp;\n readonly scrollX: number;\n readonly scrollY: number;\n readonly self: Window;\n readonly speechSynthesis: SpeechSynthesis;\n status: string;\n readonly statusbar: BarProp;\n readonly styleMedia: StyleMedia;\n readonly toolbar: BarProp;\n readonly top: Window;\n readonly window: Window;\n URL: typeof URL;\n URLSearchParams: typeof URLSearchParams;\n Blob: typeof Blob;\n customElements: CustomElementRegistry;\n alert(message?: any): void;\n blur(): void;\n cancelAnimationFrame(handle: number): void;\n captureEvents(): void;\n close(): void;\n confirm(message?: string): boolean;\n departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\n focus(): void;\n getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;\n getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;\n getSelection(): Selection;\n matchMedia(mediaQuery: string): MediaQueryList;\n moveBy(x?: number, y?: number): void;\n moveTo(x?: number, y?: number): void;\n msWriteProfilerMark(profilerMarkName: string): void;\n open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\n postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\n print(): void;\n prompt(message?: string, _default?: string): string | null;\n releaseEvents(): void;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n resizeBy(x?: number, y?: number): void;\n resizeTo(x?: number, y?: number): void;\n scroll(x?: number, y?: number): void;\n scrollBy(x?: number, y?: number): void;\n scrollTo(x?: number, y?: number): void;\n stop(): void;\n webkitCancelAnimationFrame(handle: number): void;\n webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\n scroll(options?: ScrollToOptions): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollBy(options?: ScrollToOptions): void;\n addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Window: {\n prototype: Window;\n new(): Window;\n};\n\ninterface WorkerEventMap extends AbstractWorkerEventMap {\n \"message\": MessageEvent;\n}\n\ninterface Worker extends EventTarget, AbstractWorker {\n onmessage: (this: Worker, ev: MessageEvent) => any;\n postMessage(message: any, transfer?: any[]): void;\n terminate(): void;\n addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Worker: {\n prototype: Worker;\n new(stringUrl: string): Worker;\n};\n\ninterface XMLDocument extends Document {\n addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLDocument: {\n prototype: XMLDocument;\n new(): XMLDocument;\n};\n\ninterface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {\n \"readystatechange\": Event;\n}\n\ninterface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {\n onreadystatechange: (this: XMLHttpRequest, ev: Event) => any;\n readonly readyState: number;\n readonly response: any;\n readonly responseText: string;\n responseType: XMLHttpRequestResponseType;\n readonly responseURL: string;\n readonly responseXML: Document | null;\n readonly status: number;\n readonly statusText: string;\n timeout: number;\n readonly upload: XMLHttpRequestUpload;\n withCredentials: boolean;\n msCaching?: string;\n abort(): void;\n getAllResponseHeaders(): string;\n getResponseHeader(header: string): string | null;\n msCachingEnabled(): boolean;\n open(method: string, url: string, async?: boolean, user?: string, password?: string): void;\n overrideMimeType(mime: string): void;\n send(data?: Document): void;\n send(data?: string): void;\n send(data?: any): void;\n setRequestHeader(header: string, value: string): void;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequest: {\n prototype: XMLHttpRequest;\n new(): XMLHttpRequest;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n};\n\ninterface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {\n addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequestUpload: {\n prototype: XMLHttpRequestUpload;\n new(): XMLHttpRequestUpload;\n};\n\ninterface XMLSerializer {\n serializeToString(target: Node): string;\n}\n\ndeclare var XMLSerializer: {\n prototype: XMLSerializer;\n new(): XMLSerializer;\n};\n\ninterface XPathEvaluator {\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n createNSResolver(nodeResolver?: Node): XPathNSResolver;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathEvaluator: {\n prototype: XPathEvaluator;\n new(): XPathEvaluator;\n};\n\ninterface XPathExpression {\n evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathExpression: {\n prototype: XPathExpression;\n new(): XPathExpression;\n};\n\ninterface XPathNSResolver {\n lookupNamespaceURI(prefix: string): string;\n}\n\ndeclare var XPathNSResolver: {\n prototype: XPathNSResolver;\n new(): XPathNSResolver;\n};\n\ninterface XPathResult {\n readonly booleanValue: boolean;\n readonly invalidIteratorState: boolean;\n readonly numberValue: number;\n readonly resultType: number;\n readonly singleNodeValue: Node;\n readonly snapshotLength: number;\n readonly stringValue: string;\n iterateNext(): Node;\n snapshotItem(index: number): Node;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n}\n\ndeclare var XPathResult: {\n prototype: XPathResult;\n new(): XPathResult;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n};\n\ninterface XSLTProcessor {\n clearParameters(): void;\n getParameter(namespaceURI: string, localName: string): any;\n importStylesheet(style: Node): void;\n removeParameter(namespaceURI: string, localName: string): void;\n reset(): void;\n setParameter(namespaceURI: string, localName: string, value: any): void;\n transformToDocument(source: Node): Document;\n transformToFragment(source: Node, document: Document): DocumentFragment;\n}\n\ndeclare var XSLTProcessor: {\n prototype: XSLTProcessor;\n new(): XSLTProcessor;\n};\n\ninterface AbstractWorkerEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface AbstractWorker {\n onerror: (this: AbstractWorker, ev: ErrorEvent) => any;\n addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface Body {\n readonly bodyUsed: boolean;\n arrayBuffer(): Promise;\n blob(): Promise;\n json(): Promise;\n text(): Promise;\n formData(): Promise;\n}\n\ninterface CanvasPathMethods {\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;\n bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;\n closePath(): void;\n ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n lineTo(x: number, y: number): void;\n moveTo(x: number, y: number): void;\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\n rect(x: number, y: number, w: number, h: number): void;\n}\n\ninterface ChildNode {\n remove(): void;\n}\n\ninterface DocumentEvent {\n createEvent(eventInterface: \"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface: \"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface: \"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface: \"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface: \"CloseEvent\"): CloseEvent;\n createEvent(eventInterface: \"CompositionEvent\"): CompositionEvent;\n createEvent(eventInterface: \"CustomEvent\"): CustomEvent;\n createEvent(eventInterface: \"DeviceLightEvent\"): DeviceLightEvent;\n createEvent(eventInterface: \"DeviceMotionEvent\"): DeviceMotionEvent;\n createEvent(eventInterface: \"DeviceOrientationEvent\"): DeviceOrientationEvent;\n createEvent(eventInterface: \"DragEvent\"): DragEvent;\n createEvent(eventInterface: \"ErrorEvent\"): ErrorEvent;\n createEvent(eventInterface: \"Event\"): Event;\n createEvent(eventInterface: \"Events\"): Event;\n createEvent(eventInterface: \"FocusEvent\"): FocusEvent;\n createEvent(eventInterface: \"FocusNavigationEvent\"): FocusNavigationEvent;\n createEvent(eventInterface: \"GamepadEvent\"): GamepadEvent;\n createEvent(eventInterface: \"HashChangeEvent\"): HashChangeEvent;\n createEvent(eventInterface: \"IDBVersionChangeEvent\"): IDBVersionChangeEvent;\n createEvent(eventInterface: \"KeyboardEvent\"): KeyboardEvent;\n createEvent(eventInterface: \"ListeningStateChangedEvent\"): ListeningStateChangedEvent;\n createEvent(eventInterface: \"LongRunningScriptDetectedEvent\"): LongRunningScriptDetectedEvent;\n createEvent(eventInterface: \"MSGestureEvent\"): MSGestureEvent;\n createEvent(eventInterface: \"MSManipulationEvent\"): MSManipulationEvent;\n createEvent(eventInterface: \"MSMediaKeyMessageEvent\"): MSMediaKeyMessageEvent;\n createEvent(eventInterface: \"MSMediaKeyNeededEvent\"): MSMediaKeyNeededEvent;\n createEvent(eventInterface: \"MSPointerEvent\"): MSPointerEvent;\n createEvent(eventInterface: \"MSSiteModeEvent\"): MSSiteModeEvent;\n createEvent(eventInterface: \"MediaEncryptedEvent\"): MediaEncryptedEvent;\n createEvent(eventInterface: \"MediaKeyMessageEvent\"): MediaKeyMessageEvent;\n createEvent(eventInterface: \"MediaStreamErrorEvent\"): MediaStreamErrorEvent;\n createEvent(eventInterface: \"MediaStreamEvent\"): MediaStreamEvent;\n createEvent(eventInterface: \"MediaStreamTrackEvent\"): MediaStreamTrackEvent;\n createEvent(eventInterface: \"MessageEvent\"): MessageEvent;\n createEvent(eventInterface: \"MouseEvent\"): MouseEvent;\n createEvent(eventInterface: \"MouseEvents\"): MouseEvent;\n createEvent(eventInterface: \"MutationEvent\"): MutationEvent;\n createEvent(eventInterface: \"MutationEvents\"): MutationEvent;\n createEvent(eventInterface: \"NavigationCompletedEvent\"): NavigationCompletedEvent;\n createEvent(eventInterface: \"NavigationEvent\"): NavigationEvent;\n createEvent(eventInterface: \"NavigationEventWithReferrer\"): NavigationEventWithReferrer;\n createEvent(eventInterface: \"OfflineAudioCompletionEvent\"): OfflineAudioCompletionEvent;\n createEvent(eventInterface: \"OverflowEvent\"): OverflowEvent;\n createEvent(eventInterface: \"PageTransitionEvent\"): PageTransitionEvent;\n createEvent(eventInterface: \"PaymentRequestUpdateEvent\"): PaymentRequestUpdateEvent;\n createEvent(eventInterface: \"PermissionRequestedEvent\"): PermissionRequestedEvent;\n createEvent(eventInterface: \"PointerEvent\"): PointerEvent;\n createEvent(eventInterface: \"PopStateEvent\"): PopStateEvent;\n createEvent(eventInterface: \"ProgressEvent\"): ProgressEvent;\n createEvent(eventInterface: \"RTCDTMFToneChangeEvent\"): RTCDTMFToneChangeEvent;\n createEvent(eventInterface: \"RTCDtlsTransportStateChangedEvent\"): RTCDtlsTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCIceCandidatePairChangedEvent\"): RTCIceCandidatePairChangedEvent;\n createEvent(eventInterface: \"RTCIceGathererEvent\"): RTCIceGathererEvent;\n createEvent(eventInterface: \"RTCIceTransportStateChangedEvent\"): RTCIceTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceEvent\"): RTCPeerConnectionIceEvent;\n createEvent(eventInterface: \"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface: \"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface: \"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface: \"ScriptNotifyEvent\"): ScriptNotifyEvent;\n createEvent(eventInterface: \"ServiceWorkerMessageEvent\"): ServiceWorkerMessageEvent;\n createEvent(eventInterface: \"SpeechSynthesisEvent\"): SpeechSynthesisEvent;\n createEvent(eventInterface: \"StorageEvent\"): StorageEvent;\n createEvent(eventInterface: \"TextEvent\"): TextEvent;\n createEvent(eventInterface: \"TouchEvent\"): TouchEvent;\n createEvent(eventInterface: \"TrackEvent\"): TrackEvent;\n createEvent(eventInterface: \"TransitionEvent\"): TransitionEvent;\n createEvent(eventInterface: \"UIEvent\"): UIEvent;\n createEvent(eventInterface: \"UIEvents\"): UIEvent;\n createEvent(eventInterface: \"UnviewableContentIdentifiedEvent\"): UnviewableContentIdentifiedEvent;\n createEvent(eventInterface: \"WebGLContextEvent\"): WebGLContextEvent;\n createEvent(eventInterface: \"WheelEvent\"): WheelEvent;\n createEvent(eventInterface: string): Event;\n}\n\ninterface DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\n}\n\ninterface ElementTraversal {\n readonly childElementCount: number;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n readonly nextElementSibling: Element | null;\n readonly previousElementSibling: Element | null;\n}\n\ninterface GetSVGDocument {\n getSVGDocument(): Document;\n}\n\ninterface GlobalEventHandlersEventMap {\n \"pointercancel\": PointerEvent;\n \"pointerdown\": PointerEvent;\n \"pointerenter\": PointerEvent;\n \"pointerleave\": PointerEvent;\n \"pointermove\": PointerEvent;\n \"pointerout\": PointerEvent;\n \"pointerover\": PointerEvent;\n \"pointerup\": PointerEvent;\n \"wheel\": WheelEvent;\n}\n\ninterface GlobalEventHandlers {\n onpointercancel: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerdown: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerenter: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerleave: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointermove: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerout: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerover: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onpointerup: (this: GlobalEventHandlers, ev: PointerEvent) => any;\n onwheel: (this: GlobalEventHandlers, ev: WheelEvent) => any;\n addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface GlobalFetch {\n fetch(input: RequestInfo, init?: RequestInit): Promise;\n}\n\ninterface HTMLTableAlignment {\n /**\n * Sets or retrieves a value that you can use to implement your own ch functionality for the object.\n */\n ch: string;\n /**\n * Sets or retrieves a value that you can use to implement your own chOff functionality for the object.\n */\n chOff: string;\n /**\n * Sets or retrieves how text and other content are vertically aligned within the object that contains them.\n */\n vAlign: string;\n}\n\ninterface IDBEnvironment {\n readonly indexedDB: IDBFactory;\n}\n\ninterface LinkStyle {\n readonly sheet: StyleSheet;\n}\n\ninterface MSBaseReaderEventMap {\n \"abort\": Event;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n}\n\ninterface MSBaseReader {\n onabort: (this: MSBaseReader, ev: Event) => any;\n onerror: (this: MSBaseReader, ev: ErrorEvent) => any;\n onload: (this: MSBaseReader, ev: Event) => any;\n onloadend: (this: MSBaseReader, ev: ProgressEvent) => any;\n onloadstart: (this: MSBaseReader, ev: Event) => any;\n onprogress: (this: MSBaseReader, ev: ProgressEvent) => any;\n readonly readyState: number;\n readonly result: any;\n abort(): void;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n addEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSBaseReader, ev: MSBaseReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface MSFileSaver {\n msSaveBlob(blob: any, defaultName?: string): boolean;\n msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;\n}\n\ninterface MSNavigatorDoNotTrack {\n confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;\n confirmWebWideTrackingException(args: ExceptionInformation): boolean;\n removeSiteSpecificTrackingException(args: ExceptionInformation): void;\n removeWebWideTrackingException(args: ExceptionInformation): void;\n storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;\n storeWebWideTrackingException(args: StoreExceptionsInformation): void;\n}\n\ninterface NavigatorBeacon {\n sendBeacon(url: USVString, data?: BodyInit): boolean;\n}\n\ninterface NavigatorConcurrentHardware {\n readonly hardwareConcurrency: number;\n}\n\ninterface NavigatorContentUtils {\n}\n\ninterface NavigatorGeolocation {\n readonly geolocation: Geolocation;\n}\n\ninterface NavigatorID {\n readonly appCodeName: string;\n readonly appName: string;\n readonly appVersion: string;\n readonly platform: string;\n readonly product: string;\n readonly productSub: string;\n readonly userAgent: string;\n readonly vendor: string;\n readonly vendorSub: string;\n}\n\ninterface NavigatorOnLine {\n readonly onLine: boolean;\n}\n\ninterface NavigatorStorageUtils {\n}\n\ninterface NavigatorUserMedia {\n readonly mediaDevices: MediaDevices;\n getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;\n}\n\ninterface NodeSelector {\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface RandomSource {\n getRandomValues(array: T): T;\n}\n\ninterface SVGAnimatedPoints {\n readonly animatedPoints: SVGPointList;\n readonly points: SVGPointList;\n}\n\ninterface SVGFilterPrimitiveStandardAttributes {\n readonly height: SVGAnimatedLength;\n readonly result: SVGAnimatedString;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n}\n\ninterface SVGFitToViewBox {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly viewBox: SVGAnimatedRect;\n}\n\ninterface SVGTests {\n readonly requiredExtensions: SVGStringList;\n readonly requiredFeatures: SVGStringList;\n readonly systemLanguage: SVGStringList;\n hasExtension(extension: string): boolean;\n}\n\ninterface SVGURIReference {\n readonly href: SVGAnimatedString;\n}\n\ninterface WindowBase64 {\n atob(encodedString: string): string;\n btoa(rawString: string): string;\n}\n\ninterface WindowConsole {\n readonly console: Console;\n}\n\ninterface WindowLocalStorage {\n readonly localStorage: Storage;\n}\n\ninterface WindowSessionStorage {\n readonly sessionStorage: Storage;\n}\n\ninterface WindowTimers extends Object, WindowTimersExtension {\n clearInterval(handle: number): void;\n clearTimeout(handle: number): void;\n setInterval(handler: (...args: any[]) => void, timeout: number): number;\n setInterval(handler: any, timeout?: any, ...args: any[]): number;\n setTimeout(handler: (...args: any[]) => void, timeout: number): number;\n setTimeout(handler: any, timeout?: any, ...args: any[]): number;\n}\n\ninterface WindowTimersExtension {\n clearImmediate(handle: number): void;\n setImmediate(handler: (...args: any[]) => void): number;\n setImmediate(handler: any, ...args: any[]): number;\n}\n\ninterface XMLHttpRequestEventTargetEventMap {\n \"abort\": Event;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n \"timeout\": ProgressEvent;\n}\n\ninterface XMLHttpRequestEventTarget {\n onabort: (this: XMLHttpRequest, ev: Event) => any;\n onerror: (this: XMLHttpRequest, ev: ErrorEvent) => any;\n onload: (this: XMLHttpRequest, ev: Event) => any;\n onloadend: (this: XMLHttpRequest, ev: ProgressEvent) => any;\n onloadstart: (this: XMLHttpRequest, ev: Event) => any;\n onprogress: (this: XMLHttpRequest, ev: ProgressEvent) => any;\n ontimeout: (this: XMLHttpRequest, ev: ProgressEvent) => any;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface BroadcastChannel extends EventTarget {\n readonly name: string;\n onmessage: (ev: MessageEvent) => any;\n onmessageerror: (ev: MessageEvent) => any;\n close(): void;\n postMessage(message: any): void;\n addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var BroadcastChannel: {\n prototype: BroadcastChannel;\n new(name: string): BroadcastChannel;\n};\n\ninterface BroadcastChannelEventMap {\n message: MessageEvent;\n messageerror: MessageEvent;\n}\n\ninterface ErrorEventInit {\n message?: string;\n filename?: string;\n lineno?: number;\n conlno?: number;\n error?: any;\n}\n\ninterface StorageEventInit extends EventInit {\n key?: string;\n oldValue?: string;\n newValue?: string;\n url: string;\n storageArea?: Storage;\n}\n\ninterface Canvas2DContextAttributes {\n alpha?: boolean;\n willReadFrequently?: boolean;\n storage?: boolean;\n [attribute: string]: boolean | string | undefined;\n}\n\ninterface ImageBitmapOptions {\n imageOrientation?: \"none\" | \"flipY\";\n premultiplyAlpha?: \"none\" | \"premultiply\" | \"default\";\n colorSpaceConversion?: \"none\" | \"default\";\n resizeWidth?: number;\n resizeHeight?: number;\n resizeQuality?: \"pixelated\" | \"low\" | \"medium\" | \"high\";\n}\n\ninterface ImageBitmap {\n readonly width: number;\n readonly height: number;\n close(): void;\n}\n\ninterface URLSearchParams {\n /**\n * Appends a specified key/value pair as a new search parameter.\n */\n append(name: string, value: string): void;\n /**\n * Deletes the given search parameter, and its associated value, from the list of all search parameters.\n */\n delete(name: string): void;\n /**\n * Returns the first value associated to the given search parameter.\n */\n get(name: string): string | null;\n /**\n * Returns all the values association with a given search parameter.\n */\n getAll(name: string): string[];\n /**\n * Returns a Boolean indicating if such a search parameter exists.\n */\n has(name: string): boolean;\n /**\n * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\n */\n set(name: string, value: string): void;\n}\n\ndeclare var URLSearchParams: {\n prototype: URLSearchParams;\n /**\n * Constructor returning a URLSearchParams object.\n */\n new (init?: string | URLSearchParams): URLSearchParams;\n};\n\ninterface NodeListOf extends NodeList {\n length: number;\n item(index: number): TNode;\n [index: number]: TNode;\n}\n\ninterface HTMLCollectionOf extends HTMLCollection {\n item(index: number): T;\n namedItem(name: string): T;\n [index: number]: T;\n}\n\ninterface BlobPropertyBag {\n type?: string;\n endings?: string;\n}\n\ninterface FilePropertyBag extends BlobPropertyBag {\n lastModified?: number;\n}\n\ninterface EventListenerObject {\n handleEvent(evt: Event): void;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface ScrollOptions {\n behavior?: ScrollBehavior;\n}\n\ninterface ScrollToOptions extends ScrollOptions {\n left?: number;\n top?: number;\n}\n\ninterface ScrollIntoViewOptions extends ScrollOptions {\n block?: ScrollLogicalPosition;\n inline?: ScrollLogicalPosition;\n}\n\ninterface ClipboardEventInit extends EventInit {\n data?: string;\n dataType?: string;\n}\n\ninterface IDBArrayKey extends Array {\n}\n\ninterface RsaKeyGenParams extends Algorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaHashedKeyGenParams extends RsaKeyGenParams {\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaKeyAlgorithm extends KeyAlgorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaHashedImportParams {\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaPssParams {\n saltLength: number;\n}\n\ninterface RsaOaepParams extends Algorithm {\n label?: BufferSource;\n}\n\ninterface EcdsaParams extends Algorithm {\n hash: AlgorithmIdentifier;\n}\n\ninterface EcKeyGenParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcKeyAlgorithm extends KeyAlgorithm {\n typedCurve: string;\n}\n\ninterface EcKeyImportParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcdhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface AesCtrParams extends Algorithm {\n counter: BufferSource;\n length: number;\n}\n\ninterface AesKeyAlgorithm extends KeyAlgorithm {\n length: number;\n}\n\ninterface AesKeyGenParams extends Algorithm {\n length: number;\n}\n\ninterface AesDerivedKeyParams extends Algorithm {\n length: number;\n}\n\ninterface AesCbcParams extends Algorithm {\n iv: BufferSource;\n}\n\ninterface AesCmacParams extends Algorithm {\n length: number;\n}\n\ninterface AesGcmParams extends Algorithm {\n iv: BufferSource;\n additionalData?: BufferSource;\n tagLength?: number;\n}\n\ninterface AesCfbParams extends Algorithm {\n iv: BufferSource;\n}\n\ninterface HmacImportParams extends Algorithm {\n hash?: AlgorithmIdentifier;\n length?: number;\n}\n\ninterface HmacKeyAlgorithm extends KeyAlgorithm {\n hash: AlgorithmIdentifier;\n length: number;\n}\n\ninterface HmacKeyGenParams extends Algorithm {\n hash: AlgorithmIdentifier;\n length?: number;\n}\n\ninterface DhKeyGenParams extends Algorithm {\n prime: Uint8Array;\n generator: Uint8Array;\n}\n\ninterface DhKeyAlgorithm extends KeyAlgorithm {\n prime: Uint8Array;\n generator: Uint8Array;\n}\n\ninterface DhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface DhImportKeyParams extends Algorithm {\n prime: Uint8Array;\n generator: Uint8Array;\n}\n\ninterface ConcatParams extends Algorithm {\n hash?: AlgorithmIdentifier;\n algorithmId: Uint8Array;\n partyUInfo: Uint8Array;\n partyVInfo: Uint8Array;\n publicInfo?: Uint8Array;\n privateInfo?: Uint8Array;\n}\n\ninterface HkdfCtrParams extends Algorithm {\n hash: AlgorithmIdentifier;\n label: BufferSource;\n context: BufferSource;\n}\n\ninterface Pbkdf2Params extends Algorithm {\n salt: BufferSource;\n iterations: number;\n hash: AlgorithmIdentifier;\n}\n\ninterface RsaOtherPrimesInfo {\n r: string;\n d: string;\n t: string;\n}\n\ninterface JsonWebKey {\n kty: string;\n use?: string;\n key_ops?: string[];\n alg?: string;\n kid?: string;\n x5u?: string;\n x5c?: string;\n x5t?: string;\n ext?: boolean;\n crv?: string;\n x?: string;\n y?: string;\n d?: string;\n n?: string;\n e?: string;\n p?: string;\n q?: string;\n dp?: string;\n dq?: string;\n qi?: string;\n oth?: RsaOtherPrimesInfo[];\n k?: string;\n}\n\ninterface ParentNode {\n readonly children: HTMLCollection;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n readonly childElementCount: number;\n}\n\ninterface DocumentOrShadowRoot {\n readonly activeElement: Element | null;\n readonly stylesheets: StyleSheetList;\n getSelection(): Selection | null;\n elementFromPoint(x: number, y: number): Element | null;\n elementsFromPoint(x: number, y: number): Element[];\n}\n\ninterface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment {\n readonly host: Element;\n innerHTML: string;\n}\n\ninterface ShadowRootInit {\n mode: \"open\" | \"closed\";\n delegatesFocus?: boolean;\n}\n\ninterface HTMLSlotElement extends HTMLElement {\n name: string;\n assignedNodes(options?: AssignedNodesOptions): Node[];\n}\n\ninterface AssignedNodesOptions {\n flatten?: boolean;\n}\n\ninterface ElementDefinitionOptions {\n extends: string;\n}\n\ninterface CustomElementRegistry {\n define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;\n get(name: string): any;\n whenDefined(name: string): PromiseLike;\n}\n\ninterface PromiseRejectionEvent extends Event {\n readonly promise: PromiseLike;\n readonly reason: any;\n}\n\ninterface PromiseRejectionEventInit extends EventInit {\n promise: PromiseLike;\n reason?: any;\n}\n\ninterface EventListenerOptions {\n capture?: boolean;\n}\n\ninterface AddEventListenerOptions extends EventListenerOptions {\n passive?: boolean;\n once?: boolean;\n}\n\ninterface TouchEventInit extends EventModifierInit {\n touches?: Touch[];\n targetTouches?: Touch[];\n changedTouches?: Touch[];\n}\n\ninterface HTMLDialogElement extends HTMLElement {\n open: boolean;\n returnValue: string;\n close(returnValue?: string): void;\n show(): void;\n showModal(): void;\n}\n\ndeclare var HTMLDialogElement: {\n prototype: HTMLDialogElement;\n new(): HTMLDialogElement;\n};\n\ninterface HTMLMainElement extends HTMLElement {\n}\n\ndeclare var HTMLMainElement: {\n prototype: HTMLMainElement;\n new(): HTMLMainElement;\n};\n\ninterface HTMLDetailsElement extends HTMLElement {\n open: boolean;\n}\n\ndeclare var HTMLDetailsElement: {\n prototype: HTMLDetailsElement;\n new(): HTMLDetailsElement;\n};\n\ninterface HTMLSummaryElement extends HTMLElement {\n}\n\ndeclare var HTMLSummaryElement: {\n prototype: HTMLSummaryElement;\n new(): HTMLSummaryElement;\n};\n\ninterface DOMRectReadOnly {\n readonly bottom: number;\n readonly height: number;\n readonly left: number;\n readonly right: number;\n readonly top: number;\n readonly width: number;\n readonly x: number;\n readonly y: number;\n}\n\ndeclare var DOMRectReadOnly: {\n prototype: DOMRectReadOnly;\n new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;\n fromRect(rectangle?: DOMRectInit): DOMRectReadOnly;\n};\n\ninterface EXT_blend_minmax {\n readonly MIN_EXT: number;\n readonly MAX_EXT: number;\n}\n\ninterface EXT_frag_depth {\n}\n\ninterface EXT_shader_texture_lod {\n}\n\ninterface EXT_sRGB {\n readonly SRGB_EXT: number;\n readonly SRGB_ALPHA_EXT: number;\n readonly SRGB8_ALPHA8_EXT: number;\n readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number;\n}\n\ninterface DOMRect extends DOMRectReadOnly {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var DOMRect: {\n prototype: DOMRect;\n new (x?: number, y?: number, width?: number, height?: number): DOMRect;\n fromRect(rectangle?: DOMRectInit): DOMRect;\n};\n\ninterface DOMRectList {\n readonly length: number;\n item(index: number): DOMRect | null;\n [index: number]: DOMRect;\n}\n\ninterface OES_vertex_array_object {\n readonly VERTEX_ARRAY_BINDING_OES: number;\n createVertexArrayOES(): WebGLVertexArrayObjectOES;\n deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n isVertexArrayOES(value: any): value is WebGLVertexArrayObjectOES;\n bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n}\n\ninterface WebGLVertexArrayObjectOES {\n}\n\ninterface WEBGL_color_buffer_float {\n readonly RGBA32F_EXT: number;\n readonly RGB32F_EXT: number;\n readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number;\n readonly UNSIGNED_NORMALIZED_EXT: number;\n}\n\ninterface WEBGL_compressed_texture_astc {\n readonly COMPRESSED_RGBA_ASTC_4x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x8_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x8_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x12_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: number;\n getSupportedProfiles(): string[];\n}\n\ninterface WEBGL_compressed_texture_s3tc_srgb {\n readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;\n}\n\ninterface WEBGL_debug_shaders {\n getTranslatedShaderSource(shader: WebGLShader): string;\n}\n\ninterface WEBGL_draw_buffers {\n readonly COLOR_ATTACHMENT0_WEBGL: number;\n readonly COLOR_ATTACHMENT1_WEBGL: number;\n readonly COLOR_ATTACHMENT2_WEBGL: number;\n readonly COLOR_ATTACHMENT3_WEBGL: number;\n readonly COLOR_ATTACHMENT4_WEBGL: number;\n readonly COLOR_ATTACHMENT5_WEBGL: number;\n readonly COLOR_ATTACHMENT6_WEBGL: number;\n readonly COLOR_ATTACHMENT7_WEBGL: number;\n readonly COLOR_ATTACHMENT8_WEBGL: number;\n readonly COLOR_ATTACHMENT9_WEBGL: number;\n readonly COLOR_ATTACHMENT10_WEBGL: number;\n readonly COLOR_ATTACHMENT11_WEBGL: number;\n readonly COLOR_ATTACHMENT12_WEBGL: number;\n readonly COLOR_ATTACHMENT13_WEBGL: number;\n readonly COLOR_ATTACHMENT14_WEBGL: number;\n readonly COLOR_ATTACHMENT15_WEBGL: number;\n readonly DRAW_BUFFER0_WEBGL: number;\n readonly DRAW_BUFFER1_WEBGL: number;\n readonly DRAW_BUFFER2_WEBGL: number;\n readonly DRAW_BUFFER3_WEBGL: number;\n readonly DRAW_BUFFER4_WEBGL: number;\n readonly DRAW_BUFFER5_WEBGL: number;\n readonly DRAW_BUFFER6_WEBGL: number;\n readonly DRAW_BUFFER7_WEBGL: number;\n readonly DRAW_BUFFER8_WEBGL: number;\n readonly DRAW_BUFFER9_WEBGL: number;\n readonly DRAW_BUFFER10_WEBGL: number;\n readonly DRAW_BUFFER11_WEBGL: number;\n readonly DRAW_BUFFER12_WEBGL: number;\n readonly DRAW_BUFFER13_WEBGL: number;\n readonly DRAW_BUFFER14_WEBGL: number;\n readonly DRAW_BUFFER15_WEBGL: number;\n readonly MAX_COLOR_ATTACHMENTS_WEBGL: number;\n readonly MAX_DRAW_BUFFERS_WEBGL: number;\n drawBuffersWEBGL(buffers: number[]): void;\n}\n\ninterface WEBGL_lose_context {\n loseContext(): void;\n restoreContext(): void;\n}\n\ninterface AbortController {\n readonly signal: AbortSignal;\n abort(): void;\n}\n\ndeclare var AbortController: {\n prototype: AbortController;\n new(): AbortController;\n};\n\ninterface AbortSignal extends EventTarget {\n readonly aborted: boolean;\n onabort: (ev: Event) => any;\n}\n\ninterface EventSource extends EventTarget {\n readonly url: string;\n readonly withCredentials: boolean;\n readonly CONNECTING: number;\n readonly OPEN: number;\n readonly CLOSED: number;\n readonly readyState: number;\n onopen: (evt: MessageEvent) => any;\n onmessage: (evt: MessageEvent) => any;\n onerror: (evt: MessageEvent) => any;\n close(): void;\n}\n\ndeclare var EventSource: {\n prototype: EventSource;\n new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;\n};\n\ninterface EventSourceInit {\n readonly withCredentials: boolean;\n}\n\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\ninterface ErrorEventHandler {\n (message: string, filename?: string, lineno?: number, colno?: number, error?: Error): void;\n}\ninterface ForEachCallback {\n (keyId: any, status: MediaKeyStatus): void;\n}\ninterface FrameRequestCallback {\n (time: number): void;\n}\ninterface FunctionStringCallback {\n (data: string): void;\n}\ninterface IntersectionObserverCallback {\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\n}\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\ninterface MSExecAtPriorityFunctionCallback {\n (...args: any[]): any;\n}\ninterface MSLaunchUriCallback {\n (): void;\n}\ninterface MSUnsafeFunctionCallback {\n (): any;\n}\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\ninterface NotificationPermissionCallback {\n (permission: NotificationPermission): void;\n}\ninterface PositionCallback {\n (position: Position): void;\n}\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\ninterface RTCPeerConnectionErrorCallback {\n (error: DOMError): void;\n}\ninterface RTCSessionDescriptionCallback {\n (sdp: RTCSessionDescription): void;\n}\ninterface RTCStatsCallback {\n (report: RTCStatsReport): void;\n}\ninterface VoidFunction {\n (): void;\n}\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"abbr\": HTMLElement;\n \"acronym\": HTMLElement;\n \"address\": HTMLElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"article\": HTMLElement;\n \"aside\": HTMLElement;\n \"audio\": HTMLAudioElement;\n \"b\": HTMLElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"bdo\": HTMLElement;\n \"big\": HTMLElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"center\": HTMLElement;\n \"cite\": HTMLElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"del\": HTMLModElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"h1\": HTMLHeadingElement;\n \"h2\": HTMLHeadingElement;\n \"h3\": HTMLHeadingElement;\n \"h4\": HTMLHeadingElement;\n \"h5\": HTMLHeadingElement;\n \"h6\": HTMLHeadingElement;\n \"head\": HTMLHeadElement;\n \"header\": HTMLElement;\n \"hgroup\": HTMLElement;\n \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"i\": HTMLElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"kbd\": HTMLElement;\n \"keygen\": HTMLElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nav\": HTMLElement;\n \"nextid\": HTMLUnknownElement;\n \"nobr\": HTMLElement;\n \"noframes\": HTMLElement;\n \"noscript\": HTMLElement;\n \"object\": HTMLObjectElement;\n \"ol\": HTMLOListElement;\n \"optgroup\": HTMLOptGroupElement;\n \"option\": HTMLOptionElement;\n \"output\": HTMLOutputElement;\n \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"rt\": HTMLElement;\n \"ruby\": HTMLElement;\n \"s\": HTMLElement;\n \"samp\": HTMLElement;\n \"script\": HTMLScriptElement;\n \"section\": HTMLElement;\n \"select\": HTMLSelectElement;\n \"small\": HTMLElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"textarea\": HTMLTextAreaElement;\n \"tfoot\": HTMLTableSectionElement;\n \"th\": HTMLTableHeaderCellElement;\n \"thead\": HTMLTableSectionElement;\n \"time\": HTMLTimeElement;\n \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"wbr\": HTMLElement;\n \"x-ms-webview\": MSHTMLWebViewElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface SVGElementTagNameMap {\n \"circle\": SVGCircleElement;\n \"clippath\": SVGClipPathElement;\n \"defs\": SVGDefsElement;\n \"desc\": SVGDescElement;\n \"ellipse\": SVGEllipseElement;\n \"feblend\": SVGFEBlendElement;\n \"fecolormatrix\": SVGFEColorMatrixElement;\n \"fecomponenttransfer\": SVGFEComponentTransferElement;\n \"fecomposite\": SVGFECompositeElement;\n \"feconvolvematrix\": SVGFEConvolveMatrixElement;\n \"fediffuselighting\": SVGFEDiffuseLightingElement;\n \"fedisplacementmap\": SVGFEDisplacementMapElement;\n \"fedistantlight\": SVGFEDistantLightElement;\n \"feflood\": SVGFEFloodElement;\n \"fefunca\": SVGFEFuncAElement;\n \"fefuncb\": SVGFEFuncBElement;\n \"fefuncg\": SVGFEFuncGElement;\n \"fefuncr\": SVGFEFuncRElement;\n \"fegaussianblur\": SVGFEGaussianBlurElement;\n \"feimage\": SVGFEImageElement;\n \"femerge\": SVGFEMergeElement;\n \"femergenode\": SVGFEMergeNodeElement;\n \"femorphology\": SVGFEMorphologyElement;\n \"feoffset\": SVGFEOffsetElement;\n \"fepointlight\": SVGFEPointLightElement;\n \"fespecularlighting\": SVGFESpecularLightingElement;\n \"fespotlight\": SVGFESpotLightElement;\n \"fetile\": SVGFETileElement;\n \"feturbulence\": SVGFETurbulenceElement;\n \"filter\": SVGFilterElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"g\": SVGGElement;\n \"image\": SVGImageElement;\n \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"marker\": SVGMarkerElement;\n \"mask\": SVGMaskElement;\n \"metadata\": SVGMetadataElement;\n \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\n \"stop\": SVGStopElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\n \"tspan\": SVGTSpanElement;\n \"use\": SVGUseElement;\n \"view\": SVGViewElement;\n}\n\n/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */\ninterface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { }\n\ndeclare var Audio: { new(src?: string): HTMLAudioElement; };\ndeclare var Image: { new(width?: number, height?: number): HTMLImageElement; };\ndeclare var Option: { new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement; };\ndeclare var applicationCache: ApplicationCache;\ndeclare var caches: CacheStorage;\ndeclare var clientInformation: Navigator;\ndeclare var closed: boolean;\ndeclare var crypto: Crypto;\ndeclare var defaultStatus: string;\ndeclare var devicePixelRatio: number;\ndeclare var document: Document;\ndeclare var doNotTrack: string;\ndeclare var event: Event | undefined;\ndeclare var external: External;\ndeclare var frameElement: Element;\ndeclare var frames: Window;\ndeclare var history: History;\ndeclare var innerHeight: number;\ndeclare var innerWidth: number;\ndeclare var isSecureContext: boolean;\ndeclare var length: number;\ndeclare var location: Location;\ndeclare var locationbar: BarProp;\ndeclare var menubar: BarProp;\ndeclare var msContentScript: ExtensionScriptApis;\ndeclare var msCredentials: MSCredentials;\ndeclare const name: never;\ndeclare var navigator: Navigator;\ndeclare var offscreenBuffering: string | boolean;\ndeclare var onabort: (this: Window, ev: UIEvent) => any;\ndeclare var onafterprint: (this: Window, ev: Event) => any;\ndeclare var onbeforeprint: (this: Window, ev: Event) => any;\ndeclare var onbeforeunload: (this: Window, ev: BeforeUnloadEvent) => any;\ndeclare var onblur: (this: Window, ev: FocusEvent) => any;\ndeclare var oncanplay: (this: Window, ev: Event) => any;\ndeclare var oncanplaythrough: (this: Window, ev: Event) => any;\ndeclare var onchange: (this: Window, ev: Event) => any;\ndeclare var onclick: (this: Window, ev: MouseEvent) => any;\ndeclare var oncompassneedscalibration: (this: Window, ev: Event) => any;\ndeclare var oncontextmenu: (this: Window, ev: PointerEvent) => any;\ndeclare var ondblclick: (this: Window, ev: MouseEvent) => any;\ndeclare var ondevicelight: (this: Window, ev: DeviceLightEvent) => any;\ndeclare var ondevicemotion: (this: Window, ev: DeviceMotionEvent) => any;\ndeclare var ondeviceorientation: (this: Window, ev: DeviceOrientationEvent) => any;\ndeclare var ondrag: (this: Window, ev: DragEvent) => any;\ndeclare var ondragend: (this: Window, ev: DragEvent) => any;\ndeclare var ondragenter: (this: Window, ev: DragEvent) => any;\ndeclare var ondragleave: (this: Window, ev: DragEvent) => any;\ndeclare var ondragover: (this: Window, ev: DragEvent) => any;\ndeclare var ondragstart: (this: Window, ev: DragEvent) => any;\ndeclare var ondrop: (this: Window, ev: DragEvent) => any;\ndeclare var ondurationchange: (this: Window, ev: Event) => any;\ndeclare var onemptied: (this: Window, ev: Event) => any;\ndeclare var onended: (this: Window, ev: MediaStreamErrorEvent) => any;\ndeclare var onerror: ErrorEventHandler;\ndeclare var onfocus: (this: Window, ev: FocusEvent) => any;\ndeclare var onhashchange: (this: Window, ev: HashChangeEvent) => any;\ndeclare var oninput: (this: Window, ev: Event) => any;\ndeclare var oninvalid: (this: Window, ev: Event) => any;\ndeclare var onkeydown: (this: Window, ev: KeyboardEvent) => any;\ndeclare var onkeypress: (this: Window, ev: KeyboardEvent) => any;\ndeclare var onkeyup: (this: Window, ev: KeyboardEvent) => any;\ndeclare var onload: (this: Window, ev: Event) => any;\ndeclare var onloadeddata: (this: Window, ev: Event) => any;\ndeclare var onloadedmetadata: (this: Window, ev: Event) => any;\ndeclare var onloadstart: (this: Window, ev: Event) => any;\ndeclare var onmessage: (this: Window, ev: MessageEvent) => any;\ndeclare var onmousedown: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseenter: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseleave: (this: Window, ev: MouseEvent) => any;\ndeclare var onmousemove: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseout: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseover: (this: Window, ev: MouseEvent) => any;\ndeclare var onmouseup: (this: Window, ev: MouseEvent) => any;\ndeclare var onmousewheel: (this: Window, ev: WheelEvent) => any;\ndeclare var onmsgesturechange: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturedoubletap: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgestureend: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturehold: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturestart: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsgesturetap: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmsinertiastart: (this: Window, ev: MSGestureEvent) => any;\ndeclare var onmspointercancel: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerdown: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerenter: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerleave: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointermove: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerout: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerover: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onmspointerup: (this: Window, ev: MSPointerEvent) => any;\ndeclare var onoffline: (this: Window, ev: Event) => any;\ndeclare var ononline: (this: Window, ev: Event) => any;\ndeclare var onorientationchange: (this: Window, ev: Event) => any;\ndeclare var onpagehide: (this: Window, ev: PageTransitionEvent) => any;\ndeclare var onpageshow: (this: Window, ev: PageTransitionEvent) => any;\ndeclare var onpause: (this: Window, ev: Event) => any;\ndeclare var onplay: (this: Window, ev: Event) => any;\ndeclare var onplaying: (this: Window, ev: Event) => any;\ndeclare var onpopstate: (this: Window, ev: PopStateEvent) => any;\ndeclare var onprogress: (this: Window, ev: ProgressEvent) => any;\ndeclare var onratechange: (this: Window, ev: Event) => any;\ndeclare var onreadystatechange: (this: Window, ev: ProgressEvent) => any;\ndeclare var onreset: (this: Window, ev: Event) => any;\ndeclare var onresize: (this: Window, ev: UIEvent) => any;\ndeclare var onscroll: (this: Window, ev: UIEvent) => any;\ndeclare var onseeked: (this: Window, ev: Event) => any;\ndeclare var onseeking: (this: Window, ev: Event) => any;\ndeclare var onselect: (this: Window, ev: UIEvent) => any;\ndeclare var onstalled: (this: Window, ev: Event) => any;\ndeclare var onstorage: (this: Window, ev: StorageEvent) => any;\ndeclare var onsubmit: (this: Window, ev: Event) => any;\ndeclare var onsuspend: (this: Window, ev: Event) => any;\ndeclare var ontimeupdate: (this: Window, ev: Event) => any;\ndeclare var ontouchcancel: (ev: TouchEvent) => any;\ndeclare var ontouchend: (ev: TouchEvent) => any;\ndeclare var ontouchmove: (ev: TouchEvent) => any;\ndeclare var ontouchstart: (ev: TouchEvent) => any;\ndeclare var onunload: (this: Window, ev: Event) => any;\ndeclare var onvolumechange: (this: Window, ev: Event) => any;\ndeclare var onwaiting: (this: Window, ev: Event) => any;\ndeclare var opener: any;\ndeclare var orientation: string | number;\ndeclare var outerHeight: number;\ndeclare var outerWidth: number;\ndeclare var pageXOffset: number;\ndeclare var pageYOffset: number;\ndeclare var parent: Window;\ndeclare var performance: Performance;\ndeclare var personalbar: BarProp;\ndeclare var screen: Screen;\ndeclare var screenLeft: number;\ndeclare var screenTop: number;\ndeclare var screenX: number;\ndeclare var screenY: number;\ndeclare var scrollbars: BarProp;\ndeclare var scrollX: number;\ndeclare var scrollY: number;\ndeclare var self: Window;\ndeclare var speechSynthesis: SpeechSynthesis;\ndeclare var status: string;\ndeclare var statusbar: BarProp;\ndeclare var styleMedia: StyleMedia;\ndeclare var toolbar: BarProp;\ndeclare var top: Window;\ndeclare var window: Window;\ndeclare var customElements: CustomElementRegistry;\ndeclare function alert(message?: any): void;\ndeclare function blur(): void;\ndeclare function cancelAnimationFrame(handle: number): void;\ndeclare function captureEvents(): void;\ndeclare function close(): void;\ndeclare function confirm(message?: string): boolean;\ndeclare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\ndeclare function focus(): void;\ndeclare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;\ndeclare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;\ndeclare function getSelection(): Selection;\ndeclare function matchMedia(mediaQuery: string): MediaQueryList;\ndeclare function moveBy(x?: number, y?: number): void;\ndeclare function moveTo(x?: number, y?: number): void;\ndeclare function msWriteProfilerMark(profilerMarkName: string): void;\ndeclare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\ndeclare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\ndeclare function print(): void;\ndeclare function prompt(message?: string, _default?: string): string | null;\ndeclare function releaseEvents(): void;\ndeclare function requestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function resizeBy(x?: number, y?: number): void;\ndeclare function resizeTo(x?: number, y?: number): void;\ndeclare function scroll(x?: number, y?: number): void;\ndeclare function scrollBy(x?: number, y?: number): void;\ndeclare function scrollTo(x?: number, y?: number): void;\ndeclare function stop(): void;\ndeclare function webkitCancelAnimationFrame(handle: number): void;\ndeclare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\ndeclare function scroll(options?: ScrollToOptions): void;\ndeclare function scrollTo(options?: ScrollToOptions): void;\ndeclare function scrollBy(options?: ScrollToOptions): void;\ndeclare function toString(): string;\ndeclare function dispatchEvent(evt: Event): boolean;\ndeclare function clearInterval(handle: number): void;\ndeclare function clearTimeout(handle: number): void;\ndeclare function setInterval(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setInterval(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function setTimeout(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function clearImmediate(handle: number): void;\ndeclare function setImmediate(handler: (...args: any[]) => void): number;\ndeclare function setImmediate(handler: any, ...args: any[]): number;\ndeclare var sessionStorage: Storage;\ndeclare var localStorage: Storage;\ndeclare var console: Console;\ndeclare var onpointercancel: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerdown: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerenter: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerleave: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointermove: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerout: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerover: (this: Window, ev: PointerEvent) => any;\ndeclare var onpointerup: (this: Window, ev: PointerEvent) => any;\ndeclare var onwheel: (this: Window, ev: WheelEvent) => any;\ndeclare var indexedDB: IDBFactory;\ndeclare function atob(encodedString: string): string;\ndeclare function btoa(rawString: string): string;\ndeclare function fetch(input: RequestInfo, init?: RequestInit): Promise;\ndeclare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\ndeclare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\ndeclare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\ntype AAGUID = string;\ntype AlgorithmIdentifier = string | Algorithm;\ntype BodyInit = Blob | BufferSource | FormData | string;\ntype ByteString = string;\ntype ConstrainBoolean = boolean | ConstrainBooleanParameters;\ntype ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;\ntype ConstrainDouble = number | ConstrainDoubleRange;\ntype ConstrainLong = number | ConstrainLongRange;\ntype CryptoOperationData = ArrayBufferView;\ntype GLbitfield = number;\ntype GLboolean = boolean;\ntype GLbyte = number;\ntype GLclampf = number;\ntype GLenum = number;\ntype GLfloat = number;\ntype GLint = number;\ntype GLintptr = number;\ntype GLshort = number;\ntype GLsizei = number;\ntype GLsizeiptr = number;\ntype GLubyte = number;\ntype GLuint = number;\ntype GLushort = number;\ntype IDBKeyPath = string;\ntype KeyFormat = string;\ntype KeyType = string;\ntype KeyUsage = string;\ntype MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload;\ntype MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent;\ntype MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload;\ntype RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete;\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\ntype RequestInfo = Request | string;\ntype USVString = string;\ntype payloadtype = number;\ntype ScrollBehavior = \"auto\" | \"instant\" | \"smooth\";\ntype ScrollLogicalPosition = \"start\" | \"center\" | \"end\" | \"nearest\";\ntype IDBValidKey = number | string | Date | IDBArrayKey;\ntype BufferSource = ArrayBuffer | ArrayBufferView;\ntype MouseWheelEvent = WheelEvent;\ntype ScrollRestoration = \"auto\" | \"manual\";\ntype FormDataEntryValue = string | File;\ntype InsertPosition = \"beforebegin\" | \"afterbegin\" | \"beforeend\" | \"afterend\";\ntype HeadersInit = Headers | string[][] | { [key: string]: string };\ntype AppendMode = \"segments\" | \"sequence\";\ntype AudioContextState = \"suspended\" | \"running\" | \"closed\";\ntype BiquadFilterType = \"lowpass\" | \"highpass\" | \"bandpass\" | \"lowshelf\" | \"highshelf\" | \"peaking\" | \"notch\" | \"allpass\";\ntype CanvasFillRule = \"nonzero\" | \"evenodd\";\ntype ChannelCountMode = \"max\" | \"clamped-max\" | \"explicit\";\ntype ChannelInterpretation = \"speakers\" | \"discrete\";\ntype DistanceModelType = \"linear\" | \"inverse\" | \"exponential\";\ntype ExpandGranularity = \"character\" | \"word\" | \"sentence\" | \"textedit\";\ntype GamepadInputEmulationType = \"mouse\" | \"keyboard\" | \"gamepad\";\ntype IDBCursorDirection = \"next\" | \"nextunique\" | \"prev\" | \"prevunique\";\ntype IDBRequestReadyState = \"pending\" | \"done\";\ntype IDBTransactionMode = \"readonly\" | \"readwrite\" | \"versionchange\";\ntype ListeningState = \"inactive\" | \"active\" | \"disambiguation\";\ntype MediaDeviceKind = \"audioinput\" | \"audiooutput\" | \"videoinput\";\ntype MediaKeyMessageType = \"license-request\" | \"license-renewal\" | \"license-release\" | \"individualization-request\";\ntype MediaKeySessionType = \"temporary\" | \"persistent-license\" | \"persistent-release-message\";\ntype MediaKeysRequirement = \"required\" | \"optional\" | \"not-allowed\";\ntype MediaKeyStatus = \"usable\" | \"expired\" | \"output-downscaled\" | \"output-not-allowed\" | \"status-pending\" | \"internal-error\";\ntype MediaStreamTrackState = \"live\" | \"ended\";\ntype MSCredentialType = \"FIDO_2_0\";\ntype MSIceAddrType = \"os\" | \"stun\" | \"turn\" | \"peer-derived\";\ntype MSIceType = \"failed\" | \"direct\" | \"relay\";\ntype MSStatsType = \"description\" | \"localclientevent\" | \"inbound-network\" | \"outbound-network\" | \"inbound-payload\" | \"outbound-payload\" | \"transportdiagnostics\";\ntype MSTransportType = \"Embedded\" | \"USB\" | \"NFC\" | \"BT\";\ntype MSWebViewPermissionState = \"unknown\" | \"defer\" | \"allow\" | \"deny\";\ntype MSWebViewPermissionType = \"geolocation\" | \"unlimitedIndexedDBQuota\" | \"media\" | \"pointerlock\" | \"webnotifications\";\ntype NavigationReason = \"up\" | \"down\" | \"left\" | \"right\";\ntype NavigationType = \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\";\ntype NotificationDirection = \"auto\" | \"ltr\" | \"rtl\";\ntype NotificationPermission = \"default\" | \"denied\" | \"granted\";\ntype OscillatorType = \"sine\" | \"square\" | \"sawtooth\" | \"triangle\" | \"custom\";\ntype OverSampleType = \"none\" | \"2x\" | \"4x\";\ntype PanningModelType = \"equalpower\";\ntype PaymentComplete = \"success\" | \"fail\" | \"\";\ntype PaymentShippingType = \"shipping\" | \"delivery\" | \"pickup\";\ntype PushEncryptionKeyName = \"p256dh\" | \"auth\";\ntype PushPermissionState = \"granted\" | \"denied\" | \"prompt\";\ntype ReferrerPolicy = \"\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-only\" | \"origin-when-cross-origin\" | \"unsafe-url\";\ntype RequestCache = \"default\" | \"no-store\" | \"reload\" | \"no-cache\" | \"force-cache\";\ntype RequestCredentials = \"omit\" | \"same-origin\" | \"include\";\ntype RequestDestination = \"\" | \"document\" | \"sharedworker\" | \"subresource\" | \"unknown\" | \"worker\";\ntype RequestMode = \"navigate\" | \"same-origin\" | \"no-cors\" | \"cors\";\ntype RequestRedirect = \"follow\" | \"error\" | \"manual\";\ntype RequestType = \"\" | \"audio\" | \"font\" | \"image\" | \"script\" | \"style\" | \"track\" | \"video\";\ntype ResponseType = \"basic\" | \"cors\" | \"default\" | \"error\" | \"opaque\" | \"opaqueredirect\";\ntype RTCBundlePolicy = \"balanced\" | \"max-compat\" | \"max-bundle\";\ntype RTCDegradationPreference = \"maintain-framerate\" | \"maintain-resolution\" | \"balanced\";\ntype RTCDtlsRole = \"auto\" | \"client\" | \"server\";\ntype RTCDtlsTransportState = \"new\" | \"connecting\" | \"connected\" | \"closed\";\ntype RTCIceCandidateType = \"host\" | \"srflx\" | \"prflx\" | \"relay\";\ntype RTCIceComponent = \"RTP\" | \"RTCP\";\ntype RTCIceConnectionState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"failed\" | \"disconnected\" | \"closed\";\ntype RTCIceGathererState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceGatheringState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceGatherPolicy = \"all\" | \"nohost\" | \"relay\";\ntype RTCIceProtocol = \"udp\" | \"tcp\";\ntype RTCIceRole = \"controlling\" | \"controlled\";\ntype RTCIceTcpCandidateType = \"active\" | \"passive\" | \"so\";\ntype RTCIceTransportPolicy = \"none\" | \"relay\" | \"all\";\ntype RTCIceTransportState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"disconnected\" | \"closed\";\ntype RTCSdpType = \"offer\" | \"pranswer\" | \"answer\";\ntype RTCSignalingState = \"stable\" | \"have-local-offer\" | \"have-remote-offer\" | \"have-local-pranswer\" | \"have-remote-pranswer\" | \"closed\";\ntype RTCStatsIceCandidatePairState = \"frozen\" | \"waiting\" | \"inprogress\" | \"failed\" | \"succeeded\" | \"cancelled\";\ntype RTCStatsIceCandidateType = \"host\" | \"serverreflexive\" | \"peerreflexive\" | \"relayed\";\ntype RTCStatsType = \"inboundrtp\" | \"outboundrtp\" | \"session\" | \"datachannel\" | \"track\" | \"transport\" | \"candidatepair\" | \"localcandidate\" | \"remotecandidate\";\ntype ScopedCredentialType = \"ScopedCred\";\ntype ServiceWorkerState = \"installing\" | \"installed\" | \"activating\" | \"activated\" | \"redundant\";\ntype Transport = \"usb\" | \"nfc\" | \"ble\";\ntype VideoFacingModeEnum = \"user\" | \"environment\" | \"left\" | \"right\";\ntype VisibilityState = \"hidden\" | \"visible\" | \"prerender\" | \"unloaded\";\ntype XMLHttpRequestResponseType = \"\" | \"arraybuffer\" | \"blob\" | \"document\" | \"json\" | \"text\";\n\n\n/////////////////////////////\n/// WorkerGlobalScope APIs\n/////////////////////////////\n// These are only available in a Web Worker\ndeclare function importScripts(...urls: string[]): void;\n\n\n\n\n/////////////////////////////\n/// Windows Script Host APIS\n/////////////////////////////\n\n\ninterface ActiveXObject {\n new (s: string): any;\n}\ndeclare var ActiveXObject: ActiveXObject;\n\ninterface ITextWriter {\n Write(s: string): void;\n WriteLine(s: string): void;\n Close(): void;\n}\n\ninterface TextStreamBase {\n /**\n * The column number of the current character position in an input stream.\n */\n Column: number;\n\n /**\n * The current line number in an input stream.\n */\n Line: number;\n\n /**\n * Closes a text stream.\n * It is not necessary to close standard streams; they close automatically when the process ends. If\n * you close a standard stream, be aware that any other pointers to that standard stream become invalid.\n */\n Close(): void;\n}\n\ninterface TextStreamWriter extends TextStreamBase {\n /**\n * Sends a string to an output stream.\n */\n Write(s: string): void;\n\n /**\n * Sends a specified number of blank lines (newline characters) to an output stream.\n */\n WriteBlankLines(intLines: number): void;\n\n /**\n * Sends a string followed by a newline character to an output stream.\n */\n WriteLine(s: string): void;\n}\n\ninterface TextStreamReader extends TextStreamBase {\n /**\n * Returns a specified number of characters from an input stream, starting at the current pointer position.\n * Does not return until the ENTER key is pressed.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n Read(characters: number): string;\n\n /**\n * Returns all characters from an input stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadAll(): string;\n\n /**\n * Returns an entire line from an input stream.\n * Although this method extracts the newline character, it does not add it to the returned string.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadLine(): string;\n\n /**\n * Skips a specified number of characters when reading from an input text stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)\n */\n Skip(characters: number): void;\n\n /**\n * Skips the next line when reading from an input text stream.\n * Can only be used on a stream in reading mode, not writing or appending mode.\n */\n SkipLine(): void;\n\n /**\n * Indicates whether the stream pointer position is at the end of a line.\n */\n AtEndOfLine: boolean;\n\n /**\n * Indicates whether the stream pointer position is at the end of a stream.\n */\n AtEndOfStream: boolean;\n}\n\ndeclare var WScript: {\n /**\n * Outputs text to either a message box (under WScript.exe) or the command console window followed by\n * a newline (under CScript.exe).\n */\n Echo(s: any): void;\n\n /**\n * Exposes the write-only error output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdErr: TextStreamWriter;\n\n /**\n * Exposes the write-only output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdOut: TextStreamWriter;\n Arguments: { length: number; Item(n: number): string; };\n\n /**\n * The full path of the currently running script.\n */\n ScriptFullName: string;\n\n /**\n * Forces the script to stop immediately, with an optional exit code.\n */\n Quit(exitCode?: number): number;\n\n /**\n * The Windows Script Host build version number.\n */\n BuildVersion: number;\n\n /**\n * Fully qualified path of the host executable.\n */\n FullName: string;\n\n /**\n * Gets/sets the script mode - interactive(true) or batch(false).\n */\n Interactive: boolean;\n\n /**\n * The name of the host executable (WScript.exe or CScript.exe).\n */\n Name: string;\n\n /**\n * Path of the directory containing the host executable.\n */\n Path: string;\n\n /**\n * The filename of the currently running script.\n */\n ScriptName: string;\n\n /**\n * Exposes the read-only input stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdIn: TextStreamReader;\n\n /**\n * Windows Script Host version\n */\n Version: string;\n\n /**\n * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.\n */\n ConnectObject(objEventSource: any, strPrefix: string): void;\n\n /**\n * Creates a COM object.\n * @param strProgiID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n CreateObject(strProgID: string, strPrefix?: string): any;\n\n /**\n * Disconnects a COM object from its event sources.\n */\n DisconnectObject(obj: any): void;\n\n /**\n * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.\n * @param strPathname Fully qualified path to the file containing the object persisted to disk.\n * For objects in memory, pass a zero-length string.\n * @param strProgID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;\n\n /**\n * Suspends script execution for a specified length of time, then continues execution.\n * @param intTime Interval (in milliseconds) to suspend script execution.\n */\n Sleep(intTime: number): void;\n};\n\n/**\n * Represents an Automation SAFEARRAY\n */\ndeclare class SafeArray {\n private constructor();\n private SafeArray_typekey: SafeArray;\n}\n\n/**\n * Allows enumerating over a COM collection, which may not have indexed item access.\n */\ninterface Enumerator {\n /**\n * Returns true if the current item is the last one in the collection, or the collection is empty,\n * or the current item is undefined.\n */\n atEnd(): boolean;\n\n /**\n * Returns the current item in the collection\n */\n item(): T;\n\n /**\n * Resets the current item in the collection to the first item. If there are no items in the collection,\n * the current item is set to undefined.\n */\n moveFirst(): void;\n\n /**\n * Moves the current item to the next item in the collection. If the enumerator is at the end of\n * the collection or the collection is empty, the current item is set to undefined.\n */\n moveNext(): void;\n}\n\ninterface EnumeratorConstructor {\n new (safearray: SafeArray): Enumerator;\n new (collection: { Item(index: any): T }): Enumerator;\n new (collection: any): Enumerator;\n}\n\ndeclare var Enumerator: EnumeratorConstructor;\n\n/**\n * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.\n */\ninterface VBArray {\n /**\n * Returns the number of dimensions (1-based).\n */\n dimensions(): number;\n\n /**\n * Takes an index for each dimension in the array, and returns the item at the corresponding location.\n */\n getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;\n\n /**\n * Returns the smallest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n lbound(dimension?: number): number;\n\n /**\n * Returns the largest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n ubound(dimension?: number): number;\n\n /**\n * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,\n * each successive dimension is appended to the end of the array.\n * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]\n */\n toArray(): T[];\n}\n\ninterface VBArrayConstructor {\n new (safeArray: SafeArray): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ndeclare class VarDate {\n private constructor();\n private VarDate_typekey: VarDate;\n}\n\ninterface DateConstructor {\n new (vd: VarDate): Date;\n}\n\ninterface Date {\n getVarDate: () => VarDate;\n}\n"; +export const contents = "/*! *****************************************************************************\nCopyright (c) Microsoft Corporation. All rights reserved. \nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0 \n \nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, \nMERCHANTABLITY OR NON-INFRINGEMENT. \n \nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\n\n\n\n/// \n\n\n/////////////////////////////\n/// ECMAScript APIs\n/////////////////////////////\n\ndeclare const NaN: number;\ndeclare const Infinity: number;\n\n/**\n * Evaluates JavaScript code and executes it.\n * @param x A String value that contains valid JavaScript code.\n */\ndeclare function eval(x: string): any;\n\n/**\n * Converts A string to an integer.\n * @param s A string to convert into a number.\n * @param radix A value between 2 and 36 that specifies the base of the number in numString.\n * If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.\n * All other strings are considered decimal.\n */\ndeclare function parseInt(s: string, radix?: number): number;\n\n/**\n * Converts a string to a floating-point number.\n * @param string A string that contains a floating-point number.\n */\ndeclare function parseFloat(string: string): number;\n\n/**\n * Returns a Boolean value that indicates whether a value is the reserved value NaN (not a number).\n * @param number A numeric value.\n */\ndeclare function isNaN(number: number): boolean;\n\n/**\n * Determines whether a supplied number is finite.\n * @param number Any numeric value.\n */\ndeclare function isFinite(number: number): boolean;\n\n/**\n * Gets the unencoded version of an encoded Uniform Resource Identifier (URI).\n * @param encodedURI A value representing an encoded URI.\n */\ndeclare function decodeURI(encodedURI: string): string;\n\n/**\n * Gets the unencoded version of an encoded component of a Uniform Resource Identifier (URI).\n * @param encodedURIComponent A value representing an encoded URI component.\n */\ndeclare function decodeURIComponent(encodedURIComponent: string): string;\n\n/**\n * Encodes a text string as a valid Uniform Resource Identifier (URI)\n * @param uri A value representing an encoded URI.\n */\ndeclare function encodeURI(uri: string): string;\n\n/**\n * Encodes a text string as a valid component of a Uniform Resource Identifier (URI).\n * @param uriComponent A value representing an encoded URI component.\n */\ndeclare function encodeURIComponent(uriComponent: string): string;\n\n/**\n * Computes a new string in which certain characters have been replaced by a hexadecimal escape sequence.\n * @param string A string value\n */\ndeclare function escape(string: string): string;\n\n/**\n * Computes a new string in which hexadecimal escape sequences are replaced with the character that it represents.\n * @param string A string value\n */\ndeclare function unescape(string: string): string;\n\ninterface PropertyDescriptor {\n configurable?: boolean;\n enumerable?: boolean;\n value?: any;\n writable?: boolean;\n get?(): any;\n set?(v: any): void;\n}\n\ninterface PropertyDescriptorMap {\n [s: string]: PropertyDescriptor;\n}\n\ninterface Object {\n /** The initial value of Object.prototype.constructor is the standard built-in Object constructor. */\n constructor: Function;\n\n /** Returns a string representation of an object. */\n toString(): string;\n\n /** Returns a date converted to a string using the current locale. */\n toLocaleString(): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): Object;\n\n /**\n * Determines whether an object has a property with the specified name.\n * @param v A property name.\n */\n hasOwnProperty(v: string): boolean;\n\n /**\n * Determines whether an object exists in another object's prototype chain.\n * @param v Another object whose prototype chain is to be checked.\n */\n isPrototypeOf(v: Object): boolean;\n\n /**\n * Determines whether a specified property is enumerable.\n * @param v A property name.\n */\n propertyIsEnumerable(v: string): boolean;\n}\n\ninterface ObjectConstructor {\n new(value?: any): Object;\n (): any;\n (value: any): any;\n\n /** A reference to the prototype for a class of objects. */\n readonly prototype: Object;\n\n /**\n * Returns the prototype of an object.\n * @param o The object that references the prototype.\n */\n getPrototypeOf(o: any): any;\n\n /**\n * Gets the own property descriptor of the specified object.\n * An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.\n * @param o Object that contains the property.\n * @param p Name of the property.\n */\n getOwnPropertyDescriptor(o: any, p: string): PropertyDescriptor | undefined;\n\n /**\n * Returns the names of the own properties of an object. The own properties of an object are those that are defined directly\n * on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.\n * @param o Object that contains the own properties.\n */\n getOwnPropertyNames(o: any): string[];\n\n /**\n * Creates an object that has the specified prototype or that has null prototype.\n * @param o Object to use as a prototype. May be null.\n */\n create(o: object | null): any;\n\n /**\n * Creates an object that has the specified prototype, and that optionally contains specified properties.\n * @param o Object to use as a prototype. May be null\n * @param properties JavaScript object that contains one or more property descriptors.\n */\n create(o: object | null, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Adds a property to an object, or modifies attributes of an existing property.\n * @param o Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.\n * @param p The property name.\n * @param attributes Descriptor for the property. It can be for a data property or an accessor property.\n */\n defineProperty(o: any, p: string, attributes: PropertyDescriptor & ThisType): any;\n\n /**\n * Adds one or more properties to an object, and/or modifies attributes of existing properties.\n * @param o Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.\n * @param properties JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.\n */\n defineProperties(o: any, properties: PropertyDescriptorMap & ThisType): any;\n\n /**\n * Prevents the modification of attributes of existing properties, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n seal(o: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(a: T[]): ReadonlyArray;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(f: T): T;\n\n /**\n * Prevents the modification of existing property attributes and values, and prevents the addition of new properties.\n * @param o Object on which to lock the attributes.\n */\n freeze(o: T): Readonly;\n\n /**\n * Prevents the addition of new properties to an object.\n * @param o Object to make non-extensible.\n */\n preventExtensions(o: T): T;\n\n /**\n * Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isSealed(o: any): boolean;\n\n /**\n * Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.\n * @param o Object to test.\n */\n isFrozen(o: any): boolean;\n\n /**\n * Returns a value that indicates whether new properties can be added to an object.\n * @param o Object to test.\n */\n isExtensible(o: any): boolean;\n\n /**\n * Returns the names of the enumerable properties and methods of an object.\n * @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.\n */\n keys(o: {}): string[];\n}\n\n/**\n * Provides functionality common to all JavaScript objects.\n */\ndeclare const Object: ObjectConstructor;\n\n/**\n * Creates a new function.\n */\ninterface Function {\n /**\n * Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.\n * @param thisArg The object to be used as the this object.\n * @param argArray A set of arguments to be passed to the function.\n */\n apply(this: Function, thisArg: any, argArray?: any): any;\n\n /**\n * Calls a method of an object, substituting another object for the current object.\n * @param thisArg The object to be used as the current object.\n * @param argArray A list of arguments to be passed to the method.\n */\n call(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /**\n * For a given function, creates a bound function that has the same body as the original function.\n * The this object of the bound function is associated with the specified object, and has the specified initial parameters.\n * @param thisArg An object to which the this keyword can refer inside the new function.\n * @param argArray A list of arguments to be passed to the new function.\n */\n bind(this: Function, thisArg: any, ...argArray: any[]): any;\n\n /** Returns a string representation of a function. */\n toString(): string;\n\n prototype: any;\n readonly length: number;\n\n // Non-standard extensions\n arguments: any;\n caller: Function;\n}\n\ninterface FunctionConstructor {\n /**\n * Creates a new function.\n * @param args A list of arguments the function accepts.\n */\n new(...args: string[]): Function;\n (...args: string[]): Function;\n readonly prototype: Function;\n}\n\ndeclare const Function: FunctionConstructor;\n\ninterface IArguments {\n [index: number]: any;\n length: number;\n callee: Function;\n}\n\ninterface String {\n /** Returns a string representation of a string. */\n toString(): string;\n\n /**\n * Returns the character at the specified index.\n * @param pos The zero-based index of the desired character.\n */\n charAt(pos: number): string;\n\n /**\n * Returns the Unicode value of the character at the specified location.\n * @param index The zero-based index of the desired character. If there is no character at the specified index, NaN is returned.\n */\n charCodeAt(index: number): number;\n\n /**\n * Returns a string that contains the concatenation of two or more strings.\n * @param strings The strings to append to the end of the string.\n */\n concat(...strings: string[]): string;\n\n /**\n * Returns the position of the first occurrence of a substring.\n * @param searchString The substring to search for in the string\n * @param position The index at which to begin searching the String object. If omitted, search starts at the beginning of the string.\n */\n indexOf(searchString: string, position?: number): number;\n\n /**\n * Returns the last occurrence of a substring in the string.\n * @param searchString The substring to search for.\n * @param position The index at which to begin searching. If omitted, the search begins at the end of the string.\n */\n lastIndexOf(searchString: string, position?: number): number;\n\n /**\n * Determines whether two strings are equivalent in the current locale.\n * @param that String to compare to target string\n */\n localeCompare(that: string): number;\n\n /**\n * Matches a string with a regular expression, and returns an array containing the results of that search.\n * @param regexp A variable name or string literal containing the regular expression pattern and flags.\n */\n match(regexp: string | RegExp): RegExpMatchArray | null;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.\n */\n replace(searchValue: string | RegExp, replaceValue: string): string;\n\n /**\n * Replaces text in a string, using a regular expression or search string.\n * @param searchValue A string to search for.\n * @param replacer A function that returns the replacement text.\n */\n replace(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;\n\n /**\n * Finds the first substring match in a regular expression search.\n * @param regexp The regular expression pattern and applicable flags.\n */\n search(regexp: string | RegExp): number;\n\n /**\n * Returns a section of a string.\n * @param start The index to the beginning of the specified portion of stringObj.\n * @param end The index to the end of the specified portion of stringObj. The substring includes the characters up to, but not including, the character indicated by end.\n * If this value is not specified, the substring continues to the end of stringObj.\n */\n slice(start?: number, end?: number): string;\n\n /**\n * Split a string into substrings using the specified separator and return them as an array.\n * @param separator A string that identifies character or characters to use in separating the string. If omitted, a single-element array containing the entire string is returned.\n * @param limit A value used to limit the number of elements returned in the array.\n */\n split(separator: string | RegExp, limit?: number): string[];\n\n /**\n * Returns the substring at the specified location within a String object.\n * @param start The zero-based index number indicating the beginning of the substring.\n * @param end Zero-based index number indicating the end of the substring. The substring includes the characters up to, but not including, the character indicated by end.\n * If end is omitted, the characters from start through the end of the original string are returned.\n */\n substring(start: number, end?: number): string;\n\n /** Converts all the alphabetic characters in a string to lowercase. */\n toLowerCase(): string;\n\n /** Converts all alphabetic characters to lowercase, taking into account the host environment's current locale. */\n toLocaleLowerCase(): string;\n\n /** Converts all the alphabetic characters in a string to uppercase. */\n toUpperCase(): string;\n\n /** Returns a string where all alphabetic characters have been converted to uppercase, taking into account the host environment's current locale. */\n toLocaleUpperCase(): string;\n\n /** Removes the leading and trailing white space and line terminator characters from a string. */\n trim(): string;\n\n /** Returns the length of a String object. */\n readonly length: number;\n\n // IE extensions\n /**\n * Gets a substring beginning at the specified location and having the specified length.\n * @param from The starting position of the desired substring. The index of the first character in the string is zero.\n * @param length The number of characters to include in the returned substring.\n */\n substr(from: number, length?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): string;\n\n readonly [index: number]: string;\n}\n\ninterface StringConstructor {\n new(value?: any): String;\n (value?: any): string;\n readonly prototype: String;\n fromCharCode(...codes: number[]): string;\n}\n\n/**\n * Allows manipulation and formatting of text strings and determination and location of substrings within strings.\n */\ndeclare const String: StringConstructor;\n\ninterface Boolean {\n /** Returns the primitive value of the specified object. */\n valueOf(): boolean;\n}\n\ninterface BooleanConstructor {\n new(value?: any): Boolean;\n (value?: any): boolean;\n readonly prototype: Boolean;\n}\n\ndeclare const Boolean: BooleanConstructor;\n\ninterface Number {\n /**\n * Returns a string representation of an object.\n * @param radix Specifies a radix for converting numeric values to strings. This value is only used for numbers.\n */\n toString(radix?: number): string;\n\n /**\n * Returns a string representing a number in fixed-point notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toFixed(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented in exponential notation.\n * @param fractionDigits Number of digits after the decimal point. Must be in the range 0 - 20, inclusive.\n */\n toExponential(fractionDigits?: number): string;\n\n /**\n * Returns a string containing a number represented either in exponential or fixed-point notation with a specified number of digits.\n * @param precision Number of significant digits. Must be in the range 1 - 21, inclusive.\n */\n toPrecision(precision?: number): string;\n\n /** Returns the primitive value of the specified object. */\n valueOf(): number;\n}\n\ninterface NumberConstructor {\n new(value?: any): Number;\n (value?: any): number;\n readonly prototype: Number;\n\n /** The largest number that can be represented in JavaScript. Equal to approximately 1.79E+308. */\n readonly MAX_VALUE: number;\n\n /** The closest number to zero that can be represented in JavaScript. Equal to approximately 5.00E-324. */\n readonly MIN_VALUE: number;\n\n /**\n * A value that is not a number.\n * In equality comparisons, NaN does not equal any value, including itself. To test whether a value is equivalent to NaN, use the isNaN function.\n */\n readonly NaN: number;\n\n /**\n * A value that is less than the largest negative number that can be represented in JavaScript.\n * JavaScript displays NEGATIVE_INFINITY values as -infinity.\n */\n readonly NEGATIVE_INFINITY: number;\n\n /**\n * A value greater than the largest number that can be represented in JavaScript.\n * JavaScript displays POSITIVE_INFINITY values as infinity.\n */\n readonly POSITIVE_INFINITY: number;\n}\n\n/** An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers. */\ndeclare const Number: NumberConstructor;\n\ninterface TemplateStringsArray extends ReadonlyArray {\n readonly raw: ReadonlyArray;\n}\n\ninterface Math {\n /** The mathematical constant e. This is Euler's number, the base of natural logarithms. */\n readonly E: number;\n /** The natural logarithm of 10. */\n readonly LN10: number;\n /** The natural logarithm of 2. */\n readonly LN2: number;\n /** The base-2 logarithm of e. */\n readonly LOG2E: number;\n /** The base-10 logarithm of e. */\n readonly LOG10E: number;\n /** Pi. This is the ratio of the circumference of a circle to its diameter. */\n readonly PI: number;\n /** The square root of 0.5, or, equivalently, one divided by the square root of 2. */\n readonly SQRT1_2: number;\n /** The square root of 2. */\n readonly SQRT2: number;\n /**\n * Returns the absolute value of a number (the value without regard to whether it is positive or negative).\n * For example, the absolute value of -5 is the same as the absolute value of 5.\n * @param x A numeric expression for which the absolute value is needed.\n */\n abs(x: number): number;\n /**\n * Returns the arc cosine (or inverse cosine) of a number.\n * @param x A numeric expression.\n */\n acos(x: number): number;\n /**\n * Returns the arcsine of a number.\n * @param x A numeric expression.\n */\n asin(x: number): number;\n /**\n * Returns the arctangent of a number.\n * @param x A numeric expression for which the arctangent is needed.\n */\n atan(x: number): number;\n /**\n * Returns the angle (in radians) from the X axis to a point.\n * @param y A numeric expression representing the cartesian y-coordinate.\n * @param x A numeric expression representing the cartesian x-coordinate.\n */\n atan2(y: number, x: number): number;\n /**\n * Returns the smallest integer greater than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n ceil(x: number): number;\n /**\n * Returns the cosine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n cos(x: number): number;\n /**\n * Returns e (the base of natural logarithms) raised to a power.\n * @param x A numeric expression representing the power of e.\n */\n exp(x: number): number;\n /**\n * Returns the greatest integer less than or equal to its numeric argument.\n * @param x A numeric expression.\n */\n floor(x: number): number;\n /**\n * Returns the natural logarithm (base e) of a number.\n * @param x A numeric expression.\n */\n log(x: number): number;\n /**\n * Returns the larger of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n max(...values: number[]): number;\n /**\n * Returns the smaller of a set of supplied numeric expressions.\n * @param values Numeric expressions to be evaluated.\n */\n min(...values: number[]): number;\n /**\n * Returns the value of a base expression taken to a specified power.\n * @param x The base value of the expression.\n * @param y The exponent value of the expression.\n */\n pow(x: number, y: number): number;\n /** Returns a pseudorandom number between 0 and 1. */\n random(): number;\n /**\n * Returns a supplied numeric expression rounded to the nearest number.\n * @param x The value to be rounded to the nearest number.\n */\n round(x: number): number;\n /**\n * Returns the sine of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n sin(x: number): number;\n /**\n * Returns the square root of a number.\n * @param x A numeric expression.\n */\n sqrt(x: number): number;\n /**\n * Returns the tangent of a number.\n * @param x A numeric expression that contains an angle measured in radians.\n */\n tan(x: number): number;\n}\n/** An intrinsic object that provides basic mathematics functionality and constants. */\ndeclare const Math: Math;\n\n/** Enables basic storage and retrieval of dates and times. */\ninterface Date {\n /** Returns a string representation of a date. The format of the string depends on the locale. */\n toString(): string;\n /** Returns a date as a string value. */\n toDateString(): string;\n /** Returns a time as a string value. */\n toTimeString(): string;\n /** Returns a value as a string value appropriate to the host environment's current locale. */\n toLocaleString(): string;\n /** Returns a date as a string value appropriate to the host environment's current locale. */\n toLocaleDateString(): string;\n /** Returns a time as a string value appropriate to the host environment's current locale. */\n toLocaleTimeString(): string;\n /** Returns the stored time value in milliseconds since midnight, January 1, 1970 UTC. */\n valueOf(): number;\n /** Gets the time value in milliseconds. */\n getTime(): number;\n /** Gets the year, using local time. */\n getFullYear(): number;\n /** Gets the year using Universal Coordinated Time (UTC). */\n getUTCFullYear(): number;\n /** Gets the month, using local time. */\n getMonth(): number;\n /** Gets the month of a Date object using Universal Coordinated Time (UTC). */\n getUTCMonth(): number;\n /** Gets the day-of-the-month, using local time. */\n getDate(): number;\n /** Gets the day-of-the-month, using Universal Coordinated Time (UTC). */\n getUTCDate(): number;\n /** Gets the day of the week, using local time. */\n getDay(): number;\n /** Gets the day of the week using Universal Coordinated Time (UTC). */\n getUTCDay(): number;\n /** Gets the hours in a date, using local time. */\n getHours(): number;\n /** Gets the hours value in a Date object using Universal Coordinated Time (UTC). */\n getUTCHours(): number;\n /** Gets the minutes of a Date object, using local time. */\n getMinutes(): number;\n /** Gets the minutes of a Date object using Universal Coordinated Time (UTC). */\n getUTCMinutes(): number;\n /** Gets the seconds of a Date object, using local time. */\n getSeconds(): number;\n /** Gets the seconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCSeconds(): number;\n /** Gets the milliseconds of a Date, using local time. */\n getMilliseconds(): number;\n /** Gets the milliseconds of a Date object using Universal Coordinated Time (UTC). */\n getUTCMilliseconds(): number;\n /** Gets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC). */\n getTimezoneOffset(): number;\n /**\n * Sets the date and time value in the Date object.\n * @param time A numeric value representing the number of elapsed milliseconds since midnight, January 1, 1970 GMT.\n */\n setTime(time: number): number;\n /**\n * Sets the milliseconds value in the Date object using local time.\n * @param ms A numeric value equal to the millisecond value.\n */\n setMilliseconds(ms: number): number;\n /**\n * Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).\n * @param ms A numeric value equal to the millisecond value.\n */\n setUTCMilliseconds(ms: number): number;\n\n /**\n * Sets the seconds value in the Date object using local time.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setSeconds(sec: number, ms?: number): number;\n /**\n * Sets the seconds value in the Date object using Universal Coordinated Time (UTC).\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCSeconds(sec: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using local time.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the minutes value in the Date object using Universal Coordinated Time (UTC).\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCMinutes(min: number, sec?: number, ms?: number): number;\n /**\n * Sets the hour value in the Date object using local time.\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the hours value in the Date object using Universal Coordinated Time (UTC).\n * @param hours A numeric value equal to the hours value.\n * @param min A numeric value equal to the minutes value.\n * @param sec A numeric value equal to the seconds value.\n * @param ms A numeric value equal to the milliseconds value.\n */\n setUTCHours(hours: number, min?: number, sec?: number, ms?: number): number;\n /**\n * Sets the numeric day-of-the-month value of the Date object using local time.\n * @param date A numeric value equal to the day of the month.\n */\n setDate(date: number): number;\n /**\n * Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).\n * @param date A numeric value equal to the day of the month.\n */\n setUTCDate(date: number): number;\n /**\n * Sets the month value in the Date object using local time.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If this value is not supplied, the value from a call to the getDate method is used.\n */\n setMonth(month: number, date?: number): number;\n /**\n * Sets the month value in the Date object using Universal Coordinated Time (UTC).\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively.\n * @param date A numeric value representing the day of the month. If it is not supplied, the value from a call to the getUTCDate method is used.\n */\n setUTCMonth(month: number, date?: number): number;\n /**\n * Sets the year of the Date object using local time.\n * @param year A numeric value for the year.\n * @param month A zero-based numeric value for the month (0 for January, 11 for December). Must be specified if numDate is specified.\n * @param date A numeric value equal for the day of the month.\n */\n setFullYear(year: number, month?: number, date?: number): number;\n /**\n * Sets the year value in the Date object using Universal Coordinated Time (UTC).\n * @param year A numeric value equal to the year.\n * @param month A numeric value equal to the month. The value for January is 0, and other month values follow consecutively. Must be supplied if numDate is supplied.\n * @param date A numeric value equal to the day of the month.\n */\n setUTCFullYear(year: number, month?: number, date?: number): number;\n /** Returns a date converted to a string using Universal Coordinated Time (UTC). */\n toUTCString(): string;\n /** Returns a date as a string value in ISO format. */\n toISOString(): string;\n /** Used by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization. */\n toJSON(key?: any): string;\n}\n\ninterface DateConstructor {\n new(): Date;\n new(value: number): Date;\n new(value: string): Date;\n new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;\n (): string;\n readonly prototype: Date;\n /**\n * Parses a string containing a date, and returns the number of milliseconds between that date and midnight, January 1, 1970.\n * @param s A date string\n */\n parse(s: string): number;\n /**\n * Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.\n * @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.\n * @param month The month as an number between 0 and 11 (January to December).\n * @param date The date as an number between 1 and 31.\n * @param hours Must be supplied if minutes is supplied. An number from 0 to 23 (midnight to 11pm) that specifies the hour.\n * @param minutes Must be supplied if seconds is supplied. An number from 0 to 59 that specifies the minutes.\n * @param seconds Must be supplied if milliseconds is supplied. An number from 0 to 59 that specifies the seconds.\n * @param ms An number from 0 to 999 that specifies the milliseconds.\n */\n UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;\n now(): number;\n}\n\ndeclare const Date: DateConstructor;\n\ninterface RegExpMatchArray extends Array {\n index?: number;\n input?: string;\n}\n\ninterface RegExpExecArray extends Array {\n index: number;\n input: string;\n}\n\ninterface RegExp {\n /**\n * Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.\n * @param string The String object or string literal on which to perform the search.\n */\n exec(string: string): RegExpExecArray | null;\n\n /**\n * Returns a Boolean value that indicates whether or not a pattern exists in a searched string.\n * @param string String on which to perform the search.\n */\n test(string: string): boolean;\n\n /** Returns a copy of the text of the regular expression pattern. Read-only. The regExp argument is a Regular expression object. It can be a variable name or a literal. */\n readonly source: string;\n\n /** Returns a Boolean value indicating the state of the global flag (g) used with a regular expression. Default is false. Read-only. */\n readonly global: boolean;\n\n /** Returns a Boolean value indicating the state of the ignoreCase flag (i) used with a regular expression. Default is false. Read-only. */\n readonly ignoreCase: boolean;\n\n /** Returns a Boolean value indicating the state of the multiline flag (m) used with a regular expression. Default is false. Read-only. */\n readonly multiline: boolean;\n\n lastIndex: number;\n\n // Non-standard extensions\n compile(): this;\n}\n\ninterface RegExpConstructor {\n new(pattern: RegExp | string): RegExp;\n new(pattern: string, flags?: string): RegExp;\n (pattern: RegExp | string): RegExp;\n (pattern: string, flags?: string): RegExp;\n readonly prototype: RegExp;\n\n // Non-standard extensions\n $1: string;\n $2: string;\n $3: string;\n $4: string;\n $5: string;\n $6: string;\n $7: string;\n $8: string;\n $9: string;\n lastMatch: string;\n}\n\ndeclare const RegExp: RegExpConstructor;\n\ninterface Error {\n name: string;\n message: string;\n stack?: string;\n}\n\ninterface ErrorConstructor {\n new(message?: string): Error;\n (message?: string): Error;\n readonly prototype: Error;\n}\n\ndeclare const Error: ErrorConstructor;\n\ninterface EvalError extends Error {\n}\n\ninterface EvalErrorConstructor {\n new(message?: string): EvalError;\n (message?: string): EvalError;\n readonly prototype: EvalError;\n}\n\ndeclare const EvalError: EvalErrorConstructor;\n\ninterface RangeError extends Error {\n}\n\ninterface RangeErrorConstructor {\n new(message?: string): RangeError;\n (message?: string): RangeError;\n readonly prototype: RangeError;\n}\n\ndeclare const RangeError: RangeErrorConstructor;\n\ninterface ReferenceError extends Error {\n}\n\ninterface ReferenceErrorConstructor {\n new(message?: string): ReferenceError;\n (message?: string): ReferenceError;\n readonly prototype: ReferenceError;\n}\n\ndeclare const ReferenceError: ReferenceErrorConstructor;\n\ninterface SyntaxError extends Error {\n}\n\ninterface SyntaxErrorConstructor {\n new(message?: string): SyntaxError;\n (message?: string): SyntaxError;\n readonly prototype: SyntaxError;\n}\n\ndeclare const SyntaxError: SyntaxErrorConstructor;\n\ninterface TypeError extends Error {\n}\n\ninterface TypeErrorConstructor {\n new(message?: string): TypeError;\n (message?: string): TypeError;\n readonly prototype: TypeError;\n}\n\ndeclare const TypeError: TypeErrorConstructor;\n\ninterface URIError extends Error {\n}\n\ninterface URIErrorConstructor {\n new(message?: string): URIError;\n (message?: string): URIError;\n readonly prototype: URIError;\n}\n\ndeclare const URIError: URIErrorConstructor;\n\ninterface JSON {\n /**\n * Converts a JavaScript Object Notation (JSON) string into an object.\n * @param text A valid JSON string.\n * @param reviver A function that transforms the results. This function is called for each member of the object.\n * If a member contains nested objects, the nested objects are transformed before the parent object is.\n */\n parse(text: string, reviver?: (key: any, value: any) => any): any;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer A function that transforms the results.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (key: string, value: any) => any, space?: string | number): string;\n /**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n * @param value A JavaScript value, usually an object or array, to be converted.\n * @param replacer An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.\n * @param space Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\n stringify(value: any, replacer?: (number | string)[] | null, space?: string | number): string;\n}\n\n/**\n * An intrinsic object that provides functions to convert JavaScript values to and from the JavaScript Object Notation (JSON) format.\n */\ndeclare const JSON: JSON;\n\n\n/////////////////////////////\n/// ECMAScript Array API (specially handled by compiler)\n/////////////////////////////\n\ninterface ReadonlyArray {\n /**\n * Gets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n readonly length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: ReadonlyArray) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: ReadonlyArray) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: ReadonlyArray) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: ReadonlyArray) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: ReadonlyArray) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: ReadonlyArray) => U, initialValue: U): U;\n\n readonly [n: number]: T;\n}\n\ninterface ConcatArray {\n readonly length: number;\n readonly [n: number]: T;\n join(separator?: string): string;\n slice(start?: number, end?: number): T[];\n}\n\ninterface Array {\n /**\n * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.\n */\n length: number;\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n /**\n * Returns a string representation of an array. The elements are converted to string using their toLocalString methods.\n */\n toLocaleString(): string;\n /**\n * Appends new elements to an array, and returns the new length of the array.\n * @param items New elements of the Array.\n */\n push(...items: T[]): number;\n /**\n * Removes the last element from an array and returns it.\n */\n pop(): T | undefined;\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: ConcatArray[]): T[];\n /**\n * Combines two or more arrays.\n * @param items Additional items to add to the end of array1.\n */\n concat(...items: (T | ConcatArray)[]): T[];\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n /**\n * Reverses the elements in an Array.\n */\n reverse(): T[];\n /**\n * Removes the first element from an array and returns it.\n */\n shift(): T | undefined;\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): T[];\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: T, b: T) => number): this;\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n */\n splice(start: number, deleteCount?: number): T[];\n /**\n * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.\n * @param start The zero-based location in the array from which to start removing elements.\n * @param deleteCount The number of elements to remove.\n * @param items Elements to insert into the array in place of the deleted elements.\n */\n splice(start: number, deleteCount: number, ...items: T[]): T[];\n /**\n * Inserts new elements at the start of an array.\n * @param items Elements to insert at the start of the Array.\n */\n unshift(...items: T[]): number;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.\n */\n indexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Returns the index of the last occurrence of a specified value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.\n */\n lastIndexOf(searchElement: T, fromIndex?: number): number;\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: T, index: number, array: T[]) => boolean, thisArg?: any): boolean;\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: T, index: number, array: T[]) => void, thisArg?: any): void;\n /**\n * Calls a defined callback function on each element of an array, and returns an array that contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: T, index: number, array: T[]) => U, thisArg?: any): U[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => value is S, thisArg?: any): S[];\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @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.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: T, index: number, array: T[]) => any, thisArg?: any): T[];\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduce(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T): T;\n reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T;\n /**\n * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: T, currentIndex: number, array: T[]) => U, initialValue: U): U;\n\n [n: number]: T;\n}\n\ninterface ArrayConstructor {\n new(arrayLength?: number): any[];\n new (arrayLength: number): T[];\n new (...items: T[]): T[];\n (arrayLength?: number): any[];\n (arrayLength: number): T[];\n (...items: T[]): T[];\n isArray(arg: any): arg is Array;\n readonly prototype: Array;\n}\n\ndeclare const Array: ArrayConstructor;\n\ninterface TypedPropertyDescriptor {\n enumerable?: boolean;\n configurable?: boolean;\n writable?: boolean;\n value?: T;\n get?: () => T;\n set?: (value: T) => void;\n}\n\ndeclare type ClassDecorator = (target: TFunction) => TFunction | void;\ndeclare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;\ndeclare type MethodDecorator = (target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor | void;\ndeclare type ParameterDecorator = (target: Object, propertyKey: string | symbol, parameterIndex: number) => void;\n\ndeclare type PromiseConstructorLike = new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void) => PromiseLike;\n\ninterface PromiseLike {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): PromiseLike;\n}\n\n/**\n * Represents the completion of an asynchronous operation\n */\ninterface Promise {\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of which ever callback is executed.\n */\n then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise;\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @returns A Promise for the completion of the callback.\n */\n catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise;\n}\n\ninterface ArrayLike {\n readonly length: number;\n readonly [n: number]: T;\n}\n\n/**\n * Make all properties in T optional\n */\ntype Partial = {\n [P in keyof T]?: T[P];\n};\n\n/**\n * Make all properties in T required\n */\ntype Required = {\n [P in keyof T]-?: T[P];\n};\n\n/**\n * Make all properties in T readonly\n */\ntype Readonly = {\n readonly [P in keyof T]: T[P];\n};\n\n/**\n * From T pick a set of properties K\n */\ntype Pick = {\n [P in K]: T[P];\n};\n\n/**\n * Construct a type with a set of properties K of type T\n */\ntype Record = {\n [P in K]: T;\n};\n\n/**\n * Exclude from T those types that are assignable to U\n */\ntype Exclude = T extends U ? never : T;\n\n/**\n * Extract from T those types that are assignable to U\n */\ntype Extract = T extends U ? T : never;\n\n/**\n * Exclude null and undefined from T\n */\ntype NonNullable = T extends null | undefined ? never : T;\n\n/**\n * Obtain the return type of a function type\n */\ntype ReturnType any> = T extends (...args: any[]) => infer R ? R : any;\n\n/**\n * Obtain the return type of a constructor function type\n */\ntype InstanceType any> = T extends new (...args: any[]) => infer R ? R : any;\n\n/**\n * Marker for contextual 'this' type\n */\ninterface ThisType { }\n\n/**\n * Represents a raw buffer of binary data, which is used to store data for the\n * different typed arrays. ArrayBuffers cannot be read from or written to directly,\n * but can be passed to a typed array or DataView Object to interpret the raw\n * buffer as needed.\n */\ninterface ArrayBuffer {\n /**\n * Read-only. The length of the ArrayBuffer (in bytes).\n */\n readonly byteLength: number;\n\n /**\n * Returns a section of an ArrayBuffer.\n */\n slice(begin: number, end?: number): ArrayBuffer;\n}\n\n/**\n * Allowed ArrayBuffer types for the buffer of an ArrayBufferView and related Typed Arrays.\n */\ninterface ArrayBufferTypes {\n ArrayBuffer: ArrayBuffer;\n}\ntype ArrayBufferLike = ArrayBufferTypes[keyof ArrayBufferTypes];\n\ninterface ArrayBufferConstructor {\n readonly prototype: ArrayBuffer;\n new(byteLength: number): ArrayBuffer;\n isView(arg: any): arg is ArrayBufferView;\n}\ndeclare const ArrayBuffer: ArrayBufferConstructor;\n\ninterface ArrayBufferView {\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n byteOffset: number;\n}\n\ninterface DataView {\n readonly buffer: ArrayBuffer;\n readonly byteLength: number;\n readonly byteOffset: number;\n /**\n * Gets the Float32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Float64 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getFloat64(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Int8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt8(byteOffset: number): number;\n\n /**\n * Gets the Int16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt16(byteOffset: number, littleEndian?: boolean): number;\n /**\n * Gets the Int32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getInt32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint8 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint8(byteOffset: number): number;\n\n /**\n * Gets the Uint16 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint16(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Gets the Uint32 value at the specified byte offset from the start of the view. There is\n * no alignment constraint; multi-byte values may be fetched from any offset.\n * @param byteOffset The place in the buffer at which the value should be retrieved.\n */\n getUint32(byteOffset: number, littleEndian?: boolean): number;\n\n /**\n * Stores an Float32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Float64 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setFloat64(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setInt8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Int16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Int32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setInt32(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint8 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n */\n setUint8(byteOffset: number, value: number): void;\n\n /**\n * Stores an Uint16 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint16(byteOffset: number, value: number, littleEndian?: boolean): void;\n\n /**\n * Stores an Uint32 value at the specified byte offset from the start of the view.\n * @param byteOffset The place in the buffer at which the value should be set.\n * @param value The value to set.\n * @param littleEndian If false or undefined, a big-endian value should be written,\n * otherwise a little-endian value should be written.\n */\n setUint32(byteOffset: number, value: number, littleEndian?: boolean): void;\n}\n\ninterface DataViewConstructor {\n new(buffer: ArrayBufferLike, byteOffset?: number, byteLength?: number): DataView;\n}\ndeclare const DataView: DataViewConstructor;\n\n/**\n * A typed array of 8-bit integer values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Int8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int8Array) => any, thisArg?: any): Int8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int8Array) => number, thisArg?: any): Int8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\ninterface Int8ArrayConstructor {\n readonly prototype: Int8Array;\n new(length: number): Int8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int8Array;\n\n\n}\ndeclare const Int8Array: Int8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8Array) => any, thisArg?: any): Uint8Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8Array) => number, thisArg?: any): Uint8Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ArrayConstructor {\n readonly prototype: Uint8Array;\n new(length: number): Uint8Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8Array;\n\n}\ndeclare const Uint8Array: Uint8ArrayConstructor;\n\n/**\n * A typed array of 8-bit unsigned integer (clamped) values. The contents are initialized to 0.\n * If the requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint8ClampedArray {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => any, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint8ClampedArray) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => number, thisArg?: any): Uint8ClampedArray;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint8ClampedArray) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint8ClampedArray;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint8ClampedArray;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint8ClampedArray view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint8ClampedArray;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint8ClampedArrayConstructor {\n readonly prototype: Uint8ClampedArray;\n new(length: number): Uint8ClampedArray;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint8ClampedArray;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint8ClampedArray;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint8ClampedArray;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint8ClampedArray;\n}\ndeclare const Uint8ClampedArray: Uint8ClampedArrayConstructor;\n\n/**\n * A typed array of 16-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int16Array) => any, thisArg?: any): Int16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int16Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int16Array) => number, thisArg?: any): Int16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int16ArrayConstructor {\n readonly prototype: Int16Array;\n new(length: number): Int16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int16Array;\n\n\n}\ndeclare const Int16Array: Int16ArrayConstructor;\n\n/**\n * A typed array of 16-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint16Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint16Array) => any, thisArg?: any): Uint16Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint16Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint16Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint16Array) => number, thisArg?: any): Uint16Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint16Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint16Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint16Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint16Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint16Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint16Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint16Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint16ArrayConstructor {\n readonly prototype: Uint16Array;\n new(length: number): Uint16Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint16Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint16Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint16Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint16Array;\n\n\n}\ndeclare const Uint16Array: Uint16ArrayConstructor;\n/**\n * A typed array of 32-bit signed integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Int32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Int32Array) => any, thisArg?: any): Int32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Int32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Int32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Int32Array) => number, thisArg?: any): Int32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Int32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Int32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Int32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Int32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Int32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Int32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Int32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Int32ArrayConstructor {\n readonly prototype: Int32Array;\n new(length: number): Int32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Int32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Int32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Int32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Int32Array;\n\n}\ndeclare const Int32Array: Int32ArrayConstructor;\n\n/**\n * A typed array of 32-bit unsigned integer values. The contents are initialized to 0. If the\n * requested number of bytes could not be allocated an exception is raised.\n */\ninterface Uint32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Uint32Array) => any, thisArg?: any): Uint32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Uint32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Uint32Array) => void, thisArg?: any): void;\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Uint32Array) => number, thisArg?: any): Uint32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Uint32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Uint32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Uint32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Uint32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Uint32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Uint32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Uint32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Uint32ArrayConstructor {\n readonly prototype: Uint32Array;\n new(length: number): Uint32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Uint32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Uint32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Uint32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Uint32Array;\n\n}\ndeclare const Uint32Array: Uint32ArrayConstructor;\n\n/**\n * A typed array of 32-bit float values. The contents are initialized to 0. If the requested number\n * of bytes could not be allocated an exception is raised.\n */\ninterface Float32Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float32Array) => any, thisArg?: any): Float32Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float32Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float32Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float32Array) => number, thisArg?: any): Float32Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float32Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float32Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float32Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float32Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float32Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float32Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float32Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float32ArrayConstructor {\n readonly prototype: Float32Array;\n new(length: number): Float32Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float32Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float32Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float32Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float32Array;\n\n\n}\ndeclare const Float32Array: Float32ArrayConstructor;\n\n/**\n * A typed array of 64-bit float values. The contents are initialized to 0. If the requested\n * number of bytes could not be allocated an exception is raised.\n */\ninterface Float64Array {\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * The ArrayBuffer instance referenced by the array.\n */\n readonly buffer: ArrayBufferLike;\n\n /**\n * The length in bytes of the array.\n */\n readonly byteLength: number;\n\n /**\n * The offset in bytes of the array.\n */\n readonly byteOffset: number;\n\n /**\n * Returns the this object after copying a section of the array identified by start and end\n * to the same array starting at position target\n * @param target If target is negative, it is treated as length+target where length is the\n * length of the array.\n * @param start If start is negative, it is treated as length+start. If end is negative, it\n * is treated as length+end.\n * @param end If not specified, length of the this object is used as its default value.\n */\n copyWithin(target: number, start: number, end?: number): this;\n\n /**\n * Determines whether all the members of an array satisfy the specified test.\n * @param callbackfn A function that accepts up to three arguments. The every method calls\n * the callbackfn function for each element in array1 until the callbackfn returns false,\n * or until the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n every(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Returns the this object after filling the section identified by start and end with value\n * @param value value to fill array section with\n * @param start index to start filling the array at. If start is negative, it is treated as\n * length+start where length is the length of the array.\n * @param end index to stop filling the array at. If end is negative, it is treated as\n * length+end.\n */\n fill(value: number, start?: number, end?: number): this;\n\n /**\n * Returns the elements of an array that meet the condition specified in a callback function.\n * @param callbackfn A function that accepts up to three arguments. The filter method calls\n * the callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n filter(callbackfn: (value: number, index: number, array: Float64Array) => any, thisArg?: any): Float64Array;\n\n /**\n * Returns the value of the first element in the array where predicate is true, and undefined\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found, find\n * immediately returns that element value. Otherwise, find returns undefined.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n find(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number | undefined;\n\n /**\n * Returns the index of the first element in the array where predicate is true, and -1\n * otherwise.\n * @param predicate find calls predicate once for each element of the array, in ascending\n * order, until it finds one where predicate returns true. If such an element is found,\n * findIndex immediately returns that element index. Otherwise, findIndex returns -1.\n * @param thisArg If provided, it will be used as the this value for each invocation of\n * predicate. If it is not provided, undefined is used instead.\n */\n findIndex(predicate: (value: number, index: number, obj: Float64Array) => boolean, thisArg?: any): number;\n\n /**\n * Performs the specified action for each element in an array.\n * @param callbackfn A function that accepts up to three arguments. forEach calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n forEach(callbackfn: (value: number, index: number, array: Float64Array) => void, thisArg?: any): void;\n\n /**\n * Returns the index of the first occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n indexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * Adds all the elements of an array separated by the specified separator string.\n * @param separator A string used to separate one element of an array from the next in the\n * resulting String. If omitted, the array elements are separated with a comma.\n */\n join(separator?: string): string;\n\n /**\n * Returns the index of the last occurrence of a value in an array.\n * @param searchElement The value to locate in the array.\n * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the\n * search starts at index 0.\n */\n lastIndexOf(searchElement: number, fromIndex?: number): number;\n\n /**\n * The length of the array.\n */\n readonly length: number;\n\n /**\n * Calls a defined callback function on each element of an array, and returns an array that\n * contains the results.\n * @param callbackfn A function that accepts up to three arguments. The map method calls the\n * callbackfn function one time for each element in the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n map(callbackfn: (value: number, index: number, array: Float64Array) => number, thisArg?: any): Float64Array;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduce(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array. The return value of\n * the callback function is the accumulated result, and is provided as an argument in the next\n * call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduce method calls the\n * callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduce(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an\n * argument instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number): number;\n reduceRight(callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: Float64Array) => number, initialValue: number): number;\n\n /**\n * Calls the specified callback function for all the elements in an array, in descending order.\n * The return value of the callback function is the accumulated result, and is provided as an\n * argument in the next call to the callback function.\n * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls\n * the callbackfn function one time for each element in the array.\n * @param initialValue If initialValue is specified, it is used as the initial value to start\n * the accumulation. The first call to the callbackfn function provides this value as an argument\n * instead of an array value.\n */\n reduceRight(callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: Float64Array) => U, initialValue: U): U;\n\n /**\n * Reverses the elements in an Array.\n */\n reverse(): Float64Array;\n\n /**\n * Sets a value or an array of values.\n * @param array A typed or untyped array of values to set.\n * @param offset The index in the current array at which the values are to be written.\n */\n set(array: ArrayLike, offset?: number): void;\n\n /**\n * Returns a section of an array.\n * @param start The beginning of the specified portion of the array.\n * @param end The end of the specified portion of the array.\n */\n slice(start?: number, end?: number): Float64Array;\n\n /**\n * Determines whether the specified callback function returns true for any element of an array.\n * @param callbackfn A function that accepts up to three arguments. The some method calls the\n * callbackfn function for each element in array1 until the callbackfn returns true, or until\n * the end of the array.\n * @param thisArg An object to which the this keyword can refer in the callbackfn function.\n * If thisArg is omitted, undefined is used as the this value.\n */\n some(callbackfn: (value: number, index: number, array: Float64Array) => boolean, thisArg?: any): boolean;\n\n /**\n * Sorts an array.\n * @param compareFn The name of the function used to determine the order of the elements. If\n * omitted, the elements are sorted in ascending, ASCII character order.\n */\n sort(compareFn?: (a: number, b: number) => number): this;\n\n /**\n * Gets a new Float64Array view of the ArrayBuffer store for this array, referencing the elements\n * at begin, inclusive, up to end, exclusive.\n * @param begin The index of the beginning of the array.\n * @param end The index of the end of the array.\n */\n subarray(begin: number, end?: number): Float64Array;\n\n /**\n * Converts a number to a string by using the current locale.\n */\n toLocaleString(): string;\n\n /**\n * Returns a string representation of an array.\n */\n toString(): string;\n\n [index: number]: number;\n}\n\ninterface Float64ArrayConstructor {\n readonly prototype: Float64Array;\n new(length: number): Float64Array;\n new(arrayOrArrayBuffer: ArrayLike | ArrayBufferLike): Float64Array;\n new(buffer: ArrayBufferLike, byteOffset: number, length?: number): Float64Array;\n\n /**\n * The size in bytes of each element in the array.\n */\n readonly BYTES_PER_ELEMENT: number;\n\n /**\n * Returns a new array from a set of elements.\n * @param items A set of elements to include in the new array object.\n */\n of(...items: number[]): Float64Array;\n\n /**\n * Creates an array from an array-like or iterable object.\n * @param arrayLike An array-like or iterable object to convert to an array.\n * @param mapfn A mapping function to call on every element of the array.\n * @param thisArg Value of 'this' used to invoke the mapfn.\n */\n from(arrayLike: ArrayLike, mapfn?: (v: number, k: number) => number, thisArg?: any): Float64Array;\n\n}\ndeclare const Float64Array: Float64ArrayConstructor;\n\n/////////////////////////////\n/// ECMAScript Internationalization API\n/////////////////////////////\n\ndeclare namespace Intl {\n interface CollatorOptions {\n usage?: string;\n localeMatcher?: string;\n numeric?: boolean;\n caseFirst?: string;\n sensitivity?: string;\n ignorePunctuation?: boolean;\n }\n\n interface ResolvedCollatorOptions {\n locale: string;\n usage: string;\n sensitivity: string;\n ignorePunctuation: boolean;\n collation: string;\n caseFirst: string;\n numeric: boolean;\n }\n\n interface Collator {\n compare(x: string, y: string): number;\n resolvedOptions(): ResolvedCollatorOptions;\n }\n var Collator: {\n new(locales?: string | string[], options?: CollatorOptions): Collator;\n (locales?: string | string[], options?: CollatorOptions): Collator;\n supportedLocalesOf(locales: string | string[], options?: CollatorOptions): string[];\n };\n\n interface NumberFormatOptions {\n localeMatcher?: string;\n style?: string;\n currency?: string;\n currencyDisplay?: string;\n useGrouping?: boolean;\n minimumIntegerDigits?: number;\n minimumFractionDigits?: number;\n maximumFractionDigits?: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n }\n\n interface ResolvedNumberFormatOptions {\n locale: string;\n numberingSystem: string;\n style: string;\n currency?: string;\n currencyDisplay?: string;\n minimumIntegerDigits: number;\n minimumFractionDigits: number;\n maximumFractionDigits: number;\n minimumSignificantDigits?: number;\n maximumSignificantDigits?: number;\n useGrouping: boolean;\n }\n\n interface NumberFormat {\n format(value: number): string;\n resolvedOptions(): ResolvedNumberFormatOptions;\n }\n var NumberFormat: {\n new(locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n (locales?: string | string[], options?: NumberFormatOptions): NumberFormat;\n supportedLocalesOf(locales: string | string[], options?: NumberFormatOptions): string[];\n };\n\n interface DateTimeFormatOptions {\n localeMatcher?: string;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n formatMatcher?: string;\n hour12?: boolean;\n timeZone?: string;\n }\n\n interface ResolvedDateTimeFormatOptions {\n locale: string;\n calendar: string;\n numberingSystem: string;\n timeZone: string;\n hour12?: boolean;\n weekday?: string;\n era?: string;\n year?: string;\n month?: string;\n day?: string;\n hour?: string;\n minute?: string;\n second?: string;\n timeZoneName?: string;\n }\n\n interface DateTimeFormat {\n format(date?: Date | number): string;\n resolvedOptions(): ResolvedDateTimeFormatOptions;\n }\n var DateTimeFormat: {\n new(locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n (locales?: string | string[], options?: DateTimeFormatOptions): DateTimeFormat;\n supportedLocalesOf(locales: string | string[], options?: DateTimeFormatOptions): string[];\n };\n}\n\ninterface String {\n /**\n * Determines whether two strings are equivalent in the current or specified locale.\n * @param that String to compare to target string\n * @param locales A locale string or array of locale strings 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. This parameter must conform to BCP 47 standards; see the Intl.Collator object for details.\n * @param options An object that contains one or more properties that specify comparison options. see the Intl.Collator object for details.\n */\n localeCompare(that: string, locales?: string | string[], options?: Intl.CollatorOptions): number;\n}\n\ninterface Number {\n /**\n * Converts a number to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.NumberFormatOptions): string;\n}\n\ninterface Date {\n /**\n * Converts a date and time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n /**\n * Converts a date to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleDateString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n\n /**\n * Converts a time to a string by using the current or specified locale.\n * @param locales A locale string or array of locale strings 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.\n * @param options An object that contains one or more properties that specify comparison options.\n */\n toLocaleTimeString(locales?: string | string[], options?: Intl.DateTimeFormatOptions): string;\n}\n\n\n/////////////////////////////\n/// DOM APIs\n/////////////////////////////\n\ninterface Account {\n displayName: string;\n id: string;\n imageURL?: string;\n name?: string;\n rpDisplayName: string;\n}\n\ninterface AddEventListenerOptions extends EventListenerOptions {\n once?: boolean;\n passive?: boolean;\n}\n\ninterface AesCbcParams extends Algorithm {\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface AesCtrParams extends Algorithm {\n counter: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n length: number;\n}\n\ninterface AesDerivedKeyParams extends Algorithm {\n length: number;\n}\n\ninterface AesGcmParams extends Algorithm {\n additionalData?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n tagLength?: number;\n}\n\ninterface AesKeyAlgorithm extends KeyAlgorithm {\n length: number;\n}\n\ninterface AesKeyGenParams extends Algorithm {\n length: number;\n}\n\ninterface Algorithm {\n name: string;\n}\n\ninterface AnalyserOptions extends AudioNodeOptions {\n fftSize?: number;\n maxDecibels?: number;\n minDecibels?: number;\n smoothingTimeConstant?: number;\n}\n\ninterface AnimationEventInit extends EventInit {\n animationName?: string;\n elapsedTime?: number;\n}\n\ninterface AssertionOptions {\n allowList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: string;\n timeoutSeconds?: number;\n}\n\ninterface AudioBufferOptions {\n length: number;\n numberOfChannels?: number;\n sampleRate: number;\n}\n\ninterface AudioBufferSourceOptions {\n buffer?: AudioBuffer | null;\n detune?: number;\n loop?: boolean;\n loopEnd?: number;\n loopStart?: number;\n playbackRate?: number;\n}\n\ninterface AudioContextInfo {\n currentTime?: number;\n sampleRate?: number;\n}\n\ninterface AudioContextOptions {\n latencyHint?: AudioContextLatencyCategory | number;\n sampleRate?: number;\n}\n\ninterface AudioNodeOptions {\n channelCount?: number;\n channelCountMode?: ChannelCountMode;\n channelInterpretation?: ChannelInterpretation;\n}\n\ninterface AudioParamDescriptor {\n defaultValue?: number;\n maxValue?: number;\n minValue?: number;\n name?: string;\n}\n\ninterface AudioProcessingEventInit extends EventInit {\n inputBuffer: AudioBuffer;\n outputBuffer: AudioBuffer;\n playbackTime: number;\n}\n\ninterface AudioTimestamp {\n contextTime?: number;\n performanceTime?: number;\n}\n\ninterface BiquadFilterOptions extends AudioNodeOptions {\n Q?: number;\n detune?: number;\n frequency?: number;\n gain?: number;\n type?: BiquadFilterType;\n}\n\ninterface ByteLengthChunk {\n byteLength?: number;\n}\n\ninterface CacheQueryOptions {\n cacheName?: string;\n ignoreMethod?: boolean;\n ignoreSearch?: boolean;\n ignoreVary?: boolean;\n}\n\ninterface ChannelMergerOptions extends AudioNodeOptions {\n numberOfInputs?: number;\n}\n\ninterface ChannelSplitterOptions extends AudioNodeOptions {\n numberOfOutputs?: number;\n}\n\ninterface ClientData {\n challenge: string;\n extensions?: WebAuthnExtensions;\n hashAlg: string | Algorithm;\n origin: string;\n rpId: string;\n tokenBinding?: string;\n}\n\ninterface ClientQueryOptions {\n includeReserved?: boolean;\n includeUncontrolled?: boolean;\n type?: ClientTypes;\n}\n\ninterface CloseEventInit extends EventInit {\n code?: number;\n reason?: string;\n wasClean?: boolean;\n}\n\ninterface CompositionEventInit extends UIEventInit {\n data?: string;\n}\n\ninterface ConfirmSiteSpecificExceptionsInformation extends ExceptionInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface ConstantSourceOptions {\n offset?: number;\n}\n\ninterface ConstrainBooleanParameters {\n exact?: boolean;\n ideal?: boolean;\n}\n\ninterface ConstrainDOMStringParameters {\n exact?: string | string[];\n ideal?: string | string[];\n}\n\ninterface ConstrainDoubleRange extends DoubleRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainLongRange extends LongRange {\n exact?: number;\n ideal?: number;\n}\n\ninterface ConstrainVideoFacingModeParameters {\n exact?: VideoFacingModeEnum | VideoFacingModeEnum[];\n ideal?: VideoFacingModeEnum | VideoFacingModeEnum[];\n}\n\ninterface ConvolverOptions extends AudioNodeOptions {\n buffer?: AudioBuffer | null;\n disableNormalization?: boolean;\n}\n\ninterface CustomEventInit extends EventInit {\n detail?: T;\n}\n\ninterface DOMRectInit {\n height?: number;\n width?: number;\n x?: number;\n y?: number;\n}\n\ninterface DelayOptions extends AudioNodeOptions {\n delayTime?: number;\n maxDelayTime?: number;\n}\n\ninterface DeviceAccelerationDict {\n x?: number | null;\n y?: number | null;\n z?: number | null;\n}\n\ninterface DeviceLightEventInit extends EventInit {\n value?: number;\n}\n\ninterface DeviceMotionEventInit extends EventInit {\n acceleration?: DeviceAccelerationDict | null;\n accelerationIncludingGravity?: DeviceAccelerationDict | null;\n interval?: number | null;\n rotationRate?: DeviceRotationRateDict | null;\n}\n\ninterface DeviceOrientationEventInit extends EventInit {\n absolute?: boolean;\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DeviceRotationRateDict {\n alpha?: number | null;\n beta?: number | null;\n gamma?: number | null;\n}\n\ninterface DoubleRange {\n max?: number;\n min?: number;\n}\n\ninterface DynamicsCompressorOptions extends AudioNodeOptions {\n attack?: number;\n knee?: number;\n ratio?: number;\n release?: number;\n threshold?: number;\n}\n\ninterface EcKeyAlgorithm extends KeyAlgorithm {\n namedCurve: string;\n}\n\ninterface EcKeyGenParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcKeyImportParams extends Algorithm {\n namedCurve: string;\n}\n\ninterface EcdhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface EcdsaParams extends Algorithm {\n hash: string | Algorithm;\n}\n\ninterface ErrorEventInit extends EventInit {\n colno?: number;\n error?: any;\n filename?: string;\n lineno?: number;\n message?: string;\n}\n\ninterface EventInit {\n bubbles?: boolean;\n cancelable?: boolean;\n scoped?: boolean;\n}\n\ninterface EventListenerOptions {\n capture?: boolean;\n}\n\ninterface EventModifierInit extends UIEventInit {\n altKey?: boolean;\n ctrlKey?: boolean;\n metaKey?: boolean;\n modifierAltGraph?: boolean;\n modifierCapsLock?: boolean;\n modifierFn?: boolean;\n modifierFnLock?: boolean;\n modifierHyper?: boolean;\n modifierNumLock?: boolean;\n modifierOS?: boolean;\n modifierScrollLock?: boolean;\n modifierSuper?: boolean;\n modifierSymbol?: boolean;\n modifierSymbolLock?: boolean;\n shiftKey?: boolean;\n}\n\ninterface ExceptionInformation {\n domain?: string | null;\n}\n\ninterface ExtendableEventInit extends EventInit {\n}\n\ninterface ExtendableMessageEventInit extends ExtendableEventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[] | null;\n source?: object | ServiceWorker | MessagePort | null;\n}\n\ninterface FetchEventInit extends ExtendableEventInit {\n clientId?: string;\n request: Request;\n reservedClientId?: string;\n targetClientId?: string;\n}\n\ninterface FocusEventInit extends UIEventInit {\n relatedTarget?: EventTarget | null;\n}\n\ninterface FocusNavigationEventInit extends EventInit {\n navigationReason?: string | null;\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface FocusNavigationOrigin {\n originHeight?: number;\n originLeft?: number;\n originTop?: number;\n originWidth?: number;\n}\n\ninterface GainOptions extends AudioNodeOptions {\n gain?: number;\n}\n\ninterface GamepadEventInit extends EventInit {\n gamepad?: Gamepad;\n}\n\ninterface GetNotificationOptions {\n tag?: string;\n}\n\ninterface HashChangeEventInit extends EventInit {\n newURL?: string;\n oldURL?: string;\n}\n\ninterface HkdfParams extends Algorithm {\n hash: string | Algorithm;\n info: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface HmacImportParams extends Algorithm {\n hash: string | Algorithm;\n length?: number;\n}\n\ninterface HmacKeyAlgorithm extends KeyAlgorithm {\n hash: KeyAlgorithm;\n length: number;\n}\n\ninterface HmacKeyGenParams extends Algorithm {\n hash: string | Algorithm;\n length?: number;\n}\n\ninterface IDBIndexParameters {\n multiEntry?: boolean;\n unique?: boolean;\n}\n\ninterface IDBObjectStoreParameters {\n autoIncrement?: boolean;\n keyPath?: string | string[];\n}\n\ninterface IIRFilterOptions extends AudioNodeOptions {\n feedback: number[];\n feedforward: number[];\n}\n\ninterface IntersectionObserverEntryInit {\n boundingClientRect: DOMRectInit;\n intersectionRect: DOMRectInit;\n isIntersecting: boolean;\n rootBounds: DOMRectInit;\n target: Element;\n time: number;\n}\n\ninterface IntersectionObserverInit {\n root?: Element | null;\n rootMargin?: string;\n threshold?: number | number[];\n}\n\ninterface JsonWebKey {\n alg?: string;\n crv?: string;\n d?: string;\n dp?: string;\n dq?: string;\n e?: string;\n ext?: boolean;\n k?: string;\n key_ops?: string[];\n kty?: string;\n n?: string;\n oth?: RsaOtherPrimesInfo[];\n p?: string;\n q?: string;\n qi?: string;\n use?: string;\n x?: string;\n y?: string;\n}\n\ninterface KeyAlgorithm {\n name: string;\n}\n\ninterface KeyboardEventInit extends EventModifierInit {\n code?: string;\n key?: string;\n location?: number;\n repeat?: boolean;\n}\n\ninterface LongRange {\n max?: number;\n min?: number;\n}\n\ninterface MSAccountInfo {\n accountImageUri?: string;\n accountName?: string;\n rpDisplayName: string;\n userDisplayName: string;\n userId?: string;\n}\n\ninterface MSAudioLocalClientEvent extends MSLocalClientEventBase {\n cpuInsufficientEventRatio?: number;\n deviceCaptureNotFunctioningEventRatio?: number;\n deviceClippingEventRatio?: number;\n deviceEchoEventRatio?: number;\n deviceGlitchesEventRatio?: number;\n deviceHalfDuplexAECEventRatio?: number;\n deviceHowlingEventCount?: number;\n deviceLowSNREventRatio?: number;\n deviceLowSpeechLevelEventRatio?: number;\n deviceMultipleEndpointsEventCount?: number;\n deviceNearEndToEchoRatioEventRatio?: number;\n deviceRenderMuteEventRatio?: number;\n deviceRenderNotFunctioningEventRatio?: number;\n deviceRenderZeroVolumeEventRatio?: number;\n networkDelayEventRatio?: number;\n networkSendQualityEventRatio?: number;\n}\n\ninterface MSAudioRecvPayload extends MSPayloadBase {\n burstLossLength1?: number;\n burstLossLength2?: number;\n burstLossLength3?: number;\n burstLossLength4?: number;\n burstLossLength5?: number;\n burstLossLength6?: number;\n burstLossLength7?: number;\n burstLossLength8OrHigher?: number;\n fecRecvDistance1?: number;\n fecRecvDistance2?: number;\n fecRecvDistance3?: number;\n packetReorderDepthAvg?: number;\n packetReorderDepthMax?: number;\n packetReorderRatio?: number;\n ratioCompressedSamplesAvg?: number;\n ratioConcealedSamplesAvg?: number;\n ratioStretchedSamplesAvg?: number;\n samplingRate?: number;\n signal?: MSAudioRecvSignal;\n}\n\ninterface MSAudioRecvSignal {\n initialSignalLevelRMS?: number;\n recvNoiseLevelCh1?: number;\n recvSignalLevelCh1?: number;\n renderLoopbackSignalLevel?: number;\n renderNoiseLevel?: number;\n renderSignalLevel?: number;\n}\n\ninterface MSAudioSendPayload extends MSPayloadBase {\n audioFECUsed?: boolean;\n samplingRate?: number;\n sendMutePercent?: number;\n signal?: MSAudioSendSignal;\n}\n\ninterface MSAudioSendSignal {\n noiseLevel?: number;\n sendNoiseLevelCh1?: number;\n sendSignalLevelCh1?: number;\n}\n\ninterface MSConnectivity {\n iceType?: MSIceType;\n iceWarningFlags?: MSIceWarningFlags;\n relayAddress?: MSRelayAddress;\n}\n\ninterface MSCredentialFilter {\n accept?: MSCredentialSpec[];\n}\n\ninterface MSCredentialParameters {\n type?: MSCredentialType;\n}\n\ninterface MSCredentialSpec {\n id?: string;\n type: MSCredentialType;\n}\n\ninterface MSDCCEventInit extends EventInit {\n maxFr?: number;\n maxFs?: number;\n}\n\ninterface MSDSHEventInit extends EventInit {\n sources?: number[];\n timestamp?: number;\n}\n\ninterface MSDelay {\n roundTrip?: number;\n roundTripMax?: number;\n}\n\ninterface MSDescription extends RTCStats {\n connectivity?: MSConnectivity;\n deviceDevName?: string;\n localAddr?: MSIPAddressInfo;\n networkconnectivity?: MSNetworkConnectivityInfo;\n reflexiveLocalIPAddr?: MSIPAddressInfo;\n remoteAddr?: MSIPAddressInfo;\n transport?: RTCIceProtocol;\n}\n\ninterface MSFIDOCredentialParameters extends MSCredentialParameters {\n algorithm?: string | Algorithm;\n authenticators?: string[];\n}\n\ninterface MSIPAddressInfo {\n ipAddr?: string;\n manufacturerMacAddrMask?: string;\n port?: number;\n}\n\ninterface MSIceWarningFlags {\n allocationMessageIntegrityFailed?: boolean;\n alternateServerReceived?: boolean;\n connCheckMessageIntegrityFailed?: boolean;\n connCheckOtherError?: boolean;\n fipsAllocationFailure?: boolean;\n multipleRelayServersAttempted?: boolean;\n noRelayServersConfigured?: boolean;\n portRangeExhausted?: boolean;\n pseudoTLSFailure?: boolean;\n tcpNatConnectivityFailed?: boolean;\n tcpRelayConnectivityFailed?: boolean;\n turnAuthUnknownUsernameError?: boolean;\n turnTcpAllocateFailed?: boolean;\n turnTcpSendFailed?: boolean;\n turnTcpTimedOut?: boolean;\n turnTurnTcpConnectivityFailed?: boolean;\n turnUdpAllocateFailed?: boolean;\n turnUdpSendFailed?: boolean;\n udpLocalConnectivityFailed?: boolean;\n udpNatConnectivityFailed?: boolean;\n udpRelayConnectivityFailed?: boolean;\n useCandidateChecksFailed?: boolean;\n}\n\ninterface MSJitter {\n interArrival?: number;\n interArrivalMax?: number;\n interArrivalSD?: number;\n}\n\ninterface MSLocalClientEventBase extends RTCStats {\n networkBandwidthLowEventRatio?: number;\n networkReceiveQualityEventRatio?: number;\n}\n\ninterface MSNetwork extends RTCStats {\n delay?: MSDelay;\n jitter?: MSJitter;\n packetLoss?: MSPacketLoss;\n utilization?: MSUtilization;\n}\n\ninterface MSNetworkConnectivityInfo {\n linkspeed?: number;\n networkConnectionDetails?: string;\n vpn?: boolean;\n}\n\ninterface MSNetworkInterfaceType {\n interfaceTypeEthernet?: boolean;\n interfaceTypePPP?: boolean;\n interfaceTypeTunnel?: boolean;\n interfaceTypeWWAN?: boolean;\n interfaceTypeWireless?: boolean;\n}\n\ninterface MSOutboundNetwork extends MSNetwork {\n appliedBandwidthLimit?: number;\n}\n\ninterface MSPacketLoss {\n lossRate?: number;\n lossRateMax?: number;\n}\n\ninterface MSPayloadBase extends RTCStats {\n payloadDescription?: string;\n}\n\ninterface MSPortRange {\n max?: number;\n min?: number;\n}\n\ninterface MSRelayAddress {\n port?: number;\n relayAddress?: string;\n}\n\ninterface MSSignatureParameters {\n userPrompt?: string;\n}\n\ninterface MSTransportDiagnosticsStats extends RTCStats {\n allocationTimeInMs?: number;\n baseAddress?: string;\n baseInterface?: MSNetworkInterfaceType;\n iceRole?: RTCIceRole;\n iceWarningFlags?: MSIceWarningFlags;\n interfaces?: MSNetworkInterfaceType;\n localAddrType?: MSIceAddrType;\n localAddress?: string;\n localInterface?: MSNetworkInterfaceType;\n localMR?: string;\n localMRTCPPort?: number;\n localSite?: string;\n msRtcEngineVersion?: string;\n networkName?: string;\n numConsentReqReceived?: number;\n numConsentReqSent?: number;\n numConsentRespReceived?: number;\n numConsentRespSent?: number;\n portRangeMax?: number;\n portRangeMin?: number;\n protocol?: RTCIceProtocol;\n remoteAddrType?: MSIceAddrType;\n remoteAddress?: string;\n remoteMR?: string;\n remoteMRTCPPort?: number;\n remoteSite?: string;\n rtpRtcpMux?: boolean;\n stunVer?: number;\n}\n\ninterface MSUtilization {\n bandwidthEstimation?: number;\n bandwidthEstimationAvg?: number;\n bandwidthEstimationMax?: number;\n bandwidthEstimationMin?: number;\n bandwidthEstimationStdDev?: number;\n packets?: number;\n}\n\ninterface MSVideoPayload extends MSPayloadBase {\n durationSeconds?: number;\n resolution?: string;\n videoBitRateAvg?: number;\n videoBitRateMax?: number;\n videoFrameRateAvg?: number;\n videoPacketLossRate?: number;\n}\n\ninterface MSVideoRecvPayload extends MSVideoPayload {\n lowBitRateCallPercent?: number;\n lowFrameRateCallPercent?: number;\n recvBitRateAverage?: number;\n recvBitRateMaximum?: number;\n recvCodecType?: string;\n recvFpsHarmonicAverage?: number;\n recvFrameRateAverage?: number;\n recvNumResSwitches?: number;\n recvReorderBufferMaxSuccessfullyOrderedExtent?: number;\n recvReorderBufferMaxSuccessfullyOrderedLateTime?: number;\n recvReorderBufferPacketsDroppedDueToBufferExhaustion?: number;\n recvReorderBufferPacketsDroppedDueToTimeout?: number;\n recvReorderBufferReorderedPackets?: number;\n recvResolutionHeight?: number;\n recvResolutionWidth?: number;\n recvVideoStreamsMax?: number;\n recvVideoStreamsMin?: number;\n recvVideoStreamsMode?: number;\n reorderBufferTotalPackets?: number;\n videoFrameLossRate?: number;\n videoPostFECPLR?: number;\n videoResolutions?: MSVideoResolutionDistribution;\n}\n\ninterface MSVideoResolutionDistribution {\n cifQuality?: number;\n h1080Quality?: number;\n h1440Quality?: number;\n h2160Quality?: number;\n h720Quality?: number;\n vgaQuality?: number;\n}\n\ninterface MSVideoSendPayload extends MSVideoPayload {\n sendBitRateAverage?: number;\n sendBitRateMaximum?: number;\n sendFrameRateAverage?: number;\n sendResolutionHeight?: number;\n sendResolutionWidth?: number;\n sendVideoStreamsMax?: number;\n}\n\ninterface MediaElementAudioSourceOptions {\n mediaElement: HTMLMediaElement;\n}\n\ninterface MediaEncryptedEventInit extends EventInit {\n initData?: ArrayBuffer | null;\n initDataType?: string;\n}\n\ninterface MediaKeyMessageEventInit extends EventInit {\n message?: ArrayBuffer | null;\n messageType?: MediaKeyMessageType;\n}\n\ninterface MediaKeySystemConfiguration {\n audioCapabilities?: MediaKeySystemMediaCapability[];\n distinctiveIdentifier?: MediaKeysRequirement;\n initDataTypes?: string[];\n persistentState?: MediaKeysRequirement;\n videoCapabilities?: MediaKeySystemMediaCapability[];\n}\n\ninterface MediaKeySystemMediaCapability {\n contentType?: string;\n robustness?: string;\n}\n\ninterface MediaStreamConstraints {\n audio?: boolean | MediaTrackConstraints;\n video?: boolean | MediaTrackConstraints;\n}\n\ninterface MediaStreamErrorEventInit extends EventInit {\n error?: MediaStreamError | null;\n}\n\ninterface MediaStreamEventInit extends EventInit {\n stream?: MediaStream;\n}\n\ninterface MediaStreamTrackEventInit extends EventInit {\n track?: MediaStreamTrack | null;\n}\n\ninterface MediaTrackCapabilities {\n aspectRatio?: number | DoubleRange;\n deviceId?: string;\n echoCancellation?: boolean[];\n facingMode?: string;\n frameRate?: number | DoubleRange;\n groupId?: string;\n height?: number | LongRange;\n sampleRate?: number | LongRange;\n sampleSize?: number | LongRange;\n volume?: number | DoubleRange;\n width?: number | LongRange;\n}\n\ninterface MediaTrackConstraintSet {\n aspectRatio?: number | ConstrainDoubleRange;\n channelCount?: number | ConstrainLongRange;\n deviceId?: string | string[] | ConstrainDOMStringParameters;\n displaySurface?: string | string[] | ConstrainDOMStringParameters;\n echoCancellation?: boolean | ConstrainBooleanParameters;\n facingMode?: string | string[] | ConstrainDOMStringParameters;\n frameRate?: number | ConstrainDoubleRange;\n groupId?: string | string[] | ConstrainDOMStringParameters;\n height?: number | ConstrainLongRange;\n latency?: number | ConstrainDoubleRange;\n logicalSurface?: boolean | ConstrainBooleanParameters;\n sampleRate?: number | ConstrainLongRange;\n sampleSize?: number | ConstrainLongRange;\n volume?: number | ConstrainDoubleRange;\n width?: number | ConstrainLongRange;\n}\n\ninterface MediaTrackConstraints extends MediaTrackConstraintSet {\n advanced?: MediaTrackConstraintSet[];\n}\n\ninterface MediaTrackSettings {\n aspectRatio?: number;\n deviceId?: string;\n echoCancellation?: boolean;\n facingMode?: string;\n frameRate?: number;\n groupId?: string;\n height?: number;\n sampleRate?: number;\n sampleSize?: number;\n volume?: number;\n width?: number;\n}\n\ninterface MediaTrackSupportedConstraints {\n aspectRatio?: boolean;\n deviceId?: boolean;\n echoCancellation?: boolean;\n facingMode?: boolean;\n frameRate?: boolean;\n groupId?: boolean;\n height?: boolean;\n sampleRate?: boolean;\n sampleSize?: boolean;\n volume?: boolean;\n width?: boolean;\n}\n\ninterface MessageEventInit extends EventInit {\n channel?: string;\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[];\n source?: Window | null;\n}\n\ninterface MouseEventInit extends EventModifierInit {\n button?: number;\n buttons?: number;\n clientX?: number;\n clientY?: number;\n relatedTarget?: EventTarget | null;\n screenX?: number;\n screenY?: number;\n}\n\ninterface MsZoomToOptions {\n animate?: string;\n contentX?: number;\n contentY?: number;\n scaleFactor?: number;\n viewportX?: string | null;\n viewportY?: string | null;\n}\n\ninterface MutationObserverInit {\n attributeFilter?: string[];\n attributeOldValue?: boolean;\n attributes?: boolean;\n characterData?: boolean;\n characterDataOldValue?: boolean;\n childList?: boolean;\n subtree?: boolean;\n}\n\ninterface NotificationEventInit extends ExtendableEventInit {\n action?: string;\n notification: Notification;\n}\n\ninterface NotificationOptions {\n body?: string;\n data?: any;\n dir?: NotificationDirection;\n icon?: string;\n lang?: string;\n tag?: string;\n}\n\ninterface ObjectURLOptions {\n oneTimeOnly?: boolean;\n}\n\ninterface OfflineAudioCompletionEventInit extends EventInit {\n renderedBuffer: AudioBuffer;\n}\n\ninterface OscillatorOptions extends AudioNodeOptions {\n detune?: number;\n frequency?: number;\n periodicWave?: PeriodicWave;\n type?: OscillatorType;\n}\n\ninterface PannerOptions extends AudioNodeOptions {\n coneInnerAngle?: number;\n coneOuterAngle?: number;\n coneOuterGain?: number;\n distanceModel?: DistanceModelType;\n maxDistance?: number;\n orientationX?: number;\n orientationY?: number;\n orientationZ?: number;\n panningModel?: PanningModelType;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n refDistance?: number;\n rolloffFactor?: number;\n}\n\ninterface PaymentCurrencyAmount {\n currency: string;\n currencySystem?: string;\n value: string;\n}\n\ninterface PaymentDetailsBase {\n displayItems?: PaymentItem[];\n modifiers?: PaymentDetailsModifier[];\n shippingOptions?: PaymentShippingOption[];\n}\n\ninterface PaymentDetailsInit extends PaymentDetailsBase {\n id?: string;\n total: PaymentItem;\n}\n\ninterface PaymentDetailsModifier {\n additionalDisplayItems?: PaymentItem[];\n data?: any;\n supportedMethods: string | string[];\n total?: PaymentItem;\n}\n\ninterface PaymentDetailsUpdate extends PaymentDetailsBase {\n error?: string;\n total?: PaymentItem;\n}\n\ninterface PaymentItem {\n amount: PaymentCurrencyAmount;\n label: string;\n pending?: boolean;\n}\n\ninterface PaymentMethodData {\n data?: any;\n supportedMethods: string | string[];\n}\n\ninterface PaymentOptions {\n requestPayerEmail?: boolean;\n requestPayerName?: boolean;\n requestPayerPhone?: boolean;\n requestShipping?: boolean;\n shippingType?: string;\n}\n\ninterface PaymentRequestUpdateEventInit extends EventInit {\n}\n\ninterface PaymentShippingOption {\n amount: PaymentCurrencyAmount;\n id: string;\n label: string;\n selected?: boolean;\n}\n\ninterface Pbkdf2Params extends Algorithm {\n hash: string | Algorithm;\n iterations: number;\n salt: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface PeriodicWaveConstraints {\n disableNormalization?: boolean;\n}\n\ninterface PeriodicWaveOptions extends PeriodicWaveConstraints {\n imag?: number[];\n real?: number[];\n}\n\ninterface PointerEventInit extends MouseEventInit {\n height?: number;\n isPrimary?: boolean;\n pointerId?: number;\n pointerType?: string;\n pressure?: number;\n tiltX?: number;\n tiltY?: number;\n width?: number;\n}\n\ninterface PopStateEventInit extends EventInit {\n state?: any;\n}\n\ninterface PositionOptions {\n enableHighAccuracy?: boolean;\n maximumAge?: number;\n timeout?: number;\n}\n\ninterface ProgressEventInit extends EventInit {\n lengthComputable?: boolean;\n loaded?: number;\n total?: number;\n}\n\ninterface PushEventInit extends ExtendableEventInit {\n data?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | string | null;\n}\n\ninterface PushSubscriptionChangeInit extends ExtendableEventInit {\n newSubscription?: PushSubscription;\n oldSubscription?: PushSubscription;\n}\n\ninterface PushSubscriptionOptionsInit {\n applicationServerKey?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | string | null;\n userVisibleOnly?: boolean;\n}\n\ninterface QueuingStrategy {\n highWaterMark?: number;\n size?: WritableStreamChunkCallback;\n}\n\ninterface RTCConfiguration {\n bundlePolicy?: RTCBundlePolicy;\n iceServers?: RTCIceServer[];\n iceTransportPolicy?: RTCIceTransportPolicy;\n peerIdentity?: string;\n}\n\ninterface RTCDTMFToneChangeEventInit extends EventInit {\n tone?: string;\n}\n\ninterface RTCDtlsFingerprint {\n algorithm?: string;\n value?: string;\n}\n\ninterface RTCDtlsParameters {\n fingerprints?: RTCDtlsFingerprint[];\n role?: RTCDtlsRole;\n}\n\ninterface RTCIceCandidateAttributes extends RTCStats {\n addressSourceUrl?: string;\n candidateType?: RTCStatsIceCandidateType;\n ipAddress?: string;\n portNumber?: number;\n priority?: number;\n transport?: string;\n}\n\ninterface RTCIceCandidateComplete {\n}\n\ninterface RTCIceCandidateDictionary {\n foundation?: string;\n ip?: string;\n msMTurnSessionId?: string;\n port?: number;\n priority?: number;\n protocol?: RTCIceProtocol;\n relatedAddress?: string;\n relatedPort?: number;\n tcpType?: RTCIceTcpCandidateType;\n type?: RTCIceCandidateType;\n}\n\ninterface RTCIceCandidateInit {\n candidate?: string;\n sdpMLineIndex?: number;\n sdpMid?: string;\n}\n\ninterface RTCIceCandidatePair {\n local?: RTCIceCandidateDictionary;\n remote?: RTCIceCandidateDictionary;\n}\n\ninterface RTCIceCandidatePairStats extends RTCStats {\n availableIncomingBitrate?: number;\n availableOutgoingBitrate?: number;\n bytesReceived?: number;\n bytesSent?: number;\n localCandidateId?: string;\n nominated?: boolean;\n priority?: number;\n readable?: boolean;\n remoteCandidateId?: string;\n roundTripTime?: number;\n state?: RTCStatsIceCandidatePairState;\n transportId?: string;\n writable?: boolean;\n}\n\ninterface RTCIceGatherOptions {\n gatherPolicy?: RTCIceGatherPolicy;\n iceservers?: RTCIceServer[];\n portRange?: MSPortRange;\n}\n\ninterface RTCIceParameters {\n iceLite?: boolean | null;\n password?: string;\n usernameFragment?: string;\n}\n\ninterface RTCIceServer {\n credential?: string | null;\n urls?: any;\n username?: string | null;\n}\n\ninterface RTCInboundRTPStreamStats extends RTCRTPStreamStats {\n bytesReceived?: number;\n fractionLost?: number;\n jitter?: number;\n packetsLost?: number;\n packetsReceived?: number;\n}\n\ninterface RTCMediaStreamTrackStats extends RTCStats {\n audioLevel?: number;\n echoReturnLoss?: number;\n echoReturnLossEnhancement?: number;\n frameHeight?: number;\n frameWidth?: number;\n framesCorrupted?: number;\n framesDecoded?: number;\n framesDropped?: number;\n framesPerSecond?: number;\n framesReceived?: number;\n framesSent?: number;\n remoteSource?: boolean;\n ssrcIds?: string[];\n trackIdentifier?: string;\n}\n\ninterface RTCOfferOptions {\n iceRestart?: boolean;\n offerToReceiveAudio?: number;\n offerToReceiveVideo?: number;\n voiceActivityDetection?: boolean;\n}\n\ninterface RTCOutboundRTPStreamStats extends RTCRTPStreamStats {\n bytesSent?: number;\n packetsSent?: number;\n roundTripTime?: number;\n targetBitrate?: number;\n}\n\ninterface RTCPeerConnectionIceEventInit extends EventInit {\n candidate?: RTCIceCandidate;\n}\n\ninterface RTCRTPStreamStats extends RTCStats {\n associateStatsId?: string;\n codecId?: string;\n firCount?: number;\n isRemote?: boolean;\n mediaTrackId?: string;\n mediaType?: string;\n nackCount?: number;\n pliCount?: number;\n sliCount?: number;\n ssrc?: string;\n transportId?: string;\n}\n\ninterface RTCRtcpFeedback {\n parameter?: string;\n type?: string;\n}\n\ninterface RTCRtcpParameters {\n cname?: string;\n mux?: boolean;\n reducedSize?: boolean;\n ssrc?: number;\n}\n\ninterface RTCRtpCapabilities {\n codecs?: RTCRtpCodecCapability[];\n fecMechanisms?: string[];\n headerExtensions?: RTCRtpHeaderExtension[];\n}\n\ninterface RTCRtpCodecCapability {\n clockRate?: number;\n kind?: string;\n maxSpatialLayers?: number;\n maxTemporalLayers?: number;\n maxptime?: number;\n name?: string;\n numChannels?: number;\n options?: any;\n parameters?: any;\n preferredPayloadType?: number;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n svcMultiStreamSupport?: boolean;\n}\n\ninterface RTCRtpCodecParameters {\n clockRate?: number;\n maxptime?: number;\n name?: string;\n numChannels?: number;\n parameters?: any;\n payloadType?: number;\n ptime?: number;\n rtcpFeedback?: RTCRtcpFeedback[];\n}\n\ninterface RTCRtpContributingSource {\n audioLevel?: number;\n csrc?: number;\n timestamp?: number;\n}\n\ninterface RTCRtpEncodingParameters {\n active?: boolean;\n codecPayloadType?: number;\n dependencyEncodingIds?: string[];\n encodingId?: string;\n fec?: RTCRtpFecParameters;\n framerateScale?: number;\n maxBitrate?: number;\n maxFramerate?: number;\n minQuality?: number;\n priority?: number;\n resolutionScale?: number;\n rtx?: RTCRtpRtxParameters;\n ssrc?: number;\n ssrcRange?: RTCSsrcRange;\n}\n\ninterface RTCRtpFecParameters {\n mechanism?: string;\n ssrc?: number;\n}\n\ninterface RTCRtpHeaderExtension {\n kind?: string;\n preferredEncrypt?: boolean;\n preferredId?: number;\n uri?: string;\n}\n\ninterface RTCRtpHeaderExtensionParameters {\n encrypt?: boolean;\n id?: number;\n uri?: string;\n}\n\ninterface RTCRtpParameters {\n codecs?: RTCRtpCodecParameters[];\n degradationPreference?: RTCDegradationPreference;\n encodings?: RTCRtpEncodingParameters[];\n headerExtensions?: RTCRtpHeaderExtensionParameters[];\n muxId?: string;\n rtcp?: RTCRtcpParameters;\n}\n\ninterface RTCRtpRtxParameters {\n ssrc?: number;\n}\n\ninterface RTCRtpUnhandled {\n muxId?: string;\n payloadType?: number;\n ssrc?: number;\n}\n\ninterface RTCSessionDescriptionInit {\n sdp?: string;\n type?: RTCSdpType;\n}\n\ninterface RTCSrtpKeyParam {\n keyMethod?: string;\n keySalt?: string;\n lifetime?: string;\n mkiLength?: number;\n mkiValue?: number;\n}\n\ninterface RTCSrtpSdesParameters {\n cryptoSuite?: string;\n keyParams?: RTCSrtpKeyParam[];\n sessionParams?: string[];\n tag?: number;\n}\n\ninterface RTCSsrcRange {\n max?: number;\n min?: number;\n}\n\ninterface RTCStats {\n id?: string;\n msType?: MSStatsType;\n timestamp?: number;\n type?: RTCStatsType;\n}\n\ninterface RTCStatsReport {\n}\n\ninterface RTCTransportStats extends RTCStats {\n activeConnection?: boolean;\n bytesReceived?: number;\n bytesSent?: number;\n localCertificateId?: string;\n remoteCertificateId?: string;\n rtcpTransportStatsId?: string;\n selectedCandidatePairId?: string;\n}\n\ninterface RegistrationOptions {\n scope?: string;\n}\n\ninterface RequestInit {\n body?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null;\n cache?: RequestCache;\n credentials?: RequestCredentials;\n headers?: HeadersInit;\n integrity?: string;\n keepalive?: boolean;\n method?: string;\n mode?: RequestMode;\n redirect?: RequestRedirect;\n referrer?: string;\n referrerPolicy?: ReferrerPolicy;\n signal?: AbortSignal;\n window?: any;\n}\n\ninterface ResponseInit {\n headers?: HeadersInit;\n status?: number;\n statusText?: string;\n}\n\ninterface RsaHashedImportParams extends Algorithm {\n hash: string | Algorithm;\n}\n\ninterface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {\n hash: KeyAlgorithm;\n}\n\ninterface RsaHashedKeyGenParams extends RsaKeyGenParams {\n hash: string | Algorithm;\n}\n\ninterface RsaKeyAlgorithm extends KeyAlgorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaKeyGenParams extends Algorithm {\n modulusLength: number;\n publicExponent: Uint8Array;\n}\n\ninterface RsaOaepParams extends Algorithm {\n label?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n}\n\ninterface RsaOtherPrimesInfo {\n d?: string;\n r?: string;\n t?: string;\n}\n\ninterface RsaPssParams extends Algorithm {\n saltLength: number;\n}\n\ninterface ScopedCredentialDescriptor {\n id: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null;\n transports?: Transport[];\n type: ScopedCredentialType;\n}\n\ninterface ScopedCredentialOptions {\n excludeList?: ScopedCredentialDescriptor[];\n extensions?: WebAuthnExtensions;\n rpId?: string;\n timeoutSeconds?: number;\n}\n\ninterface ScopedCredentialParameters {\n algorithm: string | Algorithm;\n type: ScopedCredentialType;\n}\n\ninterface SecurityPolicyViolationEventInit extends EventInit {\n blockedURI?: string;\n columnNumber?: number;\n documentURI?: string;\n effectiveDirective?: string;\n lineNumber?: number;\n originalPolicy?: string;\n referrer?: string;\n sourceFile?: string;\n statusCode?: number;\n violatedDirective?: string;\n}\n\ninterface ServiceWorkerMessageEventInit extends EventInit {\n data?: any;\n lastEventId?: string;\n origin?: string;\n ports?: MessagePort[] | null;\n source?: ServiceWorker | MessagePort | null;\n}\n\ninterface SpeechSynthesisEventInit extends EventInit {\n charIndex?: number;\n charLength?: number;\n elapsedTime?: number;\n name?: string;\n utterance?: SpeechSynthesisUtterance | null;\n}\n\ninterface StereoPannerOptions extends AudioNodeOptions {\n pan?: number;\n}\n\ninterface StoreExceptionsInformation extends ExceptionInformation {\n detailURI?: string | null;\n explanationString?: string | null;\n siteName?: string | null;\n}\n\ninterface StoreSiteSpecificExceptionsInformation extends StoreExceptionsInformation {\n arrayOfDomainStrings?: string[];\n}\n\ninterface SyncEventInit extends ExtendableEventInit {\n lastChance?: boolean;\n tag: string;\n}\n\ninterface TextDecodeOptions {\n stream?: boolean;\n}\n\ninterface TextDecoderOptions {\n fatal?: boolean;\n ignoreBOM?: boolean;\n}\n\ninterface TrackEventInit extends EventInit {\n track?: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ninterface TransitionEventInit extends EventInit {\n elapsedTime?: number;\n propertyName?: string;\n}\n\ninterface UIEventInit extends EventInit {\n detail?: number;\n view?: Window | null;\n}\n\ninterface UnderlyingSink {\n abort?: WritableStreamErrorCallback;\n close?: WritableStreamDefaultControllerCallback;\n start: WritableStreamDefaultControllerCallback;\n write?: WritableStreamChunkCallback;\n}\n\ninterface VRDisplayEventInit extends EventInit {\n display: VRDisplay;\n reason?: VRDisplayEventReason;\n}\n\ninterface VRLayer {\n leftBounds?: number[] | null;\n rightBounds?: number[] | null;\n source?: HTMLCanvasElement | null;\n}\n\ninterface VRStageParameters {\n sittingToStandingTransform?: Float32Array;\n sizeX?: number;\n sizeY?: number;\n}\n\ninterface WaveShaperOptions extends AudioNodeOptions {\n curve?: number[];\n oversample?: OverSampleType;\n}\n\ninterface WebAuthnExtensions {\n}\n\ninterface WebGLContextAttributes {\n alpha?: boolean;\n antialias?: boolean;\n depth?: boolean;\n failIfMajorPerformanceCaveat?: boolean;\n premultipliedAlpha?: boolean;\n preserveDrawingBuffer?: boolean;\n stencil?: boolean;\n}\n\ninterface WebGLContextEventInit extends EventInit {\n statusMessage?: string;\n}\n\ninterface WheelEventInit extends MouseEventInit {\n deltaMode?: number;\n deltaX?: number;\n deltaY?: number;\n deltaZ?: number;\n}\n\ninterface EventListener {\n (evt: Event): void;\n}\n\ntype WebKitEntriesCallback = ((entries: WebKitEntry[]) => void) | { handleEvent(entries: WebKitEntry[]): void; };\n\ntype WebKitErrorCallback = ((err: DOMError) => void) | { handleEvent(err: DOMError): void; };\n\ntype WebKitFileCallback = ((file: File) => void) | { handleEvent(file: File): void; };\n\ninterface ANGLE_instanced_arrays {\n drawArraysInstancedANGLE(mode: number, first: number, count: number, primcount: number): void;\n drawElementsInstancedANGLE(mode: number, count: number, type: number, offset: number, primcount: number): void;\n vertexAttribDivisorANGLE(index: number, divisor: number): void;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n}\n\ndeclare var ANGLE_instanced_arrays: {\n prototype: ANGLE_instanced_arrays;\n new(): ANGLE_instanced_arrays;\n readonly VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE: number;\n};\n\ninterface AbortController {\n readonly signal: AbortSignal;\n abort(): void;\n}\n\ndeclare var AbortController: {\n prototype: AbortController;\n new(): AbortController;\n};\n\ninterface AbortSignalEventMap {\n \"abort\": ProgressEvent;\n}\n\ninterface AbortSignal extends EventTarget {\n readonly aborted: boolean;\n onabort: ((this: AbortSignal, ev: ProgressEvent) => any) | null;\n addEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbortSignal, ev: AbortSignalEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AbortSignal: {\n prototype: AbortSignal;\n new(): AbortSignal;\n};\n\ninterface AbstractWorkerEventMap {\n \"error\": ErrorEvent;\n}\n\ninterface AbstractWorker {\n onerror: ((this: AbstractWorker, ev: ErrorEvent) => any) | null;\n addEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AbstractWorker, ev: AbstractWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface AesCfbParams extends Algorithm {\n iv: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface AesCmacParams extends Algorithm {\n length: number;\n}\n\ninterface AnalyserNode extends AudioNode {\n fftSize: number;\n readonly frequencyBinCount: number;\n maxDecibels: number;\n minDecibels: number;\n smoothingTimeConstant: number;\n getByteFrequencyData(array: Uint8Array): void;\n getByteTimeDomainData(array: Uint8Array): void;\n getFloatFrequencyData(array: Float32Array): void;\n getFloatTimeDomainData(array: Float32Array): void;\n}\n\ndeclare var AnalyserNode: {\n prototype: AnalyserNode;\n new(): AnalyserNode;\n};\n\ninterface Animation {\n currentTime: number | null;\n effect: AnimationEffectReadOnly;\n readonly finished: Promise;\n id: string;\n readonly pending: boolean;\n readonly playState: \"idle\" | \"running\" | \"paused\" | \"finished\";\n playbackRate: number;\n readonly ready: Promise;\n startTime: number;\n timeline: AnimationTimeline;\n cancel(): void;\n finish(): void;\n oncancel: (this: Animation, ev: AnimationPlaybackEvent) => any;\n onfinish: (this: Animation, ev: AnimationPlaybackEvent) => any;\n pause(): void;\n play(): void;\n reverse(): void;\n}\n\ndeclare var Animation: {\n prototype: Animation;\n new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation;\n};\n\ninterface AnimationEffectReadOnly {\n readonly timing: number;\n getComputedTiming(): ComputedTimingProperties;\n}\n\ninterface AnimationEvent extends Event {\n readonly animationName: string;\n readonly elapsedTime: number;\n}\n\ndeclare var AnimationEvent: {\n prototype: AnimationEvent;\n new(typeArg: string, eventInitDict?: AnimationEventInit): AnimationEvent;\n};\n\ninterface AnimationKeyFrame {\n easing?: string | string[];\n offset?: number | null | (number | null)[];\n [index: string]: string | number | number[] | string[] | null | (number | null)[] | undefined;\n}\n\ninterface AnimationOptions {\n delay?: number;\n direction?: \"normal\" | \"reverse\" | \"alternate\" | \"alternate-reverse\";\n duration?: number;\n easing?: string;\n endDelay?: number;\n fill?: \"none\" | \"forwards\" | \"backwards\" | \"both\"| \"auto\";\n id?: string;\n iterationStart?: number;\n iterations?: number;\n}\n\ninterface AnimationPlaybackEvent extends Event {\n readonly currentTime: number | null;\n readonly timelineTime: number | null;\n}\n\ndeclare var AnimationPlaybackEvent: {\n prototype: AnimationPlaybackEvent;\n new(type: string, eventInitDict?: AnimationPlaybackEventInit): AnimationPlaybackEvent;\n};\n\ninterface AnimationPlaybackEventInit extends EventInit {\n currentTime?: number | null;\n timelineTime?: number | null;\n}\n\ninterface AnimationTimeline {\n readonly currentTime: number | null;\n}\n\ninterface ApplicationCacheEventMap {\n \"cached\": Event;\n \"checking\": Event;\n \"downloading\": Event;\n \"error\": Event;\n \"noupdate\": Event;\n \"obsolete\": Event;\n \"progress\": ProgressEvent;\n \"updateready\": Event;\n}\n\ninterface ApplicationCache extends EventTarget {\n oncached: ((this: ApplicationCache, ev: Event) => any) | null;\n onchecking: ((this: ApplicationCache, ev: Event) => any) | null;\n ondownloading: ((this: ApplicationCache, ev: Event) => any) | null;\n onerror: ((this: ApplicationCache, ev: Event) => any) | null;\n onnoupdate: ((this: ApplicationCache, ev: Event) => any) | null;\n onobsolete: ((this: ApplicationCache, ev: Event) => any) | null;\n onprogress: ((this: ApplicationCache, ev: ProgressEvent) => any) | null;\n onupdateready: ((this: ApplicationCache, ev: Event) => any) | null;\n readonly status: number;\n abort(): void;\n swapCache(): void;\n update(): void;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n addEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ApplicationCache, ev: ApplicationCacheEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ApplicationCache: {\n prototype: ApplicationCache;\n new(): ApplicationCache;\n readonly CHECKING: number;\n readonly DOWNLOADING: number;\n readonly IDLE: number;\n readonly OBSOLETE: number;\n readonly UNCACHED: number;\n readonly UPDATEREADY: number;\n};\n\ninterface AssignedNodesOptions {\n flatten?: boolean;\n}\n\ninterface Attr extends Node {\n readonly name: string;\n readonly ownerElement: Element | null;\n readonly prefix: string | null;\n readonly specified: boolean;\n value: string;\n}\n\ndeclare var Attr: {\n prototype: Attr;\n new(): Attr;\n};\n\ninterface AudioBuffer {\n readonly duration: number;\n readonly length: number;\n readonly numberOfChannels: number;\n readonly sampleRate: number;\n copyFromChannel(destination: Float32Array, channelNumber: number, startInChannel?: number): void;\n copyToChannel(source: Float32Array, channelNumber: number, startInChannel?: number): void;\n getChannelData(channel: number): Float32Array;\n}\n\ndeclare var AudioBuffer: {\n prototype: AudioBuffer;\n new(): AudioBuffer;\n};\n\ninterface AudioBufferSourceNodeEventMap {\n \"ended\": Event;\n}\n\ninterface AudioBufferSourceNode extends AudioNode {\n buffer: AudioBuffer | null;\n readonly detune: AudioParam;\n loop: boolean;\n loopEnd: number;\n loopStart: number;\n onended: ((this: AudioBufferSourceNode, ev: Event) => any) | null;\n readonly playbackRate: AudioParam;\n start(when?: number, offset?: number, duration?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioBufferSourceNode, ev: AudioBufferSourceNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var AudioBufferSourceNode: {\n prototype: AudioBufferSourceNode;\n new(): AudioBufferSourceNode;\n};\n\ninterface AudioContextEventMap {\n \"statechange\": Event;\n}\n\ninterface AudioContextBase extends EventTarget {\n readonly currentTime: number;\n readonly destination: AudioDestinationNode;\n readonly listener: AudioListener;\n onstatechange: ((this: AudioContext, ev: Event) => any) | null;\n readonly sampleRate: number;\n readonly state: AudioContextState;\n close(): Promise;\n createAnalyser(): AnalyserNode;\n createBiquadFilter(): BiquadFilterNode;\n createBuffer(numberOfChannels: number, length: number, sampleRate: number): AudioBuffer;\n createBufferSource(): AudioBufferSourceNode;\n createChannelMerger(numberOfInputs?: number): ChannelMergerNode;\n createChannelSplitter(numberOfOutputs?: number): ChannelSplitterNode;\n createConvolver(): ConvolverNode;\n createDelay(maxDelayTime?: number): DelayNode;\n createDynamicsCompressor(): DynamicsCompressorNode;\n createGain(): GainNode;\n createIIRFilter(feedforward: number[], feedback: number[]): IIRFilterNode;\n createMediaElementSource(mediaElement: HTMLMediaElement): MediaElementAudioSourceNode;\n createMediaStreamSource(mediaStream: MediaStream): MediaStreamAudioSourceNode;\n createOscillator(): OscillatorNode;\n createPanner(): PannerNode;\n createPeriodicWave(real: Float32Array, imag: Float32Array, constraints?: PeriodicWaveConstraints): PeriodicWave;\n createScriptProcessor(bufferSize?: number, numberOfInputChannels?: number, numberOfOutputChannels?: number): ScriptProcessorNode;\n createStereoPanner(): StereoPannerNode;\n createWaveShaper(): WaveShaperNode;\n decodeAudioData(audioData: ArrayBuffer, successCallback?: DecodeSuccessCallback, errorCallback?: DecodeErrorCallback): Promise;\n resume(): Promise;\n addEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioContext, ev: AudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface AudioContext extends AudioContextBase {\n suspend(): Promise;\n}\n\ndeclare var AudioContext: {\n prototype: AudioContext;\n new(): AudioContext;\n};\n\ninterface AudioDestinationNode extends AudioNode {\n readonly maxChannelCount: number;\n}\n\ndeclare var AudioDestinationNode: {\n prototype: AudioDestinationNode;\n new(): AudioDestinationNode;\n};\n\ninterface AudioListener {\n /** @deprecated */\n dopplerFactor: number;\n /** @deprecated */\n speedOfSound: number;\n /** @deprecated */\n setOrientation(x: number, y: number, z: number, xUp: number, yUp: number, zUp: number): void;\n /** @deprecated */\n setPosition(x: number, y: number, z: number): void;\n /** @deprecated */\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var AudioListener: {\n prototype: AudioListener;\n new(): AudioListener;\n};\n\ninterface AudioNode extends EventTarget {\n channelCount: number;\n channelCountMode: ChannelCountMode;\n channelInterpretation: ChannelInterpretation;\n readonly context: AudioContext;\n readonly numberOfInputs: number;\n readonly numberOfOutputs: number;\n connect(destination: AudioNode, output?: number, input?: number): AudioNode;\n connect(destination: AudioParam, output?: number): void;\n disconnect(): void;\n disconnect(output: number): void;\n disconnect(destination: AudioNode): void;\n disconnect(destination: AudioNode, output: number): void;\n disconnect(destination: AudioNode, output: number, input: number): void;\n disconnect(destination: AudioParam): void;\n disconnect(destination: AudioParam, output: number): void;\n}\n\ndeclare var AudioNode: {\n prototype: AudioNode;\n new(): AudioNode;\n};\n\ninterface AudioParam {\n readonly defaultValue: number;\n value: number;\n cancelScheduledValues(cancelTime: number): AudioParam;\n exponentialRampToValueAtTime(value: number, endTime: number): AudioParam;\n linearRampToValueAtTime(value: number, endTime: number): AudioParam;\n setTargetAtTime(target: number, startTime: number, timeConstant: number): AudioParam;\n setValueAtTime(value: number, startTime: number): AudioParam;\n setValueCurveAtTime(values: number[], startTime: number, duration: number): AudioParam;\n}\n\ndeclare var AudioParam: {\n prototype: AudioParam;\n new(): AudioParam;\n};\n\ninterface AudioProcessingEvent extends Event {\n readonly inputBuffer: AudioBuffer;\n readonly outputBuffer: AudioBuffer;\n readonly playbackTime: number;\n}\n\ndeclare var AudioProcessingEvent: {\n prototype: AudioProcessingEvent;\n new(): AudioProcessingEvent;\n};\n\ninterface AudioTrack {\n enabled: boolean;\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var AudioTrack: {\n prototype: AudioTrack;\n new(): AudioTrack;\n};\n\ninterface AudioTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface AudioTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: AudioTrackList, ev: TrackEvent) => any) | null;\n onchange: ((this: AudioTrackList, ev: Event) => any) | null;\n onremovetrack: ((this: AudioTrackList, ev: TrackEvent) => any) | null;\n getTrackById(id: string): AudioTrack | null;\n item(index: number): AudioTrack;\n addEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: AudioTrackList, ev: AudioTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: AudioTrack;\n}\n\ndeclare var AudioTrackList: {\n prototype: AudioTrackList;\n new(): AudioTrackList;\n};\n\ninterface BarProp {\n readonly visible: boolean;\n}\n\ndeclare var BarProp: {\n prototype: BarProp;\n new(): BarProp;\n};\n\ninterface BeforeUnloadEvent extends Event {\n returnValue: any;\n}\n\ndeclare var BeforeUnloadEvent: {\n prototype: BeforeUnloadEvent;\n new(): BeforeUnloadEvent;\n};\n\ninterface BhxBrowser {\n readonly lastError: DOMException;\n checkMatchesGlobExpression(pattern: string, value: string): boolean;\n checkMatchesUriExpression(pattern: string, value: string): boolean;\n clearLastError(): void;\n currentWindowId(): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\n genericFunction(functionId: number, destination: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n getExtensionId(): string;\n getThisAddress(): any;\n registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\n registerGenericListenerHandler(eventHandler: Function): void;\n setLastError(parameters: string): void;\n webPlatformGenericFunction(destination: any, parameters?: string, callbackId?: number): void;\n}\n\ndeclare var BhxBrowser: {\n prototype: BhxBrowser;\n new(): BhxBrowser;\n};\n\ninterface BiquadFilterNode extends AudioNode {\n readonly Q: AudioParam;\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n readonly gain: AudioParam;\n type: BiquadFilterType;\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var BiquadFilterNode: {\n prototype: BiquadFilterNode;\n new(): BiquadFilterNode;\n};\n\ninterface Blob {\n readonly size: number;\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n slice(start?: number, end?: number, contentType?: string): Blob;\n}\n\ndeclare var Blob: {\n prototype: Blob;\n new (blobParts?: any[], options?: BlobPropertyBag): Blob;\n};\n\ninterface BlobPropertyBag {\n endings?: string;\n type?: string;\n}\n\ninterface Body {\n readonly bodyUsed: boolean;\n arrayBuffer(): Promise;\n blob(): Promise;\n formData(): Promise;\n json(): Promise;\n text(): Promise;\n}\n\ninterface BroadcastChannel extends EventTarget {\n readonly name: string;\n onmessage: (ev: MessageEvent) => any;\n onmessageerror: (ev: MessageEvent) => any;\n addEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n close(): void;\n postMessage(message: any): void;\n removeEventListener(type: K, listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var BroadcastChannel: {\n prototype: BroadcastChannel;\n new(name: string): BroadcastChannel;\n};\n\ninterface BroadcastChannelEventMap {\n message: MessageEvent;\n messageerror: MessageEvent;\n}\n\ninterface ByteLengthQueuingStrategy {\n highWaterMark: number;\n size(chunk?: any): number;\n}\n\ndeclare var ByteLengthQueuingStrategy: {\n prototype: ByteLengthQueuingStrategy;\n new(strategy: QueuingStrategy): ByteLengthQueuingStrategy;\n};\n\ninterface CDATASection extends Text {\n}\n\ndeclare var CDATASection: {\n prototype: CDATASection;\n new(): CDATASection;\n};\n\ninterface CSS {\n escape(value: string): string;\n supports(property: string, value?: string): boolean;\n}\ndeclare var CSS: CSS;\n\ninterface CSSConditionRule extends CSSGroupingRule {\n conditionText: string;\n}\n\ndeclare var CSSConditionRule: {\n prototype: CSSConditionRule;\n new(): CSSConditionRule;\n};\n\ninterface CSSFontFaceRule extends CSSRule {\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSFontFaceRule: {\n prototype: CSSFontFaceRule;\n new(): CSSFontFaceRule;\n};\n\ninterface CSSGroupingRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n deleteRule(index: number): void;\n insertRule(rule: string, index: number): number;\n}\n\ndeclare var CSSGroupingRule: {\n prototype: CSSGroupingRule;\n new(): CSSGroupingRule;\n};\n\ninterface CSSImportRule extends CSSRule {\n readonly href: string;\n readonly media: MediaList;\n readonly styleSheet: CSSStyleSheet;\n}\n\ndeclare var CSSImportRule: {\n prototype: CSSImportRule;\n new(): CSSImportRule;\n};\n\ninterface CSSKeyframeRule extends CSSRule {\n keyText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSKeyframeRule: {\n prototype: CSSKeyframeRule;\n new(): CSSKeyframeRule;\n};\n\ninterface CSSKeyframesRule extends CSSRule {\n readonly cssRules: CSSRuleList;\n name: string;\n appendRule(rule: string): void;\n deleteRule(rule: string): void;\n findRule(rule: string): CSSKeyframeRule | null;\n}\n\ndeclare var CSSKeyframesRule: {\n prototype: CSSKeyframesRule;\n new(): CSSKeyframesRule;\n};\n\ninterface CSSMediaRule extends CSSConditionRule {\n readonly media: MediaList;\n}\n\ndeclare var CSSMediaRule: {\n prototype: CSSMediaRule;\n new(): CSSMediaRule;\n};\n\ninterface CSSNamespaceRule extends CSSRule {\n readonly namespaceURI: string;\n readonly prefix: string;\n}\n\ndeclare var CSSNamespaceRule: {\n prototype: CSSNamespaceRule;\n new(): CSSNamespaceRule;\n};\n\ninterface CSSPageRule extends CSSRule {\n readonly pseudoClass: string;\n readonly selector: string;\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSPageRule: {\n prototype: CSSPageRule;\n new(): CSSPageRule;\n};\n\ninterface CSSRule {\n cssText: string;\n readonly parentRule: CSSRule | null;\n readonly parentStyleSheet: CSSStyleSheet | null;\n readonly type: number;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n}\n\ndeclare var CSSRule: {\n prototype: CSSRule;\n new(): CSSRule;\n readonly CHARSET_RULE: number;\n readonly FONT_FACE_RULE: number;\n readonly IMPORT_RULE: number;\n readonly KEYFRAMES_RULE: number;\n readonly KEYFRAME_RULE: number;\n readonly MEDIA_RULE: number;\n readonly NAMESPACE_RULE: number;\n readonly PAGE_RULE: number;\n readonly STYLE_RULE: number;\n readonly SUPPORTS_RULE: number;\n readonly UNKNOWN_RULE: number;\n readonly VIEWPORT_RULE: number;\n};\n\ninterface CSSRuleList {\n readonly length: number;\n item(index: number): CSSRule | null;\n [index: number]: CSSRule;\n}\n\ndeclare var CSSRuleList: {\n prototype: CSSRuleList;\n new(): CSSRuleList;\n};\n\ninterface CSSStyleDeclaration {\n alignContent: string | null;\n alignItems: string | null;\n alignSelf: string | null;\n alignmentBaseline: string | null;\n animation: string | null;\n animationDelay: string | null;\n animationDirection: string | null;\n animationDuration: string | null;\n animationFillMode: string | null;\n animationIterationCount: string | null;\n animationName: string | null;\n animationPlayState: string | null;\n animationTimingFunction: string | null;\n backfaceVisibility: string | null;\n background: string | null;\n backgroundAttachment: string | null;\n backgroundClip: string | null;\n backgroundColor: string | null;\n backgroundImage: string | null;\n backgroundOrigin: string | null;\n backgroundPosition: string | null;\n backgroundPositionX: string | null;\n backgroundPositionY: string | null;\n backgroundRepeat: string | null;\n backgroundSize: string | null;\n baselineShift: string | null;\n border: string | null;\n borderBottom: string | null;\n borderBottomColor: string | null;\n borderBottomLeftRadius: string | null;\n borderBottomRightRadius: string | null;\n borderBottomStyle: string | null;\n borderBottomWidth: string | null;\n borderCollapse: string | null;\n borderColor: string | null;\n borderImage: string | null;\n borderImageOutset: string | null;\n borderImageRepeat: string | null;\n borderImageSlice: string | null;\n borderImageSource: string | null;\n borderImageWidth: string | null;\n borderLeft: string | null;\n borderLeftColor: string | null;\n borderLeftStyle: string | null;\n borderLeftWidth: string | null;\n borderRadius: string | null;\n borderRight: string | null;\n borderRightColor: string | null;\n borderRightStyle: string | null;\n borderRightWidth: string | null;\n borderSpacing: string | null;\n borderStyle: string | null;\n borderTop: string | null;\n borderTopColor: string | null;\n borderTopLeftRadius: string | null;\n borderTopRightRadius: string | null;\n borderTopStyle: string | null;\n borderTopWidth: string | null;\n borderWidth: string | null;\n bottom: string | null;\n boxShadow: string | null;\n boxSizing: string | null;\n breakAfter: string | null;\n breakBefore: string | null;\n breakInside: string | null;\n captionSide: string | null;\n clear: string | null;\n clip: string | null;\n clipPath: string | null;\n clipRule: string | null;\n color: string | null;\n colorInterpolationFilters: string | null;\n columnCount: any;\n columnFill: string | null;\n columnGap: any;\n columnRule: string | null;\n columnRuleColor: any;\n columnRuleStyle: string | null;\n columnRuleWidth: any;\n columnSpan: string | null;\n columnWidth: any;\n columns: string | null;\n content: string | null;\n counterIncrement: string | null;\n counterReset: string | null;\n cssFloat: string | null;\n cssText: string;\n cursor: string | null;\n direction: string | null;\n display: string | null;\n dominantBaseline: string | null;\n emptyCells: string | null;\n enableBackground: string | null;\n fill: string | null;\n fillOpacity: string | null;\n fillRule: string | null;\n filter: string | null;\n flex: string | null;\n flexBasis: string | null;\n flexDirection: string | null;\n flexFlow: string | null;\n flexGrow: string | null;\n flexShrink: string | null;\n flexWrap: string | null;\n floodColor: string | null;\n floodOpacity: string | null;\n font: string | null;\n fontFamily: string | null;\n fontFeatureSettings: string | null;\n fontSize: string | null;\n fontSizeAdjust: string | null;\n fontStretch: string | null;\n fontStyle: string | null;\n fontVariant: string | null;\n fontWeight: string | null;\n gap: string | null;\n glyphOrientationHorizontal: string | null;\n glyphOrientationVertical: string | null;\n grid: string | null;\n gridArea: string | null;\n gridAutoColumns: string | null;\n gridAutoFlow: string | null;\n gridAutoRows: string | null;\n gridColumn: string | null;\n gridColumnEnd: string | null;\n gridColumnGap: string | null;\n gridColumnStart: string | null;\n gridGap: string | null;\n gridRow: string | null;\n gridRowEnd: string | null;\n gridRowGap: string | null;\n gridRowStart: string | null;\n gridTemplate: string | null;\n gridTemplateAreas: string | null;\n gridTemplateColumns: string | null;\n gridTemplateRows: string | null;\n height: string | null;\n imeMode: string | null;\n justifyContent: string | null;\n justifyItems: string | null;\n justifySelf: string | null;\n kerning: string | null;\n layoutGrid: string | null;\n layoutGridChar: string | null;\n layoutGridLine: string | null;\n layoutGridMode: string | null;\n layoutGridType: string | null;\n left: string | null;\n readonly length: number;\n letterSpacing: string | null;\n lightingColor: string | null;\n lineBreak: string | null;\n lineHeight: string | null;\n listStyle: string | null;\n listStyleImage: string | null;\n listStylePosition: string | null;\n listStyleType: string | null;\n margin: string | null;\n marginBottom: string | null;\n marginLeft: string | null;\n marginRight: string | null;\n marginTop: string | null;\n marker: string | null;\n markerEnd: string | null;\n markerMid: string | null;\n markerStart: string | null;\n mask: string | null;\n maskImage: string | null;\n maxHeight: string | null;\n maxWidth: string | null;\n minHeight: string | null;\n minWidth: string | null;\n msContentZoomChaining: string | null;\n msContentZoomLimit: string | null;\n msContentZoomLimitMax: any;\n msContentZoomLimitMin: any;\n msContentZoomSnap: string | null;\n msContentZoomSnapPoints: string | null;\n msContentZoomSnapType: string | null;\n msContentZooming: string | null;\n msFlowFrom: string | null;\n msFlowInto: string | null;\n msFontFeatureSettings: string | null;\n msGridColumn: any;\n msGridColumnAlign: string | null;\n msGridColumnSpan: any;\n msGridColumns: string | null;\n msGridRow: any;\n msGridRowAlign: string | null;\n msGridRowSpan: any;\n msGridRows: string | null;\n msHighContrastAdjust: string | null;\n msHyphenateLimitChars: string | null;\n msHyphenateLimitLines: any;\n msHyphenateLimitZone: any;\n msHyphens: string | null;\n msImeAlign: string | null;\n msOverflowStyle: string | null;\n msScrollChaining: string | null;\n msScrollLimit: string | null;\n msScrollLimitXMax: any;\n msScrollLimitXMin: any;\n msScrollLimitYMax: any;\n msScrollLimitYMin: any;\n msScrollRails: string | null;\n msScrollSnapPointsX: string | null;\n msScrollSnapPointsY: string | null;\n msScrollSnapType: string | null;\n msScrollSnapX: string | null;\n msScrollSnapY: string | null;\n msScrollTranslation: string | null;\n msTextCombineHorizontal: string | null;\n msTextSizeAdjust: any;\n msTouchAction: string | null;\n msTouchSelect: string | null;\n msUserSelect: string | null;\n msWrapFlow: string;\n msWrapMargin: any;\n msWrapThrough: string;\n objectFit: string | null;\n objectPosition: string | null;\n opacity: string | null;\n order: string | null;\n orphans: string | null;\n outline: string | null;\n outlineColor: string | null;\n outlineOffset: string | null;\n outlineStyle: string | null;\n outlineWidth: string | null;\n overflow: string | null;\n overflowX: string | null;\n overflowY: string | null;\n padding: string | null;\n paddingBottom: string | null;\n paddingLeft: string | null;\n paddingRight: string | null;\n paddingTop: string | null;\n pageBreakAfter: string | null;\n pageBreakBefore: string | null;\n pageBreakInside: string | null;\n readonly parentRule: CSSRule;\n penAction: string | null;\n perspective: string | null;\n perspectiveOrigin: string | null;\n pointerEvents: string | null;\n position: string | null;\n quotes: string | null;\n resize: string | null;\n right: string | null;\n rotate: string | null;\n rowGap: string | null;\n rubyAlign: string | null;\n rubyOverhang: string | null;\n rubyPosition: string | null;\n scale: string | null;\n stopColor: string | null;\n stopOpacity: string | null;\n stroke: string | null;\n strokeDasharray: string | null;\n strokeDashoffset: string | null;\n strokeLinecap: string | null;\n strokeLinejoin: string | null;\n strokeMiterlimit: string | null;\n strokeOpacity: string | null;\n strokeWidth: string | null;\n tableLayout: string | null;\n textAlign: string | null;\n textAlignLast: string | null;\n textAnchor: string | null;\n textCombineUpright: string | null;\n textDecoration: string | null;\n textIndent: string | null;\n textJustify: string | null;\n textKashida: string | null;\n textKashidaSpace: string | null;\n textOverflow: string | null;\n textShadow: string | null;\n textTransform: string | null;\n textUnderlinePosition: string | null;\n top: string | null;\n touchAction: string | null;\n transform: string | null;\n transformOrigin: string | null;\n transformStyle: string | null;\n transition: string | null;\n transitionDelay: string | null;\n transitionDuration: string | null;\n transitionProperty: string | null;\n transitionTimingFunction: string | null;\n translate: string | null;\n unicodeBidi: string | null;\n userSelect: string | null;\n verticalAlign: string | null;\n visibility: string | null;\n webkitAlignContent: string | null;\n webkitAlignItems: string | null;\n webkitAlignSelf: string | null;\n webkitAnimation: string | null;\n webkitAnimationDelay: string | null;\n webkitAnimationDirection: string | null;\n webkitAnimationDuration: string | null;\n webkitAnimationFillMode: string | null;\n webkitAnimationIterationCount: string | null;\n webkitAnimationName: string | null;\n webkitAnimationPlayState: string | null;\n webkitAnimationTimingFunction: string | null;\n webkitAppearance: string | null;\n webkitBackfaceVisibility: string | null;\n webkitBackgroundClip: string | null;\n webkitBackgroundOrigin: string | null;\n webkitBackgroundSize: string | null;\n webkitBorderBottomLeftRadius: string | null;\n webkitBorderBottomRightRadius: string | null;\n webkitBorderImage: string | null;\n webkitBorderRadius: string | null;\n webkitBorderTopLeftRadius: string | null;\n webkitBorderTopRightRadius: string | null;\n webkitBoxAlign: string | null;\n webkitBoxDirection: string | null;\n webkitBoxFlex: string | null;\n webkitBoxOrdinalGroup: string | null;\n webkitBoxOrient: string | null;\n webkitBoxPack: string | null;\n webkitBoxSizing: string | null;\n webkitColumnBreakAfter: string | null;\n webkitColumnBreakBefore: string | null;\n webkitColumnBreakInside: string | null;\n webkitColumnCount: any;\n webkitColumnGap: any;\n webkitColumnRule: string | null;\n webkitColumnRuleColor: any;\n webkitColumnRuleStyle: string | null;\n webkitColumnRuleWidth: any;\n webkitColumnSpan: string | null;\n webkitColumnWidth: any;\n webkitColumns: string | null;\n webkitFilter: string | null;\n webkitFlex: string | null;\n webkitFlexBasis: string | null;\n webkitFlexDirection: string | null;\n webkitFlexFlow: string | null;\n webkitFlexGrow: string | null;\n webkitFlexShrink: string | null;\n webkitFlexWrap: string | null;\n webkitJustifyContent: string | null;\n webkitOrder: string | null;\n webkitPerspective: string | null;\n webkitPerspectiveOrigin: string | null;\n webkitTapHighlightColor: string | null;\n webkitTextFillColor: string | null;\n webkitTextSizeAdjust: any;\n webkitTextStroke: string | null;\n webkitTextStrokeColor: string | null;\n webkitTextStrokeWidth: string | null;\n webkitTransform: string | null;\n webkitTransformOrigin: string | null;\n webkitTransformStyle: string | null;\n webkitTransition: string | null;\n webkitTransitionDelay: string | null;\n webkitTransitionDuration: string | null;\n webkitTransitionProperty: string | null;\n webkitTransitionTimingFunction: string | null;\n webkitUserModify: string | null;\n webkitUserSelect: string | null;\n webkitWritingMode: string | null;\n whiteSpace: string | null;\n widows: string | null;\n width: string | null;\n wordBreak: string | null;\n wordSpacing: string | null;\n wordWrap: string | null;\n writingMode: string | null;\n zIndex: string | null;\n zoom: string | null;\n getPropertyPriority(propertyName: string): string;\n getPropertyValue(propertyName: string): string;\n item(index: number): string;\n removeProperty(propertyName: string): string;\n setProperty(propertyName: string, value: string | null, priority?: string | null): void;\n [index: number]: string;\n}\n\ndeclare var CSSStyleDeclaration: {\n prototype: CSSStyleDeclaration;\n new(): CSSStyleDeclaration;\n};\n\ninterface CSSStyleRule extends CSSRule {\n selectorText: string;\n readonly style: CSSStyleDeclaration;\n}\n\ndeclare var CSSStyleRule: {\n prototype: CSSStyleRule;\n new(): CSSStyleRule;\n};\n\ninterface CSSStyleSheet extends StyleSheet {\n readonly cssRules: CSSRuleList;\n /** @deprecated */\n cssText: string;\n /** @deprecated */\n readonly id: string;\n /** @deprecated */\n readonly imports: StyleSheetList;\n /** @deprecated */\n readonly isAlternate: boolean;\n /** @deprecated */\n readonly isPrefAlternate: boolean;\n readonly ownerRule: CSSRule | null;\n /** @deprecated */\n readonly owningElement: Element;\n /** @deprecated */\n readonly pages: any;\n /** @deprecated */\n readonly readOnly: boolean;\n readonly rules: CSSRuleList;\n /** @deprecated */\n addImport(bstrURL: string, lIndex?: number): number;\n /** @deprecated */\n addPageRule(bstrSelector: string, bstrStyle: string, lIndex?: number): number;\n addRule(bstrSelector: string, bstrStyle?: string, lIndex?: number): number;\n deleteRule(index?: number): void;\n insertRule(rule: string, index?: number): number;\n /** @deprecated */\n removeImport(lIndex: number): void;\n removeRule(lIndex: number): void;\n}\n\ndeclare var CSSStyleSheet: {\n prototype: CSSStyleSheet;\n new(): CSSStyleSheet;\n};\n\ninterface CSSSupportsRule extends CSSConditionRule {\n}\n\ndeclare var CSSSupportsRule: {\n prototype: CSSSupportsRule;\n new(): CSSSupportsRule;\n};\n\ninterface Cache {\n add(request: Request | string): Promise;\n addAll(requests: (Request | string)[]): Promise;\n delete(request: Request | string, options?: CacheQueryOptions): Promise;\n keys(request?: Request | string, options?: CacheQueryOptions): Promise;\n match(request: Request | string, options?: CacheQueryOptions): Promise;\n matchAll(request?: Request | string, options?: CacheQueryOptions): Promise;\n put(request: Request | string, response: Response): Promise;\n}\n\ndeclare var Cache: {\n prototype: Cache;\n new(): Cache;\n};\n\ninterface CacheStorage {\n delete(cacheName: string): Promise;\n has(cacheName: string): Promise;\n keys(): Promise;\n match(request: Request | string, options?: CacheQueryOptions): Promise;\n open(cacheName: string): Promise;\n}\n\ndeclare var CacheStorage: {\n prototype: CacheStorage;\n new(): CacheStorage;\n};\n\ninterface Canvas2DContextAttributes {\n alpha?: boolean;\n storage?: boolean;\n willReadFrequently?: boolean;\n [attribute: string]: boolean | string | undefined;\n}\n\ninterface CanvasGradient {\n addColorStop(offset: number, color: string): void;\n}\n\ndeclare var CanvasGradient: {\n prototype: CanvasGradient;\n new(): CanvasGradient;\n};\n\ninterface CanvasPathMethods {\n arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;\n arcTo(x1: number, y1: number, x2: number, y2: number, radiusX: number, radiusY: number, rotation: number): void;\n bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void;\n closePath(): void;\n ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n lineTo(x: number, y: number): void;\n moveTo(x: number, y: number): void;\n quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;\n rect(x: number, y: number, w: number, h: number): void;\n}\n\ninterface CanvasPattern {\n setTransform(matrix: SVGMatrix): void;\n}\n\ndeclare var CanvasPattern: {\n prototype: CanvasPattern;\n new(): CanvasPattern;\n};\n\ninterface CanvasRenderingContext2D extends CanvasPathMethods {\n readonly canvas: HTMLCanvasElement;\n fillStyle: string | CanvasGradient | CanvasPattern;\n font: string;\n globalAlpha: number;\n globalCompositeOperation: string;\n imageSmoothingEnabled: boolean;\n lineCap: string;\n lineDashOffset: number;\n lineJoin: string;\n lineWidth: number;\n miterLimit: number;\n mozImageSmoothingEnabled: boolean;\n msFillRule: CanvasFillRule;\n oImageSmoothingEnabled: boolean;\n shadowBlur: number;\n shadowColor: string;\n shadowOffsetX: number;\n shadowOffsetY: number;\n strokeStyle: string | CanvasGradient | CanvasPattern;\n textAlign: string;\n textBaseline: string;\n webkitImageSmoothingEnabled: boolean;\n beginPath(): void;\n clearRect(x: number, y: number, w: number, h: number): void;\n clip(fillRule?: CanvasFillRule): void;\n clip(path: Path2D, fillRule?: CanvasFillRule): void;\n createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;\n createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;\n createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;\n createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient;\n drawFocusIfNeeded(element: Element): void;\n drawFocusIfNeeded(path: Path2D, element: Element): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void;\n drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void;\n fill(fillRule?: CanvasFillRule): void;\n fill(path: Path2D, fillRule?: CanvasFillRule): void;\n fillRect(x: number, y: number, w: number, h: number): void;\n fillText(text: string, x: number, y: number, maxWidth?: number): void;\n getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;\n getLineDash(): number[];\n isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInStroke(x: number, y: number, fillRule?: CanvasFillRule): boolean;\n isPointInStroke(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean;\n measureText(text: string): TextMetrics;\n putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;\n restore(): void;\n rotate(angle: number): void;\n save(): void;\n scale(x: number, y: number): void;\n setLineDash(segments: number[]): void;\n setTransform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n stroke(path?: Path2D): void;\n strokeRect(x: number, y: number, w: number, h: number): void;\n strokeText(text: string, x: number, y: number, maxWidth?: number): void;\n transform(m11: number, m12: number, m21: number, m22: number, dx: number, dy: number): void;\n translate(x: number, y: number): void;\n}\n\ndeclare var CanvasRenderingContext2D: {\n prototype: CanvasRenderingContext2D;\n new(): CanvasRenderingContext2D;\n};\n\ninterface ChannelMergerNode extends AudioNode {\n}\n\ndeclare var ChannelMergerNode: {\n prototype: ChannelMergerNode;\n new(): ChannelMergerNode;\n};\n\ninterface ChannelSplitterNode extends AudioNode {\n}\n\ndeclare var ChannelSplitterNode: {\n prototype: ChannelSplitterNode;\n new(): ChannelSplitterNode;\n};\n\ninterface CharacterData extends Node, ChildNode {\n data: string;\n readonly length: number;\n appendData(arg: string): void;\n deleteData(offset: number, count: number): void;\n insertData(offset: number, arg: string): void;\n replaceData(offset: number, count: number, arg: string): void;\n substringData(offset: number, count: number): string;\n}\n\ndeclare var CharacterData: {\n prototype: CharacterData;\n new(): CharacterData;\n};\n\ninterface ChildNode {\n remove(): void;\n}\n\ninterface ClientRect {\n bottom: number;\n readonly height: number;\n left: number;\n right: number;\n top: number;\n readonly width: number;\n}\n\ndeclare var ClientRect: {\n prototype: ClientRect;\n new(): ClientRect;\n};\n\ninterface ClientRectList {\n readonly length: number;\n item(index: number): ClientRect;\n [index: number]: ClientRect;\n}\n\ndeclare var ClientRectList: {\n prototype: ClientRectList;\n new(): ClientRectList;\n};\n\ninterface ClipboardEvent extends Event {\n readonly clipboardData: DataTransfer;\n}\n\ndeclare var ClipboardEvent: {\n prototype: ClipboardEvent;\n new(type: string, eventInitDict?: ClipboardEventInit): ClipboardEvent;\n};\n\ninterface ClipboardEventInit extends EventInit {\n data?: string;\n dataType?: string;\n}\n\ninterface CloseEvent extends Event {\n readonly code: number;\n readonly reason: string;\n readonly wasClean: boolean;\n /** @deprecated */\n initCloseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, wasCleanArg: boolean, codeArg: number, reasonArg: string): void;\n}\n\ndeclare var CloseEvent: {\n prototype: CloseEvent;\n new(type: string, eventInitDict?: CloseEventInit): CloseEvent;\n};\n\ninterface Comment extends CharacterData {\n text: string;\n}\n\ndeclare var Comment: {\n prototype: Comment;\n new(data?: string): Comment;\n};\n\ninterface CompositionEvent extends UIEvent {\n readonly data: string;\n readonly locale: string;\n initCompositionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, locale: string): void;\n}\n\ndeclare var CompositionEvent: {\n prototype: CompositionEvent;\n new(typeArg: string, eventInitDict?: CompositionEventInit): CompositionEvent;\n};\n\ninterface ComputedTimingProperties {\n activeDuration: number;\n currentIteration: number | null;\n endTime: number;\n localTime: number | null;\n progress: number | null;\n}\n\ninterface ConcatParams extends Algorithm {\n algorithmId: Uint8Array;\n hash?: string | Algorithm;\n partyUInfo: Uint8Array;\n partyVInfo: Uint8Array;\n privateInfo?: Uint8Array;\n publicInfo?: Uint8Array;\n}\n\ninterface Console {\n memory: any;\n assert(condition?: boolean, message?: string, ...data: any[]): void;\n clear(): void;\n count(label?: string): void;\n debug(message?: any, ...optionalParams: any[]): void;\n dir(value?: any, ...optionalParams: any[]): void;\n dirxml(value: any): void;\n error(message?: any, ...optionalParams: any[]): void;\n exception(message?: string, ...optionalParams: any[]): void;\n group(groupTitle?: string, ...optionalParams: any[]): void;\n groupCollapsed(groupTitle?: string, ...optionalParams: any[]): void;\n groupEnd(): void;\n info(message?: any, ...optionalParams: any[]): void;\n log(message?: any, ...optionalParams: any[]): void;\n markTimeline(label?: string): void;\n msIsIndependentlyComposed(element: Element): boolean;\n profile(reportName?: string): void;\n profileEnd(): void;\n select(element: Element): void;\n table(...tabularData: any[]): void;\n time(label?: string): void;\n timeEnd(label?: string): void;\n timeStamp(label?: string): void;\n timeline(label?: string): void;\n timelineEnd(label?: string): void;\n trace(message?: any, ...optionalParams: any[]): void;\n warn(message?: any, ...optionalParams: any[]): void;\n}\n\ndeclare var Console: {\n prototype: Console;\n new(): Console;\n};\n\ninterface ContentScriptGlobalScope extends EventTarget {\n readonly msContentScript: ExtensionScriptApis;\n readonly window: Window;\n}\n\ndeclare var ContentScriptGlobalScope: {\n prototype: ContentScriptGlobalScope;\n new(): ContentScriptGlobalScope;\n};\n\ninterface ConvolverNode extends AudioNode {\n buffer: AudioBuffer | null;\n normalize: boolean;\n}\n\ndeclare var ConvolverNode: {\n prototype: ConvolverNode;\n new(): ConvolverNode;\n};\n\ninterface Coordinates {\n readonly accuracy: number;\n readonly altitude: number | null;\n readonly altitudeAccuracy: number | null;\n readonly heading: number | null;\n readonly latitude: number;\n readonly longitude: number;\n readonly speed: number | null;\n}\n\ndeclare var Coordinates: {\n prototype: Coordinates;\n new(): Coordinates;\n};\n\ninterface CountQueuingStrategy {\n highWaterMark: number;\n size(): number;\n}\n\ndeclare var CountQueuingStrategy: {\n prototype: CountQueuingStrategy;\n new(strategy: QueuingStrategy): CountQueuingStrategy;\n};\n\ninterface Crypto {\n readonly subtle: SubtleCrypto;\n getRandomValues(array: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null;\n}\n\ndeclare var Crypto: {\n prototype: Crypto;\n new(): Crypto;\n};\n\ninterface CryptoKey {\n readonly algorithm: KeyAlgorithm;\n readonly extractable: boolean;\n readonly type: string;\n readonly usages: string[];\n}\n\ndeclare var CryptoKey: {\n prototype: CryptoKey;\n new(): CryptoKey;\n};\n\ninterface CryptoKeyPair {\n privateKey: CryptoKey;\n publicKey: CryptoKey;\n}\n\ndeclare var CryptoKeyPair: {\n prototype: CryptoKeyPair;\n new(): CryptoKeyPair;\n};\n\ninterface CustomElementRegistry {\n define(name: string, constructor: Function, options?: ElementDefinitionOptions): void;\n get(name: string): any;\n whenDefined(name: string): PromiseLike;\n}\n\ninterface CustomEvent extends Event {\n readonly detail: T;\n initCustomEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, detailArg: T): void;\n}\n\ndeclare var CustomEvent: {\n prototype: CustomEvent;\n new(typeArg: string, eventInitDict?: CustomEventInit): CustomEvent;\n};\n\ninterface DOMError {\n readonly name: string;\n toString(): string;\n}\n\ndeclare var DOMError: {\n prototype: DOMError;\n new(): DOMError;\n};\n\ninterface DOMException {\n readonly code: number;\n readonly message: string;\n readonly name: string;\n toString(): string;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n}\n\ndeclare var DOMException: {\n prototype: DOMException;\n new(message?: string, name?: string): DOMException;\n readonly ABORT_ERR: number;\n readonly DATA_CLONE_ERR: number;\n readonly DOMSTRING_SIZE_ERR: number;\n readonly HIERARCHY_REQUEST_ERR: number;\n readonly INDEX_SIZE_ERR: number;\n readonly INUSE_ATTRIBUTE_ERR: number;\n readonly INVALID_ACCESS_ERR: number;\n readonly INVALID_CHARACTER_ERR: number;\n readonly INVALID_MODIFICATION_ERR: number;\n readonly INVALID_NODE_TYPE_ERR: number;\n readonly INVALID_STATE_ERR: number;\n readonly NAMESPACE_ERR: number;\n readonly NETWORK_ERR: number;\n readonly NOT_FOUND_ERR: number;\n readonly NOT_SUPPORTED_ERR: number;\n readonly NO_DATA_ALLOWED_ERR: number;\n readonly NO_MODIFICATION_ALLOWED_ERR: number;\n readonly PARSE_ERR: number;\n readonly QUOTA_EXCEEDED_ERR: number;\n readonly SECURITY_ERR: number;\n readonly SERIALIZE_ERR: number;\n readonly SYNTAX_ERR: number;\n readonly TIMEOUT_ERR: number;\n readonly TYPE_MISMATCH_ERR: number;\n readonly URL_MISMATCH_ERR: number;\n readonly VALIDATION_ERR: number;\n readonly WRONG_DOCUMENT_ERR: number;\n};\n\ninterface DOMImplementation {\n createDocument(namespaceURI: string | null, qualifiedName: string | null, doctype: DocumentType | null): Document;\n createDocumentType(qualifiedName: string, publicId: string, systemId: string): DocumentType;\n createHTMLDocument(title?: string): Document;\n hasFeature(feature: string | null, version: string | null): boolean;\n}\n\ndeclare var DOMImplementation: {\n prototype: DOMImplementation;\n new(): DOMImplementation;\n};\n\ninterface DOML2DeprecatedColorProperty {\n color: string;\n}\n\ninterface DOML2DeprecatedSizeProperty {\n size: number;\n}\n\ninterface DOMParser {\n parseFromString(source: string, mimeType: string): Document;\n}\n\ndeclare var DOMParser: {\n prototype: DOMParser;\n new(): DOMParser;\n};\n\ninterface DOMRect extends DOMRectReadOnly {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var DOMRect: {\n prototype: DOMRect;\n new (x?: number, y?: number, width?: number, height?: number): DOMRect;\n fromRect(rectangle?: DOMRectInit): DOMRect;\n};\n\ninterface DOMRectList {\n readonly length: number;\n item(index: number): DOMRect | null;\n [index: number]: DOMRect;\n}\n\ninterface DOMRectReadOnly {\n readonly bottom: number;\n readonly height: number;\n readonly left: number;\n readonly right: number;\n readonly top: number;\n readonly width: number;\n readonly x: number;\n readonly y: number;\n}\n\ndeclare var DOMRectReadOnly: {\n prototype: DOMRectReadOnly;\n new (x?: number, y?: number, width?: number, height?: number): DOMRectReadOnly;\n fromRect(rectangle?: DOMRectInit): DOMRectReadOnly;\n};\n\ninterface DOMSettableTokenList extends DOMTokenList {\n value: string;\n}\n\ndeclare var DOMSettableTokenList: {\n prototype: DOMSettableTokenList;\n new(): DOMSettableTokenList;\n};\n\ninterface DOMStringList {\n readonly length: number;\n contains(str: string): boolean;\n item(index: number): string | null;\n [index: number]: string;\n}\n\ndeclare var DOMStringList: {\n prototype: DOMStringList;\n new(): DOMStringList;\n};\n\ninterface DOMStringMap {\n [name: string]: string | undefined;\n}\n\ndeclare var DOMStringMap: {\n prototype: DOMStringMap;\n new(): DOMStringMap;\n};\n\ninterface DOMTokenList {\n readonly length: number;\n add(...tokens: string[]): void;\n contains(token: string): boolean;\n item(index: number): string | null;\n remove(...tokens: string[]): void;\n toString(): string;\n toggle(token: string, force?: boolean): boolean;\n [index: number]: string;\n}\n\ndeclare var DOMTokenList: {\n prototype: DOMTokenList;\n new(): DOMTokenList;\n};\n\ninterface DataCue extends TextTrackCue {\n data: ArrayBuffer;\n addEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: DataCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var DataCue: {\n prototype: DataCue;\n new(): DataCue;\n};\n\ninterface DataTransfer {\n dropEffect: string;\n effectAllowed: string;\n readonly files: FileList;\n readonly items: DataTransferItemList;\n readonly types: string[];\n clearData(format?: string): boolean;\n getData(format: string): string;\n setData(format: string, data: string): boolean;\n setDragImage(image: Element, x: number, y: number): void;\n}\n\ndeclare var DataTransfer: {\n prototype: DataTransfer;\n new(): DataTransfer;\n};\n\ninterface DataTransferItem {\n readonly kind: string;\n readonly type: string;\n getAsFile(): File | null;\n getAsString(_callback: FunctionStringCallback | null): void;\n webkitGetAsEntry(): any;\n}\n\ndeclare var DataTransferItem: {\n prototype: DataTransferItem;\n new(): DataTransferItem;\n};\n\ninterface DataTransferItemList {\n readonly length: number;\n add(data: File): DataTransferItem | null;\n add(data: string, type: string): DataTransferItem | null;\n clear(): void;\n item(index: number): DataTransferItem;\n remove(index: number): void;\n [name: number]: DataTransferItem;\n}\n\ndeclare var DataTransferItemList: {\n prototype: DataTransferItemList;\n new(): DataTransferItemList;\n};\n\ninterface DeferredPermissionRequest {\n readonly id: number;\n readonly type: MSWebViewPermissionType;\n readonly uri: string;\n allow(): void;\n deny(): void;\n}\n\ndeclare var DeferredPermissionRequest: {\n prototype: DeferredPermissionRequest;\n new(): DeferredPermissionRequest;\n};\n\ninterface DelayNode extends AudioNode {\n readonly delayTime: AudioParam;\n}\n\ndeclare var DelayNode: {\n prototype: DelayNode;\n new(): DelayNode;\n};\n\ninterface DeviceAcceleration {\n readonly x: number | null;\n readonly y: number | null;\n readonly z: number | null;\n}\n\ndeclare var DeviceAcceleration: {\n prototype: DeviceAcceleration;\n new(): DeviceAcceleration;\n};\n\ninterface DeviceLightEvent extends Event {\n readonly value: number;\n}\n\ndeclare var DeviceLightEvent: {\n prototype: DeviceLightEvent;\n new(typeArg: string, eventInitDict?: DeviceLightEventInit): DeviceLightEvent;\n};\n\ninterface DeviceMotionEvent extends Event {\n readonly acceleration: DeviceAcceleration | null;\n readonly accelerationIncludingGravity: DeviceAcceleration | null;\n readonly interval: number | null;\n readonly rotationRate: DeviceRotationRate | null;\n initDeviceMotionEvent(type: string, bubbles: boolean, cancelable: boolean, acceleration: DeviceAccelerationDict | null, accelerationIncludingGravity: DeviceAccelerationDict | null, rotationRate: DeviceRotationRateDict | null, interval: number | null): void;\n}\n\ndeclare var DeviceMotionEvent: {\n prototype: DeviceMotionEvent;\n new(typeArg: string, eventInitDict?: DeviceMotionEventInit): DeviceMotionEvent;\n};\n\ninterface DeviceOrientationEvent extends Event {\n readonly absolute: boolean;\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n initDeviceOrientationEvent(type: string, bubbles: boolean, cancelable: boolean, alpha: number | null, beta: number | null, gamma: number | null, absolute: boolean): void;\n}\n\ndeclare var DeviceOrientationEvent: {\n prototype: DeviceOrientationEvent;\n new(typeArg: string, eventInitDict?: DeviceOrientationEventInit): DeviceOrientationEvent;\n};\n\ninterface DeviceRotationRate {\n readonly alpha: number | null;\n readonly beta: number | null;\n readonly gamma: number | null;\n}\n\ndeclare var DeviceRotationRate: {\n prototype: DeviceRotationRate;\n new(): DeviceRotationRate;\n};\n\ninterface DhImportKeyParams extends Algorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DhKeyAlgorithm extends KeyAlgorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DhKeyDeriveParams extends Algorithm {\n public: CryptoKey;\n}\n\ninterface DhKeyGenParams extends Algorithm {\n generator: Uint8Array;\n prime: Uint8Array;\n}\n\ninterface DocumentEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"activate\": Event;\n \"beforeactivate\": Event;\n \"beforedeactivate\": Event;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": Event;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"fullscreenchange\": Event;\n \"fullscreenerror\": Event;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": Event;\n \"MSGestureChange\": Event;\n \"MSGestureDoubleTap\": Event;\n \"MSGestureEnd\": Event;\n \"MSGestureHold\": Event;\n \"MSGestureStart\": Event;\n \"MSGestureTap\": Event;\n \"MSInertiaStart\": Event;\n \"MSManipulationStateChanged\": Event;\n \"MSPointerCancel\": Event;\n \"MSPointerDown\": Event;\n \"MSPointerEnter\": Event;\n \"MSPointerLeave\": Event;\n \"MSPointerMove\": Event;\n \"MSPointerOut\": Event;\n \"MSPointerOver\": Event;\n \"MSPointerUp\": Event;\n \"mssitemodejumplistitemremoved\": Event;\n \"msthumbnailclick\": Event;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"pointerlockchange\": Event;\n \"pointerlockerror\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectionchange\": Event;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"stop\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": Event;\n \"touchend\": Event;\n \"touchmove\": Event;\n \"touchstart\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Document extends Node, GlobalEventHandlers, ParentNode, DocumentEvent {\n /**\n * Sets or gets the URL for the current document.\n */\n readonly URL: string;\n /**\n * Gets the URL for the document, stripped of any character encoding.\n */\n readonly URLUnencoded: string;\n /**\n * Gets the object that has the focus when the parent document has focus.\n */\n readonly activeElement: Element;\n /**\n * Sets or gets the color of all active links in the document.\n */\n alinkColor: string;\n /**\n * Returns a reference to the collection of elements contained by the object.\n */\n readonly all: HTMLAllCollection;\n /**\n * Retrieves a collection of all a objects that have a name and/or id property. Objects in this collection are in HTML source order.\n */\n readonly anchors: HTMLCollectionOf;\n /**\n * Retrieves a collection of all applet objects in the document.\n */\n readonly applets: HTMLCollectionOf;\n /**\n * Deprecated. Sets or retrieves a value that indicates the background color behind the object.\n */\n bgColor: string;\n /**\n * Specifies the beginning and end of the document body.\n */\n body: HTMLElement;\n readonly characterSet: string;\n /**\n * Gets or sets the character set used to encode the object.\n */\n charset: string;\n /**\n * Gets a value that indicates whether standards-compliant mode is switched on for the object.\n */\n readonly compatMode: string;\n cookie: string;\n readonly currentScript: HTMLScriptElement | SVGScriptElement | null;\n readonly defaultView: Window;\n /**\n * Sets or gets a value that indicates whether the document can be edited.\n */\n designMode: string;\n /**\n * Sets or retrieves a value that indicates the reading order of the object.\n */\n dir: string;\n /**\n * Gets an object representing the document type declaration associated with the current document.\n */\n readonly doctype: DocumentType;\n /**\n * Gets a reference to the root node of the document.\n */\n readonly documentElement: HTMLElement;\n /**\n * Sets or gets the security domain of the document.\n */\n domain: string;\n /**\n * Retrieves a collection of all embed objects in the document.\n */\n readonly embeds: HTMLCollectionOf;\n /**\n * Sets or gets the foreground (text) color of the document.\n */\n fgColor: string;\n /**\n * Retrieves a collection, in source order, of all form objects in the document.\n */\n readonly forms: HTMLCollectionOf;\n readonly fullscreenElement: Element | null;\n readonly fullscreenEnabled: boolean;\n readonly head: HTMLHeadElement;\n readonly hidden: boolean;\n /**\n * Retrieves a collection, in source order, of img objects in the document.\n */\n readonly images: HTMLCollectionOf;\n /**\n * Gets the implementation object of the current document.\n */\n readonly implementation: DOMImplementation;\n /**\n * Returns the character encoding used to create the webpage that is loaded into the document object.\n */\n readonly inputEncoding: string | null;\n /**\n * Gets the date that the page was last modified, if the page supplies one.\n */\n readonly lastModified: string;\n /**\n * Sets or gets the color of the document links.\n */\n linkColor: string;\n /**\n * Retrieves a collection of all a objects that specify the href property and all area objects in the document.\n */\n readonly links: HTMLCollectionOf;\n /**\n * Contains information about the current URL.\n */\n location: Location;\n msCSSOMElementFloatMetrics: boolean;\n msCapsLockWarningOff: boolean;\n /**\n * Fires when the user aborts the download.\n * @param ev The event.\n */\n onabort: ((this: Document, ev: UIEvent) => any) | null;\n /**\n * Fires when the object is set as the active element.\n * @param ev The event.\n */\n onactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires immediately before the object is set as the active element.\n * @param ev The event.\n */\n onbeforeactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires immediately before the activeElement is changed from the current object to another object in the parent document.\n * @param ev The event.\n */\n onbeforedeactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the object loses the input focus.\n * @param ev The focus event.\n */\n onblur: ((this: Document, ev: FocusEvent) => any) | null;\n /**\n * Occurs when playback is possible, but would require further buffering.\n * @param ev The event.\n */\n oncanplay: ((this: Document, ev: Event) => any) | null;\n oncanplaythrough: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the contents of the object or selection have changed.\n * @param ev The event.\n */\n onchange: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the left mouse button on the object\n * @param ev The mouse event.\n */\n onclick: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user clicks the right mouse button in the client area, opening the context menu.\n * @param ev The mouse event.\n */\n oncontextmenu: ((this: Document, ev: PointerEvent) => any) | null;\n /**\n * Fires when the user double-clicks the object.\n * @param ev The mouse event.\n */\n ondblclick: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the activeElement is changed from the current object to another object in the parent document.\n * @param ev The UI Event\n */\n ondeactivate: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires on the source object continuously during a drag operation.\n * @param ev The event.\n */\n ondrag: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the source object when the user releases the mouse at the close of a drag operation.\n * @param ev The event.\n */\n ondragend: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the target element when the user drags the object to a valid drop target.\n * @param ev The drag event.\n */\n ondragenter: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation.\n * @param ev The drag event.\n */\n ondragleave: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the target element continuously while the user drags the object over a valid drop target.\n * @param ev The event.\n */\n ondragover: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Fires on the source object when the user starts to drag a text selection or selected object.\n * @param ev The event.\n */\n ondragstart: ((this: Document, ev: DragEvent) => any) | null;\n ondrop: ((this: Document, ev: DragEvent) => any) | null;\n /**\n * Occurs when the duration attribute is updated.\n * @param ev The event.\n */\n ondurationchange: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the media element is reset to its initial state.\n * @param ev The event.\n */\n onemptied: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the end of playback is reached.\n * @param ev The event\n */\n onended: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when an error occurs during object loading.\n * @param ev The event.\n */\n onerror: ((this: Document, ev: ErrorEvent) => any) | null;\n /**\n * Fires when the object receives focus.\n * @param ev The event.\n */\n onfocus: ((this: Document, ev: FocusEvent) => any) | null;\n onfullscreenchange: ((this: Document, ev: Event) => any) | null;\n onfullscreenerror: ((this: Document, ev: Event) => any) | null;\n oninput: ((this: Document, ev: Event) => any) | null;\n oninvalid: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user presses a key.\n * @param ev The keyboard event\n */\n onkeydown: ((this: Document, ev: KeyboardEvent) => any) | null;\n /**\n * Fires when the user presses an alphanumeric key.\n * @param ev The event.\n */\n onkeypress: ((this: Document, ev: KeyboardEvent) => any) | null;\n /**\n * Fires when the user releases a key.\n * @param ev The keyboard event\n */\n onkeyup: ((this: Document, ev: KeyboardEvent) => any) | null;\n /**\n * Fires immediately after the browser loads the object.\n * @param ev The event.\n */\n onload: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when media data is loaded at the current playback position.\n * @param ev The event.\n */\n onloadeddata: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the duration and dimensions of the media have been determined.\n * @param ev The event.\n */\n onloadedmetadata: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when Internet Explorer begins looking for media data.\n * @param ev The event.\n */\n onloadstart: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the object with either mouse button.\n * @param ev The mouse event.\n */\n onmousedown: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse over the object.\n * @param ev The mouse event.\n */\n onmousemove: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse pointer outside the boundaries of the object.\n * @param ev The mouse event.\n */\n onmouseout: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user moves the mouse pointer into the object.\n * @param ev The mouse event.\n */\n onmouseover: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the user releases a mouse button while the mouse is over the object.\n * @param ev The mouse event.\n */\n onmouseup: ((this: Document, ev: MouseEvent) => any) | null;\n /**\n * Fires when the wheel button is rotated.\n * @param ev The mouse event\n */\n onmousewheel: ((this: Document, ev: WheelEvent) => any) | null;\n onmscontentzoom: ((this: Document, ev: Event) => any) | null;\n onmsgesturechange: ((this: Document, ev: Event) => any) | null;\n onmsgesturedoubletap: ((this: Document, ev: Event) => any) | null;\n onmsgestureend: ((this: Document, ev: Event) => any) | null;\n onmsgesturehold: ((this: Document, ev: Event) => any) | null;\n onmsgesturestart: ((this: Document, ev: Event) => any) | null;\n onmsgesturetap: ((this: Document, ev: Event) => any) | null;\n onmsinertiastart: ((this: Document, ev: Event) => any) | null;\n onmsmanipulationstatechanged: ((this: Document, ev: Event) => any) | null;\n onmspointercancel: ((this: Document, ev: Event) => any) | null;\n onmspointerdown: ((this: Document, ev: Event) => any) | null;\n onmspointerenter: ((this: Document, ev: Event) => any) | null;\n onmspointerleave: ((this: Document, ev: Event) => any) | null;\n onmspointermove: ((this: Document, ev: Event) => any) | null;\n onmspointerout: ((this: Document, ev: Event) => any) | null;\n onmspointerover: ((this: Document, ev: Event) => any) | null;\n onmspointerup: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when an item is removed from a Jump List of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmssitemodejumplistitemremoved: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when a user clicks a button in a Thumbnail Toolbar of a webpage running in Site Mode.\n * @param ev The event.\n */\n onmsthumbnailclick: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when playback is paused.\n * @param ev The event.\n */\n onpause: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the play method is requested.\n * @param ev The event.\n */\n onplay: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the audio or video has started playing.\n * @param ev The event.\n */\n onplaying: ((this: Document, ev: Event) => any) | null;\n onpointerlockchange: ((this: Document, ev: Event) => any) | null;\n onpointerlockerror: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs to indicate progress while downloading media data.\n * @param ev The event.\n */\n onprogress: ((this: Document, ev: ProgressEvent) => any) | null;\n /**\n * Occurs when the playback rate is increased or decreased.\n * @param ev The event.\n */\n onratechange: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the state of the object has changed.\n * @param ev The event\n */\n onreadystatechange: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user resets a form.\n * @param ev The event.\n */\n onreset: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user repositions the scroll box in the scroll bar on the object.\n * @param ev The event.\n */\n onscroll: ((this: Document, ev: UIEvent) => any) | null;\n /**\n * Occurs when the seek operation ends.\n * @param ev The event.\n */\n onseeked: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the current playback position is moved.\n * @param ev The event.\n */\n onseeking: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the current selection changes.\n * @param ev The event.\n */\n onselect: ((this: Document, ev: UIEvent) => any) | null;\n /**\n * Fires when the selection state of a document changes.\n * @param ev The event.\n */\n onselectionchange: ((this: Document, ev: Event) => any) | null;\n onselectstart: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when the download has stopped.\n * @param ev The event.\n */\n onstalled: ((this: Document, ev: Event) => any) | null;\n /**\n * Fires when the user clicks the Stop button or leaves the Web page.\n * @param ev The event.\n */\n onstop: ((this: Document, ev: Event) => any) | null;\n onsubmit: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs if the load operation has been intentionally halted.\n * @param ev The event.\n */\n onsuspend: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs to indicate the current playback position.\n * @param ev The event.\n */\n ontimeupdate: ((this: Document, ev: Event) => any) | null;\n ontouchcancel: ((this: Document, ev: Event) => any) | null;\n ontouchend: ((this: Document, ev: Event) => any) | null;\n ontouchmove: ((this: Document, ev: Event) => any) | null;\n ontouchstart: ((this: Document, ev: Event) => any) | null;\n onvisibilitychange: (this: Document, ev: Event) => any;\n /**\n * Occurs when the volume is changed, or playback is muted or unmuted.\n * @param ev The event.\n */\n onvolumechange: ((this: Document, ev: Event) => any) | null;\n /**\n * Occurs when playback stops because the next frame of a video resource is not available.\n * @param ev The event.\n */\n onwaiting: ((this: Document, ev: Event) => any) | null;\n onwebkitfullscreenchange: ((this: Document, ev: Event) => any) | null;\n onwebkitfullscreenerror: ((this: Document, ev: Event) => any) | null;\n readonly plugins: HTMLCollectionOf;\n readonly pointerLockElement: Element;\n /**\n * Retrieves a value that indicates the current state of the object.\n */\n readonly readyState: string;\n /**\n * Gets the URL of the location that referred the user to the current page.\n */\n readonly referrer: string;\n /**\n * Gets the root svg element in the document hierarchy.\n */\n readonly rootElement: SVGSVGElement;\n /**\n * Retrieves a collection of all script objects in the document.\n */\n readonly scripts: HTMLCollectionOf;\n readonly scrollingElement: Element | null;\n /**\n * Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document.\n */\n readonly styleSheets: StyleSheetList;\n /**\n * Contains the title of the document.\n */\n title: string;\n readonly visibilityState: VisibilityState;\n /**\n * Sets or gets the color of the links that the user has visited.\n */\n vlinkColor: string;\n readonly webkitCurrentFullScreenElement: Element | null;\n readonly webkitFullscreenElement: Element | null;\n readonly webkitFullscreenEnabled: boolean;\n readonly webkitIsFullScreen: boolean;\n readonly xmlEncoding: string | null;\n xmlStandalone: boolean;\n /**\n * Gets or sets the version attribute specified in the declaration of an XML document.\n */\n xmlVersion: string | null;\n adoptNode(source: T): T;\n captureEvents(): void;\n caretRangeFromPoint(x: number, y: number): Range;\n clear(): void;\n /**\n * Closes an output stream and forces the sent data to display.\n */\n close(): void;\n /**\n * Creates an attribute object with a specified name.\n * @param name String that sets the attribute object's name.\n */\n createAttribute(name: string): Attr;\n createAttributeNS(namespaceURI: string | null, qualifiedName: string): Attr;\n createCDATASection(data: string): CDATASection;\n /**\n * Creates a comment object with the specified data.\n * @param data Sets the comment object's data.\n */\n createComment(data: string): Comment;\n /**\n * Creates a new document.\n */\n createDocumentFragment(): DocumentFragment;\n /**\n * Creates an instance of the element for the specified tag.\n * @param tagName The name of an element.\n */\n createElement(tagName: K, options?: ElementCreationOptions): HTMLElementTagNameMap[K];\n createElement(tagName: string, options?: ElementCreationOptions): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", qualifiedName: string): HTMLElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"a\"): SVGAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"circle\"): SVGCircleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"clipPath\"): SVGClipPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"componentTransferFunction\"): SVGComponentTransferFunctionElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"defs\"): SVGDefsElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"desc\"): SVGDescElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"ellipse\"): SVGEllipseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feBlend\"): SVGFEBlendElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feColorMatrix\"): SVGFEColorMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComponentTransfer\"): SVGFEComponentTransferElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feComposite\"): SVGFECompositeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feConvolveMatrix\"): SVGFEConvolveMatrixElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDiffuseLighting\"): SVGFEDiffuseLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDisplacementMap\"): SVGFEDisplacementMapElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feDistantLight\"): SVGFEDistantLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFlood\"): SVGFEFloodElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncA\"): SVGFEFuncAElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncB\"): SVGFEFuncBElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncG\"): SVGFEFuncGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feFuncR\"): SVGFEFuncRElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feGaussianBlur\"): SVGFEGaussianBlurElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feImage\"): SVGFEImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMerge\"): SVGFEMergeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMergeNode\"): SVGFEMergeNodeElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feMorphology\"): SVGFEMorphologyElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feOffset\"): SVGFEOffsetElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"fePointLight\"): SVGFEPointLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpecularLighting\"): SVGFESpecularLightingElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feSpotLight\"): SVGFESpotLightElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTile\"): SVGFETileElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"feTurbulence\"): SVGFETurbulenceElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"filter\"): SVGFilterElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"foreignObject\"): SVGForeignObjectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"g\"): SVGGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"image\"): SVGImageElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"gradient\"): SVGGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"line\"): SVGLineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"linearGradient\"): SVGLinearGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"marker\"): SVGMarkerElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"mask\"): SVGMaskElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"path\"): SVGPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"metadata\"): SVGMetadataElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"pattern\"): SVGPatternElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polygon\"): SVGPolygonElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"polyline\"): SVGPolylineElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"radialGradient\"): SVGRadialGradientElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"rect\"): SVGRectElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"svg\"): SVGSVGElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"script\"): SVGScriptElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"stop\"): SVGStopElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"style\"): SVGStyleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"switch\"): SVGSwitchElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"symbol\"): SVGSymbolElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"tspan\"): SVGTSpanElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textContent\"): SVGTextContentElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"text\"): SVGTextElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPath\"): SVGTextPathElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"textPositioning\"): SVGTextPositioningElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"title\"): SVGTitleElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"use\"): SVGUseElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: \"view\"): SVGViewElement;\n createElementNS(namespaceURI: \"http://www.w3.org/2000/svg\", qualifiedName: string): SVGElement;\n createElementNS(namespaceURI: string | null, qualifiedName: string): Element;\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n createNSResolver(nodeResolver: Node): XPathNSResolver;\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list\n * @param filter A custom NodeFilter function to use. For more information, see filter. Use null for no filter.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createNodeIterator(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): NodeIterator;\n createProcessingInstruction(target: string, data: string): ProcessingInstruction;\n /**\n * Returns an empty range object that has both of its boundary points positioned at the beginning of the document.\n */\n createRange(): Range;\n /**\n * Creates a text string from the specified value.\n * @param data String that specifies the nodeValue property of the text node.\n */\n createTextNode(data: string): Text;\n createTouch(view: Window, target: EventTarget, identifier: number, pageX: number, pageY: number, screenX: number, screenY: number): Touch;\n createTouchList(...touches: Touch[]): TouchList;\n /**\n * Creates a TreeWalker object that you can use to traverse filtered lists of nodes or elements in a document.\n * @param root The root element or node to start traversing on.\n * @param whatToShow The type of nodes or elements to appear in the node list. For more information, see whatToShow.\n * @param filter A custom NodeFilter function to use.\n * @param entityReferenceExpansion A flag that specifies whether entity reference nodes are expanded.\n */\n createTreeWalker(root: Node, whatToShow?: number, filter?: NodeFilter, entityReferenceExpansion?: boolean): TreeWalker;\n /**\n * Returns the element for the specified x coordinate and the specified y coordinate.\n * @param x The x-offset\n * @param y The y-offset\n */\n elementFromPoint(x: number, y: number): Element;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n /**\n * Executes a command on the current document, current selection, or the given range.\n * @param commandId String that specifies the command to execute. This command can be any of the command identifiers that can be executed in script.\n * @param showUI Display the user interface, defaults to false.\n * @param value Value to assign.\n */\n execCommand(commandId: string, showUI?: boolean, value?: any): boolean;\n /**\n * Displays help information for the given command identifier.\n * @param commandId Displays help information for the given command identifier.\n */\n execCommandShowHelp(commandId: string): boolean;\n exitFullscreen(): void;\n exitPointerLock(): void;\n /**\n * Causes the element to receive the focus and executes the code specified by the onfocus event.\n */\n /** @deprecated */\n focus(): void;\n /**\n * Returns a reference to the first object with the specified value of the ID or NAME attribute.\n * @param elementId String that specifies the ID value. Case-insensitive.\n */\n getElementById(elementId: string): HTMLElement | null;\n getElementsByClassName(classNames: string): HTMLCollectionOf;\n /**\n * Gets a collection of objects based on the value of the NAME or ID attribute.\n * @param elementName Gets a collection of objects based on the value of the NAME or ID attribute.\n */\n getElementsByName(elementName: string): NodeListOf;\n /**\n * Retrieves a collection of objects based on the specified element name.\n * @param name Specifies the name of an element.\n */\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: K): NodeListOf;\n getElementsByTagName(tagname: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n /**\n * Returns an object representing the current selection of the document that is loaded into the object displaying a webpage.\n */\n getSelection(): Selection;\n /**\n * Gets a value indicating whether the object currently has focus.\n */\n hasFocus(): boolean;\n importNode(importedNode: T, deep: boolean): T;\n msElementsFromPoint(x: number, y: number): NodeListOf;\n msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf;\n /**\n * Opens a new window and loads a document specified by a given URL. Also, opens a new window that uses the url parameter and the name parameter to collect the output of the write method and the writeln method.\n * @param url Specifies a MIME type for the document.\n * @param name Specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element.\n * @param features Contains a list of items separated by commas. Each item consists of an option and a value, separated by an equals sign (for example, \"fullscreen=yes, toolbar=yes\"). The following values are supported.\n * @param replace Specifies whether the existing entry for the document is replaced in the history list.\n */\n open(url?: string, name?: string, features?: string, replace?: boolean): Document;\n /**\n * Returns a Boolean value that indicates whether a specified command can be successfully executed using execCommand, given the current state of the document.\n * @param commandId Specifies a command identifier.\n */\n queryCommandEnabled(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the specified command is in the indeterminate state.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandIndeterm(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates the current state of the command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandState(commandId: string): boolean;\n /**\n * Returns a Boolean value that indicates whether the current command is supported on the current range.\n * @param commandId Specifies a command identifier.\n */\n queryCommandSupported(commandId: string): boolean;\n /**\n * Retrieves the string associated with a command.\n * @param commandId String that contains the identifier of a command. This can be any command identifier given in the list of Command Identifiers.\n */\n queryCommandText(commandId: string): string;\n /**\n * Returns the current value of the document, range, or current selection for the given command.\n * @param commandId String that specifies a command identifier.\n */\n queryCommandValue(commandId: string): string;\n releaseEvents(): void;\n webkitCancelFullScreen(): void;\n webkitExitFullscreen(): void;\n /**\n * Writes one or more HTML expressions to a document in the specified window.\n * @param content Specifies the text and HTML tags to write.\n */\n write(...content: string[]): void;\n /**\n * Writes one or more HTML expressions, followed by a carriage return, to a document in the specified window.\n * @param content The text and HTML tags to write.\n */\n writeln(...content: string[]): void;\n addEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Document: {\n prototype: Document;\n new(): Document;\n};\n\ninterface DocumentEvent {\n createEvent(eventInterface: \"AnimationEvent\"): AnimationEvent;\n createEvent(eventInterface: \"AnimationPlaybackEvent\"): AnimationPlaybackEvent;\n createEvent(eventInterface: \"AudioProcessingEvent\"): AudioProcessingEvent;\n createEvent(eventInterface: \"BeforeUnloadEvent\"): BeforeUnloadEvent;\n createEvent(eventInterface: \"ClipboardEvent\"): ClipboardEvent;\n createEvent(eventInterface: \"CloseEvent\"): CloseEvent;\n createEvent(eventInterface: \"CompositionEvent\"): CompositionEvent;\n createEvent(eventInterface: \"CustomEvent\"): CustomEvent;\n createEvent(eventInterface: \"DeviceLightEvent\"): DeviceLightEvent;\n createEvent(eventInterface: \"DeviceMotionEvent\"): DeviceMotionEvent;\n createEvent(eventInterface: \"DeviceOrientationEvent\"): DeviceOrientationEvent;\n createEvent(eventInterface: \"DragEvent\"): DragEvent;\n createEvent(eventInterface: \"ErrorEvent\"): ErrorEvent;\n createEvent(eventInterface: \"Event\"): Event;\n createEvent(eventInterface: \"Events\"): Event;\n createEvent(eventInterface: \"FocusEvent\"): FocusEvent;\n createEvent(eventInterface: \"FocusNavigationEvent\"): FocusNavigationEvent;\n createEvent(eventInterface: \"GamepadEvent\"): GamepadEvent;\n createEvent(eventInterface: \"HashChangeEvent\"): HashChangeEvent;\n createEvent(eventInterface: \"IDBVersionChangeEvent\"): IDBVersionChangeEvent;\n createEvent(eventInterface: \"KeyboardEvent\"): KeyboardEvent;\n createEvent(eventInterface: \"ListeningStateChangedEvent\"): ListeningStateChangedEvent;\n createEvent(eventInterface: \"MSDCCEvent\"): MSDCCEvent;\n createEvent(eventInterface: \"MSDSHEvent\"): MSDSHEvent;\n createEvent(eventInterface: \"MSMediaKeyMessageEvent\"): MSMediaKeyMessageEvent;\n createEvent(eventInterface: \"MSMediaKeyNeededEvent\"): MSMediaKeyNeededEvent;\n createEvent(eventInterface: \"MediaEncryptedEvent\"): MediaEncryptedEvent;\n createEvent(eventInterface: \"MediaKeyMessageEvent\"): MediaKeyMessageEvent;\n createEvent(eventInterface: \"MediaStreamErrorEvent\"): MediaStreamErrorEvent;\n createEvent(eventInterface: \"MediaStreamEvent\"): MediaStreamEvent;\n createEvent(eventInterface: \"MediaStreamTrackEvent\"): MediaStreamTrackEvent;\n createEvent(eventInterface: \"MessageEvent\"): MessageEvent;\n createEvent(eventInterface: \"MouseEvent\"): MouseEvent;\n createEvent(eventInterface: \"MouseEvents\"): MouseEvent;\n createEvent(eventInterface: \"MutationEvent\"): MutationEvent;\n createEvent(eventInterface: \"MutationEvents\"): MutationEvent;\n createEvent(eventInterface: \"OfflineAudioCompletionEvent\"): OfflineAudioCompletionEvent;\n createEvent(eventInterface: \"OverflowEvent\"): OverflowEvent;\n createEvent(eventInterface: \"PageTransitionEvent\"): PageTransitionEvent;\n createEvent(eventInterface: \"PaymentRequestUpdateEvent\"): PaymentRequestUpdateEvent;\n createEvent(eventInterface: \"PermissionRequestedEvent\"): PermissionRequestedEvent;\n createEvent(eventInterface: \"PointerEvent\"): PointerEvent;\n createEvent(eventInterface: \"PopStateEvent\"): PopStateEvent;\n createEvent(eventInterface: \"ProgressEvent\"): ProgressEvent;\n createEvent(eventInterface: \"PromiseRejectionEvent\"): PromiseRejectionEvent;\n createEvent(eventInterface: \"RTCDTMFToneChangeEvent\"): RTCDTMFToneChangeEvent;\n createEvent(eventInterface: \"RTCDtlsTransportStateChangedEvent\"): RTCDtlsTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCIceCandidatePairChangedEvent\"): RTCIceCandidatePairChangedEvent;\n createEvent(eventInterface: \"RTCIceGathererEvent\"): RTCIceGathererEvent;\n createEvent(eventInterface: \"RTCIceTransportStateChangedEvent\"): RTCIceTransportStateChangedEvent;\n createEvent(eventInterface: \"RTCPeerConnectionIceEvent\"): RTCPeerConnectionIceEvent;\n createEvent(eventInterface: \"RTCSsrcConflictEvent\"): RTCSsrcConflictEvent;\n createEvent(eventInterface: \"SVGZoomEvent\"): SVGZoomEvent;\n createEvent(eventInterface: \"SVGZoomEvents\"): SVGZoomEvent;\n createEvent(eventInterface: \"SecurityPolicyViolationEvent\"): SecurityPolicyViolationEvent;\n createEvent(eventInterface: \"ServiceWorkerMessageEvent\"): ServiceWorkerMessageEvent;\n createEvent(eventInterface: \"SpeechSynthesisEvent\"): SpeechSynthesisEvent;\n createEvent(eventInterface: \"StorageEvent\"): StorageEvent;\n createEvent(eventInterface: \"TextEvent\"): TextEvent;\n createEvent(eventInterface: \"TrackEvent\"): TrackEvent;\n createEvent(eventInterface: \"TransitionEvent\"): TransitionEvent;\n createEvent(eventInterface: \"UIEvent\"): UIEvent;\n createEvent(eventInterface: \"UIEvents\"): UIEvent;\n createEvent(eventInterface: \"VRDisplayEvent\"): VRDisplayEvent;\n createEvent(eventInterface: \"VRDisplayEvent \"): VRDisplayEvent ;\n createEvent(eventInterface: \"WebGLContextEvent\"): WebGLContextEvent;\n createEvent(eventInterface: \"WheelEvent\"): WheelEvent;\n createEvent(eventInterface: string): Event;\n}\n\ninterface DocumentFragment extends Node, ParentNode {\n getElementById(elementId: string): HTMLElement | null;\n}\n\ndeclare var DocumentFragment: {\n prototype: DocumentFragment;\n new(): DocumentFragment;\n};\n\ninterface DocumentOrShadowRoot {\n readonly activeElement: Element | null;\n readonly styleSheets: StyleSheetList;\n elementFromPoint(x: number, y: number): Element | null;\n elementsFromPoint(x: number, y: number): Element[];\n getSelection(): Selection | null;\n}\n\ninterface DocumentType extends Node, ChildNode {\n readonly entities: NamedNodeMap;\n readonly internalSubset: string | null;\n readonly name: string;\n readonly notations: NamedNodeMap;\n readonly publicId: string;\n readonly systemId: string;\n}\n\ndeclare var DocumentType: {\n prototype: DocumentType;\n new(): DocumentType;\n};\n\ninterface DragEvent extends MouseEvent {\n readonly dataTransfer: DataTransfer;\n initDragEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, dataTransferArg: DataTransfer): void;\n msConvertURL(file: File, targetType: string, targetURL?: string): void;\n}\n\ndeclare var DragEvent: {\n prototype: DragEvent;\n new(type: \"drag\" | \"dragend\" | \"dragenter\" | \"dragexit\" | \"dragleave\" | \"dragover\" | \"dragstart\" | \"drop\", dragEventInit?: { dataTransfer?: DataTransfer }): DragEvent;\n};\n\ninterface DynamicsCompressorNode extends AudioNode {\n readonly attack: AudioParam;\n readonly knee: AudioParam;\n readonly ratio: AudioParam;\n readonly reduction: number;\n readonly release: AudioParam;\n readonly threshold: AudioParam;\n}\n\ndeclare var DynamicsCompressorNode: {\n prototype: DynamicsCompressorNode;\n new(): DynamicsCompressorNode;\n};\n\ninterface EXT_blend_minmax {\n readonly MAX_EXT: number;\n readonly MIN_EXT: number;\n}\n\ninterface EXT_frag_depth {\n}\n\ninterface EXT_sRGB {\n readonly FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT: number;\n readonly SRGB8_ALPHA8_EXT: number;\n readonly SRGB_ALPHA_EXT: number;\n readonly SRGB_EXT: number;\n}\n\ninterface EXT_shader_texture_lod {\n}\n\ninterface EXT_texture_filter_anisotropic {\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n}\n\ndeclare var EXT_texture_filter_anisotropic: {\n prototype: EXT_texture_filter_anisotropic;\n new(): EXT_texture_filter_anisotropic;\n readonly MAX_TEXTURE_MAX_ANISOTROPY_EXT: number;\n readonly TEXTURE_MAX_ANISOTROPY_EXT: number;\n};\n\ninterface ElementEventMap extends GlobalEventHandlersEventMap {\n \"ariarequest\": Event;\n \"command\": Event;\n \"gotpointercapture\": PointerEvent;\n \"lostpointercapture\": PointerEvent;\n \"MSGestureChange\": Event;\n \"MSGestureDoubleTap\": Event;\n \"MSGestureEnd\": Event;\n \"MSGestureHold\": Event;\n \"MSGestureStart\": Event;\n \"MSGestureTap\": Event;\n \"MSGotPointerCapture\": Event;\n \"MSInertiaStart\": Event;\n \"MSLostPointerCapture\": Event;\n \"MSPointerCancel\": Event;\n \"MSPointerDown\": Event;\n \"MSPointerEnter\": Event;\n \"MSPointerLeave\": Event;\n \"MSPointerMove\": Event;\n \"MSPointerOut\": Event;\n \"MSPointerOver\": Event;\n \"MSPointerUp\": Event;\n \"touchcancel\": Event;\n \"touchend\": Event;\n \"touchmove\": Event;\n \"touchstart\": Event;\n \"webkitfullscreenchange\": Event;\n \"webkitfullscreenerror\": Event;\n}\n\ninterface Element extends Node, GlobalEventHandlers, ElementTraversal, ParentNode, ChildNode {\n readonly assignedSlot: HTMLSlotElement | null;\n readonly attributes: NamedNodeMap;\n readonly classList: DOMTokenList;\n className: string;\n readonly clientHeight: number;\n readonly clientLeft: number;\n readonly clientTop: number;\n readonly clientWidth: number;\n id: string;\n innerHTML: string;\n msContentZoomFactor: number;\n readonly msRegionOverflow: string;\n onariarequest: ((this: Element, ev: Event) => any) | null;\n oncommand: ((this: Element, ev: Event) => any) | null;\n ongotpointercapture: ((this: Element, ev: PointerEvent) => any) | null;\n onlostpointercapture: ((this: Element, ev: PointerEvent) => any) | null;\n onmsgesturechange: ((this: Element, ev: Event) => any) | null;\n onmsgesturedoubletap: ((this: Element, ev: Event) => any) | null;\n onmsgestureend: ((this: Element, ev: Event) => any) | null;\n onmsgesturehold: ((this: Element, ev: Event) => any) | null;\n onmsgesturestart: ((this: Element, ev: Event) => any) | null;\n onmsgesturetap: ((this: Element, ev: Event) => any) | null;\n onmsgotpointercapture: ((this: Element, ev: Event) => any) | null;\n onmsinertiastart: ((this: Element, ev: Event) => any) | null;\n onmslostpointercapture: ((this: Element, ev: Event) => any) | null;\n onmspointercancel: ((this: Element, ev: Event) => any) | null;\n onmspointerdown: ((this: Element, ev: Event) => any) | null;\n onmspointerenter: ((this: Element, ev: Event) => any) | null;\n onmspointerleave: ((this: Element, ev: Event) => any) | null;\n onmspointermove: ((this: Element, ev: Event) => any) | null;\n onmspointerout: ((this: Element, ev: Event) => any) | null;\n onmspointerover: ((this: Element, ev: Event) => any) | null;\n onmspointerup: ((this: Element, ev: Event) => any) | null;\n ontouchcancel: ((this: Element, ev: Event) => any) | null;\n ontouchend: ((this: Element, ev: Event) => any) | null;\n ontouchmove: ((this: Element, ev: Event) => any) | null;\n ontouchstart: ((this: Element, ev: Event) => any) | null;\n onwebkitfullscreenchange: ((this: Element, ev: Event) => any) | null;\n onwebkitfullscreenerror: ((this: Element, ev: Event) => any) | null;\n outerHTML: string;\n readonly prefix: string | null;\n readonly scrollHeight: number;\n scrollLeft: number;\n scrollTop: number;\n readonly scrollWidth: number;\n readonly shadowRoot: ShadowRoot | null;\n slot: string;\n readonly tagName: string;\n attachShadow(shadowRootInitDict: ShadowRootInit): ShadowRoot;\n closest(selector: K): HTMLElementTagNameMap[K] | null;\n closest(selector: K): SVGElementTagNameMap[K] | null;\n closest(selector: string): Element | null;\n getAttribute(qualifiedName: string): string | null;\n getAttributeNS(namespaceURI: string, localName: string): string;\n getAttributeNode(name: string): Attr | null;\n getAttributeNodeNS(namespaceURI: string, localName: string): Attr | null;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n getElementsByClassName(classNames: string): NodeListOf;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: K): NodeListOf;\n getElementsByTagName(name: string): NodeListOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/1999/xhtml\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: \"http://www.w3.org/2000/svg\", localName: string): HTMLCollectionOf;\n getElementsByTagNameNS(namespaceURI: string, localName: string): HTMLCollectionOf;\n hasAttribute(name: string): boolean;\n hasAttributeNS(namespaceURI: string, localName: string): boolean;\n hasAttributes(): boolean;\n insertAdjacentElement(position: InsertPosition, insertedElement: Element): Element | null;\n insertAdjacentHTML(where: InsertPosition, html: string): void;\n insertAdjacentText(where: InsertPosition, text: string): void;\n matches(selectors: string): boolean;\n msGetRegionContent(): any;\n msGetUntransformedBounds(): ClientRect;\n msMatchesSelector(selectors: string): boolean;\n msReleasePointerCapture(pointerId: number): void;\n msSetPointerCapture(pointerId: number): void;\n msZoomTo(args: MsZoomToOptions): void;\n releasePointerCapture(pointerId: number): void;\n removeAttribute(qualifiedName: string): void;\n removeAttributeNS(namespaceURI: string, localName: string): void;\n removeAttributeNode(oldAttr: Attr): Attr;\n requestFullscreen(): void;\n requestPointerLock(): void;\n scroll(options?: ScrollToOptions): void;\n scroll(x: number, y: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x: number, y: number): void;\n scrollIntoView(arg?: boolean | ScrollIntoViewOptions): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x: number, y: number): void;\n setAttribute(qualifiedName: string, value: string): void;\n setAttributeNS(namespaceURI: string, qualifiedName: string, value: string): void;\n setAttributeNode(newAttr: Attr): Attr;\n setAttributeNodeNS(newAttr: Attr): Attr;\n setPointerCapture(pointerId: number): void;\n webkitMatchesSelector(selectors: string): boolean;\n webkitRequestFullScreen(): void;\n webkitRequestFullscreen(): void;\n addEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Element, ev: ElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Element: {\n prototype: Element;\n new(): Element;\n};\n\ninterface ElementCSSInlineStyle {\n readonly style: CSSStyleDeclaration;\n}\n\ninterface ElementCreationOptions {\n is?: string;\n}\n\ninterface ElementDefinitionOptions {\n extends: string;\n}\n\ninterface ElementTraversal {\n readonly childElementCount: number;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n readonly nextElementSibling: Element | null;\n readonly previousElementSibling: Element | null;\n}\n\ninterface ErrorEvent extends Event {\n readonly colno: number;\n readonly error: any;\n readonly filename: string;\n readonly lineno: number;\n readonly message: string;\n initErrorEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, messageArg: string, filenameArg: string, linenoArg: number): void;\n}\n\ndeclare var ErrorEvent: {\n prototype: ErrorEvent;\n new(typeArg: string, eventInitDict?: ErrorEventInit): ErrorEvent;\n};\n\ninterface Event {\n readonly bubbles: boolean;\n cancelBubble: boolean;\n readonly cancelable: boolean;\n readonly currentTarget: EventTarget | null;\n readonly defaultPrevented: boolean;\n readonly eventPhase: number;\n readonly isTrusted: boolean;\n returnValue: boolean;\n readonly scoped: boolean;\n readonly srcElement: Element | null;\n readonly target: EventTarget | null;\n readonly timeStamp: number;\n readonly type: string;\n deepPath(): EventTarget[];\n initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;\n preventDefault(): void;\n stopImmediatePropagation(): void;\n stopPropagation(): void;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n readonly NONE: number;\n}\n\ndeclare var Event: {\n prototype: Event;\n new(typeArg: string, eventInitDict?: EventInit): Event;\n readonly AT_TARGET: number;\n readonly BUBBLING_PHASE: number;\n readonly CAPTURING_PHASE: number;\n readonly NONE: number;\n};\n\ninterface EventListenerObject {\n handleEvent(evt: Event): void;\n}\n\ninterface EventSource extends EventTarget {\n readonly CLOSED: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n onerror: (evt: MessageEvent) => any;\n onmessage: (evt: MessageEvent) => any;\n onopen: (evt: MessageEvent) => any;\n readonly readyState: number;\n readonly url: string;\n readonly withCredentials: boolean;\n close(): void;\n}\n\ndeclare var EventSource: {\n prototype: EventSource;\n new(url: string, eventSourceInitDict?: EventSourceInit): EventSource;\n};\n\ninterface EventSourceInit {\n readonly withCredentials: boolean;\n}\n\ninterface EventTarget {\n addEventListener(type: string, listener: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;\n dispatchEvent(evt: Event): boolean;\n removeEventListener(type: string, listener?: EventListenerOrEventListenerObject | null, options?: EventListenerOptions | boolean): void;\n}\n\ndeclare var EventTarget: {\n prototype: EventTarget;\n new(): EventTarget;\n};\n\ninterface ExtensionScriptApis {\n extensionIdToShortId(extensionId: string): number;\n fireExtensionApiTelemetry(functionName: string, isSucceeded: boolean, isSupported: boolean, errorString: string): void;\n genericFunction(routerAddress: any, parameters?: string, callbackId?: number): void;\n genericSynchronousFunction(functionId: number, parameters?: string): string;\n genericWebRuntimeCallout(to: any, from: any, payload: string): void;\n getExtensionId(): string;\n registerGenericFunctionCallbackHandler(callbackHandler: Function): void;\n registerGenericPersistentCallbackHandler(callbackHandler: Function): void;\n registerWebRuntimeCallbackHandler(handler: Function): any;\n}\n\ndeclare var ExtensionScriptApis: {\n prototype: ExtensionScriptApis;\n new(): ExtensionScriptApis;\n};\n\ninterface External {\n}\n\ndeclare var External: {\n prototype: External;\n new(): External;\n};\n\ninterface File extends Blob {\n readonly lastModified: number;\n /** @deprecated */\n readonly lastModifiedDate: Date;\n readonly name: string;\n readonly webkitRelativePath: string;\n}\n\ndeclare var File: {\n prototype: File;\n new (parts: (ArrayBuffer | ArrayBufferView | Blob | string)[], filename: string, properties?: FilePropertyBag): File;\n};\n\ninterface FileList {\n readonly length: number;\n item(index: number): File | null;\n [index: number]: File;\n}\n\ndeclare var FileList: {\n prototype: FileList;\n new(): FileList;\n};\n\ninterface FilePropertyBag extends BlobPropertyBag {\n lastModified?: number;\n}\n\ninterface FileReaderEventMap {\n \"abort\": ProgressEvent;\n \"error\": ProgressEvent;\n \"load\": ProgressEvent;\n \"loadend\": ProgressEvent;\n \"loadstart\": ProgressEvent;\n \"progress\": ProgressEvent;\n}\n\ninterface FileReader extends EventTarget {\n readonly error: DOMException | null;\n onabort: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onerror: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onload: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onloadend: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: FileReader, ev: ProgressEvent) => any) | null;\n onprogress: ((this: FileReader, ev: ProgressEvent) => any) | null;\n readonly readyState: number;\n readonly result: any;\n abort(): void;\n readAsArrayBuffer(blob: Blob): void;\n readAsBinaryString(blob: Blob): void;\n readAsDataURL(blob: Blob): void;\n readAsText(blob: Blob, label?: string): void;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n addEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: FileReader, ev: FileReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var FileReader: {\n prototype: FileReader;\n new(): FileReader;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n};\n\ninterface FocusEvent extends UIEvent {\n readonly relatedTarget: EventTarget;\n initFocusEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, relatedTargetArg: EventTarget): void;\n}\n\ndeclare var FocusEvent: {\n prototype: FocusEvent;\n new(typeArg: string, eventInitDict?: FocusEventInit): FocusEvent;\n};\n\ninterface FocusNavigationEvent extends Event {\n readonly navigationReason: NavigationReason;\n readonly originHeight: number;\n readonly originLeft: number;\n readonly originTop: number;\n readonly originWidth: number;\n requestFocus(): void;\n}\n\ndeclare var FocusNavigationEvent: {\n prototype: FocusNavigationEvent;\n new(type: string, eventInitDict?: FocusNavigationEventInit): FocusNavigationEvent;\n};\n\ninterface FormData {\n append(name: string, value: string | Blob, fileName?: string): void;\n delete(name: string): void;\n get(name: string): FormDataEntryValue | null;\n getAll(name: string): FormDataEntryValue[];\n has(name: string): boolean;\n set(name: string, value: string | Blob, fileName?: string): void;\n}\n\ndeclare var FormData: {\n prototype: FormData;\n new(): FormData;\n new(form: HTMLFormElement): FormData;\n};\n\ninterface GainNode extends AudioNode {\n readonly gain: AudioParam;\n}\n\ndeclare var GainNode: {\n prototype: GainNode;\n new(): GainNode;\n};\n\ninterface Gamepad {\n readonly axes: number[];\n readonly buttons: GamepadButton[];\n readonly connected: boolean;\n readonly displayId: number;\n readonly hand: GamepadHand;\n readonly hapticActuators: GamepadHapticActuator[];\n readonly id: string;\n readonly index: number;\n readonly mapping: GamepadMappingType;\n readonly pose: GamepadPose | null;\n readonly timestamp: number;\n}\n\ndeclare var Gamepad: {\n prototype: Gamepad;\n new(): Gamepad;\n};\n\ninterface GamepadButton {\n readonly pressed: boolean;\n readonly touched: boolean;\n readonly value: number;\n}\n\ndeclare var GamepadButton: {\n prototype: GamepadButton;\n new(): GamepadButton;\n};\n\ninterface GamepadEvent extends Event {\n readonly gamepad: Gamepad;\n}\n\ndeclare var GamepadEvent: {\n prototype: GamepadEvent;\n new(typeArg: string, eventInitDict?: GamepadEventInit): GamepadEvent;\n};\n\ninterface GamepadHapticActuator {\n readonly type: GamepadHapticActuatorType;\n pulse(value: number, duration: number): Promise;\n}\n\ndeclare var GamepadHapticActuator: {\n prototype: GamepadHapticActuator;\n new(): GamepadHapticActuator;\n};\n\ninterface GamepadPose {\n readonly angularAcceleration: Float32Array | null;\n readonly angularVelocity: Float32Array | null;\n readonly hasOrientation: boolean;\n readonly hasPosition: boolean;\n readonly linearAcceleration: Float32Array | null;\n readonly linearVelocity: Float32Array | null;\n readonly orientation: Float32Array | null;\n readonly position: Float32Array | null;\n}\n\ndeclare var GamepadPose: {\n prototype: GamepadPose;\n new(): GamepadPose;\n};\n\ninterface Geolocation {\n clearWatch(watchId: number): void;\n getCurrentPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): void;\n watchPosition(successCallback: PositionCallback, errorCallback?: PositionErrorCallback, options?: PositionOptions): number;\n}\n\ndeclare var Geolocation: {\n prototype: Geolocation;\n new(): Geolocation;\n};\n\ninterface GetSVGDocument {\n getSVGDocument(): Document;\n}\n\ninterface GlobalEventHandlersEventMap {\n \"pointercancel\": PointerEvent;\n \"pointerdown\": PointerEvent;\n \"pointerenter\": PointerEvent;\n \"pointerleave\": PointerEvent;\n \"pointermove\": PointerEvent;\n \"pointerout\": PointerEvent;\n \"pointerover\": PointerEvent;\n \"pointerup\": PointerEvent;\n \"wheel\": WheelEvent;\n}\n\ninterface GlobalEventHandlers {\n onpointercancel: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerdown: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerenter: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerleave: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointermove: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerout: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerover: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onpointerup: ((this: GlobalEventHandlers, ev: PointerEvent) => any) | null;\n onwheel: ((this: GlobalEventHandlers, ev: WheelEvent) => any) | null;\n addEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: GlobalEventHandlers, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface GlobalFetch {\n fetch(input?: Request | string, init?: RequestInit): Promise;\n}\n\ninterface HTMLAllCollection {\n readonly length: number;\n item(nameOrIndex?: string): HTMLCollection | Element | null;\n namedItem(name: string): HTMLCollection | Element | null;\n [index: number]: Element;\n}\n\ndeclare var HTMLAllCollection: {\n prototype: HTMLAllCollection;\n new(): HTMLAllCollection;\n};\n\ninterface HTMLAnchorElement extends HTMLElement, HTMLHyperlinkElementUtils {\n Methods: string;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n /** @deprecated */\n coords: string;\n download: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n readonly mimeType: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n name: string;\n readonly nameProp: string;\n readonly protocolLong: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n /** @deprecated */\n rev: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n type: string;\n urn: string;\n addEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAnchorElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAnchorElement: {\n prototype: HTMLAnchorElement;\n new(): HTMLAnchorElement;\n};\n\ninterface HTMLAppletElement extends HTMLElement {\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n /** @deprecated */\n alt: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n /** @deprecated */\n archive: string;\n /** @deprecated */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n /** @deprecated */\n codeBase: string;\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n /** @deprecated */\n height: string;\n /** @deprecated */\n hspace: number;\n /**\n * Sets or retrieves the shape of the object.\n */\n /** @deprecated */\n name: string;\n /** @deprecated */\n object: string;\n /** @deprecated */\n vspace: number;\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAppletElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAppletElement: {\n prototype: HTMLAppletElement;\n new(): HTMLAppletElement;\n};\n\ninterface HTMLAreaElement extends HTMLElement, HTMLHyperlinkElementUtils {\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Sets or retrieves the coordinates of the object.\n */\n coords: string;\n download: string;\n /**\n * Sets or gets whether clicks in this region cause action.\n */\n /** @deprecated */\n noHref: boolean;\n rel: string;\n /**\n * Sets or retrieves the shape of the object.\n */\n shape: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAreaElement: {\n prototype: HTMLAreaElement;\n new(): HTMLAreaElement;\n};\n\ninterface HTMLAreasCollection extends HTMLCollectionBase {\n}\n\ndeclare var HTMLAreasCollection: {\n prototype: HTMLAreasCollection;\n new(): HTMLAreasCollection;\n};\n\ninterface HTMLAudioElement extends HTMLMediaElement {\n addEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLAudioElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLAudioElement: {\n prototype: HTMLAudioElement;\n new(): HTMLAudioElement;\n};\n\ninterface HTMLBRElement extends HTMLElement {\n /**\n * Sets or retrieves the side on which floating objects are not to be positioned when any IHTMLBlockElement is inserted into the document.\n */\n /** @deprecated */\n clear: string;\n addEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBRElement: {\n prototype: HTMLBRElement;\n new(): HTMLBRElement;\n};\n\ninterface HTMLBaseElement extends HTMLElement {\n /**\n * Gets or sets the baseline URL on which relative links are based.\n */\n href: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n addEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseElement: {\n prototype: HTMLBaseElement;\n new(): HTMLBaseElement;\n};\n\ninterface HTMLBaseFontElement extends HTMLElement, DOML2DeprecatedColorProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n /** @deprecated */\n face: string;\n /**\n * Sets or retrieves the font size of the object.\n */\n /** @deprecated */\n size: number;\n addEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBaseFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBaseFontElement: {\n prototype: HTMLBaseFontElement;\n new(): HTMLBaseFontElement;\n};\n\ninterface HTMLBodyElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"load\": Event;\n \"orientationchange\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n}\n\ninterface HTMLBodyElement extends HTMLElement, WindowEventHandlers {\n /** @deprecated */\n aLink: string;\n /** @deprecated */\n background: string;\n /** @deprecated */\n bgColor: string;\n bgProperties: string;\n /** @deprecated */\n link: string;\n /** @deprecated */\n noWrap: boolean;\n onorientationchange: ((this: HTMLBodyElement, ev: Event) => any) | null;\n onresize: ((this: HTMLBodyElement, ev: UIEvent) => any) | null;\n /** @deprecated */\n text: string;\n /** @deprecated */\n vLink: string;\n addEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLBodyElement, ev: HTMLBodyElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLBodyElement: {\n prototype: HTMLBodyElement;\n new(): HTMLBodyElement;\n};\n\ninterface HTMLButtonElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: boolean;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n status: any;\n /**\n * Gets the classification and default behavior of the button.\n */\n type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the default or selected value of the control.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLButtonElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLButtonElement: {\n prototype: HTMLButtonElement;\n new(): HTMLButtonElement;\n};\n\ninterface HTMLCanvasElement extends HTMLElement {\n /**\n * Gets or sets the height of a canvas element on a document.\n */\n height: number;\n /**\n * Gets or sets the width of a canvas element on a document.\n */\n width: number;\n /**\n * Returns an object that provides methods and properties for drawing and manipulating images and graphics on a canvas element in a document. A context object includes information about colors, line widths, fonts, and other graphic parameters that can be drawn on a canvas.\n * @param contextId The identifier (ID) of the type of canvas to create. Internet Explorer 9 and Internet Explorer 10 support only a 2-D context using canvas.getContext(\"2d\"); IE11 Preview also supports 3-D or WebGL context using canvas.getContext(\"experimental-webgl\");\n */\n getContext(contextId: \"2d\", contextAttributes?: Canvas2DContextAttributes): CanvasRenderingContext2D | null;\n getContext(contextId: \"webgl\" | \"experimental-webgl\", contextAttributes?: WebGLContextAttributes): WebGLRenderingContext | null;\n getContext(contextId: string, contextAttributes?: {}): CanvasRenderingContext2D | WebGLRenderingContext | null;\n /**\n * Returns a blob object encoded as a Portable Network Graphics (PNG) format from a canvas image or drawing.\n */\n msToBlob(): Blob;\n toBlob(callback: (result: Blob | null) => void, type?: string, ...arguments: any[]): void;\n /**\n * Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.\n * @param type The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image.\n */\n toDataURL(type?: string, ...args: any[]): string;\n addEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLCanvasElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLCanvasElement: {\n prototype: HTMLCanvasElement;\n new(): HTMLCanvasElement;\n};\n\ninterface HTMLCollectionBase {\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Retrieves an object from various collections.\n */\n item(index: number): Element;\n [index: number]: Element;\n}\n\ninterface HTMLCollection extends HTMLCollectionBase {\n /**\n * Retrieves a select object or an object from an options collection.\n */\n namedItem(name: string): Element | null;\n}\n\ndeclare var HTMLCollection: {\n prototype: HTMLCollection;\n new(): HTMLCollection;\n};\n\ninterface HTMLCollectionOf extends HTMLCollectionBase {\n item(index: number): T;\n namedItem(name: string): T;\n [index: number]: T;\n}\n\ninterface HTMLDListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDListElement: {\n prototype: HTMLDListElement;\n new(): HTMLDListElement;\n};\n\ninterface HTMLDataElement extends HTMLElement {\n value: string;\n addEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataElement: {\n prototype: HTMLDataElement;\n new(): HTMLDataElement;\n};\n\ninterface HTMLDataListElement extends HTMLElement {\n readonly options: HTMLCollectionOf;\n addEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDataListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDataListElement: {\n prototype: HTMLDataListElement;\n new(): HTMLDataListElement;\n};\n\ninterface HTMLDetailsElement extends HTMLElement {\n open: boolean;\n addEventListener(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDetailsElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDetailsElement: {\n prototype: HTMLDetailsElement;\n new(): HTMLDetailsElement;\n};\n\ninterface HTMLDialogElement extends HTMLElement {\n open: boolean;\n returnValue: string;\n close(returnValue?: string): void;\n show(): void;\n showModal(): void;\n addEventListener(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDialogElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDialogElement: {\n prototype: HTMLDialogElement;\n new(): HTMLDialogElement;\n};\n\ninterface HTMLDirectoryElement extends HTMLElement {\n compact: boolean;\n addEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDirectoryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDirectoryElement: {\n prototype: HTMLDirectoryElement;\n new(): HTMLDirectoryElement;\n};\n\ninterface HTMLDivElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n noWrap: boolean;\n addEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDivElement: {\n prototype: HTMLDivElement;\n new(): HTMLDivElement;\n};\n\ninterface HTMLDocument extends Document {\n addEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLDocument: {\n prototype: HTMLDocument;\n new(): HTMLDocument;\n};\n\ninterface HTMLElementEventMap extends ElementEventMap {\n \"abort\": UIEvent;\n \"activate\": Event;\n \"beforeactivate\": Event;\n \"beforecopy\": Event;\n \"beforecut\": Event;\n \"beforedeactivate\": Event;\n \"beforepaste\": Event;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"contextmenu\": PointerEvent;\n \"copy\": ClipboardEvent;\n \"cuechange\": Event;\n \"cut\": ClipboardEvent;\n \"dblclick\": MouseEvent;\n \"deactivate\": Event;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSContentZoom\": Event;\n \"MSManipulationStateChanged\": Event;\n \"paste\": ClipboardEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"reset\": Event;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"selectstart\": Event;\n \"stalled\": Event;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"volumechange\": Event;\n \"waiting\": Event;\n}\n\ninterface HTMLElement extends Element, ElementCSSInlineStyle {\n accessKey: string;\n contentEditable: string;\n readonly dataset: DOMStringMap;\n dir: string;\n draggable: boolean;\n hidden: boolean;\n hideFocus: boolean;\n innerText: string;\n readonly isContentEditable: boolean;\n lang: string;\n readonly offsetHeight: number;\n readonly offsetLeft: number;\n readonly offsetParent: Element;\n readonly offsetTop: number;\n readonly offsetWidth: number;\n onabort: ((this: HTMLElement, ev: UIEvent) => any) | null;\n onactivate: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforeactivate: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforecopy: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforecut: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforedeactivate: ((this: HTMLElement, ev: Event) => any) | null;\n onbeforepaste: ((this: HTMLElement, ev: Event) => any) | null;\n onblur: ((this: HTMLElement, ev: FocusEvent) => any) | null;\n oncanplay: ((this: HTMLElement, ev: Event) => any) | null;\n oncanplaythrough: ((this: HTMLElement, ev: Event) => any) | null;\n onchange: ((this: HTMLElement, ev: Event) => any) | null;\n onclick: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n oncontextmenu: ((this: HTMLElement, ev: PointerEvent) => any) | null;\n oncopy: ((this: HTMLElement, ev: ClipboardEvent) => any) | null;\n oncuechange: ((this: HTMLElement, ev: Event) => any) | null;\n oncut: ((this: HTMLElement, ev: ClipboardEvent) => any) | null;\n ondblclick: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n ondeactivate: ((this: HTMLElement, ev: Event) => any) | null;\n ondrag: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragend: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragenter: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragleave: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragover: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondragstart: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondrop: ((this: HTMLElement, ev: DragEvent) => any) | null;\n ondurationchange: ((this: HTMLElement, ev: Event) => any) | null;\n onemptied: ((this: HTMLElement, ev: Event) => any) | null;\n onended: ((this: HTMLElement, ev: Event) => any) | null;\n onerror: ((this: HTMLElement, ev: ErrorEvent) => any) | null;\n onfocus: ((this: HTMLElement, ev: FocusEvent) => any) | null;\n oninput: ((this: HTMLElement, ev: Event) => any) | null;\n oninvalid: ((this: HTMLElement, ev: Event) => any) | null;\n onkeydown: ((this: HTMLElement, ev: KeyboardEvent) => any) | null;\n onkeypress: ((this: HTMLElement, ev: KeyboardEvent) => any) | null;\n onkeyup: ((this: HTMLElement, ev: KeyboardEvent) => any) | null;\n onload: ((this: HTMLElement, ev: Event) => any) | null;\n onloadeddata: ((this: HTMLElement, ev: Event) => any) | null;\n onloadedmetadata: ((this: HTMLElement, ev: Event) => any) | null;\n onloadstart: ((this: HTMLElement, ev: Event) => any) | null;\n onmousedown: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseenter: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseleave: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmousemove: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseout: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseover: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmouseup: ((this: HTMLElement, ev: MouseEvent) => any) | null;\n onmousewheel: ((this: HTMLElement, ev: WheelEvent) => any) | null;\n onmscontentzoom: ((this: HTMLElement, ev: Event) => any) | null;\n onmsmanipulationstatechanged: ((this: HTMLElement, ev: Event) => any) | null;\n onpaste: ((this: HTMLElement, ev: ClipboardEvent) => any) | null;\n onpause: ((this: HTMLElement, ev: Event) => any) | null;\n onplay: ((this: HTMLElement, ev: Event) => any) | null;\n onplaying: ((this: HTMLElement, ev: Event) => any) | null;\n onprogress: ((this: HTMLElement, ev: ProgressEvent) => any) | null;\n onratechange: ((this: HTMLElement, ev: Event) => any) | null;\n onreset: ((this: HTMLElement, ev: Event) => any) | null;\n onscroll: ((this: HTMLElement, ev: UIEvent) => any) | null;\n onseeked: ((this: HTMLElement, ev: Event) => any) | null;\n onseeking: ((this: HTMLElement, ev: Event) => any) | null;\n onselect: ((this: HTMLElement, ev: UIEvent) => any) | null;\n onselectstart: ((this: HTMLElement, ev: Event) => any) | null;\n onstalled: ((this: HTMLElement, ev: Event) => any) | null;\n onsubmit: ((this: HTMLElement, ev: Event) => any) | null;\n onsuspend: ((this: HTMLElement, ev: Event) => any) | null;\n ontimeupdate: ((this: HTMLElement, ev: Event) => any) | null;\n onvolumechange: ((this: HTMLElement, ev: Event) => any) | null;\n onwaiting: ((this: HTMLElement, ev: Event) => any) | null;\n outerText: string;\n spellcheck: boolean;\n tabIndex: number;\n title: string;\n animate(keyframes: AnimationKeyFrame | AnimationKeyFrame[], options: number | AnimationOptions): Animation;\n blur(): void;\n click(): void;\n dragDrop(): boolean;\n focus(): void;\n msGetInputContext(): MSInputMethodContext;\n addEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLElement: {\n prototype: HTMLElement;\n new(): HTMLElement;\n};\n\ninterface HTMLEmbedElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n hidden: any;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n /** @deprecated */\n name: string;\n /**\n * Retrieves the palette used for the embedded document.\n */\n readonly palette: string;\n /**\n * Retrieves the URL of the plug-in used to view an embedded document.\n */\n readonly pluginspage: string;\n readonly readyState: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrieves the height and width units of the embed object.\n */\n units: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLEmbedElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLEmbedElement: {\n prototype: HTMLEmbedElement;\n new(): HTMLEmbedElement;\n};\n\ninterface HTMLFieldSetElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n align: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n name: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFieldSetElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFieldSetElement: {\n prototype: HTMLFieldSetElement;\n new(): HTMLFieldSetElement;\n};\n\ninterface HTMLFontElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves the current typeface family.\n */\n /** @deprecated */\n face: string;\n addEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFontElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFontElement: {\n prototype: HTMLFontElement;\n new(): HTMLFontElement;\n};\n\ninterface HTMLFormControlsCollection extends HTMLCollectionBase {\n namedItem(name: string): HTMLCollection | Element | null;\n}\n\ndeclare var HTMLFormControlsCollection: {\n prototype: HTMLFormControlsCollection;\n new(): HTMLFormControlsCollection;\n};\n\ninterface HTMLFormElement extends HTMLElement {\n /**\n * Sets or retrieves a list of character encodings for input data that must be accepted by the server processing the form.\n */\n acceptCharset: string;\n /**\n * Sets or retrieves the URL to which the form content is sent for processing.\n */\n action: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Retrieves a collection, in source order, of all controls in a given form.\n */\n readonly elements: HTMLFormControlsCollection;\n /**\n * Sets or retrieves the MIME encoding for the form.\n */\n encoding: string;\n /**\n * Sets or retrieves the encoding type for the form.\n */\n enctype: string;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n readonly length: number;\n /**\n * Sets or retrieves how to send the form data to the server.\n */\n method: string;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Designates a form that is not validated when submitted.\n */\n noValidate: boolean;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n target: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a form object or an object from an elements collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is a Number, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): any;\n /**\n * Retrieves a form object or an object from an elements collection.\n */\n namedItem(name: string): any;\n reportValidity(): boolean;\n /**\n * Fires when the user resets a form.\n */\n reset(): void;\n /**\n * Fires when a FORM is about to be submitted.\n */\n submit(): void;\n addEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFormElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLFormElement: {\n prototype: HTMLFormElement;\n new(): HTMLFormElement;\n};\n\ninterface HTMLFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Specifies the properties of a border drawn around an object.\n */\n border: string;\n /**\n * Sets or retrieves the border color of the object.\n */\n borderColor: any;\n /**\n * Retrieves the document object of the page or frame.\n */\n /** @deprecated */\n readonly contentDocument: Document | null;\n /**\n * Retrieves the object of the specified.\n */\n /** @deprecated */\n readonly contentWindow: Window | null;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n /** @deprecated */\n frameBorder: string;\n /**\n * Sets or retrieves the amount of additional space between the frames.\n */\n frameSpacing: any;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string | number;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n /** @deprecated */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n /** @deprecated */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n /** @deprecated */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n /** @deprecated */\n name: string;\n /**\n * Sets or retrieves whether the user can resize the frame.\n */\n /** @deprecated */\n noResize: boolean;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n /** @deprecated */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n /** @deprecated */\n src: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string | number;\n addEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameElement, ev: HTMLFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameElement: {\n prototype: HTMLFrameElement;\n new(): HTMLFrameElement;\n};\n\ninterface HTMLFrameSetElementEventMap extends HTMLElementEventMap, WindowEventHandlersEventMap {\n \"blur\": FocusEvent;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"load\": Event;\n \"orientationchange\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n}\n\ninterface HTMLFrameSetElement extends HTMLElement, WindowEventHandlers {\n /**\n * Sets or retrieves the frame widths of the object.\n */\n /** @deprecated */\n cols: string;\n name: string;\n onorientationchange: ((this: HTMLFrameSetElement, ev: Event) => any) | null;\n onresize: ((this: HTMLFrameSetElement, ev: UIEvent) => any) | null;\n /**\n * Sets or retrieves the frame heights of the object.\n */\n /** @deprecated */\n rows: string;\n addEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLFrameSetElement, ev: HTMLFrameSetElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLFrameSetElement: {\n prototype: HTMLFrameSetElement;\n new(): HTMLFrameSetElement;\n};\n\ninterface HTMLHRElement extends HTMLElement, DOML2DeprecatedColorProperty, DOML2DeprecatedSizeProperty {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves whether the horizontal rule is drawn with 3-D shading.\n */\n /** @deprecated */\n noShade: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHRElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHRElement: {\n prototype: HTMLHRElement;\n new(): HTMLHRElement;\n};\n\ninterface HTMLHeadElement extends HTMLElement {\n /** @deprecated */\n profile: string;\n addEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadElement: {\n prototype: HTMLHeadElement;\n new(): HTMLHeadElement;\n};\n\ninterface HTMLHeadingElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHeadingElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHeadingElement: {\n prototype: HTMLHeadingElement;\n new(): HTMLHeadingElement;\n};\n\ninterface HTMLHtmlElement extends HTMLElement {\n /**\n * Sets or retrieves the DTD version that governs the current document.\n */\n /** @deprecated */\n version: string;\n addEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLHtmlElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLHtmlElement: {\n prototype: HTMLHtmlElement;\n new(): HTMLHtmlElement;\n};\n\ninterface HTMLHyperlinkElementUtils {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n origin: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n toString(): string;\n}\n\ninterface HTMLIFrameElementEventMap extends HTMLElementEventMap {\n \"load\": Event;\n}\n\ninterface HTMLIFrameElement extends HTMLElement, GetSVGDocument {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n allowFullscreen: boolean;\n allowPaymentRequest: boolean;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document | null;\n /**\n * Retrieves the object of the specified.\n */\n readonly contentWindow: Window | null;\n /**\n * Sets or retrieves whether to display a border for the frame.\n */\n /** @deprecated */\n frameBorder: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /**\n * Sets or retrieves a URI to a long description of the object.\n */\n /** @deprecated */\n longDesc: string;\n /**\n * Sets or retrieves the top and bottom margin heights before displaying the text in a frame.\n */\n /** @deprecated */\n marginHeight: string;\n /**\n * Sets or retrieves the left and right margin widths before displaying the text in a frame.\n */\n /** @deprecated */\n marginWidth: string;\n /**\n * Sets or retrieves the frame name.\n */\n name: string;\n readonly sandbox: DOMTokenList;\n /**\n * Sets or retrieves whether the frame can be scrolled.\n */\n /** @deprecated */\n scrolling: string;\n /**\n * Sets or retrieves a URL to be loaded by the object.\n */\n src: string;\n /**\n * Sets or retrives the content of the page that is to contain.\n */\n srcdoc: string;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n addEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLIFrameElement, ev: HTMLIFrameElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLIFrameElement: {\n prototype: HTMLIFrameElement;\n new(): HTMLIFrameElement;\n};\n\ninterface HTMLImageElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies the properties of a border drawn around an object.\n */\n /** @deprecated */\n border: string;\n /**\n * Retrieves whether the object is fully loaded.\n */\n readonly complete: boolean;\n crossOrigin: string | null;\n readonly currentSrc: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n /** @deprecated */\n hspace: number;\n /**\n * Sets or retrieves whether the image is a server-side image map.\n */\n isMap: boolean;\n /**\n * Sets or retrieves a Uniform Resource Identifier (URI) to a long description of the object.\n */\n longDesc: string;\n /** @deprecated */\n lowsrc: string;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n /** @deprecated */\n name: string;\n /**\n * The original height of the image resource before sizing.\n */\n readonly naturalHeight: number;\n /**\n * The original width of the image resource before sizing.\n */\n readonly naturalWidth: number;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Sets or retrieves the vertical margin for the object.\n */\n /** @deprecated */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n readonly x: number;\n readonly y: number;\n msGetAsCastingSource(): any;\n addEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLImageElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLImageElement: {\n prototype: HTMLImageElement;\n new(): HTMLImageElement;\n};\n\ninterface HTMLInputElement extends HTMLElement {\n /**\n * Sets or retrieves a comma-separated list of content types.\n */\n accept: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a text alternative to the graphic.\n */\n alt: string;\n /**\n * Specifies whether autocomplete is applied to an editable text field.\n */\n autocomplete: string;\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n checked: boolean;\n /**\n * Sets or retrieves the state of the check box or radio button.\n */\n defaultChecked: boolean;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Returns a FileList object on a file type input object.\n */\n readonly files: FileList | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Overrides the action attribute (where the data on a form is sent) on the parent form element.\n */\n formAction: string;\n /**\n * Used to override the encoding (formEnctype attribute) specified on the form element.\n */\n formEnctype: string;\n /**\n * Overrides the submit method attribute previously specified on a form element.\n */\n formMethod: string;\n /**\n * Overrides any validation or required attributes on a form or form elements to allow it to be submitted without validation. This can be used to create a \"save draft\"-type submit option.\n */\n formNoValidate: boolean;\n /**\n * Overrides the target attribute on a form element.\n */\n formTarget: string;\n /**\n * Sets or retrieves the height of the object.\n */\n height: number;\n indeterminate: boolean;\n /**\n * Specifies the ID of a pre-defined datalist of options for an input element.\n */\n readonly list: HTMLElement | null;\n /**\n * Defines the maximum acceptable value for an input element with type=\"number\".When used with the min and step attributes, lets you control the range and increment (such as only even numbers) that the user can enter into an input field.\n */\n max: string;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n /**\n * Defines the minimum acceptable value for an input element with type=\"number\". When used with the max and step attributes, lets you control the range and increment (such as even numbers only) that the user can enter into an input field.\n */\n min: string;\n minLength: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a string containing a regular expression that the user's input must match.\n */\n pattern: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n selectionDirection: string | null;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number | null;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number | null;\n size: number;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n /**\n * Defines an increment or jump between values that you want to allow the user to enter. When used with the max and min attributes, lets you control the range and increment (for example, allow only even numbers) that the user can enter into an input field.\n */\n step: string;\n /**\n * Returns the content type of the object.\n */\n type: string;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n /** @deprecated */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Returns the value of the data at the cursor's current position.\n */\n value: string;\n valueAsDate: any;\n /**\n * Returns the input field value as a number.\n */\n valueAsNumber: number;\n webkitdirectory: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n width: number;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Makes the selection equal to the current object.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n /**\n * Decrements a range input control's value by the value given by the Step attribute. If the optional parameter is used, it will decrement the input control's step value multiplied by the parameter's value.\n * @param n Value to decrement the value by.\n */\n stepDown(n?: number): void;\n /**\n * Increments a range input control's value by the value given by the Step attribute. If the optional parameter is used, will increment the input control's value by that value.\n * @param n Value to increment the value by.\n */\n stepUp(n?: number): void;\n addEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLInputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLInputElement: {\n prototype: HTMLInputElement;\n new(): HTMLInputElement;\n};\n\ninterface HTMLLIElement extends HTMLElement {\n /** @deprecated */\n type: string;\n /**\n * Sets or retrieves the value of a list item.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLIElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLIElement: {\n prototype: HTMLLIElement;\n new(): HTMLLIElement;\n};\n\ninterface HTMLLabelElement extends HTMLElement {\n readonly control: HTMLInputElement | null;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the object to which the given label object is assigned.\n */\n htmlFor: string;\n addEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLabelElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLabelElement: {\n prototype: HTMLLabelElement;\n new(): HTMLLabelElement;\n};\n\ninterface HTMLLegendElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n /** @deprecated */\n align: string;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n addEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLegendElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLegendElement: {\n prototype: HTMLLegendElement;\n new(): HTMLLegendElement;\n};\n\ninterface HTMLLinkElement extends HTMLElement, LinkStyle {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n crossOrigin: string | null;\n /** @deprecated */\n disabled: boolean;\n /**\n * Sets or retrieves a destination URL or an anchor point.\n */\n href: string;\n /**\n * Sets or retrieves the language code of the object.\n */\n hreflang: string;\n import?: Document;\n integrity: string;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n rel: string;\n /**\n * Sets or retrieves the relationship between the object and the destination of the link.\n */\n /** @deprecated */\n rev: string;\n /**\n * Sets or retrieves the window or frame at which to target content.\n */\n /** @deprecated */\n target: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLLinkElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLLinkElement: {\n prototype: HTMLLinkElement;\n new(): HTMLLinkElement;\n};\n\ninterface HTMLMainElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLMainElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMainElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMainElement: {\n prototype: HTMLMainElement;\n new(): HTMLMainElement;\n};\n\ninterface HTMLMapElement extends HTMLElement {\n /**\n * Retrieves a collection of the area objects defined for the given map object.\n */\n readonly areas: HTMLAreasCollection;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n addEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMapElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMapElement: {\n prototype: HTMLMapElement;\n new(): HTMLMapElement;\n};\n\ninterface HTMLMarqueeElementEventMap extends HTMLElementEventMap {\n \"bounce\": Event;\n \"finish\": Event;\n \"start\": Event;\n}\n\ninterface HTMLMarqueeElement extends HTMLElement {\n /** @deprecated */\n behavior: string;\n /** @deprecated */\n bgColor: string;\n /** @deprecated */\n direction: string;\n /** @deprecated */\n height: string;\n /** @deprecated */\n hspace: number;\n /** @deprecated */\n loop: number;\n /** @deprecated */\n onbounce: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n onfinish: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n onstart: ((this: HTMLMarqueeElement, ev: Event) => any) | null;\n /** @deprecated */\n scrollAmount: number;\n /** @deprecated */\n scrollDelay: number;\n /** @deprecated */\n trueSpeed: boolean;\n /** @deprecated */\n vspace: number;\n /** @deprecated */\n width: string;\n /** @deprecated */\n start(): void;\n /** @deprecated */\n stop(): void;\n addEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMarqueeElement, ev: HTMLMarqueeElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMarqueeElement: {\n prototype: HTMLMarqueeElement;\n new(): HTMLMarqueeElement;\n};\n\ninterface HTMLMediaElementEventMap extends HTMLElementEventMap {\n \"encrypted\": MediaEncryptedEvent;\n \"msneedkey\": Event;\n}\n\ninterface HTMLMediaElement extends HTMLElement {\n /**\n * Returns an AudioTrackList object with the audio tracks for a given video element.\n */\n readonly audioTracks: AudioTrackList;\n /**\n * Gets or sets a value that indicates whether to start playing the media automatically.\n */\n autoplay: boolean;\n /**\n * Gets a collection of buffered time ranges.\n */\n readonly buffered: TimeRanges;\n /**\n * Gets or sets a flag that indicates whether the client provides a set of controls for the media (in case the developer does not include controls for the player).\n */\n controls: boolean;\n crossOrigin: string | null;\n /**\n * Gets the address or URL of the current media resource that is selected by IHTMLMediaElement.\n */\n readonly currentSrc: string;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n currentTime: number;\n defaultMuted: boolean;\n /**\n * Gets or sets the default playback rate when the user is not using fast forward or reverse for a video or audio resource.\n */\n defaultPlaybackRate: number;\n /**\n * Returns the duration in seconds of the current media resource. A NaN value is returned if duration is not available, or Infinity if the media resource is streaming.\n */\n readonly duration: number;\n /**\n * Gets information about whether the playback has ended or not.\n */\n readonly ended: boolean;\n /**\n * Returns an object representing the current error state of the audio or video element.\n */\n readonly error: MediaError | null;\n /**\n * Gets or sets a flag to specify whether playback should restart after it completes.\n */\n loop: boolean;\n readonly mediaKeys: MediaKeys | null;\n /**\n * Specifies the purpose of the audio or video media, such as background audio or alerts.\n */\n msAudioCategory: string;\n /**\n * Specifies the output device id that the audio will be sent to.\n */\n msAudioDeviceType: string;\n readonly msGraphicsTrustStatus: MSGraphicsTrust;\n /**\n * Gets the MSMediaKeys object, which is used for decrypting media data, that is associated with this media element.\n */\n /** @deprecated */\n readonly msKeys: MSMediaKeys;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Specifies whether or not to enable low-latency playback on the media element.\n */\n msRealTime: boolean;\n /**\n * Gets or sets a flag that indicates whether the audio (either audio or the audio track on video media) is muted.\n */\n muted: boolean;\n /**\n * Gets the current network activity for the element.\n */\n readonly networkState: number;\n onencrypted: ((this: HTMLMediaElement, ev: MediaEncryptedEvent) => any) | null;\n /** @deprecated */\n onmsneedkey: ((this: HTMLMediaElement, ev: Event) => any) | null;\n /**\n * Gets a flag that specifies whether playback is paused.\n */\n readonly paused: boolean;\n /**\n * Gets or sets the current rate of speed for the media resource to play. This speed is expressed as a multiple of the normal speed of the media resource.\n */\n playbackRate: number;\n /**\n * Gets TimeRanges for the current media resource that has been played.\n */\n readonly played: TimeRanges;\n /**\n * Gets or sets the current playback position, in seconds.\n */\n preload: string;\n readonly readyState: number;\n /**\n * Returns a TimeRanges object that represents the ranges of the current media resource that can be seeked.\n */\n readonly seekable: TimeRanges;\n /**\n * Gets a flag that indicates whether the the client is currently moving to a new playback position in the media resource.\n */\n readonly seeking: boolean;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcObject: MediaStream | MediaSource | Blob | null;\n readonly textTracks: TextTrackList;\n readonly videoTracks: VideoTrackList;\n /**\n * Gets or sets the volume level for audio portions of the media element.\n */\n volume: number;\n addTextTrack(kind: TextTrackKind, label?: string, language?: string): TextTrack;\n /**\n * Returns a string that specifies whether the client can play a given media resource type.\n */\n canPlayType(type: string): CanPlayTypeResult;\n /**\n * Resets the audio or video object and loads a new media resource.\n */\n load(): void;\n /**\n * Clears all effects from the media pipeline.\n */\n msClearEffects(): void;\n msGetAsCastingSource(): any;\n /**\n * Inserts the specified audio effect into media pipeline.\n */\n msInsertAudioEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n /** @deprecated */\n msSetMediaKeys(mediaKeys: MSMediaKeys): void;\n /**\n * Specifies the media protection manager for a given media pipeline.\n */\n msSetMediaProtectionManager(mediaProtectionManager?: any): void;\n /**\n * Pauses the current playback and sets paused to TRUE. This can be used to test whether the media is playing or paused. You can also use the pause or play events to tell whether the media is playing or not.\n */\n pause(): void;\n /**\n * Loads and starts playback of a media resource.\n */\n play(): Promise;\n setMediaKeys(mediaKeys: MediaKeys | null): Promise;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n addEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMediaElement, ev: HTMLMediaElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMediaElement: {\n prototype: HTMLMediaElement;\n new(): HTMLMediaElement;\n readonly HAVE_CURRENT_DATA: number;\n readonly HAVE_ENOUGH_DATA: number;\n readonly HAVE_FUTURE_DATA: number;\n readonly HAVE_METADATA: number;\n readonly HAVE_NOTHING: number;\n readonly NETWORK_EMPTY: number;\n readonly NETWORK_IDLE: number;\n readonly NETWORK_LOADING: number;\n readonly NETWORK_NO_SOURCE: number;\n};\n\ninterface HTMLMenuElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n type: string;\n addEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMenuElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMenuElement: {\n prototype: HTMLMenuElement;\n new(): HTMLMenuElement;\n};\n\ninterface HTMLMetaElement extends HTMLElement {\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n /** @deprecated */\n charset: string;\n /**\n * Gets or sets meta-information to associate with httpEquiv or name.\n */\n content: string;\n /**\n * Gets or sets information used to bind the value of a content attribute of a meta element to an HTTP response header.\n */\n httpEquiv: string;\n /**\n * Sets or retrieves the value specified in the content attribute of the meta object.\n */\n name: string;\n /**\n * Sets or retrieves a scheme to be used in interpreting the value of a property specified for the object.\n */\n /** @deprecated */\n scheme: string;\n /**\n * Sets or retrieves the URL property that will be loaded after the specified time has elapsed.\n */\n /** @deprecated */\n url: string;\n addEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMetaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMetaElement: {\n prototype: HTMLMetaElement;\n new(): HTMLMetaElement;\n};\n\ninterface HTMLMeterElement extends HTMLElement {\n high: number;\n low: number;\n max: number;\n min: number;\n optimum: number;\n value: number;\n addEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLMeterElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLMeterElement: {\n prototype: HTMLMeterElement;\n new(): HTMLMeterElement;\n};\n\ninterface HTMLModElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n /**\n * Sets or retrieves the date and time of a modification to the object.\n */\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLModElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLModElement: {\n prototype: HTMLModElement;\n new(): HTMLModElement;\n};\n\ninterface HTMLOListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n /**\n * The starting number.\n */\n start: number;\n type: string;\n addEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOListElement: {\n prototype: HTMLOListElement;\n new(): HTMLOListElement;\n};\n\ninterface HTMLObjectElement extends HTMLElement, GetSVGDocument {\n /**\n * Retrieves a string of the URL where the object tag can be found. This is often the href of the document that the object is in, or the value set by a base element.\n */\n readonly BaseHref: string;\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a character string that can be used to implement your own archive functionality for the object.\n */\n /** @deprecated */\n archive: string;\n /** @deprecated */\n border: string;\n /**\n * Sets or retrieves the URL of the file containing the compiled Java class.\n */\n /** @deprecated */\n code: string;\n /**\n * Sets or retrieves the URL of the component.\n */\n /** @deprecated */\n codeBase: string;\n /**\n * Sets or retrieves the Internet media type for the code associated with the object.\n */\n /** @deprecated */\n codeType: string;\n /**\n * Retrieves the document object of the page or frame.\n */\n readonly contentDocument: Document | null;\n /**\n * Sets or retrieves the URL that references the data of the object.\n */\n data: string;\n /** @deprecated */\n declare: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the height of the object.\n */\n height: string;\n /** @deprecated */\n hspace: number;\n /**\n * Gets or sets whether the DLNA PlayTo device is available.\n */\n msPlayToDisabled: boolean;\n /**\n * Gets or sets the path to the preferred media source. This enables the Play To target device to stream the media content, which can be DRM protected, from a different location, such as a cloud media server.\n */\n msPlayToPreferredSourceUri: string;\n /**\n * Gets or sets the primary DLNA PlayTo device.\n */\n msPlayToPrimary: boolean;\n /**\n * Gets the source associated with the media element for use by the PlayToManager.\n */\n readonly msPlayToSource: any;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly readyState: number;\n /**\n * Sets or retrieves a message to be displayed while an object is loading.\n */\n /** @deprecated */\n standby: string;\n /**\n * Sets or retrieves the MIME type of the object.\n */\n type: string;\n typemustmatch: boolean;\n /**\n * Sets or retrieves the URL, often with a bookmark extension (#name), to use as a client-side image map.\n */\n useMap: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /** @deprecated */\n vspace: number;\n /**\n * Sets or retrieves the width of the object.\n */\n width: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLObjectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLObjectElement: {\n prototype: HTMLObjectElement;\n new(): HTMLObjectElement;\n};\n\ninterface HTMLOptGroupElement extends HTMLElement {\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n addEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptGroupElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptGroupElement: {\n prototype: HTMLOptGroupElement;\n new(): HTMLOptGroupElement;\n};\n\ninterface HTMLOptionElement extends HTMLElement {\n /**\n * Sets or retrieves the status of an option.\n */\n defaultSelected: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the ordinal position of an option in a list box.\n */\n readonly index: number;\n /**\n * Sets or retrieves a value that you can use to implement your own label functionality for the object.\n */\n label: string;\n /**\n * Sets or retrieves whether the option in the list box is the default item.\n */\n selected: boolean;\n /**\n * Sets or retrieves the text string specified by the option tag.\n */\n text: string;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n addEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOptionElement: {\n prototype: HTMLOptionElement;\n new(): HTMLOptionElement;\n};\n\ninterface HTMLOptionsCollection extends HTMLCollectionOf {\n length: number;\n selectedIndex: number;\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\n remove(index: number): void;\n}\n\ndeclare var HTMLOptionsCollection: {\n prototype: HTMLOptionsCollection;\n new(): HTMLOptionsCollection;\n};\n\ninterface HTMLOutputElement extends HTMLElement {\n defaultValue: string;\n readonly form: HTMLFormElement | null;\n readonly htmlFor: DOMTokenList;\n name: string;\n readonly type: string;\n readonly validationMessage: string;\n readonly validity: ValidityState;\n value: string;\n readonly willValidate: boolean;\n checkValidity(): boolean;\n reportValidity(): boolean;\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLOutputElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLOutputElement: {\n prototype: HTMLOutputElement;\n new(): HTMLOutputElement;\n};\n\ninterface HTMLParagraphElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n clear: string;\n addEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParagraphElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParagraphElement: {\n prototype: HTMLParagraphElement;\n new(): HTMLParagraphElement;\n};\n\ninterface HTMLParamElement extends HTMLElement {\n /**\n * Sets or retrieves the name of an input parameter for an element.\n */\n name: string;\n /**\n * Sets or retrieves the content type of the resource designated by the value attribute.\n */\n /** @deprecated */\n type: string;\n /**\n * Sets or retrieves the value of an input parameter for an element.\n */\n value: string;\n /**\n * Sets or retrieves the data type of the value attribute.\n */\n /** @deprecated */\n valueType: string;\n addEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLParamElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLParamElement: {\n prototype: HTMLParamElement;\n new(): HTMLParamElement;\n};\n\ninterface HTMLPictureElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPictureElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPictureElement: {\n prototype: HTMLPictureElement;\n new(): HTMLPictureElement;\n};\n\ninterface HTMLPreElement extends HTMLElement {\n /**\n * Sets or gets a value that you can use to implement your own width functionality for the object.\n */\n /** @deprecated */\n width: number;\n addEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLPreElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLPreElement: {\n prototype: HTMLPreElement;\n new(): HTMLPreElement;\n};\n\ninterface HTMLProgressElement extends HTMLElement {\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Defines the maximum, or \"done\" value for a progress element.\n */\n max: number;\n /**\n * Returns the quotient of value/max when the value attribute is set (determinate progress bar), or -1 when the value attribute is missing (indeterminate progress bar).\n */\n readonly position: number;\n /**\n * Sets or gets the current value of a progress element. The value must be a non-negative number between 0 and the max value.\n */\n value: number;\n addEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLProgressElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLProgressElement: {\n prototype: HTMLProgressElement;\n new(): HTMLProgressElement;\n};\n\ninterface HTMLQuoteElement extends HTMLElement {\n /**\n * Sets or retrieves reference information about the object.\n */\n cite: string;\n addEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLQuoteElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLQuoteElement: {\n prototype: HTMLQuoteElement;\n new(): HTMLQuoteElement;\n};\n\ninterface HTMLScriptElement extends HTMLElement {\n async: boolean;\n /**\n * Sets or retrieves the character set used to encode the object.\n */\n charset: string;\n crossOrigin: string | null;\n /**\n * Sets or retrieves the status of the script.\n */\n defer: boolean;\n /**\n * Sets or retrieves the event for which the script is written.\n */\n /** @deprecated */\n event: string;\n /**\n * Sets or retrieves the object that is bound to the event script.\n */\n /** @deprecated */\n htmlFor: string;\n integrity: string;\n noModule: boolean;\n /**\n * Retrieves the URL to an external file that contains the source code or data.\n */\n src: string;\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n /**\n * Sets or retrieves the MIME type for the associated scripting engine.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLScriptElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLScriptElement: {\n prototype: HTMLScriptElement;\n new(): HTMLScriptElement;\n};\n\ninterface HTMLSelectElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the number of objects in a collection.\n */\n length: number;\n /**\n * Sets or retrieves the Boolean value indicating whether multiple items can be selected from a list.\n */\n multiple: boolean;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n readonly options: HTMLOptionsCollection;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the index of the selected option in a select object.\n */\n selectedIndex: number;\n readonly selectedOptions: HTMLCollectionOf;\n /**\n * Sets or retrieves the number of rows in the list box.\n */\n size: number;\n /**\n * Retrieves the type of select control based on the value of the MULTIPLE attribute.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Sets or retrieves the value which is returned to the server when the form control is submitted.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Adds an element to the areas, controlRange, or options collection.\n * @param element Variant of type Number that specifies the index position in the collection where the element is placed. If no value is given, the method places the element at the end of the collection.\n * @param before Variant of type Object that specifies an element to insert before, or null to append the object to the collection.\n */\n add(element: HTMLOptionElement | HTMLOptGroupElement, before?: HTMLElement | number | null): void;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param name Variant of type Number or String that specifies the object or collection to retrieve. If this parameter is an integer, it is the zero-based index of the object. If this parameter is a string, all objects with matching name or id properties are retrieved, and a collection is returned if more than one match is made.\n * @param index Variant of type Number that specifies the zero-based index of the object to retrieve when a collection is returned.\n */\n item(name?: any, index?: any): Element | null;\n /**\n * Retrieves a select object or an object from an options collection.\n * @param namedItem A String that specifies the name or id property of the object to retrieve. A collection is returned if more than one match is made.\n */\n namedItem(name: string): any;\n /**\n * Removes an element from the collection.\n * @param index Number that specifies the zero-based index of the element to remove from the collection.\n */\n remove(index?: number): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n addEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSelectElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [name: string]: any;\n}\n\ndeclare var HTMLSelectElement: {\n prototype: HTMLSelectElement;\n new(): HTMLSelectElement;\n};\n\ninterface HTMLSlotElement extends HTMLElement {\n name: string;\n assignedNodes(options?: AssignedNodesOptions): Node[];\n addEventListener(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSlotElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface HTMLSourceElement extends HTMLElement {\n /**\n * Gets or sets the intended media type of the media source.\n */\n media: string;\n /** @deprecated */\n msKeySystem: string;\n sizes: string;\n /**\n * The address or URL of the a media resource that is to be considered.\n */\n src: string;\n srcset: string;\n /**\n * Gets or sets the MIME type of a media resource.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSourceElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSourceElement: {\n prototype: HTMLSourceElement;\n new(): HTMLSourceElement;\n};\n\ninterface HTMLSpanElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSpanElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSpanElement: {\n prototype: HTMLSpanElement;\n new(): HTMLSpanElement;\n};\n\ninterface HTMLStyleElement extends HTMLElement, LinkStyle {\n /** @deprecated */\n disabled: boolean;\n /**\n * Sets or retrieves the media type.\n */\n media: string;\n /**\n * Retrieves the CSS language in which the style sheet is written.\n */\n type: string;\n addEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLStyleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLStyleElement: {\n prototype: HTMLStyleElement;\n new(): HTMLStyleElement;\n};\n\ninterface HTMLSummaryElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLSummaryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLSummaryElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLSummaryElement: {\n prototype: HTMLSummaryElement;\n new(): HTMLSummaryElement;\n};\n\ninterface HTMLTableCaptionElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the caption or legend.\n */\n /** @deprecated */\n align: string;\n addEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCaptionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCaptionElement: {\n prototype: HTMLTableCaptionElement;\n new(): HTMLTableCaptionElement;\n};\n\ninterface HTMLTableCellElement extends HTMLElement {\n /**\n * Sets or retrieves abbreviated text for the object.\n */\n abbr: string;\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /**\n * Sets or retrieves a comma-delimited list of conceptual categories associated with the object.\n */\n /** @deprecated */\n axis: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Retrieves the position of the object in the cells collection of a row.\n */\n readonly cellIndex: number;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number columns in the table that the object should span.\n */\n colSpan: number;\n /**\n * Sets or retrieves a list of header cells that provide information for the object.\n */\n headers: string;\n /**\n * Sets or retrieves the height of the object.\n */\n /** @deprecated */\n height: string;\n /**\n * Sets or retrieves whether the browser automatically performs wordwrap.\n */\n /** @deprecated */\n noWrap: boolean;\n /**\n * Sets or retrieves how many rows in a table the cell should span.\n */\n rowSpan: number;\n /**\n * Sets or retrieves the group of cells in a table to which the object's information applies.\n */\n scope: string;\n /** @deprecated */\n vAlign: string;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableCellElement: {\n prototype: HTMLTableCellElement;\n new(): HTMLTableCellElement;\n};\n\ninterface HTMLTableColElement extends HTMLElement {\n /**\n * Sets or retrieves the alignment of the object relative to the display or table.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number of columns in the group.\n */\n span: number;\n /** @deprecated */\n vAlign: string;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n addEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableColElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableColElement: {\n prototype: HTMLTableColElement;\n new(): HTMLTableColElement;\n};\n\ninterface HTMLTableDataCellElement extends HTMLTableCellElement {\n addEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableDataCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableDataCellElement: {\n prototype: HTMLTableDataCellElement;\n new(): HTMLTableDataCellElement;\n};\n\ninterface HTMLTableElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Sets or retrieves the width of the border to draw around the object.\n */\n /** @deprecated */\n border: string;\n /**\n * Retrieves the caption object of a table.\n */\n caption: HTMLTableCaptionElement | null;\n /**\n * Sets or retrieves the amount of space between the border of the cell and the content of the cell.\n */\n /** @deprecated */\n cellPadding: string;\n /**\n * Sets or retrieves the amount of space between cells in a table.\n */\n /** @deprecated */\n cellSpacing: string;\n /**\n * Sets or retrieves the way the border frame around the table is displayed.\n */\n /** @deprecated */\n frame: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n readonly rows: HTMLCollectionOf;\n /**\n * Sets or retrieves which dividing lines (inner borders) are displayed.\n */\n /** @deprecated */\n rules: string;\n /**\n * Sets or retrieves a description and/or structure of the object.\n */\n /** @deprecated */\n summary: string;\n /**\n * Retrieves a collection of all tBody objects in the table. Objects in this collection are in source order.\n */\n readonly tBodies: HTMLCollectionOf;\n /**\n * Retrieves the tFoot object of the table.\n */\n tFoot: HTMLTableSectionElement | null;\n /**\n * Retrieves the tHead object of the table.\n */\n tHead: HTMLTableSectionElement | null;\n /**\n * Sets or retrieves the width of the object.\n */\n /** @deprecated */\n width: string;\n /**\n * Creates an empty caption element in the table.\n */\n createCaption(): HTMLTableCaptionElement;\n /**\n * Creates an empty tBody element in the table.\n */\n createTBody(): HTMLTableSectionElement;\n /**\n * Creates an empty tFoot element in the table.\n */\n createTFoot(): HTMLTableSectionElement;\n /**\n * Returns the tHead element object if successful, or null otherwise.\n */\n createTHead(): HTMLTableSectionElement;\n /**\n * Deletes the caption element and its contents from the table.\n */\n deleteCaption(): void;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Deletes the tFoot element and its contents from the table.\n */\n deleteTFoot(): void;\n /**\n * Deletes the tHead element and its contents from the table.\n */\n deleteTHead(): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableElement: {\n prototype: HTMLTableElement;\n new(): HTMLTableElement;\n};\n\ninterface HTMLTableHeaderCellElement extends HTMLTableCellElement {\n scope: string;\n addEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableHeaderCellElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableHeaderCellElement: {\n prototype: HTMLTableHeaderCellElement;\n new(): HTMLTableHeaderCellElement;\n};\n\ninterface HTMLTableRowElement extends HTMLElement {\n /**\n * Sets or retrieves how the object is aligned with adjacent text.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n bgColor: string;\n /**\n * Retrieves a collection of all cells in the table row.\n */\n readonly cells: HTMLCollectionOf;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Retrieves the position of the object in the rows collection for the table.\n */\n readonly rowIndex: number;\n /**\n * Retrieves the position of the object in the collection.\n */\n readonly sectionRowIndex: number;\n /** @deprecated */\n vAlign: string;\n /**\n * Removes the specified cell from the table row, as well as from the cells collection.\n * @param index Number that specifies the zero-based position of the cell to remove from the table row. If no value is provided, the last cell in the cells collection is deleted.\n */\n deleteCell(index?: number): void;\n /**\n * Creates a new cell in the table row, and adds the cell to the cells collection.\n * @param index Number that specifies where to insert the cell in the tr. The default value is -1, which appends the new cell to the end of the cells collection.\n */\n insertCell(index?: number): HTMLTableDataCellElement;\n addEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableRowElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableRowElement: {\n prototype: HTMLTableRowElement;\n new(): HTMLTableRowElement;\n};\n\ninterface HTMLTableSectionElement extends HTMLElement {\n /**\n * Sets or retrieves a value that indicates the table alignment.\n */\n /** @deprecated */\n align: string;\n /** @deprecated */\n ch: string;\n /** @deprecated */\n chOff: string;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n readonly rows: HTMLCollectionOf;\n /** @deprecated */\n vAlign: string;\n /**\n * Removes the specified row (tr) from the element and from the rows collection.\n * @param index Number that specifies the zero-based position in the rows collection of the row to remove.\n */\n deleteRow(index?: number): void;\n /**\n * Creates a new row (tr) in the table, and adds the row to the rows collection.\n * @param index Number that specifies where to insert the row in the rows collection. The default value is -1, which appends the new row to the end of the rows collection.\n */\n insertRow(index?: number): HTMLTableRowElement;\n addEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTableSectionElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTableSectionElement: {\n prototype: HTMLTableSectionElement;\n new(): HTMLTableSectionElement;\n};\n\ninterface HTMLTemplateElement extends HTMLElement {\n readonly content: DocumentFragment;\n addEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTemplateElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTemplateElement: {\n prototype: HTMLTemplateElement;\n new(): HTMLTemplateElement;\n};\n\ninterface HTMLTextAreaElement extends HTMLElement {\n /**\n * Provides a way to direct a user to a specific field when a document loads. This can provide both direction and convenience for a user, reducing the need to click or tab to a field when a page opens. This attribute is true when present on an element, and false when missing.\n */\n autofocus: boolean;\n /**\n * Sets or retrieves the width of the object.\n */\n cols: number;\n /**\n * Sets or retrieves the initial contents of the object.\n */\n defaultValue: string;\n disabled: boolean;\n /**\n * Retrieves a reference to the form that the object is embedded in.\n */\n readonly form: HTMLFormElement | null;\n /**\n * Sets or retrieves the maximum number of characters that the user can enter in a text control.\n */\n maxLength: number;\n minLength: number;\n /**\n * Sets or retrieves the name of the object.\n */\n name: string;\n /**\n * Gets or sets a text string that is displayed in an input field as a hint or prompt to users as the format or type of information they need to enter.The text appears in an input field until the user puts focus on the field.\n */\n placeholder: string;\n /**\n * Sets or retrieves the value indicated whether the content of the object is read-only.\n */\n readOnly: boolean;\n /**\n * When present, marks an element that can't be submitted without a value.\n */\n required: boolean;\n /**\n * Sets or retrieves the number of horizontal rows contained in the object.\n */\n rows: number;\n /**\n * Gets or sets the end position or offset of a text selection.\n */\n selectionEnd: number;\n /**\n * Gets or sets the starting position or offset of a text selection.\n */\n selectionStart: number;\n /**\n * Retrieves the type of control.\n */\n readonly type: string;\n /**\n * Returns the error message that would be displayed if the user submits the form, or an empty string if no error message. It also triggers the standard error message, such as \"this is a required field\". The result is that the user sees validation messages without actually submitting.\n */\n readonly validationMessage: string;\n /**\n * Returns a ValidityState object that represents the validity states of an element.\n */\n readonly validity: ValidityState;\n /**\n * Retrieves or sets the text in the entry field of the textArea element.\n */\n value: string;\n /**\n * Returns whether an element will successfully validate based on forms validation rules and constraints.\n */\n readonly willValidate: boolean;\n /**\n * Sets or retrieves how to handle wordwrapping in the object.\n */\n wrap: string;\n /**\n * Returns whether a form will validate when it is submitted, without having to submit it.\n */\n checkValidity(): boolean;\n /**\n * Highlights the input area of a form element.\n */\n select(): void;\n /**\n * Sets a custom error message that is displayed when a form is submitted.\n * @param error Sets a custom error message that is displayed when a form is submitted.\n */\n setCustomValidity(error: string): void;\n /**\n * Sets the start and end positions of a selection in a text field.\n * @param start The offset into the text field for the start of the selection.\n * @param end The offset into the text field for the end of the selection.\n * @param direction The direction in which the selection is performed.\n */\n setSelectionRange(start: number, end: number, direction?: \"forward\" | \"backward\" | \"none\"): void;\n addEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTextAreaElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTextAreaElement: {\n prototype: HTMLTextAreaElement;\n new(): HTMLTextAreaElement;\n};\n\ninterface HTMLTimeElement extends HTMLElement {\n dateTime: string;\n addEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTimeElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTimeElement: {\n prototype: HTMLTimeElement;\n new(): HTMLTimeElement;\n};\n\ninterface HTMLTitleElement extends HTMLElement {\n /**\n * Retrieves or sets the text of the object as a string.\n */\n text: string;\n addEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTitleElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTitleElement: {\n prototype: HTMLTitleElement;\n new(): HTMLTitleElement;\n};\n\ninterface HTMLTrackElement extends HTMLElement {\n default: boolean;\n kind: string;\n label: string;\n readonly readyState: number;\n src: string;\n srclang: string;\n readonly track: TextTrack;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n addEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLTrackElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLTrackElement: {\n prototype: HTMLTrackElement;\n new(): HTMLTrackElement;\n readonly ERROR: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n};\n\ninterface HTMLUListElement extends HTMLElement {\n /** @deprecated */\n compact: boolean;\n /** @deprecated */\n type: string;\n addEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUListElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUListElement: {\n prototype: HTMLUListElement;\n new(): HTMLUListElement;\n};\n\ninterface HTMLUnknownElement extends HTMLElement {\n addEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLUnknownElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLUnknownElement: {\n prototype: HTMLUnknownElement;\n new(): HTMLUnknownElement;\n};\n\ninterface HTMLVideoElementEventMap extends HTMLMediaElementEventMap {\n \"MSVideoFormatChanged\": Event;\n \"MSVideoFrameStepCompleted\": Event;\n \"MSVideoOptimalLayoutChanged\": Event;\n}\n\ninterface HTMLVideoElement extends HTMLMediaElement {\n /**\n * Gets or sets the height of the video element.\n */\n height: number;\n msHorizontalMirror: boolean;\n readonly msIsLayoutOptimalForPlayback: boolean;\n readonly msIsStereo3D: boolean;\n msStereo3DPackingMode: string;\n msStereo3DRenderMode: string;\n msZoom: boolean;\n onMSVideoFormatChanged: ((this: HTMLVideoElement, ev: Event) => any) | null;\n onMSVideoFrameStepCompleted: ((this: HTMLVideoElement, ev: Event) => any) | null;\n onMSVideoOptimalLayoutChanged: ((this: HTMLVideoElement, ev: Event) => any) | null;\n /**\n * Gets or sets a URL of an image to display, for example, like a movie poster. This can be a still frame from the video, or another image if no video data is available.\n */\n poster: string;\n /**\n * Gets the intrinsic height of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoHeight: number;\n /**\n * Gets the intrinsic width of a video in CSS pixels, or zero if the dimensions are not known.\n */\n readonly videoWidth: number;\n readonly webkitDisplayingFullscreen: boolean;\n readonly webkitSupportsFullscreen: boolean;\n /**\n * Gets or sets the width of the video element.\n */\n width: number;\n getVideoPlaybackQuality(): VideoPlaybackQuality;\n msFrameStep(forward: boolean): void;\n msInsertVideoEffect(activatableClassId: string, effectRequired: boolean, config?: any): void;\n msSetVideoRectangle(left: number, top: number, right: number, bottom: number): void;\n webkitEnterFullScreen(): void;\n webkitEnterFullscreen(): void;\n webkitExitFullScreen(): void;\n webkitExitFullscreen(): void;\n addEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: HTMLVideoElement, ev: HTMLVideoElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var HTMLVideoElement: {\n prototype: HTMLVideoElement;\n new(): HTMLVideoElement;\n};\n\ninterface HTMLegendElement {\n readonly form: HTMLFormElement | null;\n}\n\ndeclare var HTMLegendElement: {\n prototype: HTMLegendElement;\n new(): HTMLegendElement;\n};\n\ninterface HashChangeEvent extends Event {\n readonly newURL: string;\n readonly oldURL: string;\n}\n\ndeclare var HashChangeEvent: {\n prototype: HashChangeEvent;\n new(type: string, eventInitDict?: HashChangeEventInit): HashChangeEvent;\n};\n\ninterface Headers {\n append(name: string, value: string): void;\n delete(name: string): void;\n forEach(callback: Function, thisArg?: any): void;\n get(name: string): string | null;\n has(name: string): boolean;\n set(name: string, value: string): void;\n}\n\ndeclare var Headers: {\n prototype: Headers;\n new(init?: HeadersInit): Headers;\n};\n\ninterface History {\n readonly length: number;\n scrollRestoration: ScrollRestoration;\n readonly state: any;\n back(distance?: any): void;\n forward(distance?: any): void;\n go(delta?: any): void;\n pushState(data: any, title?: string, url?: string | null): void;\n replaceState(data: any, title?: string, url?: string | null): void;\n}\n\ndeclare var History: {\n prototype: History;\n new(): History;\n};\n\ninterface HkdfCtrParams extends Algorithm {\n context: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n hash: string | Algorithm;\n label: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer;\n}\n\ninterface IDBArrayKey extends Array {\n}\n\ninterface IDBCursor {\n readonly direction: IDBCursorDirection;\n readonly key: IDBKeyRange | number | string | Date | IDBArrayKey;\n readonly primaryKey: any;\n readonly source: IDBObjectStore | IDBIndex;\n advance(count: number): void;\n continue(key?: IDBKeyRange | number | string | Date | IDBArrayKey): void;\n delete(): IDBRequest;\n update(value: any): IDBRequest;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n}\n\ndeclare var IDBCursor: {\n prototype: IDBCursor;\n new(): IDBCursor;\n readonly NEXT: string;\n readonly NEXT_NO_DUPLICATE: string;\n readonly PREV: string;\n readonly PREV_NO_DUPLICATE: string;\n};\n\ninterface IDBCursorWithValue extends IDBCursor {\n readonly value: any;\n}\n\ndeclare var IDBCursorWithValue: {\n prototype: IDBCursorWithValue;\n new(): IDBCursorWithValue;\n};\n\ninterface IDBDatabaseEventMap {\n \"abort\": Event;\n \"error\": Event;\n}\n\ninterface IDBDatabase extends EventTarget {\n readonly name: string;\n readonly objectStoreNames: DOMStringList;\n onabort: ((this: IDBDatabase, ev: Event) => any) | null;\n onerror: ((this: IDBDatabase, ev: Event) => any) | null;\n onversionchange: ((this: IDBDatabase, ev: Event) => any) | null;\n readonly version: number;\n close(): void;\n createObjectStore(name: string, optionalParameters?: IDBObjectStoreParameters): IDBObjectStore;\n deleteObjectStore(name: string): void;\n transaction(storeNames: string | string[], mode?: IDBTransactionMode): IDBTransaction;\n addEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBDatabase, ev: IDBDatabaseEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBDatabase: {\n prototype: IDBDatabase;\n new(): IDBDatabase;\n};\n\ninterface IDBEnvironment {\n readonly indexedDB: IDBFactory;\n}\n\ninterface IDBFactory {\n cmp(first: any, second: any): number;\n deleteDatabase(name: string): IDBOpenDBRequest;\n open(name: string, version?: number): IDBOpenDBRequest;\n}\n\ndeclare var IDBFactory: {\n prototype: IDBFactory;\n new(): IDBFactory;\n};\n\ninterface IDBIndex {\n readonly keyPath: string | string[];\n multiEntry: boolean;\n readonly name: string;\n readonly objectStore: IDBObjectStore;\n readonly unique: boolean;\n count(key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n get(key: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n getKey(key: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n openCursor(range?: IDBKeyRange | number | string | Date | IDBArrayKey, direction?: IDBCursorDirection): IDBRequest;\n openKeyCursor(range?: IDBKeyRange | number | string | Date | IDBArrayKey, direction?: IDBCursorDirection): IDBRequest;\n}\n\ndeclare var IDBIndex: {\n prototype: IDBIndex;\n new(): IDBIndex;\n};\n\ninterface IDBKeyRange {\n readonly lower: any;\n readonly lowerOpen: boolean;\n readonly upper: any;\n readonly upperOpen: boolean;\n}\n\ndeclare var IDBKeyRange: {\n prototype: IDBKeyRange;\n new(): IDBKeyRange;\n bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;\n lowerBound(lower: any, open?: boolean): IDBKeyRange;\n only(value: any): IDBKeyRange;\n upperBound(upper: any, open?: boolean): IDBKeyRange;\n};\n\ninterface IDBObjectStore {\n autoIncrement: boolean;\n readonly indexNames: DOMStringList;\n readonly keyPath: string | string[] | null;\n readonly name: string;\n readonly transaction: IDBTransaction;\n add(value: any, key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n clear(): IDBRequest;\n count(key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n createIndex(name: string, keyPath: string | string[], optionalParameters?: IDBIndexParameters): IDBIndex;\n delete(key: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n deleteIndex(indexName: string): void;\n get(key: any): IDBRequest;\n index(name: string): IDBIndex;\n openCursor(range?: IDBKeyRange | number | string | Date | IDBArrayKey, direction?: IDBCursorDirection): IDBRequest;\n put(value: any, key?: IDBKeyRange | number | string | Date | IDBArrayKey): IDBRequest;\n}\n\ndeclare var IDBObjectStore: {\n prototype: IDBObjectStore;\n new(): IDBObjectStore;\n};\n\ninterface IDBOpenDBRequestEventMap extends IDBRequestEventMap {\n \"blocked\": Event;\n \"upgradeneeded\": IDBVersionChangeEvent;\n}\n\ninterface IDBOpenDBRequest extends IDBRequest {\n onblocked: ((this: IDBOpenDBRequest, ev: Event) => any) | null;\n onupgradeneeded: ((this: IDBOpenDBRequest, ev: IDBVersionChangeEvent) => any) | null;\n addEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBOpenDBRequest, ev: IDBOpenDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBOpenDBRequest: {\n prototype: IDBOpenDBRequest;\n new(): IDBOpenDBRequest;\n};\n\ninterface IDBRequestEventMap {\n \"error\": Event;\n \"success\": Event;\n}\n\ninterface IDBRequest extends EventTarget {\n readonly error: DOMException;\n onerror: ((this: IDBRequest, ev: Event) => any) | null;\n onsuccess: ((this: IDBRequest, ev: Event) => any) | null;\n readonly readyState: IDBRequestReadyState;\n readonly result: any;\n readonly source: IDBObjectStore | IDBIndex | IDBCursor;\n readonly transaction: IDBTransaction;\n addEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBRequest, ev: IDBRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBRequest: {\n prototype: IDBRequest;\n new(): IDBRequest;\n};\n\ninterface IDBTransactionEventMap {\n \"abort\": Event;\n \"complete\": Event;\n \"error\": Event;\n}\n\ninterface IDBTransaction extends EventTarget {\n readonly db: IDBDatabase;\n readonly error: DOMException;\n readonly mode: IDBTransactionMode;\n onabort: ((this: IDBTransaction, ev: Event) => any) | null;\n oncomplete: ((this: IDBTransaction, ev: Event) => any) | null;\n onerror: ((this: IDBTransaction, ev: Event) => any) | null;\n abort(): void;\n objectStore(name: string): IDBObjectStore;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n addEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: IDBTransaction, ev: IDBTransactionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var IDBTransaction: {\n prototype: IDBTransaction;\n new(): IDBTransaction;\n readonly READ_ONLY: string;\n readonly READ_WRITE: string;\n readonly VERSION_CHANGE: string;\n};\n\ninterface IDBVersionChangeEvent extends Event {\n readonly newVersion: number | null;\n readonly oldVersion: number;\n}\n\ndeclare var IDBVersionChangeEvent: {\n prototype: IDBVersionChangeEvent;\n new(): IDBVersionChangeEvent;\n};\n\ninterface IIRFilterNode extends AudioNode {\n getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;\n}\n\ndeclare var IIRFilterNode: {\n prototype: IIRFilterNode;\n new(): IIRFilterNode;\n};\n\ninterface ImageBitmap {\n readonly height: number;\n readonly width: number;\n close(): void;\n}\n\ninterface ImageBitmapOptions {\n colorSpaceConversion?: \"none\" | \"default\";\n imageOrientation?: \"none\" | \"flipY\";\n premultiplyAlpha?: \"none\" | \"premultiply\" | \"default\";\n resizeHeight?: number;\n resizeQuality?: \"pixelated\" | \"low\" | \"medium\" | \"high\";\n resizeWidth?: number;\n}\n\ninterface ImageData {\n readonly data: Uint8ClampedArray;\n readonly height: number;\n readonly width: number;\n}\n\ndeclare var ImageData: {\n prototype: ImageData;\n new(width: number, height: number): ImageData;\n new(array: Uint8ClampedArray, width: number, height: number): ImageData;\n};\n\ninterface IntersectionObserver {\n readonly root: Element | null;\n readonly rootMargin: string;\n readonly thresholds: number[];\n disconnect(): void;\n observe(target: Element): void;\n takeRecords(): IntersectionObserverEntry[];\n unobserve(target: Element): void;\n}\n\ndeclare var IntersectionObserver: {\n prototype: IntersectionObserver;\n new(callback: IntersectionObserverCallback, options?: IntersectionObserverInit): IntersectionObserver;\n};\n\ninterface IntersectionObserverEntry {\n readonly boundingClientRect: ClientRect | DOMRect;\n readonly intersectionRatio: number;\n readonly intersectionRect: ClientRect | DOMRect;\n readonly isIntersecting: boolean;\n readonly rootBounds: ClientRect | DOMRect;\n readonly target: Element;\n readonly time: number;\n}\n\ndeclare var IntersectionObserverEntry: {\n prototype: IntersectionObserverEntry;\n new(intersectionObserverEntryInit: IntersectionObserverEntryInit): IntersectionObserverEntry;\n};\n\ninterface KeyboardEvent extends UIEvent {\n readonly altKey: boolean;\n /** @deprecated */\n char: string;\n /** @deprecated */\n readonly charCode: number;\n readonly code: string;\n readonly ctrlKey: boolean;\n readonly key: string;\n /** @deprecated */\n readonly keyCode: number;\n readonly location: number;\n readonly metaKey: boolean;\n readonly repeat: boolean;\n readonly shiftKey: boolean;\n /** @deprecated */\n readonly which: number;\n getModifierState(keyArg: string): boolean;\n /** @deprecated */\n initKeyboardEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, keyArg: string, locationArg: number, modifiersListArg: string, repeat: boolean, locale: string): void;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n}\n\ndeclare var KeyboardEvent: {\n prototype: KeyboardEvent;\n new(typeArg: string, eventInitDict?: KeyboardEventInit): KeyboardEvent;\n readonly DOM_KEY_LOCATION_JOYSTICK: number;\n readonly DOM_KEY_LOCATION_LEFT: number;\n readonly DOM_KEY_LOCATION_MOBILE: number;\n readonly DOM_KEY_LOCATION_NUMPAD: number;\n readonly DOM_KEY_LOCATION_RIGHT: number;\n readonly DOM_KEY_LOCATION_STANDARD: number;\n};\n\ninterface LinkStyle {\n readonly sheet: StyleSheet | null;\n}\n\ninterface ListeningStateChangedEvent extends Event {\n readonly label: string;\n readonly state: ListeningState;\n}\n\ndeclare var ListeningStateChangedEvent: {\n prototype: ListeningStateChangedEvent;\n new(): ListeningStateChangedEvent;\n};\n\ninterface Location {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n assign(url: string): void;\n reload(forcedReload?: boolean): void;\n replace(url: string): void;\n toString(): string;\n}\n\ndeclare var Location: {\n prototype: Location;\n new(): Location;\n};\n\ninterface MSAssertion {\n readonly id: string;\n readonly type: MSCredentialType;\n}\n\ndeclare var MSAssertion: {\n prototype: MSAssertion;\n new(): MSAssertion;\n};\n\ninterface MSBlobBuilder {\n append(data: any, endings?: string): void;\n getBlob(contentType?: string): Blob;\n}\n\ndeclare var MSBlobBuilder: {\n prototype: MSBlobBuilder;\n new(): MSBlobBuilder;\n};\n\ninterface MSCredentials {\n getAssertion(challenge: string, filter?: MSCredentialFilter, params?: MSSignatureParameters): Promise;\n makeCredential(accountInfo: MSAccountInfo, params: MSCredentialParameters[], challenge?: string): Promise;\n}\n\ndeclare var MSCredentials: {\n prototype: MSCredentials;\n new(): MSCredentials;\n};\n\ninterface MSDCCEvent extends Event {\n readonly maxFr: number;\n readonly maxFs: number;\n}\n\ndeclare var MSDCCEvent: {\n prototype: MSDCCEvent;\n new(type: string, eventInitDict: MSDCCEventInit): MSDCCEvent;\n};\n\ninterface MSDSHEvent extends Event {\n readonly sources: number[];\n readonly timestamp: number;\n}\n\ndeclare var MSDSHEvent: {\n prototype: MSDSHEvent;\n new(type: string, eventInitDict: MSDSHEventInit): MSDSHEvent;\n};\n\ninterface MSFIDOCredentialAssertion extends MSAssertion {\n readonly algorithm: string | Algorithm;\n readonly attestation: any;\n readonly publicKey: string;\n readonly transportHints: MSTransportType[];\n}\n\ndeclare var MSFIDOCredentialAssertion: {\n prototype: MSFIDOCredentialAssertion;\n new(): MSFIDOCredentialAssertion;\n};\n\ninterface MSFIDOSignature {\n readonly authnrData: string;\n readonly clientData: string;\n readonly signature: string;\n}\n\ndeclare var MSFIDOSignature: {\n prototype: MSFIDOSignature;\n new(): MSFIDOSignature;\n};\n\ninterface MSFIDOSignatureAssertion extends MSAssertion {\n readonly signature: MSFIDOSignature;\n}\n\ndeclare var MSFIDOSignatureAssertion: {\n prototype: MSFIDOSignatureAssertion;\n new(): MSFIDOSignatureAssertion;\n};\n\ninterface MSFileSaver {\n msSaveBlob(blob: any, defaultName?: string): boolean;\n msSaveOrOpenBlob(blob: any, defaultName?: string): boolean;\n}\n\ninterface MSGesture {\n target: Element;\n addPointer(pointerId: number): void;\n stop(): void;\n}\n\ndeclare var MSGesture: {\n prototype: MSGesture;\n new(): MSGesture;\n};\n\ninterface MSGestureEvent extends UIEvent {\n readonly clientX: number;\n readonly clientY: number;\n readonly expansion: number;\n readonly gestureObject: any;\n readonly hwTimestamp: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly rotation: number;\n readonly scale: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly translationX: number;\n readonly translationY: number;\n readonly velocityAngular: number;\n readonly velocityExpansion: number;\n readonly velocityX: number;\n readonly velocityY: number;\n initGestureEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, offsetXArg: number, offsetYArg: number, translationXArg: number, translationYArg: number, scaleArg: number, expansionArg: number, rotationArg: number, velocityXArg: number, velocityYArg: number, velocityExpansionArg: number, velocityAngularArg: number, hwTimestampArg: number): void;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n}\n\ndeclare var MSGestureEvent: {\n prototype: MSGestureEvent;\n new(): MSGestureEvent;\n readonly MSGESTURE_FLAG_BEGIN: number;\n readonly MSGESTURE_FLAG_CANCEL: number;\n readonly MSGESTURE_FLAG_END: number;\n readonly MSGESTURE_FLAG_INERTIA: number;\n readonly MSGESTURE_FLAG_NONE: number;\n};\n\ninterface MSGraphicsTrust {\n readonly constrictionActive: boolean;\n readonly status: string;\n}\n\ndeclare var MSGraphicsTrust: {\n prototype: MSGraphicsTrust;\n new(): MSGraphicsTrust;\n};\n\ninterface MSInputMethodContextEventMap {\n \"MSCandidateWindowHide\": Event;\n \"MSCandidateWindowShow\": Event;\n \"MSCandidateWindowUpdate\": Event;\n}\n\ninterface MSInputMethodContext extends EventTarget {\n readonly compositionEndOffset: number;\n readonly compositionStartOffset: number;\n oncandidatewindowhide: ((this: MSInputMethodContext, ev: Event) => any) | null;\n oncandidatewindowshow: ((this: MSInputMethodContext, ev: Event) => any) | null;\n oncandidatewindowupdate: ((this: MSInputMethodContext, ev: Event) => any) | null;\n readonly target: HTMLElement;\n getCandidateWindowClientRect(): ClientRect;\n getCompositionAlternatives(): string[];\n hasComposition(): boolean;\n isCandidateWindowVisible(): boolean;\n addEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSInputMethodContext, ev: MSInputMethodContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSInputMethodContext: {\n prototype: MSInputMethodContext;\n new(): MSInputMethodContext;\n};\n\ninterface MSMediaKeyError {\n readonly code: number;\n readonly systemCode: number;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n}\n\ndeclare var MSMediaKeyError: {\n prototype: MSMediaKeyError;\n new(): MSMediaKeyError;\n readonly MS_MEDIA_KEYERR_CLIENT: number;\n readonly MS_MEDIA_KEYERR_DOMAIN: number;\n readonly MS_MEDIA_KEYERR_HARDWARECHANGE: number;\n readonly MS_MEDIA_KEYERR_OUTPUT: number;\n readonly MS_MEDIA_KEYERR_SERVICE: number;\n readonly MS_MEDIA_KEYERR_UNKNOWN: number;\n};\n\ninterface MSMediaKeyMessageEvent extends Event {\n readonly destinationURL: string | null;\n readonly message: Uint8Array;\n}\n\ndeclare var MSMediaKeyMessageEvent: {\n prototype: MSMediaKeyMessageEvent;\n new(): MSMediaKeyMessageEvent;\n};\n\ninterface MSMediaKeyNeededEvent extends Event {\n readonly initData: Uint8Array | null;\n}\n\ndeclare var MSMediaKeyNeededEvent: {\n prototype: MSMediaKeyNeededEvent;\n new(): MSMediaKeyNeededEvent;\n};\n\ninterface MSMediaKeySession extends EventTarget {\n readonly error: MSMediaKeyError | null;\n readonly keySystem: string;\n readonly sessionId: string;\n close(): void;\n update(key: Uint8Array): void;\n}\n\ndeclare var MSMediaKeySession: {\n prototype: MSMediaKeySession;\n new(): MSMediaKeySession;\n};\n\ninterface MSMediaKeys {\n readonly keySystem: string;\n createSession(type: string, initData: Uint8Array, cdmData?: Uint8Array | null): MSMediaKeySession;\n}\n\ndeclare var MSMediaKeys: {\n prototype: MSMediaKeys;\n new(keySystem: string): MSMediaKeys;\n isTypeSupported(keySystem: string, type?: string | null): boolean;\n isTypeSupportedWithFeatures(keySystem: string, type?: string | null): string;\n};\n\ninterface MSNavigatorDoNotTrack {\n confirmSiteSpecificTrackingException(args: ConfirmSiteSpecificExceptionsInformation): boolean;\n confirmWebWideTrackingException(args: ExceptionInformation): boolean;\n removeSiteSpecificTrackingException(args: ExceptionInformation): void;\n removeWebWideTrackingException(args: ExceptionInformation): void;\n storeSiteSpecificTrackingException(args: StoreSiteSpecificExceptionsInformation): void;\n storeWebWideTrackingException(args: StoreExceptionsInformation): void;\n}\n\ninterface MSPointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var MSPointerEvent: {\n prototype: MSPointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): MSPointerEvent;\n};\n\ninterface MSStream {\n readonly type: string;\n msClose(): void;\n msDetachStream(): any;\n}\n\ndeclare var MSStream: {\n prototype: MSStream;\n new(): MSStream;\n};\n\ninterface MSStreamReaderEventMap {\n \"abort\": UIEvent;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n}\n\ninterface MSStreamReader extends EventTarget {\n readonly error: DOMError;\n onabort: ((this: MSStreamReader, ev: UIEvent) => any) | null;\n onerror: ((this: MSStreamReader, ev: ErrorEvent) => any) | null;\n onload: ((this: MSStreamReader, ev: Event) => any) | null;\n onloadend: ((this: MSStreamReader, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: MSStreamReader, ev: Event) => any) | null;\n onprogress: ((this: MSStreamReader, ev: ProgressEvent) => any) | null;\n readonly readyState: number;\n readonly result: any;\n abort(): void;\n readAsArrayBuffer(stream: MSStream, size?: number): void;\n readAsBinaryString(stream: MSStream, size?: number): void;\n readAsBlob(stream: MSStream, size?: number): void;\n readAsDataURL(stream: MSStream, size?: number): void;\n readAsText(stream: MSStream, encoding?: string, size?: number): void;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n addEventListener(type: K, listener: (this: MSStreamReader, ev: MSStreamReaderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MSStreamReader, ev: MSStreamReaderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MSStreamReader: {\n prototype: MSStreamReader;\n new(): MSStreamReader;\n readonly DONE: number;\n readonly EMPTY: number;\n readonly LOADING: number;\n};\n\ninterface MediaDeviceInfo {\n readonly deviceId: string;\n readonly groupId: string;\n readonly kind: MediaDeviceKind;\n readonly label: string;\n}\n\ndeclare var MediaDeviceInfo: {\n prototype: MediaDeviceInfo;\n new(): MediaDeviceInfo;\n};\n\ninterface MediaDevicesEventMap {\n \"devicechange\": Event;\n}\n\ninterface MediaDevices extends EventTarget {\n ondevicechange: ((this: MediaDevices, ev: Event) => any) | null;\n enumerateDevices(): Promise;\n getSupportedConstraints(): MediaTrackSupportedConstraints;\n getUserMedia(constraints: MediaStreamConstraints): Promise;\n addEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaDevices, ev: MediaDevicesEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaDevices: {\n prototype: MediaDevices;\n new(): MediaDevices;\n};\n\ninterface MediaElementAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaElementAudioSourceNode: {\n prototype: MediaElementAudioSourceNode;\n new(): MediaElementAudioSourceNode;\n};\n\ninterface MediaEncryptedEvent extends Event {\n readonly initData: ArrayBuffer | null;\n readonly initDataType: string;\n}\n\ndeclare var MediaEncryptedEvent: {\n prototype: MediaEncryptedEvent;\n new(type: string, eventInitDict?: MediaEncryptedEventInit): MediaEncryptedEvent;\n};\n\ninterface MediaError {\n readonly code: number;\n readonly msExtendedCode: number;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n}\n\ndeclare var MediaError: {\n prototype: MediaError;\n new(): MediaError;\n readonly MEDIA_ERR_ABORTED: number;\n readonly MEDIA_ERR_DECODE: number;\n readonly MEDIA_ERR_NETWORK: number;\n readonly MEDIA_ERR_SRC_NOT_SUPPORTED: number;\n readonly MS_MEDIA_ERR_ENCRYPTED: number;\n};\n\ninterface MediaKeyMessageEvent extends Event {\n readonly message: ArrayBuffer;\n readonly messageType: MediaKeyMessageType;\n}\n\ndeclare var MediaKeyMessageEvent: {\n prototype: MediaKeyMessageEvent;\n new(type: string, eventInitDict?: MediaKeyMessageEventInit): MediaKeyMessageEvent;\n};\n\ninterface MediaKeySession extends EventTarget {\n readonly closed: Promise;\n readonly expiration: number;\n readonly keyStatuses: MediaKeyStatusMap;\n readonly sessionId: string;\n close(): Promise;\n generateRequest(initDataType: string, initData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n load(sessionId: string): Promise;\n remove(): Promise;\n update(response: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n}\n\ndeclare var MediaKeySession: {\n prototype: MediaKeySession;\n new(): MediaKeySession;\n};\n\ninterface MediaKeyStatusMap {\n readonly size: number;\n forEach(callback: Function, thisArg?: any): void;\n get(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): MediaKeyStatus;\n has(keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): boolean;\n}\n\ndeclare var MediaKeyStatusMap: {\n prototype: MediaKeyStatusMap;\n new(): MediaKeyStatusMap;\n};\n\ninterface MediaKeySystemAccess {\n readonly keySystem: string;\n createMediaKeys(): Promise;\n getConfiguration(): MediaKeySystemConfiguration;\n}\n\ndeclare var MediaKeySystemAccess: {\n prototype: MediaKeySystemAccess;\n new(): MediaKeySystemAccess;\n};\n\ninterface MediaKeys {\n createSession(sessionType?: MediaKeySessionType): MediaKeySession;\n setServerCertificate(serverCertificate: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): Promise;\n}\n\ndeclare var MediaKeys: {\n prototype: MediaKeys;\n new(): MediaKeys;\n};\n\ninterface MediaList {\n readonly length: number;\n mediaText: string;\n appendMedium(medium: string): void;\n deleteMedium(medium: string): void;\n item(index: number): string | null;\n toString(): number;\n [index: number]: string;\n}\n\ndeclare var MediaList: {\n prototype: MediaList;\n new(): MediaList;\n};\n\ninterface MediaQueryList {\n readonly matches: boolean;\n readonly media: string;\n addListener(listener: MediaQueryListListener): void;\n removeListener(listener: MediaQueryListListener): void;\n}\n\ndeclare var MediaQueryList: {\n prototype: MediaQueryList;\n new(): MediaQueryList;\n};\n\ninterface MediaSource extends EventTarget {\n readonly activeSourceBuffers: SourceBufferList;\n duration: number;\n readonly readyState: string;\n readonly sourceBuffers: SourceBufferList;\n addSourceBuffer(type: string): SourceBuffer;\n endOfStream(error?: number): void;\n removeSourceBuffer(sourceBuffer: SourceBuffer): void;\n}\n\ndeclare var MediaSource: {\n prototype: MediaSource;\n new(): MediaSource;\n isTypeSupported(type: string): boolean;\n};\n\ninterface MediaStreamEventMap {\n \"active\": Event;\n \"addtrack\": MediaStreamTrackEvent;\n \"inactive\": Event;\n \"removetrack\": MediaStreamTrackEvent;\n}\n\ninterface MediaStream extends EventTarget {\n readonly active: boolean;\n readonly id: string;\n onactive: ((this: MediaStream, ev: Event) => any) | null;\n onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\n oninactive: ((this: MediaStream, ev: Event) => any) | null;\n onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;\n addTrack(track: MediaStreamTrack): void;\n clone(): MediaStream;\n getAudioTracks(): MediaStreamTrack[];\n getTrackById(trackId: string): MediaStreamTrack | null;\n getTracks(): MediaStreamTrack[];\n getVideoTracks(): MediaStreamTrack[];\n removeTrack(track: MediaStreamTrack): void;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStream: {\n prototype: MediaStream;\n new(): MediaStream;\n new(stream: MediaStream): MediaStream;\n new(tracks: MediaStreamTrack[]): MediaStream;\n};\n\ninterface MediaStreamAudioSourceNode extends AudioNode {\n}\n\ndeclare var MediaStreamAudioSourceNode: {\n prototype: MediaStreamAudioSourceNode;\n new(): MediaStreamAudioSourceNode;\n};\n\ninterface MediaStreamError {\n readonly constraintName: string | null;\n readonly message: string | null;\n readonly name: string;\n}\n\ndeclare var MediaStreamError: {\n prototype: MediaStreamError;\n new(): MediaStreamError;\n};\n\ninterface MediaStreamErrorEvent extends Event {\n readonly error: MediaStreamError | null;\n}\n\ndeclare var MediaStreamErrorEvent: {\n prototype: MediaStreamErrorEvent;\n new(typeArg: string, eventInitDict?: MediaStreamErrorEventInit): MediaStreamErrorEvent;\n};\n\ninterface MediaStreamEvent extends Event {\n readonly stream: MediaStream | null;\n}\n\ndeclare var MediaStreamEvent: {\n prototype: MediaStreamEvent;\n new(type: string, eventInitDict: MediaStreamEventInit): MediaStreamEvent;\n};\n\ninterface MediaStreamTrackEventMap {\n \"ended\": MediaStreamErrorEvent;\n \"mute\": Event;\n \"overconstrained\": MediaStreamErrorEvent;\n \"unmute\": Event;\n}\n\ninterface MediaStreamTrack extends EventTarget {\n enabled: boolean;\n readonly id: string;\n readonly kind: string;\n readonly label: string;\n readonly muted: boolean;\n onended: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;\n onmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\n onoverconstrained: ((this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any) | null;\n onunmute: ((this: MediaStreamTrack, ev: Event) => any) | null;\n readonly readonly: boolean;\n readonly readyState: MediaStreamTrackState;\n readonly remote: boolean;\n applyConstraints(constraints: MediaTrackConstraints): Promise;\n clone(): MediaStreamTrack;\n getCapabilities(): MediaTrackCapabilities;\n getConstraints(): MediaTrackConstraints;\n getSettings(): MediaTrackSettings;\n stop(): void;\n addEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MediaStreamTrack, ev: MediaStreamTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MediaStreamTrack: {\n prototype: MediaStreamTrack;\n new(): MediaStreamTrack;\n};\n\ninterface MediaStreamTrackEvent extends Event {\n readonly track: MediaStreamTrack;\n}\n\ndeclare var MediaStreamTrackEvent: {\n prototype: MediaStreamTrackEvent;\n new(typeArg: string, eventInitDict?: MediaStreamTrackEventInit): MediaStreamTrackEvent;\n};\n\ninterface MessageChannel {\n readonly port1: MessagePort;\n readonly port2: MessagePort;\n}\n\ndeclare var MessageChannel: {\n prototype: MessageChannel;\n new(): MessageChannel;\n};\n\ninterface MessageEvent extends Event {\n readonly data: any;\n readonly origin: string;\n readonly ports: ReadonlyArray;\n readonly source: Window | null;\n initMessageEvent(type: string, bubbles: boolean, cancelable: boolean, data: any, origin: string, lastEventId: string, source: Window): void;\n}\n\ndeclare var MessageEvent: {\n prototype: MessageEvent;\n new(type: string, eventInitDict?: MessageEventInit): MessageEvent;\n};\n\ninterface MessagePortEventMap {\n \"message\": MessageEvent;\n}\n\ninterface MessagePort extends EventTarget {\n onmessage: ((this: MessagePort, ev: MessageEvent) => any) | null;\n close(): void;\n postMessage(message?: any, transfer?: any[]): void;\n start(): void;\n addEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: MessagePort, ev: MessagePortEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var MessagePort: {\n prototype: MessagePort;\n new(): MessagePort;\n};\n\ninterface MimeType {\n readonly description: string;\n readonly enabledPlugin: Plugin;\n readonly suffixes: string;\n readonly type: string;\n}\n\ndeclare var MimeType: {\n prototype: MimeType;\n new(): MimeType;\n};\n\ninterface MimeTypeArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(type: string): Plugin;\n [index: number]: Plugin;\n}\n\ndeclare var MimeTypeArray: {\n prototype: MimeTypeArray;\n new(): MimeTypeArray;\n};\n\ninterface MouseEvent extends UIEvent {\n readonly altKey: boolean;\n readonly button: number;\n readonly buttons: number;\n readonly clientX: number;\n readonly clientY: number;\n readonly ctrlKey: boolean;\n /** @deprecated */\n readonly fromElement: Element;\n readonly layerX: number;\n readonly layerY: number;\n readonly metaKey: boolean;\n readonly movementX: number;\n readonly movementY: number;\n readonly offsetX: number;\n readonly offsetY: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly relatedTarget: EventTarget;\n readonly screenX: number;\n readonly screenY: number;\n readonly shiftKey: boolean;\n /** @deprecated */\n readonly toElement: Element;\n /** @deprecated */\n readonly which: number;\n readonly x: number;\n readonly y: number;\n getModifierState(keyArg: string): boolean;\n initMouseEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget | null): void;\n}\n\ndeclare var MouseEvent: {\n prototype: MouseEvent;\n new(typeArg: string, eventInitDict?: MouseEventInit): MouseEvent;\n};\n\ninterface MutationEvent extends Event {\n readonly attrChange: number;\n readonly attrName: string;\n readonly newValue: string;\n readonly prevValue: string;\n readonly relatedNode: Node;\n initMutationEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, relatedNodeArg: Node, prevValueArg: string, newValueArg: string, attrNameArg: string, attrChangeArg: number): void;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n}\n\ndeclare var MutationEvent: {\n prototype: MutationEvent;\n new(): MutationEvent;\n readonly ADDITION: number;\n readonly MODIFICATION: number;\n readonly REMOVAL: number;\n};\n\ninterface MutationObserver {\n disconnect(): void;\n observe(target: Node, options: MutationObserverInit): void;\n takeRecords(): MutationRecord[];\n}\n\ndeclare var MutationObserver: {\n prototype: MutationObserver;\n new(callback: MutationCallback): MutationObserver;\n};\n\ninterface MutationRecord {\n readonly addedNodes: NodeList;\n readonly attributeName: string | null;\n readonly attributeNamespace: string | null;\n readonly nextSibling: Node | null;\n readonly oldValue: string | null;\n readonly previousSibling: Node | null;\n readonly removedNodes: NodeList;\n readonly target: Node;\n readonly type: MutationRecordType;\n}\n\ndeclare var MutationRecord: {\n prototype: MutationRecord;\n new(): MutationRecord;\n};\n\ninterface NamedNodeMap {\n readonly length: number;\n getNamedItem(qualifiedName: string): Attr | null;\n getNamedItemNS(namespace: string | null, localName: string): Attr | null;\n item(index: number): Attr | null;\n removeNamedItem(qualifiedName: string): Attr;\n removeNamedItemNS(namespace: string | null, localName: string): Attr;\n setNamedItem(attr: Attr): Attr | null;\n setNamedItemNS(attr: Attr): Attr | null;\n [index: number]: Attr;\n}\n\ndeclare var NamedNodeMap: {\n prototype: NamedNodeMap;\n new(): NamedNodeMap;\n};\n\ninterface Navigator extends NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia, NavigatorLanguage {\n readonly activeVRDisplays: ReadonlyArray;\n readonly authentication: WebAuthentication;\n readonly cookieEnabled: boolean;\n readonly doNotTrack: string | null;\n gamepadInputEmulation: GamepadInputEmulationType;\n readonly geolocation: Geolocation;\n readonly maxTouchPoints: number;\n readonly mimeTypes: MimeTypeArray;\n readonly msManipulationViewsEnabled: boolean;\n readonly msMaxTouchPoints: number;\n readonly msPointerEnabled: boolean;\n readonly plugins: PluginArray;\n readonly pointerEnabled: boolean;\n readonly serviceWorker: ServiceWorkerContainer;\n readonly webdriver: boolean;\n getGamepads(): (Gamepad | null)[];\n getVRDisplays(): Promise;\n javaEnabled(): boolean;\n msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;\n requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise;\n vibrate(pattern: number | number[]): boolean;\n}\n\ndeclare var Navigator: {\n prototype: Navigator;\n new(): Navigator;\n};\n\ninterface NavigatorBeacon {\n sendBeacon(url: string, data?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null): boolean;\n}\n\ninterface NavigatorConcurrentHardware {\n readonly hardwareConcurrency: number;\n}\n\ninterface NavigatorContentUtils {\n}\n\ninterface NavigatorID {\n readonly appCodeName: string;\n readonly appName: string;\n readonly appVersion: string;\n readonly platform: string;\n readonly product: string;\n readonly productSub: string;\n readonly userAgent: string;\n readonly vendor: string;\n readonly vendorSub: string;\n}\n\ninterface NavigatorLanguage {\n readonly language: string;\n readonly languages: ReadonlyArray;\n}\n\ninterface NavigatorOnLine {\n readonly onLine: boolean;\n}\n\ninterface NavigatorStorageUtils {\n}\n\ninterface NavigatorUserMedia {\n readonly mediaDevices: MediaDevices;\n getDisplayMedia(constraints: MediaStreamConstraints): Promise;\n getUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;\n}\n\ninterface Node extends EventTarget {\n readonly baseURI: string | null;\n readonly childNodes: NodeListOf;\n readonly firstChild: Node | null;\n readonly lastChild: Node | null;\n readonly localName: string | null;\n readonly namespaceURI: string | null;\n readonly nextSibling: Node | null;\n readonly nodeName: string;\n readonly nodeType: number;\n nodeValue: string | null;\n readonly ownerDocument: Document;\n readonly parentElement: HTMLElement | null;\n readonly parentNode: Node | null;\n readonly previousSibling: Node | null;\n textContent: string | null;\n appendChild(newChild: T): T;\n cloneNode(deep?: boolean): Node;\n compareDocumentPosition(other: Node): number;\n contains(child: Node): boolean;\n hasChildNodes(): boolean;\n insertBefore(newChild: T, refChild: Node | null): T;\n isDefaultNamespace(namespaceURI: string | null): boolean;\n isEqualNode(arg: Node): boolean;\n isSameNode(other: Node): boolean;\n lookupNamespaceURI(prefix: string | null): string | null;\n lookupPrefix(namespaceURI: string | null): string | null;\n normalize(): void;\n removeChild(oldChild: T): T;\n replaceChild(newChild: Node, oldChild: T): T;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n}\n\ndeclare var Node: {\n prototype: Node;\n new(): Node;\n readonly ATTRIBUTE_NODE: number;\n readonly CDATA_SECTION_NODE: number;\n readonly COMMENT_NODE: number;\n readonly DOCUMENT_FRAGMENT_NODE: number;\n readonly DOCUMENT_NODE: number;\n readonly DOCUMENT_POSITION_CONTAINED_BY: number;\n readonly DOCUMENT_POSITION_CONTAINS: number;\n readonly DOCUMENT_POSITION_DISCONNECTED: number;\n readonly DOCUMENT_POSITION_FOLLOWING: number;\n readonly DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC: number;\n readonly DOCUMENT_POSITION_PRECEDING: number;\n readonly DOCUMENT_TYPE_NODE: number;\n readonly ELEMENT_NODE: number;\n readonly ENTITY_NODE: number;\n readonly ENTITY_REFERENCE_NODE: number;\n readonly NOTATION_NODE: number;\n readonly PROCESSING_INSTRUCTION_NODE: number;\n readonly TEXT_NODE: number;\n};\n\ninterface NodeFilter {\n acceptNode(node: Node): number;\n}\n\ndeclare var NodeFilter: {\n readonly FILTER_ACCEPT: number;\n readonly FILTER_REJECT: number;\n readonly FILTER_SKIP: number;\n readonly SHOW_ALL: number;\n readonly SHOW_ATTRIBUTE: number;\n readonly SHOW_CDATA_SECTION: number;\n readonly SHOW_COMMENT: number;\n readonly SHOW_DOCUMENT: number;\n readonly SHOW_DOCUMENT_FRAGMENT: number;\n readonly SHOW_DOCUMENT_TYPE: number;\n readonly SHOW_ELEMENT: number;\n readonly SHOW_ENTITY: number;\n readonly SHOW_ENTITY_REFERENCE: number;\n readonly SHOW_NOTATION: number;\n readonly SHOW_PROCESSING_INSTRUCTION: number;\n readonly SHOW_TEXT: number;\n};\n\ninterface NodeIterator {\n /** @deprecated */\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter | null;\n readonly root: Node;\n readonly whatToShow: number;\n detach(): void;\n nextNode(): Node | null;\n previousNode(): Node | null;\n}\n\ndeclare var NodeIterator: {\n prototype: NodeIterator;\n new(): NodeIterator;\n};\n\ninterface NodeList {\n readonly length: number;\n item(index: number): Node;\n [index: number]: Node;\n}\n\ndeclare var NodeList: {\n prototype: NodeList;\n new(): NodeList;\n};\n\ninterface NodeListOf extends NodeList {\n length: number;\n item(index: number): TNode;\n [index: number]: TNode;\n}\n\ninterface NodeSelector {\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface NotificationEventMap {\n \"click\": Event;\n \"close\": Event;\n \"error\": Event;\n \"show\": Event;\n}\n\ninterface Notification extends EventTarget {\n readonly body: string | null;\n readonly data: any;\n readonly dir: NotificationDirection;\n readonly icon: string | null;\n readonly lang: string | null;\n onclick: ((this: Notification, ev: Event) => any) | null;\n onclose: ((this: Notification, ev: Event) => any) | null;\n onerror: ((this: Notification, ev: Event) => any) | null;\n onshow: ((this: Notification, ev: Event) => any) | null;\n readonly permission: NotificationPermission;\n readonly tag: string | null;\n readonly title: string;\n close(): void;\n addEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Notification, ev: NotificationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Notification: {\n prototype: Notification;\n new(title: string, options?: NotificationOptions): Notification;\n requestPermission(callback?: NotificationPermissionCallback): Promise;\n};\n\ninterface OES_element_index_uint {\n}\n\ndeclare var OES_element_index_uint: {\n prototype: OES_element_index_uint;\n new(): OES_element_index_uint;\n};\n\ninterface OES_standard_derivatives {\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n}\n\ndeclare var OES_standard_derivatives: {\n prototype: OES_standard_derivatives;\n new(): OES_standard_derivatives;\n readonly FRAGMENT_SHADER_DERIVATIVE_HINT_OES: number;\n};\n\ninterface OES_texture_float {\n}\n\ndeclare var OES_texture_float: {\n prototype: OES_texture_float;\n new(): OES_texture_float;\n};\n\ninterface OES_texture_float_linear {\n}\n\ndeclare var OES_texture_float_linear: {\n prototype: OES_texture_float_linear;\n new(): OES_texture_float_linear;\n};\n\ninterface OES_texture_half_float {\n readonly HALF_FLOAT_OES: number;\n}\n\ndeclare var OES_texture_half_float: {\n prototype: OES_texture_half_float;\n new(): OES_texture_half_float;\n readonly HALF_FLOAT_OES: number;\n};\n\ninterface OES_texture_half_float_linear {\n}\n\ndeclare var OES_texture_half_float_linear: {\n prototype: OES_texture_half_float_linear;\n new(): OES_texture_half_float_linear;\n};\n\ninterface OES_vertex_array_object {\n readonly VERTEX_ARRAY_BINDING_OES: number;\n bindVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n createVertexArrayOES(): WebGLVertexArrayObjectOES;\n deleteVertexArrayOES(arrayObject: WebGLVertexArrayObjectOES): void;\n isVertexArrayOES(value: any): value is WebGLVertexArrayObjectOES;\n}\n\ninterface OfflineAudioCompletionEvent extends Event {\n readonly renderedBuffer: AudioBuffer;\n}\n\ndeclare var OfflineAudioCompletionEvent: {\n prototype: OfflineAudioCompletionEvent;\n new(): OfflineAudioCompletionEvent;\n};\n\ninterface OfflineAudioContextEventMap extends AudioContextEventMap {\n \"complete\": OfflineAudioCompletionEvent;\n}\n\ninterface OfflineAudioContext extends AudioContextBase {\n readonly length: number;\n oncomplete: ((this: OfflineAudioContext, ev: OfflineAudioCompletionEvent) => any) | null;\n startRendering(): Promise;\n suspend(suspendTime: number): Promise;\n addEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OfflineAudioContext, ev: OfflineAudioContextEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OfflineAudioContext: {\n prototype: OfflineAudioContext;\n new(numberOfChannels: number, length: number, sampleRate: number): OfflineAudioContext;\n};\n\ninterface OscillatorNodeEventMap {\n \"ended\": Event;\n}\n\ninterface OscillatorNode extends AudioNode {\n readonly detune: AudioParam;\n readonly frequency: AudioParam;\n onended: ((this: OscillatorNode, ev: Event) => any) | null;\n type: OscillatorType;\n setPeriodicWave(periodicWave: PeriodicWave): void;\n start(when?: number): void;\n stop(when?: number): void;\n addEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: OscillatorNode, ev: OscillatorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var OscillatorNode: {\n prototype: OscillatorNode;\n new(): OscillatorNode;\n};\n\ninterface OverflowEvent extends UIEvent {\n readonly horizontalOverflow: boolean;\n readonly orient: number;\n readonly verticalOverflow: boolean;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n}\n\ndeclare var OverflowEvent: {\n prototype: OverflowEvent;\n new(): OverflowEvent;\n readonly BOTH: number;\n readonly HORIZONTAL: number;\n readonly VERTICAL: number;\n};\n\ninterface PageTransitionEvent extends Event {\n readonly persisted: boolean;\n}\n\ndeclare var PageTransitionEvent: {\n prototype: PageTransitionEvent;\n new(): PageTransitionEvent;\n};\n\ninterface PannerNode extends AudioNode {\n coneInnerAngle: number;\n coneOuterAngle: number;\n coneOuterGain: number;\n distanceModel: DistanceModelType;\n maxDistance: number;\n panningModel: PanningModelType;\n refDistance: number;\n rolloffFactor: number;\n /** @deprecated */\n setOrientation(x: number, y: number, z: number): void;\n /** @deprecated */\n setPosition(x: number, y: number, z: number): void;\n /** @deprecated */\n setVelocity(x: number, y: number, z: number): void;\n}\n\ndeclare var PannerNode: {\n prototype: PannerNode;\n new(): PannerNode;\n};\n\ninterface ParentNode {\n readonly children: HTMLCollection;\n querySelector(selectors: K): HTMLElementTagNameMap[K] | null;\n querySelector(selectors: K): SVGElementTagNameMap[K] | null;\n querySelector(selectors: string): E | null;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: K): NodeListOf;\n querySelectorAll(selectors: string): NodeListOf;\n}\n\ninterface ParentNode {\n readonly childElementCount: number;\n readonly firstElementChild: Element | null;\n readonly lastElementChild: Element | null;\n}\n\ninterface Path2D extends CanvasPathMethods {\n}\n\ndeclare var Path2D: {\n prototype: Path2D;\n new(d?: Path2D | string): Path2D;\n};\n\ninterface PaymentAddress {\n readonly addressLine: string[];\n readonly city: string;\n readonly country: string;\n readonly dependentLocality: string;\n readonly languageCode: string;\n readonly organization: string;\n readonly phone: string;\n readonly postalCode: string;\n readonly recipient: string;\n readonly region: string;\n readonly sortingCode: string;\n toJSON(): any;\n}\n\ndeclare var PaymentAddress: {\n prototype: PaymentAddress;\n new(): PaymentAddress;\n};\n\ninterface PaymentRequestEventMap {\n \"shippingaddresschange\": Event;\n \"shippingoptionchange\": Event;\n}\n\ninterface PaymentRequest extends EventTarget {\n readonly id: string;\n onshippingaddresschange: ((this: PaymentRequest, ev: Event) => any) | null;\n onshippingoptionchange: ((this: PaymentRequest, ev: Event) => any) | null;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n readonly shippingType: PaymentShippingType | null;\n abort(): Promise;\n canMakePayment(): Promise;\n show(): Promise;\n addEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var PaymentRequest: {\n prototype: PaymentRequest;\n new(methodData: PaymentMethodData[], details: PaymentDetailsInit, options?: PaymentOptions): PaymentRequest;\n};\n\ninterface PaymentRequestUpdateEvent extends Event {\n updateWith(detailsPromise: Promise): void;\n}\n\ndeclare var PaymentRequestUpdateEvent: {\n prototype: PaymentRequestUpdateEvent;\n new(type: string, eventInitDict?: PaymentRequestUpdateEventInit): PaymentRequestUpdateEvent;\n};\n\ninterface PaymentResponse {\n readonly details: any;\n readonly methodName: string;\n readonly payerEmail: string | null;\n readonly payerName: string | null;\n readonly payerPhone: string | null;\n readonly requestId: string;\n readonly shippingAddress: PaymentAddress | null;\n readonly shippingOption: string | null;\n complete(result?: PaymentComplete): Promise;\n toJSON(): any;\n}\n\ndeclare var PaymentResponse: {\n prototype: PaymentResponse;\n new(): PaymentResponse;\n};\n\ninterface PerfWidgetExternal {\n readonly activeNetworkRequestCount: number;\n readonly averageFrameTime: number;\n readonly averagePaintTime: number;\n readonly extraInformationEnabled: boolean;\n readonly independentRenderingEnabled: boolean;\n readonly irDisablingContentString: string;\n readonly irStatusAvailable: boolean;\n readonly maxCpuSpeed: number;\n readonly paintRequestsPerSecond: number;\n readonly performanceCounter: number;\n readonly performanceCounterFrequency: number;\n addEventListener(eventType: string, callback: Function): void;\n getMemoryUsage(): number;\n getProcessCpuUsage(): number;\n getRecentCpuUsage(last: number | null): any;\n getRecentFrames(last: number | null): any;\n getRecentMemoryUsage(last: number | null): any;\n getRecentPaintRequests(last: number | null): any;\n removeEventListener(eventType: string, callback: Function): void;\n repositionWindow(x: number, y: number): void;\n resizeWindow(width: number, height: number): void;\n}\n\ndeclare var PerfWidgetExternal: {\n prototype: PerfWidgetExternal;\n new(): PerfWidgetExternal;\n};\n\ninterface Performance {\n /** @deprecated */\n readonly navigation: PerformanceNavigation;\n readonly timeOrigin: number;\n /** @deprecated */\n readonly timing: PerformanceTiming;\n clearMarks(markName?: string): void;\n clearMeasures(measureName?: string): void;\n clearResourceTimings(): void;\n getEntries(): any;\n getEntriesByName(name: string, type?: string): any;\n getEntriesByType(type: string): any;\n /** @deprecated */\n getMarks(markName?: string): any;\n /** @deprecated */\n getMeasures(measureName?: string): any;\n mark(markName: string): void;\n measure(measureName: string, startMarkName?: string, endMarkName?: string): void;\n now(): number;\n setResourceTimingBufferSize(maxSize: number): void;\n toJSON(): any;\n}\n\ndeclare var Performance: {\n prototype: Performance;\n new(): Performance;\n};\n\ninterface PerformanceEntry {\n readonly duration: number;\n readonly entryType: string;\n readonly name: string;\n readonly startTime: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceEntry: {\n prototype: PerformanceEntry;\n new(): PerformanceEntry;\n};\n\ninterface PerformanceMark extends PerformanceEntry {\n}\n\ndeclare var PerformanceMark: {\n prototype: PerformanceMark;\n new(): PerformanceMark;\n};\n\ninterface PerformanceMeasure extends PerformanceEntry {\n}\n\ndeclare var PerformanceMeasure: {\n prototype: PerformanceMeasure;\n new(): PerformanceMeasure;\n};\n\ninterface PerformanceNavigation {\n readonly redirectCount: number;\n readonly type: number;\n toJSON(): any;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n}\n\ndeclare var PerformanceNavigation: {\n prototype: PerformanceNavigation;\n new(): PerformanceNavigation;\n readonly TYPE_BACK_FORWARD: number;\n readonly TYPE_NAVIGATE: number;\n readonly TYPE_RELOAD: number;\n readonly TYPE_RESERVED: number;\n};\n\ninterface PerformanceNavigationTiming extends PerformanceEntry {\n /** @deprecated */\n readonly connectEnd: number;\n /** @deprecated */\n readonly connectStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n /** @deprecated */\n readonly domLoading: number;\n /** @deprecated */\n readonly domainLookupEnd: number;\n /** @deprecated */\n readonly domainLookupStart: number;\n /** @deprecated */\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n /** @deprecated */\n readonly navigationStart: number;\n readonly redirectCount: number;\n /** @deprecated */\n readonly redirectEnd: number;\n /** @deprecated */\n readonly redirectStart: number;\n /** @deprecated */\n readonly requestStart: number;\n /** @deprecated */\n readonly responseEnd: number;\n /** @deprecated */\n readonly responseStart: number;\n readonly type: NavigationType;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n readonly workerStart: number;\n}\n\ndeclare var PerformanceNavigationTiming: {\n prototype: PerformanceNavigationTiming;\n new(): PerformanceNavigationTiming;\n};\n\ninterface PerformanceResourceTiming extends PerformanceEntry {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly fetchStart: number;\n readonly initiatorType: string;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly workerStart: number;\n}\n\ndeclare var PerformanceResourceTiming: {\n prototype: PerformanceResourceTiming;\n new(): PerformanceResourceTiming;\n};\n\ninterface PerformanceTiming {\n readonly connectEnd: number;\n readonly connectStart: number;\n readonly domComplete: number;\n readonly domContentLoadedEventEnd: number;\n readonly domContentLoadedEventStart: number;\n readonly domInteractive: number;\n readonly domLoading: number;\n readonly domainLookupEnd: number;\n readonly domainLookupStart: number;\n readonly fetchStart: number;\n readonly loadEventEnd: number;\n readonly loadEventStart: number;\n readonly msFirstPaint: number;\n readonly navigationStart: number;\n readonly redirectEnd: number;\n readonly redirectStart: number;\n readonly requestStart: number;\n readonly responseEnd: number;\n readonly responseStart: number;\n readonly secureConnectionStart: number;\n readonly unloadEventEnd: number;\n readonly unloadEventStart: number;\n toJSON(): any;\n}\n\ndeclare var PerformanceTiming: {\n prototype: PerformanceTiming;\n new(): PerformanceTiming;\n};\n\ninterface PeriodicWave {\n}\n\ndeclare var PeriodicWave: {\n prototype: PeriodicWave;\n new(): PeriodicWave;\n};\n\ninterface PermissionRequest extends DeferredPermissionRequest {\n readonly state: MSWebViewPermissionState;\n defer(): void;\n}\n\ndeclare var PermissionRequest: {\n prototype: PermissionRequest;\n new(): PermissionRequest;\n};\n\ninterface PermissionRequestedEvent extends Event {\n readonly permissionRequest: PermissionRequest;\n}\n\ndeclare var PermissionRequestedEvent: {\n prototype: PermissionRequestedEvent;\n new(): PermissionRequestedEvent;\n};\n\ninterface Plugin {\n readonly description: string;\n readonly filename: string;\n readonly length: number;\n readonly name: string;\n readonly version: string;\n item(index: number): MimeType;\n namedItem(type: string): MimeType;\n [index: number]: MimeType;\n}\n\ndeclare var Plugin: {\n prototype: Plugin;\n new(): Plugin;\n};\n\ninterface PluginArray {\n readonly length: number;\n item(index: number): Plugin;\n namedItem(name: string): Plugin;\n refresh(reload?: boolean): void;\n [index: number]: Plugin;\n}\n\ndeclare var PluginArray: {\n prototype: PluginArray;\n new(): PluginArray;\n};\n\ninterface PointerEvent extends MouseEvent {\n readonly currentPoint: any;\n readonly height: number;\n readonly hwTimestamp: number;\n readonly intermediatePoints: any;\n readonly isPrimary: boolean;\n readonly pointerId: number;\n readonly pointerType: any;\n readonly pressure: number;\n readonly rotation: number;\n readonly tiltX: number;\n readonly tiltY: number;\n readonly width: number;\n getCurrentPoint(element: Element): void;\n getIntermediatePoints(element: Element): void;\n initPointerEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, ctrlKeyArg: boolean, altKeyArg: boolean, shiftKeyArg: boolean, metaKeyArg: boolean, buttonArg: number, relatedTargetArg: EventTarget, offsetXArg: number, offsetYArg: number, widthArg: number, heightArg: number, pressure: number, rotation: number, tiltX: number, tiltY: number, pointerIdArg: number, pointerType: any, hwTimestampArg: number, isPrimary: boolean): void;\n}\n\ndeclare var PointerEvent: {\n prototype: PointerEvent;\n new(typeArg: string, eventInitDict?: PointerEventInit): PointerEvent;\n};\n\ninterface PopStateEvent extends Event {\n readonly state: any;\n}\n\ndeclare var PopStateEvent: {\n prototype: PopStateEvent;\n new(type: string, eventInitDict?: PopStateEventInit): PopStateEvent;\n};\n\ninterface Position {\n readonly coords: Coordinates;\n readonly timestamp: number;\n}\n\ndeclare var Position: {\n prototype: Position;\n new(): Position;\n};\n\ninterface PositionError {\n readonly code: number;\n readonly message: string;\n toString(): string;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n}\n\ndeclare var PositionError: {\n prototype: PositionError;\n new(): PositionError;\n readonly PERMISSION_DENIED: number;\n readonly POSITION_UNAVAILABLE: number;\n readonly TIMEOUT: number;\n};\n\ninterface ProcessingInstruction extends CharacterData {\n readonly target: string;\n}\n\ndeclare var ProcessingInstruction: {\n prototype: ProcessingInstruction;\n new(): ProcessingInstruction;\n};\n\ninterface ProgressEvent extends Event {\n readonly lengthComputable: boolean;\n readonly loaded: number;\n readonly total: number;\n initProgressEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, lengthComputableArg: boolean, loadedArg: number, totalArg: number): void;\n}\n\ndeclare var ProgressEvent: {\n prototype: ProgressEvent;\n new(typeArg: string, eventInitDict?: ProgressEventInit): ProgressEvent;\n};\n\ninterface PromiseRejectionEvent extends Event {\n readonly promise: PromiseLike;\n readonly reason: any;\n}\n\ninterface PromiseRejectionEventInit extends EventInit {\n promise: PromiseLike;\n reason?: any;\n}\n\ninterface PushManager {\n readonly supportedContentEncodings: ReadonlyArray;\n getSubscription(): Promise;\n permissionState(options?: PushSubscriptionOptionsInit): Promise;\n subscribe(options?: PushSubscriptionOptionsInit): Promise;\n}\n\ndeclare var PushManager: {\n prototype: PushManager;\n new(): PushManager;\n};\n\ninterface PushSubscription {\n readonly endpoint: string;\n readonly expirationTime: number | null;\n readonly options: PushSubscriptionOptions;\n getKey(name: PushEncryptionKeyName): ArrayBuffer | null;\n toJSON(): any;\n unsubscribe(): Promise;\n}\n\ndeclare var PushSubscription: {\n prototype: PushSubscription;\n new(): PushSubscription;\n};\n\ninterface PushSubscriptionOptions {\n readonly applicationServerKey: ArrayBuffer | null;\n readonly userVisibleOnly: boolean;\n}\n\ndeclare var PushSubscriptionOptions: {\n prototype: PushSubscriptionOptions;\n new(): PushSubscriptionOptions;\n};\n\ninterface RTCDTMFToneChangeEvent extends Event {\n readonly tone: string;\n}\n\ndeclare var RTCDTMFToneChangeEvent: {\n prototype: RTCDTMFToneChangeEvent;\n new(typeArg: string, eventInitDict: RTCDTMFToneChangeEventInit): RTCDTMFToneChangeEvent;\n};\n\ninterface RTCDtlsTransportEventMap {\n \"dtlsstatechange\": RTCDtlsTransportStateChangedEvent;\n \"error\": Event;\n}\n\ninterface RTCDtlsTransport extends RTCStatsProvider {\n ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null;\n onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null;\n readonly state: RTCDtlsTransportState;\n readonly transport: RTCIceTransport;\n getLocalParameters(): RTCDtlsParameters;\n getRemoteCertificates(): ArrayBuffer[];\n getRemoteParameters(): RTCDtlsParameters | null;\n start(remoteParameters: RTCDtlsParameters): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtlsTransport, ev: RTCDtlsTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtlsTransport: {\n prototype: RTCDtlsTransport;\n new(transport: RTCIceTransport): RTCDtlsTransport;\n};\n\ninterface RTCDtlsTransportStateChangedEvent extends Event {\n readonly state: RTCDtlsTransportState;\n}\n\ndeclare var RTCDtlsTransportStateChangedEvent: {\n prototype: RTCDtlsTransportStateChangedEvent;\n new(): RTCDtlsTransportStateChangedEvent;\n};\n\ninterface RTCDtmfSenderEventMap {\n \"tonechange\": RTCDTMFToneChangeEvent;\n}\n\ninterface RTCDtmfSender extends EventTarget {\n readonly canInsertDTMF: boolean;\n readonly duration: number;\n readonly interToneGap: number;\n ontonechange: ((this: RTCDtmfSender, ev: RTCDTMFToneChangeEvent) => any) | null;\n readonly sender: RTCRtpSender;\n readonly toneBuffer: string;\n insertDTMF(tones: string, duration?: number, interToneGap?: number): void;\n addEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCDtmfSender, ev: RTCDtmfSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCDtmfSender: {\n prototype: RTCDtmfSender;\n new(sender: RTCRtpSender): RTCDtmfSender;\n};\n\ninterface RTCIceCandidate {\n candidate: string | null;\n sdpMLineIndex: number | null;\n sdpMid: string | null;\n toJSON(): any;\n}\n\ndeclare var RTCIceCandidate: {\n prototype: RTCIceCandidate;\n new(candidateInitDict?: RTCIceCandidateInit): RTCIceCandidate;\n};\n\ninterface RTCIceCandidatePairChangedEvent extends Event {\n readonly pair: RTCIceCandidatePair;\n}\n\ndeclare var RTCIceCandidatePairChangedEvent: {\n prototype: RTCIceCandidatePairChangedEvent;\n new(): RTCIceCandidatePairChangedEvent;\n};\n\ninterface RTCIceGathererEventMap {\n \"error\": Event;\n \"localcandidate\": RTCIceGathererEvent;\n}\n\ninterface RTCIceGatherer extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n onerror: ((this: RTCIceGatherer, ev: Event) => any) | null;\n onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;\n createAssociatedGatherer(): RTCIceGatherer;\n getLocalCandidates(): RTCIceCandidateDictionary[];\n getLocalParameters(): RTCIceParameters;\n addEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceGatherer, ev: RTCIceGathererEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceGatherer: {\n prototype: RTCIceGatherer;\n new(options: RTCIceGatherOptions): RTCIceGatherer;\n};\n\ninterface RTCIceGathererEvent extends Event {\n readonly candidate: RTCIceCandidateDictionary | RTCIceCandidateComplete;\n}\n\ndeclare var RTCIceGathererEvent: {\n prototype: RTCIceGathererEvent;\n new(): RTCIceGathererEvent;\n};\n\ninterface RTCIceTransportEventMap {\n \"candidatepairchange\": RTCIceCandidatePairChangedEvent;\n \"icestatechange\": RTCIceTransportStateChangedEvent;\n}\n\ninterface RTCIceTransport extends RTCStatsProvider {\n readonly component: RTCIceComponent;\n readonly iceGatherer: RTCIceGatherer | null;\n oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null;\n onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null;\n readonly role: RTCIceRole;\n readonly state: RTCIceTransportState;\n addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void;\n createAssociatedTransport(): RTCIceTransport;\n getNominatedCandidatePair(): RTCIceCandidatePair | null;\n getRemoteCandidates(): RTCIceCandidateDictionary[];\n getRemoteParameters(): RTCIceParameters | null;\n setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void;\n start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCIceTransport: {\n prototype: RTCIceTransport;\n new(): RTCIceTransport;\n};\n\ninterface RTCIceTransportStateChangedEvent extends Event {\n readonly state: RTCIceTransportState;\n}\n\ndeclare var RTCIceTransportStateChangedEvent: {\n prototype: RTCIceTransportStateChangedEvent;\n new(): RTCIceTransportStateChangedEvent;\n};\n\ninterface RTCPeerConnectionEventMap {\n \"addstream\": MediaStreamEvent;\n \"icecandidate\": RTCPeerConnectionIceEvent;\n \"iceconnectionstatechange\": Event;\n \"icegatheringstatechange\": Event;\n \"negotiationneeded\": Event;\n \"removestream\": MediaStreamEvent;\n \"signalingstatechange\": Event;\n}\n\ninterface RTCPeerConnection extends EventTarget {\n readonly canTrickleIceCandidates: boolean | null;\n readonly iceConnectionState: RTCIceConnectionState;\n readonly iceGatheringState: RTCIceGatheringState;\n readonly localDescription: RTCSessionDescription | null;\n onaddstream: ((this: RTCPeerConnection, ev: MediaStreamEvent) => any) | null;\n onicecandidate: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any) | null;\n oniceconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null;\n onremovestream: ((this: RTCPeerConnection, ev: MediaStreamEvent) => any) | null;\n onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;\n readonly remoteDescription: RTCSessionDescription | null;\n readonly signalingState: RTCSignalingState;\n addIceCandidate(candidate: RTCIceCandidateInit | RTCIceCandidate): Promise;\n addStream(stream: MediaStream): void;\n close(): void;\n createAnswer(options?: RTCOfferOptions): Promise;\n createOffer(options?: RTCOfferOptions): Promise;\n getConfiguration(): RTCConfiguration;\n getLocalStreams(): MediaStream[];\n getRemoteStreams(): MediaStream[];\n getStats(selector: MediaStreamTrack | null, successCallback?: RTCStatsCallback, failureCallback?: RTCPeerConnectionErrorCallback): Promise;\n getStreamById(streamId: string): MediaStream | null;\n removeStream(stream: MediaStream): void;\n setLocalDescription(description: RTCSessionDescriptionInit): Promise;\n setRemoteDescription(description: RTCSessionDescriptionInit): Promise;\n addEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCPeerConnection: {\n prototype: RTCPeerConnection;\n new(configuration: RTCConfiguration): RTCPeerConnection;\n};\n\ninterface RTCPeerConnectionIceEvent extends Event {\n readonly candidate: RTCIceCandidate;\n}\n\ndeclare var RTCPeerConnectionIceEvent: {\n prototype: RTCPeerConnectionIceEvent;\n new(type: string, eventInitDict: RTCPeerConnectionIceEventInit): RTCPeerConnectionIceEvent;\n};\n\ninterface RTCRtpReceiverEventMap {\n \"error\": Event;\n \"msdecodercapacitychange\": Event;\n \"msdsh\": Event;\n}\n\ninterface RTCRtpReceiver extends RTCStatsProvider {\n onerror: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n onmsdecodercapacitychange: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n onmsdsh: ((this: RTCRtpReceiver, ev: Event) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack | null;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n getContributingSources(): RTCRtpContributingSource[];\n receive(parameters: RTCRtpParameters): void;\n requestSendCSRC(csrc: number): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpReceiver, ev: RTCRtpReceiverEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpReceiver: {\n prototype: RTCRtpReceiver;\n new(transport: RTCDtlsTransport | RTCSrtpSdesTransport, kind: string, rtcpTransport?: RTCDtlsTransport): RTCRtpReceiver;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCRtpSenderEventMap {\n \"error\": Event;\n \"ssrcconflict\": RTCSsrcConflictEvent;\n}\n\ninterface RTCRtpSender extends RTCStatsProvider {\n onerror: ((this: RTCRtpSender, ev: Event) => any) | null;\n onssrcconflict: ((this: RTCRtpSender, ev: RTCSsrcConflictEvent) => any) | null;\n readonly rtcpTransport: RTCDtlsTransport;\n readonly track: MediaStreamTrack;\n readonly transport: RTCDtlsTransport | RTCSrtpSdesTransport;\n send(parameters: RTCRtpParameters): void;\n setTrack(track: MediaStreamTrack): void;\n setTransport(transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): void;\n stop(): void;\n addEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCRtpSender, ev: RTCRtpSenderEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCRtpSender: {\n prototype: RTCRtpSender;\n new(track: MediaStreamTrack, transport: RTCDtlsTransport | RTCSrtpSdesTransport, rtcpTransport?: RTCDtlsTransport): RTCRtpSender;\n getCapabilities(kind?: string): RTCRtpCapabilities;\n};\n\ninterface RTCSessionDescription {\n sdp: string | null;\n type: RTCSdpType | null;\n toJSON(): any;\n}\n\ndeclare var RTCSessionDescription: {\n prototype: RTCSessionDescription;\n new(descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;\n};\n\ninterface RTCSrtpSdesTransportEventMap {\n \"error\": Event;\n}\n\ninterface RTCSrtpSdesTransport extends EventTarget {\n onerror: ((this: RTCSrtpSdesTransport, ev: Event) => any) | null;\n readonly transport: RTCIceTransport;\n addEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: RTCSrtpSdesTransport, ev: RTCSrtpSdesTransportEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var RTCSrtpSdesTransport: {\n prototype: RTCSrtpSdesTransport;\n new(transport: RTCIceTransport, encryptParameters: RTCSrtpSdesParameters, decryptParameters: RTCSrtpSdesParameters): RTCSrtpSdesTransport;\n getLocalParameters(): RTCSrtpSdesParameters[];\n};\n\ninterface RTCSsrcConflictEvent extends Event {\n readonly ssrc: number;\n}\n\ndeclare var RTCSsrcConflictEvent: {\n prototype: RTCSsrcConflictEvent;\n new(): RTCSsrcConflictEvent;\n};\n\ninterface RTCStatsProvider extends EventTarget {\n getStats(): Promise;\n msGetStats(): Promise;\n}\n\ndeclare var RTCStatsProvider: {\n prototype: RTCStatsProvider;\n new(): RTCStatsProvider;\n};\n\ninterface RandomSource {\n getRandomValues(array: T): T;\n}\n\ndeclare var RandomSource: {\n prototype: RandomSource;\n new(): RandomSource;\n};\n\ninterface Range {\n readonly collapsed: boolean;\n readonly commonAncestorContainer: Node;\n readonly endContainer: Node;\n readonly endOffset: number;\n readonly startContainer: Node;\n readonly startOffset: number;\n cloneContents(): DocumentFragment;\n cloneRange(): Range;\n collapse(toStart?: boolean): void;\n compareBoundaryPoints(how: number, sourceRange: Range): number;\n createContextualFragment(fragment: string): DocumentFragment;\n deleteContents(): void;\n detach(): void;\n expand(Unit: ExpandGranularity): boolean;\n extractContents(): DocumentFragment;\n getBoundingClientRect(): ClientRect | DOMRect;\n getClientRects(): ClientRectList | DOMRectList;\n insertNode(node: Node): void;\n isPointInRange(node: Node, offset: number): boolean;\n selectNode(node: Node): void;\n selectNodeContents(node: Node): void;\n setEnd(node: Node, offset: number): void;\n setEndAfter(node: Node): void;\n setEndBefore(node: Node): void;\n setStart(node: Node, offset: number): void;\n setStartAfter(node: Node): void;\n setStartBefore(node: Node): void;\n surroundContents(newParent: Node): void;\n toString(): string;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n}\n\ndeclare var Range: {\n prototype: Range;\n new(): Range;\n readonly END_TO_END: number;\n readonly END_TO_START: number;\n readonly START_TO_END: number;\n readonly START_TO_START: number;\n};\n\ninterface ReadableStream {\n readonly locked: boolean;\n cancel(): Promise;\n getReader(): ReadableStreamReader;\n}\n\ndeclare var ReadableStream: {\n prototype: ReadableStream;\n new(): ReadableStream;\n};\n\ninterface ReadableStreamReader {\n cancel(): Promise;\n read(): Promise;\n releaseLock(): void;\n}\n\ndeclare var ReadableStreamReader: {\n prototype: ReadableStreamReader;\n new(): ReadableStreamReader;\n};\n\ninterface Request extends Body {\n readonly cache: RequestCache;\n readonly credentials: RequestCredentials;\n readonly destination: RequestDestination;\n readonly headers: Headers;\n readonly integrity: string;\n readonly keepalive: boolean;\n readonly method: string;\n readonly mode: RequestMode;\n readonly redirect: RequestRedirect;\n readonly referrer: string;\n readonly referrerPolicy: ReferrerPolicy;\n readonly signal: AbortSignal | null;\n readonly type: RequestType;\n readonly url: string;\n clone(): Request;\n}\n\ndeclare var Request: {\n prototype: Request;\n new(input: Request | string, init?: RequestInit): Request;\n};\n\ninterface Response extends Body {\n readonly body: ReadableStream | null;\n readonly headers: Headers;\n readonly ok: boolean;\n readonly redirected: boolean;\n readonly status: number;\n readonly statusText: string;\n readonly type: ResponseType;\n readonly url: string;\n clone(): Response;\n}\n\ndeclare var Response: {\n prototype: Response;\n new(body?: Blob | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | FormData | string | null, init?: ResponseInit): Response;\n error(): Response;\n redirect(url: string, status?: number): Response;\n};\n\ninterface SVGAElement extends SVGGraphicsElement, SVGURIReference {\n readonly target: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGAElement: {\n prototype: SVGAElement;\n new(): SVGAElement;\n};\n\ninterface SVGAngle {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n}\n\ndeclare var SVGAngle: {\n prototype: SVGAngle;\n new(): SVGAngle;\n readonly SVG_ANGLETYPE_DEG: number;\n readonly SVG_ANGLETYPE_GRAD: number;\n readonly SVG_ANGLETYPE_RAD: number;\n readonly SVG_ANGLETYPE_UNKNOWN: number;\n readonly SVG_ANGLETYPE_UNSPECIFIED: number;\n};\n\ninterface SVGAnimatedAngle {\n readonly animVal: SVGAngle;\n readonly baseVal: SVGAngle;\n}\n\ndeclare var SVGAnimatedAngle: {\n prototype: SVGAnimatedAngle;\n new(): SVGAnimatedAngle;\n};\n\ninterface SVGAnimatedBoolean {\n readonly animVal: boolean;\n baseVal: boolean;\n}\n\ndeclare var SVGAnimatedBoolean: {\n prototype: SVGAnimatedBoolean;\n new(): SVGAnimatedBoolean;\n};\n\ninterface SVGAnimatedEnumeration {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedEnumeration: {\n prototype: SVGAnimatedEnumeration;\n new(): SVGAnimatedEnumeration;\n};\n\ninterface SVGAnimatedInteger {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedInteger: {\n prototype: SVGAnimatedInteger;\n new(): SVGAnimatedInteger;\n};\n\ninterface SVGAnimatedLength {\n readonly animVal: SVGLength;\n readonly baseVal: SVGLength;\n}\n\ndeclare var SVGAnimatedLength: {\n prototype: SVGAnimatedLength;\n new(): SVGAnimatedLength;\n};\n\ninterface SVGAnimatedLengthList {\n readonly animVal: SVGLengthList;\n readonly baseVal: SVGLengthList;\n}\n\ndeclare var SVGAnimatedLengthList: {\n prototype: SVGAnimatedLengthList;\n new(): SVGAnimatedLengthList;\n};\n\ninterface SVGAnimatedNumber {\n readonly animVal: number;\n baseVal: number;\n}\n\ndeclare var SVGAnimatedNumber: {\n prototype: SVGAnimatedNumber;\n new(): SVGAnimatedNumber;\n};\n\ninterface SVGAnimatedNumberList {\n readonly animVal: SVGNumberList;\n readonly baseVal: SVGNumberList;\n}\n\ndeclare var SVGAnimatedNumberList: {\n prototype: SVGAnimatedNumberList;\n new(): SVGAnimatedNumberList;\n};\n\ninterface SVGAnimatedPoints {\n readonly animatedPoints: SVGPointList;\n readonly points: SVGPointList;\n}\n\ninterface SVGAnimatedPreserveAspectRatio {\n readonly animVal: SVGPreserveAspectRatio;\n readonly baseVal: SVGPreserveAspectRatio;\n}\n\ndeclare var SVGAnimatedPreserveAspectRatio: {\n prototype: SVGAnimatedPreserveAspectRatio;\n new(): SVGAnimatedPreserveAspectRatio;\n};\n\ninterface SVGAnimatedRect {\n readonly animVal: SVGRect;\n readonly baseVal: SVGRect;\n}\n\ndeclare var SVGAnimatedRect: {\n prototype: SVGAnimatedRect;\n new(): SVGAnimatedRect;\n};\n\ninterface SVGAnimatedString {\n readonly animVal: string;\n baseVal: string;\n}\n\ndeclare var SVGAnimatedString: {\n prototype: SVGAnimatedString;\n new(): SVGAnimatedString;\n};\n\ninterface SVGAnimatedTransformList {\n readonly animVal: SVGTransformList;\n readonly baseVal: SVGTransformList;\n}\n\ndeclare var SVGAnimatedTransformList: {\n prototype: SVGAnimatedTransformList;\n new(): SVGAnimatedTransformList;\n};\n\ninterface SVGCircleElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGCircleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGCircleElement: {\n prototype: SVGCircleElement;\n new(): SVGCircleElement;\n};\n\ninterface SVGClipPathElement extends SVGGraphicsElement, SVGUnitTypes {\n readonly clipPathUnits: SVGAnimatedEnumeration;\n addEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGClipPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGClipPathElement: {\n prototype: SVGClipPathElement;\n new(): SVGClipPathElement;\n};\n\ninterface SVGComponentTransferFunctionElement extends SVGElement {\n readonly amplitude: SVGAnimatedNumber;\n readonly exponent: SVGAnimatedNumber;\n readonly intercept: SVGAnimatedNumber;\n readonly offset: SVGAnimatedNumber;\n readonly slope: SVGAnimatedNumber;\n readonly tableValues: SVGAnimatedNumberList;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGComponentTransferFunctionElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGComponentTransferFunctionElement: {\n prototype: SVGComponentTransferFunctionElement;\n new(): SVGComponentTransferFunctionElement;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_DISCRETE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_GAMMA: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_IDENTITY: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_LINEAR: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_TABLE: number;\n readonly SVG_FECOMPONENTTRANSFER_TYPE_UNKNOWN: number;\n};\n\ninterface SVGDefsElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDefsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDefsElement: {\n prototype: SVGDefsElement;\n new(): SVGDefsElement;\n};\n\ninterface SVGDescElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGDescElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGDescElement: {\n prototype: SVGDescElement;\n new(): SVGDescElement;\n};\n\ninterface SVGElementEventMap extends ElementEventMap {\n \"click\": MouseEvent;\n \"dblclick\": MouseEvent;\n \"focusin\": FocusEvent;\n \"focusout\": FocusEvent;\n \"load\": Event;\n \"mousedown\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n}\n\ninterface SVGElement extends Element, ElementCSSInlineStyle {\n readonly className: any;\n onclick: ((this: SVGElement, ev: MouseEvent) => any) | null;\n ondblclick: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onfocusin: ((this: SVGElement, ev: FocusEvent) => any) | null;\n onfocusout: ((this: SVGElement, ev: FocusEvent) => any) | null;\n onload: ((this: SVGElement, ev: Event) => any) | null;\n onmousedown: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmousemove: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmouseout: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmouseover: ((this: SVGElement, ev: MouseEvent) => any) | null;\n onmouseup: ((this: SVGElement, ev: MouseEvent) => any) | null;\n readonly ownerSVGElement: SVGSVGElement | null;\n readonly viewportElement: SVGElement | null;\n /** @deprecated */\n xmlbase: string;\n addEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGElement: {\n prototype: SVGElement;\n new(): SVGElement;\n};\n\ninterface SVGElementInstance extends EventTarget {\n readonly childNodes: SVGElementInstanceList;\n readonly correspondingElement: SVGElement;\n readonly correspondingUseElement: SVGUseElement;\n readonly firstChild: SVGElementInstance;\n readonly lastChild: SVGElementInstance;\n readonly nextSibling: SVGElementInstance;\n readonly parentNode: SVGElementInstance;\n readonly previousSibling: SVGElementInstance;\n}\n\ndeclare var SVGElementInstance: {\n prototype: SVGElementInstance;\n new(): SVGElementInstance;\n};\n\ninterface SVGElementInstanceList {\n /** @deprecated */\n readonly length: number;\n /** @deprecated */\n item(index: number): SVGElementInstance;\n}\n\ndeclare var SVGElementInstanceList: {\n prototype: SVGElementInstanceList;\n new(): SVGElementInstanceList;\n};\n\ninterface SVGEllipseElement extends SVGGraphicsElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGEllipseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGEllipseElement: {\n prototype: SVGEllipseElement;\n new(): SVGEllipseElement;\n};\n\ninterface SVGFEBlendElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly mode: SVGAnimatedEnumeration;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEBlendElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEBlendElement: {\n prototype: SVGFEBlendElement;\n new(): SVGFEBlendElement;\n readonly SVG_FEBLEND_MODE_COLOR: number;\n readonly SVG_FEBLEND_MODE_COLOR_BURN: number;\n readonly SVG_FEBLEND_MODE_COLOR_DODGE: number;\n readonly SVG_FEBLEND_MODE_DARKEN: number;\n readonly SVG_FEBLEND_MODE_DIFFERENCE: number;\n readonly SVG_FEBLEND_MODE_EXCLUSION: number;\n readonly SVG_FEBLEND_MODE_HARD_LIGHT: number;\n readonly SVG_FEBLEND_MODE_HUE: number;\n readonly SVG_FEBLEND_MODE_LIGHTEN: number;\n readonly SVG_FEBLEND_MODE_LUMINOSITY: number;\n readonly SVG_FEBLEND_MODE_MULTIPLY: number;\n readonly SVG_FEBLEND_MODE_NORMAL: number;\n readonly SVG_FEBLEND_MODE_OVERLAY: number;\n readonly SVG_FEBLEND_MODE_SATURATION: number;\n readonly SVG_FEBLEND_MODE_SCREEN: number;\n readonly SVG_FEBLEND_MODE_SOFT_LIGHT: number;\n readonly SVG_FEBLEND_MODE_UNKNOWN: number;\n};\n\ninterface SVGFEColorMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly type: SVGAnimatedEnumeration;\n readonly values: SVGAnimatedNumberList;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEColorMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEColorMatrixElement: {\n prototype: SVGFEColorMatrixElement;\n new(): SVGFEColorMatrixElement;\n readonly SVG_FECOLORMATRIX_TYPE_HUEROTATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA: number;\n readonly SVG_FECOLORMATRIX_TYPE_MATRIX: number;\n readonly SVG_FECOLORMATRIX_TYPE_SATURATE: number;\n readonly SVG_FECOLORMATRIX_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFEComponentTransferElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEComponentTransferElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEComponentTransferElement: {\n prototype: SVGFEComponentTransferElement;\n new(): SVGFEComponentTransferElement;\n};\n\ninterface SVGFECompositeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly k1: SVGAnimatedNumber;\n readonly k2: SVGAnimatedNumber;\n readonly k3: SVGAnimatedNumber;\n readonly k4: SVGAnimatedNumber;\n readonly operator: SVGAnimatedEnumeration;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n addEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFECompositeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFECompositeElement: {\n prototype: SVGFECompositeElement;\n new(): SVGFECompositeElement;\n readonly SVG_FECOMPOSITE_OPERATOR_ARITHMETIC: number;\n readonly SVG_FECOMPOSITE_OPERATOR_ATOP: number;\n readonly SVG_FECOMPOSITE_OPERATOR_IN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OUT: number;\n readonly SVG_FECOMPOSITE_OPERATOR_OVER: number;\n readonly SVG_FECOMPOSITE_OPERATOR_UNKNOWN: number;\n readonly SVG_FECOMPOSITE_OPERATOR_XOR: number;\n};\n\ninterface SVGFEConvolveMatrixElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly bias: SVGAnimatedNumber;\n readonly divisor: SVGAnimatedNumber;\n readonly edgeMode: SVGAnimatedEnumeration;\n readonly in1: SVGAnimatedString;\n readonly kernelMatrix: SVGAnimatedNumberList;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly orderX: SVGAnimatedInteger;\n readonly orderY: SVGAnimatedInteger;\n readonly preserveAlpha: SVGAnimatedBoolean;\n readonly targetX: SVGAnimatedInteger;\n readonly targetY: SVGAnimatedInteger;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n addEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEConvolveMatrixElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEConvolveMatrixElement: {\n prototype: SVGFEConvolveMatrixElement;\n new(): SVGFEConvolveMatrixElement;\n readonly SVG_EDGEMODE_DUPLICATE: number;\n readonly SVG_EDGEMODE_NONE: number;\n readonly SVG_EDGEMODE_UNKNOWN: number;\n readonly SVG_EDGEMODE_WRAP: number;\n};\n\ninterface SVGFEDiffuseLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly diffuseConstant: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDiffuseLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDiffuseLightingElement: {\n prototype: SVGFEDiffuseLightingElement;\n new(): SVGFEDiffuseLightingElement;\n};\n\ninterface SVGFEDisplacementMapElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly in2: SVGAnimatedString;\n readonly scale: SVGAnimatedNumber;\n readonly xChannelSelector: SVGAnimatedEnumeration;\n readonly yChannelSelector: SVGAnimatedEnumeration;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDisplacementMapElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDisplacementMapElement: {\n prototype: SVGFEDisplacementMapElement;\n new(): SVGFEDisplacementMapElement;\n readonly SVG_CHANNEL_A: number;\n readonly SVG_CHANNEL_B: number;\n readonly SVG_CHANNEL_G: number;\n readonly SVG_CHANNEL_R: number;\n readonly SVG_CHANNEL_UNKNOWN: number;\n};\n\ninterface SVGFEDistantLightElement extends SVGElement {\n readonly azimuth: SVGAnimatedNumber;\n readonly elevation: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEDistantLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEDistantLightElement: {\n prototype: SVGFEDistantLightElement;\n new(): SVGFEDistantLightElement;\n};\n\ninterface SVGFEFloodElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFloodElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFloodElement: {\n prototype: SVGFEFloodElement;\n new(): SVGFEFloodElement;\n};\n\ninterface SVGFEFuncAElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncAElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncAElement: {\n prototype: SVGFEFuncAElement;\n new(): SVGFEFuncAElement;\n};\n\ninterface SVGFEFuncBElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncBElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncBElement: {\n prototype: SVGFEFuncBElement;\n new(): SVGFEFuncBElement;\n};\n\ninterface SVGFEFuncGElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncGElement: {\n prototype: SVGFEFuncGElement;\n new(): SVGFEFuncGElement;\n};\n\ninterface SVGFEFuncRElement extends SVGComponentTransferFunctionElement {\n addEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEFuncRElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEFuncRElement: {\n prototype: SVGFEFuncRElement;\n new(): SVGFEFuncRElement;\n};\n\ninterface SVGFEGaussianBlurElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly stdDeviationX: SVGAnimatedNumber;\n readonly stdDeviationY: SVGAnimatedNumber;\n setStdDeviation(stdDeviationX: number, stdDeviationY: number): void;\n addEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEGaussianBlurElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEGaussianBlurElement: {\n prototype: SVGFEGaussianBlurElement;\n new(): SVGFEGaussianBlurElement;\n};\n\ninterface SVGFEImageElement extends SVGElement, SVGFilterPrimitiveStandardAttributes, SVGURIReference {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n addEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEImageElement: {\n prototype: SVGFEImageElement;\n new(): SVGFEImageElement;\n};\n\ninterface SVGFEMergeElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n addEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeElement: {\n prototype: SVGFEMergeElement;\n new(): SVGFEMergeElement;\n};\n\ninterface SVGFEMergeNodeElement extends SVGElement {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMergeNodeElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMergeNodeElement: {\n prototype: SVGFEMergeNodeElement;\n new(): SVGFEMergeNodeElement;\n};\n\ninterface SVGFEMorphologyElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly operator: SVGAnimatedEnumeration;\n readonly radiusX: SVGAnimatedNumber;\n readonly radiusY: SVGAnimatedNumber;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEMorphologyElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEMorphologyElement: {\n prototype: SVGFEMorphologyElement;\n new(): SVGFEMorphologyElement;\n readonly SVG_MORPHOLOGY_OPERATOR_DILATE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_ERODE: number;\n readonly SVG_MORPHOLOGY_OPERATOR_UNKNOWN: number;\n};\n\ninterface SVGFEOffsetElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly dx: SVGAnimatedNumber;\n readonly dy: SVGAnimatedNumber;\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEOffsetElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEOffsetElement: {\n prototype: SVGFEOffsetElement;\n new(): SVGFEOffsetElement;\n};\n\ninterface SVGFEPointLightElement extends SVGElement {\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFEPointLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFEPointLightElement: {\n prototype: SVGFEPointLightElement;\n new(): SVGFEPointLightElement;\n};\n\ninterface SVGFESpecularLightingElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n readonly kernelUnitLengthX: SVGAnimatedNumber;\n readonly kernelUnitLengthY: SVGAnimatedNumber;\n readonly specularConstant: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly surfaceScale: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpecularLightingElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpecularLightingElement: {\n prototype: SVGFESpecularLightingElement;\n new(): SVGFESpecularLightingElement;\n};\n\ninterface SVGFESpotLightElement extends SVGElement {\n readonly limitingConeAngle: SVGAnimatedNumber;\n readonly pointsAtX: SVGAnimatedNumber;\n readonly pointsAtY: SVGAnimatedNumber;\n readonly pointsAtZ: SVGAnimatedNumber;\n readonly specularExponent: SVGAnimatedNumber;\n readonly x: SVGAnimatedNumber;\n readonly y: SVGAnimatedNumber;\n readonly z: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFESpotLightElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFESpotLightElement: {\n prototype: SVGFESpotLightElement;\n new(): SVGFESpotLightElement;\n};\n\ninterface SVGFETileElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly in1: SVGAnimatedString;\n addEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETileElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETileElement: {\n prototype: SVGFETileElement;\n new(): SVGFETileElement;\n};\n\ninterface SVGFETurbulenceElement extends SVGElement, SVGFilterPrimitiveStandardAttributes {\n readonly baseFrequencyX: SVGAnimatedNumber;\n readonly baseFrequencyY: SVGAnimatedNumber;\n readonly numOctaves: SVGAnimatedInteger;\n readonly seed: SVGAnimatedNumber;\n readonly stitchTiles: SVGAnimatedEnumeration;\n readonly type: SVGAnimatedEnumeration;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFETurbulenceElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFETurbulenceElement: {\n prototype: SVGFETurbulenceElement;\n new(): SVGFETurbulenceElement;\n readonly SVG_STITCHTYPE_NOSTITCH: number;\n readonly SVG_STITCHTYPE_STITCH: number;\n readonly SVG_STITCHTYPE_UNKNOWN: number;\n readonly SVG_TURBULENCE_TYPE_FRACTALNOISE: number;\n readonly SVG_TURBULENCE_TYPE_TURBULENCE: number;\n readonly SVG_TURBULENCE_TYPE_UNKNOWN: number;\n};\n\ninterface SVGFilterElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n /** @deprecated */\n readonly filterResX: SVGAnimatedInteger;\n /** @deprecated */\n readonly filterResY: SVGAnimatedInteger;\n readonly filterUnits: SVGAnimatedEnumeration;\n readonly height: SVGAnimatedLength;\n readonly primitiveUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n /** @deprecated */\n setFilterRes(filterResX: number, filterResY: number): void;\n addEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGFilterElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGFilterElement: {\n prototype: SVGFilterElement;\n new(): SVGFilterElement;\n};\n\ninterface SVGFilterPrimitiveStandardAttributes {\n readonly height: SVGAnimatedLength;\n readonly result: SVGAnimatedString;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n}\n\ninterface SVGFitToViewBox {\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly viewBox: SVGAnimatedRect;\n}\n\ninterface SVGForeignObjectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGForeignObjectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGForeignObjectElement: {\n prototype: SVGForeignObjectElement;\n new(): SVGForeignObjectElement;\n};\n\ninterface SVGGElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGElement: {\n prototype: SVGGElement;\n new(): SVGGElement;\n};\n\ninterface SVGGradientElement extends SVGElement, SVGUnitTypes, SVGURIReference {\n readonly gradientTransform: SVGAnimatedTransformList;\n readonly gradientUnits: SVGAnimatedEnumeration;\n readonly spreadMethod: SVGAnimatedEnumeration;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGradientElement: {\n prototype: SVGGradientElement;\n new(): SVGGradientElement;\n readonly SVG_SPREADMETHOD_PAD: number;\n readonly SVG_SPREADMETHOD_REFLECT: number;\n readonly SVG_SPREADMETHOD_REPEAT: number;\n readonly SVG_SPREADMETHOD_UNKNOWN: number;\n};\n\ninterface SVGGraphicsElement extends SVGElement, SVGTests {\n /** @deprecated */\n readonly farthestViewportElement: SVGElement | null;\n /** @deprecated */\n readonly nearestViewportElement: SVGElement | null;\n readonly transform: SVGAnimatedTransformList;\n getBBox(): SVGRect;\n getCTM(): SVGMatrix | null;\n getScreenCTM(): SVGMatrix | null;\n /** @deprecated */\n getTransformToElement(element: SVGElement): SVGMatrix;\n addEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGGraphicsElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGGraphicsElement: {\n prototype: SVGGraphicsElement;\n new(): SVGGraphicsElement;\n};\n\ninterface SVGImageElement extends SVGGraphicsElement, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly preserveAspectRatio: SVGAnimatedPreserveAspectRatio;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGImageElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGImageElement: {\n prototype: SVGImageElement;\n new(): SVGImageElement;\n};\n\ninterface SVGLength {\n readonly unitType: number;\n value: number;\n valueAsString: string;\n valueInSpecifiedUnits: number;\n convertToSpecifiedUnits(unitType: number): void;\n newValueSpecifiedUnits(unitType: number, valueInSpecifiedUnits: number): void;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n}\n\ndeclare var SVGLength: {\n prototype: SVGLength;\n new(): SVGLength;\n readonly SVG_LENGTHTYPE_CM: number;\n readonly SVG_LENGTHTYPE_EMS: number;\n readonly SVG_LENGTHTYPE_EXS: number;\n readonly SVG_LENGTHTYPE_IN: number;\n readonly SVG_LENGTHTYPE_MM: number;\n readonly SVG_LENGTHTYPE_NUMBER: number;\n readonly SVG_LENGTHTYPE_PC: number;\n readonly SVG_LENGTHTYPE_PERCENTAGE: number;\n readonly SVG_LENGTHTYPE_PT: number;\n readonly SVG_LENGTHTYPE_PX: number;\n readonly SVG_LENGTHTYPE_UNKNOWN: number;\n};\n\ninterface SVGLengthList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGLength): SVGLength;\n clear(): void;\n getItem(index: number): SVGLength;\n initialize(newItem: SVGLength): SVGLength;\n insertItemBefore(newItem: SVGLength, index: number): SVGLength;\n removeItem(index: number): SVGLength;\n replaceItem(newItem: SVGLength, index: number): SVGLength;\n}\n\ndeclare var SVGLengthList: {\n prototype: SVGLengthList;\n new(): SVGLengthList;\n};\n\ninterface SVGLineElement extends SVGGraphicsElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLineElement: {\n prototype: SVGLineElement;\n new(): SVGLineElement;\n};\n\ninterface SVGLinearGradientElement extends SVGGradientElement {\n readonly x1: SVGAnimatedLength;\n readonly x2: SVGAnimatedLength;\n readonly y1: SVGAnimatedLength;\n readonly y2: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGLinearGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGLinearGradientElement: {\n prototype: SVGLinearGradientElement;\n new(): SVGLinearGradientElement;\n};\n\ninterface SVGMarkerElement extends SVGElement, SVGFitToViewBox {\n readonly markerHeight: SVGAnimatedLength;\n readonly markerUnits: SVGAnimatedEnumeration;\n readonly markerWidth: SVGAnimatedLength;\n readonly orientAngle: SVGAnimatedAngle;\n readonly orientType: SVGAnimatedEnumeration;\n readonly refX: SVGAnimatedLength;\n readonly refY: SVGAnimatedLength;\n setOrientToAngle(angle: SVGAngle): void;\n setOrientToAuto(): void;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMarkerElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMarkerElement: {\n prototype: SVGMarkerElement;\n new(): SVGMarkerElement;\n readonly SVG_MARKERUNITS_STROKEWIDTH: number;\n readonly SVG_MARKERUNITS_UNKNOWN: number;\n readonly SVG_MARKERUNITS_USERSPACEONUSE: number;\n readonly SVG_MARKER_ORIENT_ANGLE: number;\n readonly SVG_MARKER_ORIENT_AUTO: number;\n readonly SVG_MARKER_ORIENT_UNKNOWN: number;\n};\n\ninterface SVGMaskElement extends SVGElement, SVGTests, SVGUnitTypes {\n readonly height: SVGAnimatedLength;\n readonly maskContentUnits: SVGAnimatedEnumeration;\n readonly maskUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMaskElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMaskElement: {\n prototype: SVGMaskElement;\n new(): SVGMaskElement;\n};\n\ninterface SVGMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n flipX(): SVGMatrix;\n flipY(): SVGMatrix;\n inverse(): SVGMatrix;\n multiply(secondMatrix: SVGMatrix): SVGMatrix;\n rotate(angle: number): SVGMatrix;\n rotateFromVector(x: number, y: number): SVGMatrix;\n scale(scaleFactor: number): SVGMatrix;\n scaleNonUniform(scaleFactorX: number, scaleFactorY: number): SVGMatrix;\n skewX(angle: number): SVGMatrix;\n skewY(angle: number): SVGMatrix;\n translate(x: number, y: number): SVGMatrix;\n}\n\ndeclare var SVGMatrix: {\n prototype: SVGMatrix;\n new(): SVGMatrix;\n};\n\ninterface SVGMetadataElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGMetadataElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGMetadataElement: {\n prototype: SVGMetadataElement;\n new(): SVGMetadataElement;\n};\n\ninterface SVGNumber {\n value: number;\n}\n\ndeclare var SVGNumber: {\n prototype: SVGNumber;\n new(): SVGNumber;\n};\n\ninterface SVGNumberList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGNumber): SVGNumber;\n clear(): void;\n getItem(index: number): SVGNumber;\n initialize(newItem: SVGNumber): SVGNumber;\n insertItemBefore(newItem: SVGNumber, index: number): SVGNumber;\n removeItem(index: number): SVGNumber;\n replaceItem(newItem: SVGNumber, index: number): SVGNumber;\n}\n\ndeclare var SVGNumberList: {\n prototype: SVGNumberList;\n new(): SVGNumberList;\n};\n\ninterface SVGPathElement extends SVGGraphicsElement {\n /** @deprecated */\n readonly pathSegList: SVGPathSegList;\n /** @deprecated */\n createSVGPathSegArcAbs(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcAbs;\n /** @deprecated */\n createSVGPathSegArcRel(x: number, y: number, r1: number, r2: number, angle: number, largeArcFlag: boolean, sweepFlag: boolean): SVGPathSegArcRel;\n /** @deprecated */\n createSVGPathSegClosePath(): SVGPathSegClosePath;\n /** @deprecated */\n createSVGPathSegCurvetoCubicAbs(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicAbs;\n /** @deprecated */\n createSVGPathSegCurvetoCubicRel(x: number, y: number, x1: number, y1: number, x2: number, y2: number): SVGPathSegCurvetoCubicRel;\n /** @deprecated */\n createSVGPathSegCurvetoCubicSmoothAbs(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothAbs;\n /** @deprecated */\n createSVGPathSegCurvetoCubicSmoothRel(x: number, y: number, x2: number, y2: number): SVGPathSegCurvetoCubicSmoothRel;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticAbs(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticAbs;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticRel(x: number, y: number, x1: number, y1: number): SVGPathSegCurvetoQuadraticRel;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticSmoothAbs(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothAbs;\n /** @deprecated */\n createSVGPathSegCurvetoQuadraticSmoothRel(x: number, y: number): SVGPathSegCurvetoQuadraticSmoothRel;\n /** @deprecated */\n createSVGPathSegLinetoAbs(x: number, y: number): SVGPathSegLinetoAbs;\n /** @deprecated */\n createSVGPathSegLinetoHorizontalAbs(x: number): SVGPathSegLinetoHorizontalAbs;\n /** @deprecated */\n createSVGPathSegLinetoHorizontalRel(x: number): SVGPathSegLinetoHorizontalRel;\n /** @deprecated */\n createSVGPathSegLinetoRel(x: number, y: number): SVGPathSegLinetoRel;\n /** @deprecated */\n createSVGPathSegLinetoVerticalAbs(y: number): SVGPathSegLinetoVerticalAbs;\n /** @deprecated */\n createSVGPathSegLinetoVerticalRel(y: number): SVGPathSegLinetoVerticalRel;\n /** @deprecated */\n createSVGPathSegMovetoAbs(x: number, y: number): SVGPathSegMovetoAbs;\n /** @deprecated */\n createSVGPathSegMovetoRel(x: number, y: number): SVGPathSegMovetoRel;\n /** @deprecated */\n getPathSegAtLength(distance: number): number;\n getPointAtLength(distance: number): SVGPoint;\n getTotalLength(): number;\n addEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPathElement: {\n prototype: SVGPathElement;\n new(): SVGPathElement;\n};\n\ninterface SVGPathSeg {\n readonly pathSegType: number;\n readonly pathSegTypeAsLetter: string;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n}\n\ndeclare var SVGPathSeg: {\n prototype: SVGPathSeg;\n new(): SVGPathSeg;\n readonly PATHSEG_ARC_ABS: number;\n readonly PATHSEG_ARC_REL: number;\n readonly PATHSEG_CLOSEPATH: number;\n readonly PATHSEG_CURVETO_CUBIC_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_REL: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_CUBIC_SMOOTH_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_REL: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS: number;\n readonly PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL: number;\n readonly PATHSEG_LINETO_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_ABS: number;\n readonly PATHSEG_LINETO_HORIZONTAL_REL: number;\n readonly PATHSEG_LINETO_REL: number;\n readonly PATHSEG_LINETO_VERTICAL_ABS: number;\n readonly PATHSEG_LINETO_VERTICAL_REL: number;\n readonly PATHSEG_MOVETO_ABS: number;\n readonly PATHSEG_MOVETO_REL: number;\n readonly PATHSEG_UNKNOWN: number;\n};\n\ninterface SVGPathSegArcAbs extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcAbs: {\n prototype: SVGPathSegArcAbs;\n new(): SVGPathSegArcAbs;\n};\n\ninterface SVGPathSegArcRel extends SVGPathSeg {\n angle: number;\n largeArcFlag: boolean;\n r1: number;\n r2: number;\n sweepFlag: boolean;\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegArcRel: {\n prototype: SVGPathSegArcRel;\n new(): SVGPathSegArcRel;\n};\n\ninterface SVGPathSegClosePath extends SVGPathSeg {\n}\n\ndeclare var SVGPathSegClosePath: {\n prototype: SVGPathSegClosePath;\n new(): SVGPathSegClosePath;\n};\n\ninterface SVGPathSegCurvetoCubicAbs extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicAbs: {\n prototype: SVGPathSegCurvetoCubicAbs;\n new(): SVGPathSegCurvetoCubicAbs;\n};\n\ninterface SVGPathSegCurvetoCubicRel extends SVGPathSeg {\n x: number;\n x1: number;\n x2: number;\n y: number;\n y1: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicRel: {\n prototype: SVGPathSegCurvetoCubicRel;\n new(): SVGPathSegCurvetoCubicRel;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothAbs extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothAbs: {\n prototype: SVGPathSegCurvetoCubicSmoothAbs;\n new(): SVGPathSegCurvetoCubicSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoCubicSmoothRel extends SVGPathSeg {\n x: number;\n x2: number;\n y: number;\n y2: number;\n}\n\ndeclare var SVGPathSegCurvetoCubicSmoothRel: {\n prototype: SVGPathSegCurvetoCubicSmoothRel;\n new(): SVGPathSegCurvetoCubicSmoothRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticAbs extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticAbs: {\n prototype: SVGPathSegCurvetoQuadraticAbs;\n new(): SVGPathSegCurvetoQuadraticAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticRel extends SVGPathSeg {\n x: number;\n x1: number;\n y: number;\n y1: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticRel: {\n prototype: SVGPathSegCurvetoQuadraticRel;\n new(): SVGPathSegCurvetoQuadraticRel;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothAbs: {\n prototype: SVGPathSegCurvetoQuadraticSmoothAbs;\n new(): SVGPathSegCurvetoQuadraticSmoothAbs;\n};\n\ninterface SVGPathSegCurvetoQuadraticSmoothRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegCurvetoQuadraticSmoothRel: {\n prototype: SVGPathSegCurvetoQuadraticSmoothRel;\n new(): SVGPathSegCurvetoQuadraticSmoothRel;\n};\n\ninterface SVGPathSegLinetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoAbs: {\n prototype: SVGPathSegLinetoAbs;\n new(): SVGPathSegLinetoAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalAbs extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalAbs: {\n prototype: SVGPathSegLinetoHorizontalAbs;\n new(): SVGPathSegLinetoHorizontalAbs;\n};\n\ninterface SVGPathSegLinetoHorizontalRel extends SVGPathSeg {\n x: number;\n}\n\ndeclare var SVGPathSegLinetoHorizontalRel: {\n prototype: SVGPathSegLinetoHorizontalRel;\n new(): SVGPathSegLinetoHorizontalRel;\n};\n\ninterface SVGPathSegLinetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegLinetoRel: {\n prototype: SVGPathSegLinetoRel;\n new(): SVGPathSegLinetoRel;\n};\n\ninterface SVGPathSegLinetoVerticalAbs extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalAbs: {\n prototype: SVGPathSegLinetoVerticalAbs;\n new(): SVGPathSegLinetoVerticalAbs;\n};\n\ninterface SVGPathSegLinetoVerticalRel extends SVGPathSeg {\n y: number;\n}\n\ndeclare var SVGPathSegLinetoVerticalRel: {\n prototype: SVGPathSegLinetoVerticalRel;\n new(): SVGPathSegLinetoVerticalRel;\n};\n\ninterface SVGPathSegList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPathSeg): SVGPathSeg;\n clear(): void;\n getItem(index: number): SVGPathSeg;\n initialize(newItem: SVGPathSeg): SVGPathSeg;\n insertItemBefore(newItem: SVGPathSeg, index: number): SVGPathSeg;\n removeItem(index: number): SVGPathSeg;\n replaceItem(newItem: SVGPathSeg, index: number): SVGPathSeg;\n}\n\ndeclare var SVGPathSegList: {\n prototype: SVGPathSegList;\n new(): SVGPathSegList;\n};\n\ninterface SVGPathSegMovetoAbs extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoAbs: {\n prototype: SVGPathSegMovetoAbs;\n new(): SVGPathSegMovetoAbs;\n};\n\ninterface SVGPathSegMovetoRel extends SVGPathSeg {\n x: number;\n y: number;\n}\n\ndeclare var SVGPathSegMovetoRel: {\n prototype: SVGPathSegMovetoRel;\n new(): SVGPathSegMovetoRel;\n};\n\ninterface SVGPatternElement extends SVGElement, SVGTests, SVGUnitTypes, SVGFitToViewBox, SVGURIReference {\n readonly height: SVGAnimatedLength;\n readonly patternContentUnits: SVGAnimatedEnumeration;\n readonly patternTransform: SVGAnimatedTransformList;\n readonly patternUnits: SVGAnimatedEnumeration;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPatternElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPatternElement: {\n prototype: SVGPatternElement;\n new(): SVGPatternElement;\n};\n\ninterface SVGPoint {\n x: number;\n y: number;\n matrixTransform(matrix: SVGMatrix): SVGPoint;\n}\n\ndeclare var SVGPoint: {\n prototype: SVGPoint;\n new(): SVGPoint;\n};\n\ninterface SVGPointList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGPoint): SVGPoint;\n clear(): void;\n getItem(index: number): SVGPoint;\n initialize(newItem: SVGPoint): SVGPoint;\n insertItemBefore(newItem: SVGPoint, index: number): SVGPoint;\n removeItem(index: number): SVGPoint;\n replaceItem(newItem: SVGPoint, index: number): SVGPoint;\n}\n\ndeclare var SVGPointList: {\n prototype: SVGPointList;\n new(): SVGPointList;\n};\n\ninterface SVGPolygonElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolygonElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolygonElement: {\n prototype: SVGPolygonElement;\n new(): SVGPolygonElement;\n};\n\ninterface SVGPolylineElement extends SVGGraphicsElement, SVGAnimatedPoints {\n addEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGPolylineElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGPolylineElement: {\n prototype: SVGPolylineElement;\n new(): SVGPolylineElement;\n};\n\ninterface SVGPreserveAspectRatio {\n align: number;\n meetOrSlice: number;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n}\n\ndeclare var SVGPreserveAspectRatio: {\n prototype: SVGPreserveAspectRatio;\n new(): SVGPreserveAspectRatio;\n readonly SVG_MEETORSLICE_MEET: number;\n readonly SVG_MEETORSLICE_SLICE: number;\n readonly SVG_MEETORSLICE_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_NONE: number;\n readonly SVG_PRESERVEASPECTRATIO_UNKNOWN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMAXYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMIDYMIN: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMAX: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMID: number;\n readonly SVG_PRESERVEASPECTRATIO_XMINYMIN: number;\n};\n\ninterface SVGRadialGradientElement extends SVGGradientElement {\n readonly cx: SVGAnimatedLength;\n readonly cy: SVGAnimatedLength;\n readonly fx: SVGAnimatedLength;\n readonly fy: SVGAnimatedLength;\n readonly r: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRadialGradientElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRadialGradientElement: {\n prototype: SVGRadialGradientElement;\n new(): SVGRadialGradientElement;\n};\n\ninterface SVGRect {\n height: number;\n width: number;\n x: number;\n y: number;\n}\n\ndeclare var SVGRect: {\n prototype: SVGRect;\n new(): SVGRect;\n};\n\ninterface SVGRectElement extends SVGGraphicsElement {\n readonly height: SVGAnimatedLength;\n readonly rx: SVGAnimatedLength;\n readonly ry: SVGAnimatedLength;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGRectElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGRectElement: {\n prototype: SVGRectElement;\n new(): SVGRectElement;\n};\n\ninterface SVGSVGElementEventMap extends SVGElementEventMap {\n \"SVGAbort\": Event;\n \"SVGError\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"SVGUnload\": Event;\n \"SVGZoom\": SVGZoomEvent;\n}\n\ninterface SVGSVGElement extends SVGGraphicsElement, DocumentEvent, SVGFitToViewBox, SVGZoomAndPan {\n /** @deprecated */\n contentScriptType: string;\n /** @deprecated */\n contentStyleType: string;\n currentScale: number;\n readonly currentTranslate: SVGPoint;\n readonly height: SVGAnimatedLength;\n onabort: ((this: SVGSVGElement, ev: Event) => any) | null;\n onerror: ((this: SVGSVGElement, ev: Event) => any) | null;\n onresize: ((this: SVGSVGElement, ev: UIEvent) => any) | null;\n onscroll: ((this: SVGSVGElement, ev: UIEvent) => any) | null;\n onunload: ((this: SVGSVGElement, ev: Event) => any) | null;\n onzoom: ((this: SVGSVGElement, ev: SVGZoomEvent) => any) | null;\n /** @deprecated */\n readonly pixelUnitToMillimeterX: number;\n /** @deprecated */\n readonly pixelUnitToMillimeterY: number;\n /** @deprecated */\n readonly screenPixelToMillimeterX: number;\n /** @deprecated */\n readonly screenPixelToMillimeterY: number;\n /** @deprecated */\n readonly viewport: SVGRect;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n checkEnclosure(element: SVGElement, rect: SVGRect): boolean;\n checkIntersection(element: SVGElement, rect: SVGRect): boolean;\n createSVGAngle(): SVGAngle;\n createSVGLength(): SVGLength;\n createSVGMatrix(): SVGMatrix;\n createSVGNumber(): SVGNumber;\n createSVGPoint(): SVGPoint;\n createSVGRect(): SVGRect;\n createSVGTransform(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n deselectAll(): void;\n /** @deprecated */\n forceRedraw(): void;\n getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\n /** @deprecated */\n getCurrentTime(): number;\n getElementById(elementId: string): Element;\n getEnclosureList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n getIntersectionList(rect: SVGRect, referenceElement: SVGElement): NodeListOf;\n /** @deprecated */\n pauseAnimations(): void;\n /** @deprecated */\n setCurrentTime(seconds: number): void;\n /** @deprecated */\n suspendRedraw(maxWaitMilliseconds: number): number;\n /** @deprecated */\n unpauseAnimations(): void;\n /** @deprecated */\n unsuspendRedraw(suspendHandleID: number): void;\n /** @deprecated */\n unsuspendRedrawAll(): void;\n addEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSVGElement, ev: SVGSVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSVGElement: {\n prototype: SVGSVGElement;\n new(): SVGSVGElement;\n};\n\ninterface SVGScriptElement extends SVGElement, SVGURIReference {\n type: string;\n addEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGScriptElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGScriptElement: {\n prototype: SVGScriptElement;\n new(): SVGScriptElement;\n};\n\ninterface SVGStopElement extends SVGElement {\n readonly offset: SVGAnimatedNumber;\n addEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStopElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStopElement: {\n prototype: SVGStopElement;\n new(): SVGStopElement;\n};\n\ninterface SVGStringList {\n readonly numberOfItems: number;\n appendItem(newItem: string): string;\n clear(): void;\n getItem(index: number): string;\n initialize(newItem: string): string;\n insertItemBefore(newItem: string, index: number): string;\n removeItem(index: number): string;\n replaceItem(newItem: string, index: number): string;\n}\n\ndeclare var SVGStringList: {\n prototype: SVGStringList;\n new(): SVGStringList;\n};\n\ninterface SVGStylable {\n className: any;\n}\n\ndeclare var SVGStylable: {\n prototype: SVGStylable;\n new(): SVGStylable;\n};\n\ninterface SVGStyleElement extends SVGElement {\n disabled: boolean;\n media: string;\n title: string;\n type: string;\n addEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGStyleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGStyleElement: {\n prototype: SVGStyleElement;\n new(): SVGStyleElement;\n};\n\ninterface SVGSwitchElement extends SVGGraphicsElement {\n addEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSwitchElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSwitchElement: {\n prototype: SVGSwitchElement;\n new(): SVGSwitchElement;\n};\n\ninterface SVGSymbolElement extends SVGElement, SVGFitToViewBox {\n addEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGSymbolElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGSymbolElement: {\n prototype: SVGSymbolElement;\n new(): SVGSymbolElement;\n};\n\ninterface SVGTSpanElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTSpanElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTSpanElement: {\n prototype: SVGTSpanElement;\n new(): SVGTSpanElement;\n};\n\ninterface SVGTests {\n readonly requiredExtensions: SVGStringList;\n /** @deprecated */\n readonly requiredFeatures: SVGStringList;\n readonly systemLanguage: SVGStringList;\n /** @deprecated */\n hasExtension(extension: string): boolean;\n}\n\ninterface SVGTextContentElement extends SVGGraphicsElement {\n readonly lengthAdjust: SVGAnimatedEnumeration;\n readonly textLength: SVGAnimatedLength;\n getCharNumAtPosition(point: SVGPoint): number;\n getComputedTextLength(): number;\n getEndPositionOfChar(charnum: number): SVGPoint;\n getExtentOfChar(charnum: number): SVGRect;\n getNumberOfChars(): number;\n getRotationOfChar(charnum: number): number;\n getStartPositionOfChar(charnum: number): SVGPoint;\n getSubStringLength(charnum: number, nchars: number): number;\n selectSubString(charnum: number, nchars: number): void;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextContentElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextContentElement: {\n prototype: SVGTextContentElement;\n new(): SVGTextContentElement;\n readonly LENGTHADJUST_SPACING: number;\n readonly LENGTHADJUST_SPACINGANDGLYPHS: number;\n readonly LENGTHADJUST_UNKNOWN: number;\n};\n\ninterface SVGTextElement extends SVGTextPositioningElement {\n addEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextElement: {\n prototype: SVGTextElement;\n new(): SVGTextElement;\n};\n\ninterface SVGTextPathElement extends SVGTextContentElement, SVGURIReference {\n readonly method: SVGAnimatedEnumeration;\n readonly spacing: SVGAnimatedEnumeration;\n readonly startOffset: SVGAnimatedLength;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n addEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPathElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPathElement: {\n prototype: SVGTextPathElement;\n new(): SVGTextPathElement;\n readonly TEXTPATH_METHODTYPE_ALIGN: number;\n readonly TEXTPATH_METHODTYPE_STRETCH: number;\n readonly TEXTPATH_METHODTYPE_UNKNOWN: number;\n readonly TEXTPATH_SPACINGTYPE_AUTO: number;\n readonly TEXTPATH_SPACINGTYPE_EXACT: number;\n readonly TEXTPATH_SPACINGTYPE_UNKNOWN: number;\n};\n\ninterface SVGTextPositioningElement extends SVGTextContentElement {\n readonly dx: SVGAnimatedLengthList;\n readonly dy: SVGAnimatedLengthList;\n readonly rotate: SVGAnimatedNumberList;\n readonly x: SVGAnimatedLengthList;\n readonly y: SVGAnimatedLengthList;\n addEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTextPositioningElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTextPositioningElement: {\n prototype: SVGTextPositioningElement;\n new(): SVGTextPositioningElement;\n};\n\ninterface SVGTitleElement extends SVGElement {\n addEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGTitleElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGTitleElement: {\n prototype: SVGTitleElement;\n new(): SVGTitleElement;\n};\n\ninterface SVGTransform {\n readonly angle: number;\n readonly matrix: SVGMatrix;\n readonly type: number;\n setMatrix(matrix: SVGMatrix): void;\n setRotate(angle: number, cx: number, cy: number): void;\n setScale(sx: number, sy: number): void;\n setSkewX(angle: number): void;\n setSkewY(angle: number): void;\n setTranslate(tx: number, ty: number): void;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n}\n\ndeclare var SVGTransform: {\n prototype: SVGTransform;\n new(): SVGTransform;\n readonly SVG_TRANSFORM_MATRIX: number;\n readonly SVG_TRANSFORM_ROTATE: number;\n readonly SVG_TRANSFORM_SCALE: number;\n readonly SVG_TRANSFORM_SKEWX: number;\n readonly SVG_TRANSFORM_SKEWY: number;\n readonly SVG_TRANSFORM_TRANSLATE: number;\n readonly SVG_TRANSFORM_UNKNOWN: number;\n};\n\ninterface SVGTransformList {\n readonly numberOfItems: number;\n appendItem(newItem: SVGTransform): SVGTransform;\n clear(): void;\n consolidate(): SVGTransform;\n createSVGTransformFromMatrix(matrix: SVGMatrix): SVGTransform;\n getItem(index: number): SVGTransform;\n initialize(newItem: SVGTransform): SVGTransform;\n insertItemBefore(newItem: SVGTransform, index: number): SVGTransform;\n removeItem(index: number): SVGTransform;\n replaceItem(newItem: SVGTransform, index: number): SVGTransform;\n}\n\ndeclare var SVGTransformList: {\n prototype: SVGTransformList;\n new(): SVGTransformList;\n};\n\ninterface SVGURIReference {\n readonly href: SVGAnimatedString;\n}\n\ninterface SVGUnitTypes {\n readonly SVG_UNIT_TYPE_OBJECTBOUNDINGBOX: number;\n readonly SVG_UNIT_TYPE_UNKNOWN: number;\n readonly SVG_UNIT_TYPE_USERSPACEONUSE: number;\n}\ndeclare var SVGUnitTypes: SVGUnitTypes;\n\ninterface SVGUseElement extends SVGGraphicsElement, SVGURIReference {\n readonly animatedInstanceRoot: SVGElementInstance | null;\n readonly height: SVGAnimatedLength;\n readonly instanceRoot: SVGElementInstance | null;\n readonly width: SVGAnimatedLength;\n readonly x: SVGAnimatedLength;\n readonly y: SVGAnimatedLength;\n addEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGUseElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGUseElement: {\n prototype: SVGUseElement;\n new(): SVGUseElement;\n};\n\ninterface SVGViewElement extends SVGElement, SVGFitToViewBox, SVGZoomAndPan {\n /** @deprecated */\n readonly viewTarget: SVGStringList;\n addEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SVGViewElement, ev: SVGElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SVGViewElement: {\n prototype: SVGViewElement;\n new(): SVGViewElement;\n};\n\ninterface SVGZoomAndPan {\n readonly zoomAndPan: number;\n}\n\ndeclare var SVGZoomAndPan: {\n readonly SVG_ZOOMANDPAN_DISABLE: number;\n readonly SVG_ZOOMANDPAN_MAGNIFY: number;\n readonly SVG_ZOOMANDPAN_UNKNOWN: number;\n};\n\ninterface SVGZoomEvent extends UIEvent {\n readonly newScale: number;\n readonly newTranslate: SVGPoint;\n readonly previousScale: number;\n readonly previousTranslate: SVGPoint;\n readonly zoomRectScreen: SVGRect;\n}\n\ndeclare var SVGZoomEvent: {\n prototype: SVGZoomEvent;\n new(): SVGZoomEvent;\n};\n\ninterface ScopedCredential {\n readonly id: ArrayBuffer;\n readonly type: ScopedCredentialType;\n}\n\ndeclare var ScopedCredential: {\n prototype: ScopedCredential;\n new(): ScopedCredential;\n};\n\ninterface ScopedCredentialInfo {\n readonly credential: ScopedCredential;\n readonly publicKey: CryptoKey;\n}\n\ndeclare var ScopedCredentialInfo: {\n prototype: ScopedCredentialInfo;\n new(): ScopedCredentialInfo;\n};\n\ninterface ScreenEventMap {\n \"MSOrientationChange\": Event;\n}\n\ninterface Screen extends EventTarget {\n readonly availHeight: number;\n readonly availWidth: number;\n /** @deprecated */\n bufferDepth: number;\n readonly colorDepth: number;\n readonly deviceXDPI: number;\n readonly deviceYDPI: number;\n readonly fontSmoothingEnabled: boolean;\n readonly height: number;\n readonly logicalXDPI: number;\n readonly logicalYDPI: number;\n readonly msOrientation: string;\n onmsorientationchange: ((this: Screen, ev: Event) => any) | null;\n readonly pixelDepth: number;\n readonly systemXDPI: number;\n readonly systemYDPI: number;\n readonly width: number;\n lockOrientation(orientations: OrientationLockType | OrientationLockType[]): boolean;\n msLockOrientation(orientations: string | string[]): boolean;\n msUnlockOrientation(): void;\n unlockOrientation(): void;\n addEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Screen, ev: ScreenEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Screen: {\n prototype: Screen;\n new(): Screen;\n};\n\ninterface ScriptProcessorNodeEventMap {\n \"audioprocess\": AudioProcessingEvent;\n}\n\ninterface ScriptProcessorNode extends AudioNode {\n /** @deprecated */\n readonly bufferSize: number;\n /** @deprecated */\n onaudioprocess: ((this: ScriptProcessorNode, ev: AudioProcessingEvent) => any) | null;\n addEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ScriptProcessorNode, ev: ScriptProcessorNodeEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ScriptProcessorNode: {\n prototype: ScriptProcessorNode;\n new(): ScriptProcessorNode;\n};\n\ninterface ScrollIntoViewOptions extends ScrollOptions {\n block?: ScrollLogicalPosition;\n inline?: ScrollLogicalPosition;\n}\n\ninterface ScrollOptions {\n behavior?: ScrollBehavior;\n}\n\ninterface ScrollToOptions extends ScrollOptions {\n left?: number;\n top?: number;\n}\n\ninterface SecurityPolicyViolationEvent extends Event {\n readonly blockedURI: string;\n readonly columnNumber: number;\n readonly documentURI: string;\n readonly effectiveDirective: string;\n readonly lineNumber: number;\n readonly originalPolicy: string;\n readonly referrer: string;\n readonly sourceFile: string;\n readonly statusCode: number;\n readonly violatedDirective: string;\n}\n\ndeclare var SecurityPolicyViolationEvent: {\n prototype: SecurityPolicyViolationEvent;\n new(type: string, eventInitDict?: SecurityPolicyViolationEventInit): SecurityPolicyViolationEvent;\n};\n\ninterface Selection {\n readonly anchorNode: Node;\n readonly anchorOffset: number;\n readonly baseNode: Node;\n readonly baseOffset: number;\n readonly extentNode: Node;\n readonly extentOffset: number;\n readonly focusNode: Node;\n readonly focusOffset: number;\n readonly isCollapsed: boolean;\n readonly rangeCount: number;\n readonly type: string;\n addRange(range: Range): void;\n collapse(parentNode: Node, offset: number): void;\n collapseToEnd(): void;\n collapseToStart(): void;\n containsNode(node: Node, partlyContained: boolean): boolean;\n deleteFromDocument(): void;\n empty(): void;\n extend(newNode: Node, offset: number): void;\n getRangeAt(index: number): Range;\n removeAllRanges(): void;\n removeRange(range: Range): void;\n selectAllChildren(parentNode: Node): void;\n setBaseAndExtent(baseNode: Node, baseOffset: number, extentNode: Node, extentOffset: number): void;\n setPosition(parentNode: Node, offset: number): void;\n toString(): string;\n}\n\ndeclare var Selection: {\n prototype: Selection;\n new(): Selection;\n};\n\ninterface ServiceUIFrameContext {\n getCachedFrameMessage(key: string): string;\n postFrameMessage(key: string, data: string): void;\n}\ndeclare var ServiceUIFrameContext: ServiceUIFrameContext;\n\ninterface ServiceWorkerEventMap extends AbstractWorkerEventMap {\n \"statechange\": Event;\n}\n\ninterface ServiceWorker extends EventTarget, AbstractWorker {\n onstatechange: ((this: ServiceWorker, ev: Event) => any) | null;\n readonly scriptURL: string;\n readonly state: ServiceWorkerState;\n postMessage(message: any, transfer?: any[]): void;\n addEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorker: {\n prototype: ServiceWorker;\n new(): ServiceWorker;\n};\n\ninterface ServiceWorkerContainerEventMap {\n \"controllerchange\": Event;\n \"message\": ServiceWorkerMessageEvent;\n \"messageerror\": MessageEvent;\n}\n\ninterface ServiceWorkerContainer extends EventTarget {\n readonly controller: ServiceWorker | null;\n oncontrollerchange: ((this: ServiceWorkerContainer, ev: Event) => any) | null;\n onmessage: ((this: ServiceWorkerContainer, ev: ServiceWorkerMessageEvent) => any) | null;\n onmessageerror: ((this: ServiceWorkerContainer, ev: MessageEvent) => any) | null;\n readonly ready: Promise;\n getRegistration(clientURL?: string): Promise;\n getRegistrations(): Promise;\n register(scriptURL: string, options?: RegistrationOptions): Promise;\n startMessages(): void;\n addEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerContainer, ev: ServiceWorkerContainerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerContainer: {\n prototype: ServiceWorkerContainer;\n new(): ServiceWorkerContainer;\n};\n\ninterface ServiceWorkerMessageEvent extends Event {\n readonly data: any;\n readonly lastEventId: string;\n readonly origin: string;\n readonly ports: ReadonlyArray | null;\n readonly source: ServiceWorker | MessagePort | null;\n}\n\ndeclare var ServiceWorkerMessageEvent: {\n prototype: ServiceWorkerMessageEvent;\n new(type: string, eventInitDict?: ServiceWorkerMessageEventInit): ServiceWorkerMessageEvent;\n};\n\ninterface ServiceWorkerRegistrationEventMap {\n \"updatefound\": Event;\n}\n\ninterface ServiceWorkerRegistration extends EventTarget {\n readonly active: ServiceWorker | null;\n readonly installing: ServiceWorker | null;\n onupdatefound: ((this: ServiceWorkerRegistration, ev: Event) => any) | null;\n readonly pushManager: PushManager;\n readonly scope: string;\n readonly sync: SyncManager;\n readonly waiting: ServiceWorker | null;\n getNotifications(filter?: GetNotificationOptions): Promise;\n showNotification(title: string, options?: NotificationOptions): Promise;\n unregister(): Promise;\n update(): Promise;\n addEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: ServiceWorkerRegistration, ev: ServiceWorkerRegistrationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var ServiceWorkerRegistration: {\n prototype: ServiceWorkerRegistration;\n new(): ServiceWorkerRegistration;\n};\n\ninterface ShadowRoot extends DocumentOrShadowRoot, DocumentFragment {\n readonly host: Element;\n innerHTML: string;\n}\n\ninterface ShadowRootInit {\n delegatesFocus?: boolean;\n mode: \"open\" | \"closed\";\n}\n\ninterface SourceBuffer extends EventTarget {\n appendWindowEnd: number;\n appendWindowStart: number;\n readonly audioTracks: AudioTrackList;\n readonly buffered: TimeRanges;\n mode: AppendMode;\n timestampOffset: number;\n readonly updating: boolean;\n readonly videoTracks: VideoTrackList;\n abort(): void;\n appendBuffer(data: ArrayBuffer | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n appendStream(stream: MSStream, maxSize?: number): void;\n remove(start: number, end: number): void;\n}\n\ndeclare var SourceBuffer: {\n prototype: SourceBuffer;\n new(): SourceBuffer;\n};\n\ninterface SourceBufferList extends EventTarget {\n readonly length: number;\n item(index: number): SourceBuffer;\n [index: number]: SourceBuffer;\n}\n\ndeclare var SourceBufferList: {\n prototype: SourceBufferList;\n new(): SourceBufferList;\n};\n\ninterface SpeechSynthesisEventMap {\n \"voiceschanged\": Event;\n}\n\ninterface SpeechSynthesis extends EventTarget {\n onvoiceschanged: ((this: SpeechSynthesis, ev: Event) => any) | null;\n readonly paused: boolean;\n readonly pending: boolean;\n readonly speaking: boolean;\n cancel(): void;\n getVoices(): SpeechSynthesisVoice[];\n pause(): void;\n resume(): void;\n speak(utterance: SpeechSynthesisUtterance): void;\n addEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesis, ev: SpeechSynthesisEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesis: {\n prototype: SpeechSynthesis;\n new(): SpeechSynthesis;\n};\n\ninterface SpeechSynthesisEvent extends Event {\n readonly charIndex: number;\n readonly charLength: number;\n readonly elapsedTime: number;\n readonly name: string;\n readonly utterance: SpeechSynthesisUtterance;\n}\n\ndeclare var SpeechSynthesisEvent: {\n prototype: SpeechSynthesisEvent;\n new(type: string, eventInitDict?: SpeechSynthesisEventInit): SpeechSynthesisEvent;\n};\n\ninterface SpeechSynthesisUtteranceEventMap {\n \"boundary\": Event;\n \"end\": Event;\n \"error\": Event;\n \"mark\": Event;\n \"pause\": Event;\n \"resume\": Event;\n \"start\": Event;\n}\n\ninterface SpeechSynthesisUtterance extends EventTarget {\n lang: string;\n onboundary: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onend: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onerror: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onmark: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onpause: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onresume: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n onstart: ((this: SpeechSynthesisUtterance, ev: Event) => any) | null;\n pitch: number;\n rate: number;\n text: string;\n voice: SpeechSynthesisVoice;\n volume: number;\n addEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: SpeechSynthesisUtterance, ev: SpeechSynthesisUtteranceEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var SpeechSynthesisUtterance: {\n prototype: SpeechSynthesisUtterance;\n new(): SpeechSynthesisUtterance;\n new(text: string): SpeechSynthesisUtterance;\n};\n\ninterface SpeechSynthesisVoice {\n readonly default: boolean;\n readonly lang: string;\n readonly localService: boolean;\n readonly name: string;\n readonly voiceURI: string;\n}\n\ndeclare var SpeechSynthesisVoice: {\n prototype: SpeechSynthesisVoice;\n new(): SpeechSynthesisVoice;\n};\n\ninterface StereoPannerNode extends AudioNode {\n readonly pan: AudioParam;\n}\n\ndeclare var StereoPannerNode: {\n prototype: StereoPannerNode;\n new(): StereoPannerNode;\n};\n\ninterface Storage {\n readonly length: number;\n clear(): void;\n getItem(key: string): string | null;\n key(index: number): string | null;\n removeItem(key: string): void;\n setItem(key: string, value: string): void;\n [key: string]: any;\n}\n\ndeclare var Storage: {\n prototype: Storage;\n new(): Storage;\n};\n\ninterface StorageEvent extends Event {\n readonly key: string | null;\n readonly newValue: string | null;\n readonly oldValue: string | null;\n readonly storageArea: Storage | null;\n readonly url: string;\n}\n\ndeclare var StorageEvent: {\n prototype: StorageEvent;\n new (type: string, eventInitDict?: StorageEventInit): StorageEvent;\n};\n\ninterface StorageEventInit extends EventInit {\n key?: string;\n newValue?: string;\n oldValue?: string;\n storageArea?: Storage;\n url: string;\n}\n\ninterface StyleMedia {\n readonly type: string;\n matchMedium(mediaquery: string): boolean;\n}\n\ndeclare var StyleMedia: {\n prototype: StyleMedia;\n new(): StyleMedia;\n};\n\ninterface StyleSheet {\n disabled: boolean;\n readonly href: string | null;\n readonly media: MediaList;\n readonly ownerNode: Node;\n readonly parentStyleSheet: StyleSheet | null;\n readonly title: string | null;\n readonly type: string;\n}\n\ndeclare var StyleSheet: {\n prototype: StyleSheet;\n new(): StyleSheet;\n};\n\ninterface StyleSheetList {\n readonly length: number;\n item(index: number): StyleSheet | null;\n [index: number]: StyleSheet;\n}\n\ndeclare var StyleSheetList: {\n prototype: StyleSheetList;\n new(): StyleSheetList;\n};\n\ninterface SubtleCrypto {\n decrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n deriveBits(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, length: number): PromiseLike;\n deriveKey(algorithm: string | EcdhKeyDeriveParams | DhKeyDeriveParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: string | AesDerivedKeyParams | HmacImportParams | ConcatParams | HkdfCtrParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n digest(algorithm: string | Algorithm, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n encrypt(algorithm: string | RsaOaepParams | AesCtrParams | AesCbcParams | AesCmacParams | AesGcmParams | AesCfbParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n exportKey(format: \"jwk\", key: CryptoKey): PromiseLike;\n exportKey(format: \"raw\" | \"pkcs8\" | \"spki\", key: CryptoKey): PromiseLike;\n exportKey(format: string, key: CryptoKey): PromiseLike;\n generateKey(algorithm: string, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams | DhKeyGenParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"jwk\", keyData: JsonWebKey, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: \"raw\" | \"pkcs8\" | \"spki\", keyData: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n importKey(format: string, keyData: JsonWebKey | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, algorithm: string | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | DhImportKeyParams, extractable: boolean, keyUsages: string[]): PromiseLike;\n sign(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n unwrapKey(format: string, wrappedKey: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, unwrappingKey: CryptoKey, unwrapAlgorithm: string | Algorithm, unwrappedKeyAlgorithm: string | Algorithm, extractable: boolean, keyUsages: string[]): PromiseLike;\n verify(algorithm: string | RsaPssParams | EcdsaParams | AesCmacParams, key: CryptoKey, signature: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer): PromiseLike;\n wrapKey(format: string, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: string | Algorithm): PromiseLike;\n}\n\ndeclare var SubtleCrypto: {\n prototype: SubtleCrypto;\n new(): SubtleCrypto;\n};\n\ninterface SyncManager {\n getTags(): Promise;\n register(tag: string): Promise;\n}\n\ndeclare var SyncManager: {\n prototype: SyncManager;\n new(): SyncManager;\n};\n\ninterface Text extends CharacterData {\n readonly assignedSlot: HTMLSlotElement | null;\n readonly wholeText: string;\n splitText(offset: number): Text;\n}\n\ndeclare var Text: {\n prototype: Text;\n new(data?: string): Text;\n};\n\ninterface TextDecoder {\n readonly encoding: string;\n readonly fatal: boolean;\n readonly ignoreBOM: boolean;\n decode(input?: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: TextDecodeOptions): string;\n}\n\ndeclare var TextDecoder: {\n prototype: TextDecoder;\n new(label?: string, options?: TextDecoderOptions): TextDecoder;\n};\n\ninterface TextEncoder {\n readonly encoding: string;\n encode(input?: string): Uint8Array;\n}\n\ndeclare var TextEncoder: {\n prototype: TextEncoder;\n new(): TextEncoder;\n};\n\ninterface TextEvent extends UIEvent {\n readonly data: string;\n initTextEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, dataArg: string, inputMethod: number, locale: string): void;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n}\n\ndeclare var TextEvent: {\n prototype: TextEvent;\n new(): TextEvent;\n readonly DOM_INPUT_METHOD_DROP: number;\n readonly DOM_INPUT_METHOD_HANDWRITING: number;\n readonly DOM_INPUT_METHOD_IME: number;\n readonly DOM_INPUT_METHOD_KEYBOARD: number;\n readonly DOM_INPUT_METHOD_MULTIMODAL: number;\n readonly DOM_INPUT_METHOD_OPTION: number;\n readonly DOM_INPUT_METHOD_PASTE: number;\n readonly DOM_INPUT_METHOD_SCRIPT: number;\n readonly DOM_INPUT_METHOD_UNKNOWN: number;\n readonly DOM_INPUT_METHOD_VOICE: number;\n};\n\ninterface TextMetrics {\n readonly width: number;\n}\n\ndeclare var TextMetrics: {\n prototype: TextMetrics;\n new(): TextMetrics;\n};\n\ninterface TextTrackEventMap {\n \"cuechange\": Event;\n \"error\": Event;\n \"load\": Event;\n}\n\ninterface TextTrack extends EventTarget {\n readonly activeCues: TextTrackCueList;\n readonly cues: TextTrackCueList;\n readonly inBandMetadataTrackDispatchType: string;\n readonly kind: string;\n readonly label: string;\n readonly language: string;\n mode: TextTrackMode | number;\n oncuechange: ((this: TextTrack, ev: Event) => any) | null;\n onerror: ((this: TextTrack, ev: Event) => any) | null;\n onload: ((this: TextTrack, ev: Event) => any) | null;\n readonly readyState: number;\n addCue(cue: TextTrackCue): void;\n removeCue(cue: TextTrackCue): void;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n addEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrack: {\n prototype: TextTrack;\n new(): TextTrack;\n readonly DISABLED: number;\n readonly ERROR: number;\n readonly HIDDEN: number;\n readonly LOADED: number;\n readonly LOADING: number;\n readonly NONE: number;\n readonly SHOWING: number;\n};\n\ninterface TextTrackCueEventMap {\n \"enter\": Event;\n \"exit\": Event;\n}\n\ninterface TextTrackCue extends EventTarget {\n endTime: number;\n id: string;\n onenter: ((this: TextTrackCue, ev: Event) => any) | null;\n onexit: ((this: TextTrackCue, ev: Event) => any) | null;\n pauseOnExit: boolean;\n startTime: number;\n text: string;\n readonly track: TextTrack;\n getCueAsHTML(): DocumentFragment;\n addEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var TextTrackCue: {\n prototype: TextTrackCue;\n new(startTime: number, endTime: number, text: string): TextTrackCue;\n};\n\ninterface TextTrackCueList {\n readonly length: number;\n getCueById(id: string): TextTrackCue;\n item(index: number): TextTrackCue;\n [index: number]: TextTrackCue;\n}\n\ndeclare var TextTrackCueList: {\n prototype: TextTrackCueList;\n new(): TextTrackCueList;\n};\n\ninterface TextTrackListEventMap {\n \"addtrack\": TrackEvent;\n}\n\ninterface TextTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: TextTrackList, ev: TrackEvent) => any) | null;\n item(index: number): TextTrack;\n addEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: TextTrackList, ev: TextTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: TextTrack;\n}\n\ndeclare var TextTrackList: {\n prototype: TextTrackList;\n new(): TextTrackList;\n};\n\ninterface TimeRanges {\n readonly length: number;\n end(index: number): number;\n start(index: number): number;\n}\n\ndeclare var TimeRanges: {\n prototype: TimeRanges;\n new(): TimeRanges;\n};\n\ninterface Touch {\n readonly clientX: number;\n readonly clientY: number;\n readonly identifier: number;\n readonly pageX: number;\n readonly pageY: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly target: EventTarget;\n}\n\ndeclare var Touch: {\n prototype: Touch;\n new(): Touch;\n};\n\ninterface TouchEvent extends UIEvent {\n readonly altKey: boolean;\n readonly changedTouches: TouchList;\n readonly charCode: number;\n readonly ctrlKey: boolean;\n readonly keyCode: number;\n readonly metaKey: boolean;\n readonly shiftKey: boolean;\n readonly targetTouches: TouchList;\n readonly touches: TouchList;\n /** @deprecated */\n readonly which: number;\n}\n\ndeclare var TouchEvent: {\n prototype: TouchEvent;\n new(type: string, touchEventInit?: TouchEventInit): TouchEvent;\n};\n\ninterface TouchEventInit extends EventModifierInit {\n changedTouches?: Touch[];\n targetTouches?: Touch[];\n touches?: Touch[];\n}\n\ninterface TouchList {\n readonly length: number;\n item(index: number): Touch | null;\n [index: number]: Touch;\n}\n\ndeclare var TouchList: {\n prototype: TouchList;\n new(): TouchList;\n};\n\ninterface TrackEvent extends Event {\n readonly track: VideoTrack | AudioTrack | TextTrack | null;\n}\n\ndeclare var TrackEvent: {\n prototype: TrackEvent;\n new(typeArg: string, eventInitDict?: TrackEventInit): TrackEvent;\n};\n\ninterface TransitionEvent extends Event {\n readonly elapsedTime: number;\n readonly propertyName: string;\n initTransitionEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, propertyNameArg: string, elapsedTimeArg: number): void;\n}\n\ndeclare var TransitionEvent: {\n prototype: TransitionEvent;\n new(typeArg: string, eventInitDict?: TransitionEventInit): TransitionEvent;\n};\n\ninterface TreeWalker {\n currentNode: Node;\n /** @deprecated */\n readonly expandEntityReferences: boolean;\n readonly filter: NodeFilter | null;\n readonly root: Node;\n readonly whatToShow: number;\n firstChild(): Node | null;\n lastChild(): Node | null;\n nextNode(): Node | null;\n nextSibling(): Node | null;\n parentNode(): Node | null;\n previousNode(): Node | null;\n previousSibling(): Node | null;\n}\n\ndeclare var TreeWalker: {\n prototype: TreeWalker;\n new(): TreeWalker;\n};\n\ninterface UIEvent extends Event {\n readonly detail: number;\n readonly view: Window;\n initUIEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number): void;\n}\n\ndeclare var UIEvent: {\n prototype: UIEvent;\n new(typeArg: string, eventInitDict?: UIEventInit): UIEvent;\n};\n\ninterface URL {\n hash: string;\n host: string;\n hostname: string;\n href: string;\n readonly origin: string;\n password: string;\n pathname: string;\n port: string;\n protocol: string;\n search: string;\n readonly searchParams: URLSearchParams;\n username: string;\n toString(): string;\n}\n\ndeclare var URL: {\n prototype: URL;\n new(url: string, base?: string | URL): URL;\n createObjectURL(object: any, options?: ObjectURLOptions): string;\n revokeObjectURL(url: string): void;\n};\n\ninterface URLSearchParams {\n /**\n * Appends a specified key/value pair as a new search parameter.\n */\n append(name: string, value: string): void;\n /**\n * Deletes the given search parameter, and its associated value, from the list of all search parameters.\n */\n delete(name: string): void;\n /**\n * Returns the first value associated to the given search parameter.\n */\n get(name: string): string | null;\n /**\n * Returns all the values association with a given search parameter.\n */\n getAll(name: string): string[];\n /**\n * Returns a Boolean indicating if such a search parameter exists.\n */\n has(name: string): boolean;\n /**\n * Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.\n */\n set(name: string, value: string): void;\n}\n\ndeclare var URLSearchParams: {\n prototype: URLSearchParams;\n new (init?: string | URLSearchParams): URLSearchParams;\n};\n\ninterface VRDisplay extends EventTarget {\n readonly capabilities: VRDisplayCapabilities;\n depthFar: number;\n depthNear: number;\n readonly displayId: number;\n readonly displayName: string;\n readonly isConnected: boolean;\n readonly isPresenting: boolean;\n readonly stageParameters: VRStageParameters | null;\n cancelAnimationFrame(handle: number): void;\n exitPresent(): Promise;\n getEyeParameters(whichEye: string): VREyeParameters;\n getFrameData(frameData: VRFrameData): boolean;\n getLayers(): VRLayer[];\n /** @deprecated */\n getPose(): VRPose;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n requestPresent(layers: VRLayer[]): Promise;\n resetPose(): void;\n submitFrame(pose?: VRPose): void;\n}\n\ndeclare var VRDisplay: {\n prototype: VRDisplay;\n new(): VRDisplay;\n};\n\ninterface VRDisplayCapabilities {\n readonly canPresent: boolean;\n readonly hasExternalDisplay: boolean;\n readonly hasOrientation: boolean;\n readonly hasPosition: boolean;\n readonly maxLayers: number;\n}\n\ndeclare var VRDisplayCapabilities: {\n prototype: VRDisplayCapabilities;\n new(): VRDisplayCapabilities;\n};\n\ninterface VRDisplayEvent extends Event {\n readonly display: VRDisplay;\n readonly reason: VRDisplayEventReason | null;\n}\n\ndeclare var VRDisplayEvent: {\n prototype: VRDisplayEvent;\n new(type: string, eventInitDict: VRDisplayEventInit): VRDisplayEvent;\n};\n\ninterface VREyeParameters {\n /** @deprecated */\n readonly fieldOfView: VRFieldOfView;\n readonly offset: Float32Array;\n readonly renderHeight: number;\n readonly renderWidth: number;\n}\n\ndeclare var VREyeParameters: {\n prototype: VREyeParameters;\n new(): VREyeParameters;\n};\n\ninterface VRFieldOfView {\n readonly downDegrees: number;\n readonly leftDegrees: number;\n readonly rightDegrees: number;\n readonly upDegrees: number;\n}\n\ndeclare var VRFieldOfView: {\n prototype: VRFieldOfView;\n new(): VRFieldOfView;\n};\n\ninterface VRFrameData {\n readonly leftProjectionMatrix: Float32Array;\n readonly leftViewMatrix: Float32Array;\n readonly pose: VRPose;\n readonly rightProjectionMatrix: Float32Array;\n readonly rightViewMatrix: Float32Array;\n readonly timestamp: number;\n}\n\ndeclare var VRFrameData: {\n prototype: VRFrameData;\n new(): VRFrameData;\n};\n\ninterface VRPose {\n readonly angularAcceleration: Float32Array | null;\n readonly angularVelocity: Float32Array | null;\n readonly linearAcceleration: Float32Array | null;\n readonly linearVelocity: Float32Array | null;\n readonly orientation: Float32Array | null;\n readonly position: Float32Array | null;\n readonly timestamp: number;\n}\n\ndeclare var VRPose: {\n prototype: VRPose;\n new(): VRPose;\n};\n\ninterface ValidityState {\n readonly badInput: boolean;\n readonly customError: boolean;\n readonly patternMismatch: boolean;\n readonly rangeOverflow: boolean;\n readonly rangeUnderflow: boolean;\n readonly stepMismatch: boolean;\n readonly tooLong: boolean;\n readonly tooShort: boolean;\n readonly typeMismatch: boolean;\n readonly valid: boolean;\n readonly valueMissing: boolean;\n}\n\ndeclare var ValidityState: {\n prototype: ValidityState;\n new(): ValidityState;\n};\n\ninterface VideoPlaybackQuality {\n readonly corruptedVideoFrames: number;\n readonly creationTime: number;\n readonly droppedVideoFrames: number;\n readonly totalFrameDelay: number;\n readonly totalVideoFrames: number;\n}\n\ndeclare var VideoPlaybackQuality: {\n prototype: VideoPlaybackQuality;\n new(): VideoPlaybackQuality;\n};\n\ninterface VideoTrack {\n readonly id: string;\n kind: string;\n readonly label: string;\n language: string;\n selected: boolean;\n readonly sourceBuffer: SourceBuffer;\n}\n\ndeclare var VideoTrack: {\n prototype: VideoTrack;\n new(): VideoTrack;\n};\n\ninterface VideoTrackListEventMap {\n \"addtrack\": TrackEvent;\n \"change\": Event;\n \"removetrack\": TrackEvent;\n}\n\ninterface VideoTrackList extends EventTarget {\n readonly length: number;\n onaddtrack: ((this: VideoTrackList, ev: TrackEvent) => any) | null;\n onchange: ((this: VideoTrackList, ev: Event) => any) | null;\n onremovetrack: ((this: VideoTrackList, ev: TrackEvent) => any) | null;\n readonly selectedIndex: number;\n getTrackById(id: string): VideoTrack | null;\n item(index: number): VideoTrack;\n addEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: VideoTrackList, ev: VideoTrackListEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n [index: number]: VideoTrack;\n}\n\ndeclare var VideoTrackList: {\n prototype: VideoTrackList;\n new(): VideoTrackList;\n};\n\ninterface WEBGL_color_buffer_float {\n readonly FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT: number;\n readonly RGB32F_EXT: number;\n readonly RGBA32F_EXT: number;\n readonly UNSIGNED_NORMALIZED_EXT: number;\n}\n\ninterface WEBGL_compressed_texture_astc {\n readonly COMPRESSED_RGBA_ASTC_10x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_10x8_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x10_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_12x12_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_4x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x4_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_5x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_6x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x5_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x6_KHR: number;\n readonly COMPRESSED_RGBA_ASTC_8x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: number;\n readonly COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: number;\n getSupportedProfiles(): string[];\n}\n\ninterface WEBGL_compressed_texture_s3tc {\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n}\n\ndeclare var WEBGL_compressed_texture_s3tc: {\n prototype: WEBGL_compressed_texture_s3tc;\n new(): WEBGL_compressed_texture_s3tc;\n readonly COMPRESSED_RGBA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_RGBA_S3TC_DXT5_EXT: number;\n readonly COMPRESSED_RGB_S3TC_DXT1_EXT: number;\n};\n\ninterface WEBGL_compressed_texture_s3tc_srgb {\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: number;\n readonly COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: number;\n readonly COMPRESSED_SRGB_S3TC_DXT1_EXT: number;\n}\n\ninterface WEBGL_debug_renderer_info {\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n}\n\ndeclare var WEBGL_debug_renderer_info: {\n prototype: WEBGL_debug_renderer_info;\n new(): WEBGL_debug_renderer_info;\n readonly UNMASKED_RENDERER_WEBGL: number;\n readonly UNMASKED_VENDOR_WEBGL: number;\n};\n\ninterface WEBGL_debug_shaders {\n getTranslatedShaderSource(shader: WebGLShader): string;\n}\n\ninterface WEBGL_depth_texture {\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n}\n\ndeclare var WEBGL_depth_texture: {\n prototype: WEBGL_depth_texture;\n new(): WEBGL_depth_texture;\n readonly UNSIGNED_INT_24_8_WEBGL: number;\n};\n\ninterface WEBGL_draw_buffers {\n readonly COLOR_ATTACHMENT0_WEBGL: number;\n readonly COLOR_ATTACHMENT10_WEBGL: number;\n readonly COLOR_ATTACHMENT11_WEBGL: number;\n readonly COLOR_ATTACHMENT12_WEBGL: number;\n readonly COLOR_ATTACHMENT13_WEBGL: number;\n readonly COLOR_ATTACHMENT14_WEBGL: number;\n readonly COLOR_ATTACHMENT15_WEBGL: number;\n readonly COLOR_ATTACHMENT1_WEBGL: number;\n readonly COLOR_ATTACHMENT2_WEBGL: number;\n readonly COLOR_ATTACHMENT3_WEBGL: number;\n readonly COLOR_ATTACHMENT4_WEBGL: number;\n readonly COLOR_ATTACHMENT5_WEBGL: number;\n readonly COLOR_ATTACHMENT6_WEBGL: number;\n readonly COLOR_ATTACHMENT7_WEBGL: number;\n readonly COLOR_ATTACHMENT8_WEBGL: number;\n readonly COLOR_ATTACHMENT9_WEBGL: number;\n readonly DRAW_BUFFER0_WEBGL: number;\n readonly DRAW_BUFFER10_WEBGL: number;\n readonly DRAW_BUFFER11_WEBGL: number;\n readonly DRAW_BUFFER12_WEBGL: number;\n readonly DRAW_BUFFER13_WEBGL: number;\n readonly DRAW_BUFFER14_WEBGL: number;\n readonly DRAW_BUFFER15_WEBGL: number;\n readonly DRAW_BUFFER1_WEBGL: number;\n readonly DRAW_BUFFER2_WEBGL: number;\n readonly DRAW_BUFFER3_WEBGL: number;\n readonly DRAW_BUFFER4_WEBGL: number;\n readonly DRAW_BUFFER5_WEBGL: number;\n readonly DRAW_BUFFER6_WEBGL: number;\n readonly DRAW_BUFFER7_WEBGL: number;\n readonly DRAW_BUFFER8_WEBGL: number;\n readonly DRAW_BUFFER9_WEBGL: number;\n readonly MAX_COLOR_ATTACHMENTS_WEBGL: number;\n readonly MAX_DRAW_BUFFERS_WEBGL: number;\n drawBuffersWEBGL(buffers: number[]): void;\n}\n\ninterface WEBGL_lose_context {\n loseContext(): void;\n restoreContext(): void;\n}\n\ninterface WaveShaperNode extends AudioNode {\n curve: Float32Array | null;\n oversample: OverSampleType;\n}\n\ndeclare var WaveShaperNode: {\n prototype: WaveShaperNode;\n new(): WaveShaperNode;\n};\n\ninterface WebAuthentication {\n getAssertion(assertionChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: AssertionOptions): Promise;\n makeCredential(accountInformation: Account, cryptoParameters: ScopedCredentialParameters[], attestationChallenge: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, options?: ScopedCredentialOptions): Promise;\n}\n\ndeclare var WebAuthentication: {\n prototype: WebAuthentication;\n new(): WebAuthentication;\n};\n\ninterface WebAuthnAssertion {\n readonly authenticatorData: ArrayBuffer;\n readonly clientData: ArrayBuffer;\n readonly credential: ScopedCredential;\n readonly signature: ArrayBuffer;\n}\n\ndeclare var WebAuthnAssertion: {\n prototype: WebAuthnAssertion;\n new(): WebAuthnAssertion;\n};\n\ninterface WebGLActiveInfo {\n readonly name: string;\n readonly size: number;\n readonly type: number;\n}\n\ndeclare var WebGLActiveInfo: {\n prototype: WebGLActiveInfo;\n new(): WebGLActiveInfo;\n};\n\ninterface WebGLBuffer extends WebGLObject {\n}\n\ndeclare var WebGLBuffer: {\n prototype: WebGLBuffer;\n new(): WebGLBuffer;\n};\n\ninterface WebGLContextEvent extends Event {\n readonly statusMessage: string;\n}\n\ndeclare var WebGLContextEvent: {\n prototype: WebGLContextEvent;\n new(typeArg: string, eventInitDict?: WebGLContextEventInit): WebGLContextEvent;\n};\n\ninterface WebGLFramebuffer extends WebGLObject {\n}\n\ndeclare var WebGLFramebuffer: {\n prototype: WebGLFramebuffer;\n new(): WebGLFramebuffer;\n};\n\ninterface WebGLObject {\n}\n\ndeclare var WebGLObject: {\n prototype: WebGLObject;\n new(): WebGLObject;\n};\n\ninterface WebGLProgram extends WebGLObject {\n}\n\ndeclare var WebGLProgram: {\n prototype: WebGLProgram;\n new(): WebGLProgram;\n};\n\ninterface WebGLRenderbuffer extends WebGLObject {\n}\n\ndeclare var WebGLRenderbuffer: {\n prototype: WebGLRenderbuffer;\n new(): WebGLRenderbuffer;\n};\n\ninterface WebGLRenderingContext {\n readonly canvas: HTMLCanvasElement;\n readonly drawingBufferHeight: number;\n readonly drawingBufferWidth: number;\n activeTexture(texture: number): void;\n attachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n bindAttribLocation(program: WebGLProgram | null, index: number, name: string): void;\n bindBuffer(target: number, buffer: WebGLBuffer | null): void;\n bindFramebuffer(target: number, framebuffer: WebGLFramebuffer | null): void;\n bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer | null): void;\n bindTexture(target: number, texture: WebGLTexture | null): void;\n blendColor(red: number, green: number, blue: number, alpha: number): void;\n blendEquation(mode: number): void;\n blendEquationSeparate(modeRGB: number, modeAlpha: number): void;\n blendFunc(sfactor: number, dfactor: number): void;\n blendFuncSeparate(srcRGB: number, dstRGB: number, srcAlpha: number, dstAlpha: number): void;\n bufferData(target: number, size: number | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, usage: number): void;\n bufferSubData(target: number, offset: number, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null): void;\n checkFramebufferStatus(target: number): number;\n clear(mask: number): void;\n clearColor(red: number, green: number, blue: number, alpha: number): void;\n clearDepth(depth: number): void;\n clearStencil(s: number): void;\n colorMask(red: boolean, green: boolean, blue: boolean, alpha: boolean): void;\n compileShader(shader: WebGLShader | null): void;\n compressedTexImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n compressedTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, data: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n copyTexImage2D(target: number, level: number, internalformat: number, x: number, y: number, width: number, height: number, border: number): void;\n copyTexSubImage2D(target: number, level: number, xoffset: number, yoffset: number, x: number, y: number, width: number, height: number): void;\n createBuffer(): WebGLBuffer | null;\n createFramebuffer(): WebGLFramebuffer | null;\n createProgram(): WebGLProgram | null;\n createRenderbuffer(): WebGLRenderbuffer | null;\n createShader(type: number): WebGLShader | null;\n createTexture(): WebGLTexture | null;\n cullFace(mode: number): void;\n deleteBuffer(buffer: WebGLBuffer | null): void;\n deleteFramebuffer(framebuffer: WebGLFramebuffer | null): void;\n deleteProgram(program: WebGLProgram | null): void;\n deleteRenderbuffer(renderbuffer: WebGLRenderbuffer | null): void;\n deleteShader(shader: WebGLShader | null): void;\n deleteTexture(texture: WebGLTexture | null): void;\n depthFunc(func: number): void;\n depthMask(flag: boolean): void;\n depthRange(zNear: number, zFar: number): void;\n detachShader(program: WebGLProgram | null, shader: WebGLShader | null): void;\n disable(cap: number): void;\n disableVertexAttribArray(index: number): void;\n drawArrays(mode: number, first: number, count: number): void;\n drawElements(mode: number, count: number, type: number, offset: number): void;\n enable(cap: number): void;\n enableVertexAttribArray(index: number): void;\n finish(): void;\n flush(): void;\n framebufferRenderbuffer(target: number, attachment: number, renderbuffertarget: number, renderbuffer: WebGLRenderbuffer | null): void;\n framebufferTexture2D(target: number, attachment: number, textarget: number, texture: WebGLTexture | null, level: number): void;\n frontFace(mode: number): void;\n generateMipmap(target: number): void;\n getActiveAttrib(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getActiveUniform(program: WebGLProgram | null, index: number): WebGLActiveInfo | null;\n getAttachedShaders(program: WebGLProgram | null): WebGLShader[] | null;\n getAttribLocation(program: WebGLProgram | null, name: string): number;\n getBufferParameter(target: number, pname: number): any;\n getContextAttributes(): WebGLContextAttributes;\n getError(): number;\n getExtension(extensionName: \"EXT_blend_minmax\"): EXT_blend_minmax | null;\n getExtension(extensionName: \"EXT_texture_filter_anisotropic\"): EXT_texture_filter_anisotropic | null;\n getExtension(extensionName: \"EXT_frag_depth\"): EXT_frag_depth | null;\n getExtension(extensionName: \"EXT_shader_texture_lod\"): EXT_shader_texture_lod | null;\n getExtension(extensionName: \"EXT_sRGB\"): EXT_sRGB | null;\n getExtension(extensionName: \"OES_vertex_array_object\"): OES_vertex_array_object | null;\n getExtension(extensionName: \"WEBGL_color_buffer_float\"): WEBGL_color_buffer_float | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_astc\"): WEBGL_compressed_texture_astc | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc_srgb\"): WEBGL_compressed_texture_s3tc_srgb | null;\n getExtension(extensionName: \"WEBGL_debug_shaders\"): WEBGL_debug_shaders | null;\n getExtension(extensionName: \"WEBGL_draw_buffers\"): WEBGL_draw_buffers | null;\n getExtension(extensionName: \"WEBGL_lose_context\"): WEBGL_lose_context | null;\n getExtension(extensionName: \"WEBGL_depth_texture\"): WEBGL_depth_texture | null;\n getExtension(extensionName: \"WEBGL_debug_renderer_info\"): WEBGL_debug_renderer_info | null;\n getExtension(extensionName: \"WEBGL_compressed_texture_s3tc\"): WEBGL_compressed_texture_s3tc | null;\n getExtension(extensionName: \"OES_texture_half_float_linear\"): OES_texture_half_float_linear | null;\n getExtension(extensionName: \"OES_texture_half_float\"): OES_texture_half_float | null;\n getExtension(extensionName: \"OES_texture_float_linear\"): OES_texture_float_linear | null;\n getExtension(extensionName: \"OES_texture_float\"): OES_texture_float | null;\n getExtension(extensionName: \"OES_standard_derivatives\"): OES_standard_derivatives | null;\n getExtension(extensionName: \"OES_element_index_uint\"): OES_element_index_uint | null;\n getExtension(extensionName: \"ANGLE_instanced_arrays\"): ANGLE_instanced_arrays | null;\n getExtension(extensionName: string): any;\n getFramebufferAttachmentParameter(target: number, attachment: number, pname: number): any;\n getParameter(pname: number): any;\n getProgramInfoLog(program: WebGLProgram | null): string | null;\n getProgramParameter(program: WebGLProgram | null, pname: number): any;\n getRenderbufferParameter(target: number, pname: number): any;\n getShaderInfoLog(shader: WebGLShader | null): string | null;\n getShaderParameter(shader: WebGLShader | null, pname: number): any;\n getShaderPrecisionFormat(shadertype: number, precisiontype: number): WebGLShaderPrecisionFormat | null;\n getShaderSource(shader: WebGLShader | null): string | null;\n getSupportedExtensions(): string[] | null;\n getTexParameter(target: number, pname: number): any;\n getUniform(program: WebGLProgram | null, location: WebGLUniformLocation | null): any;\n getUniformLocation(program: WebGLProgram | null, name: string): WebGLUniformLocation | null;\n getVertexAttrib(index: number, pname: number): any;\n getVertexAttribOffset(index: number, pname: number): number;\n hint(target: number, mode: number): void;\n isBuffer(buffer: WebGLBuffer | null): boolean;\n isContextLost(): boolean;\n isEnabled(cap: number): boolean;\n isFramebuffer(framebuffer: WebGLFramebuffer | null): boolean;\n isProgram(program: WebGLProgram | null): boolean;\n isRenderbuffer(renderbuffer: WebGLRenderbuffer | null): boolean;\n isShader(shader: WebGLShader | null): boolean;\n isTexture(texture: WebGLTexture | null): boolean;\n lineWidth(width: number): void;\n linkProgram(program: WebGLProgram | null): void;\n pixelStorei(pname: number, param: number | boolean): void;\n polygonOffset(factor: number, units: number): void;\n readPixels(x: number, y: number, width: number, height: number, format: number, type: number, pixels: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null): void;\n renderbufferStorage(target: number, internalformat: number, width: number, height: number): void;\n sampleCoverage(value: number, invert: boolean): void;\n scissor(x: number, y: number, width: number, height: number): void;\n shaderSource(shader: WebGLShader | null, source: string): void;\n stencilFunc(func: number, ref: number, mask: number): void;\n stencilFuncSeparate(face: number, func: number, ref: number, mask: number): void;\n stencilMask(mask: number): void;\n stencilMaskSeparate(face: number, mask: number): void;\n stencilOp(fail: number, zfail: number, zpass: number): void;\n stencilOpSeparate(face: number, fail: number, zfail: number, zpass: number): void;\n texImage2D(target: number, level: number, internalformat: number, width: number, height: number, border: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texImage2D(target: number, level: number, internalformat: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n texParameterf(target: number, pname: number, param: number): void;\n texParameteri(target: number, pname: number, param: number): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, width: number, height: number, format: number, type: number, pixels: ArrayBufferView | null): void;\n texSubImage2D(target: number, level: number, xoffset: number, yoffset: number, format: number, type: number, pixels: ImageBitmap | ImageData | HTMLVideoElement | HTMLImageElement | HTMLCanvasElement): void;\n uniform1f(location: WebGLUniformLocation | null, x: number): void;\n uniform1fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform1i(location: WebGLUniformLocation | null, x: number): void;\n uniform1iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniform2f(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform2i(location: WebGLUniformLocation | null, x: number, y: number): void;\n uniform2iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniform3f(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform3i(location: WebGLUniformLocation | null, x: number, y: number, z: number): void;\n uniform3iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniform4f(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4fv(location: WebGLUniformLocation, v: Float32Array | ArrayLike): void;\n uniform4i(location: WebGLUniformLocation | null, x: number, y: number, z: number, w: number): void;\n uniform4iv(location: WebGLUniformLocation, v: Int32Array | ArrayLike): void;\n uniformMatrix2fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void;\n uniformMatrix3fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void;\n uniformMatrix4fv(location: WebGLUniformLocation, transpose: boolean, value: Float32Array | ArrayLike): void;\n useProgram(program: WebGLProgram | null): void;\n validateProgram(program: WebGLProgram | null): void;\n vertexAttrib1f(indx: number, x: number): void;\n vertexAttrib1fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib2f(indx: number, x: number, y: number): void;\n vertexAttrib2fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib3f(indx: number, x: number, y: number, z: number): void;\n vertexAttrib3fv(indx: number, values: Float32Array | number[]): void;\n vertexAttrib4f(indx: number, x: number, y: number, z: number, w: number): void;\n vertexAttrib4fv(indx: number, values: Float32Array | number[]): void;\n vertexAttribPointer(indx: number, size: number, type: number, normalized: boolean, stride: number, offset: number): void;\n viewport(x: number, y: number, width: number, height: number): void;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly NO_ERROR: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB565: number;\n readonly RGB5_A1: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TRIANGLES: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n}\n\ndeclare var WebGLRenderingContext: {\n prototype: WebGLRenderingContext;\n new(): WebGLRenderingContext;\n readonly ACTIVE_ATTRIBUTES: number;\n readonly ACTIVE_TEXTURE: number;\n readonly ACTIVE_UNIFORMS: number;\n readonly ALIASED_LINE_WIDTH_RANGE: number;\n readonly ALIASED_POINT_SIZE_RANGE: number;\n readonly ALPHA: number;\n readonly ALPHA_BITS: number;\n readonly ALWAYS: number;\n readonly ARRAY_BUFFER: number;\n readonly ARRAY_BUFFER_BINDING: number;\n readonly ATTACHED_SHADERS: number;\n readonly BACK: number;\n readonly BLEND: number;\n readonly BLEND_COLOR: number;\n readonly BLEND_DST_ALPHA: number;\n readonly BLEND_DST_RGB: number;\n readonly BLEND_EQUATION: number;\n readonly BLEND_EQUATION_ALPHA: number;\n readonly BLEND_EQUATION_RGB: number;\n readonly BLEND_SRC_ALPHA: number;\n readonly BLEND_SRC_RGB: number;\n readonly BLUE_BITS: number;\n readonly BOOL: number;\n readonly BOOL_VEC2: number;\n readonly BOOL_VEC3: number;\n readonly BOOL_VEC4: number;\n readonly BROWSER_DEFAULT_WEBGL: number;\n readonly BUFFER_SIZE: number;\n readonly BUFFER_USAGE: number;\n readonly BYTE: number;\n readonly CCW: number;\n readonly CLAMP_TO_EDGE: number;\n readonly COLOR_ATTACHMENT0: number;\n readonly COLOR_BUFFER_BIT: number;\n readonly COLOR_CLEAR_VALUE: number;\n readonly COLOR_WRITEMASK: number;\n readonly COMPILE_STATUS: number;\n readonly COMPRESSED_TEXTURE_FORMATS: number;\n readonly CONSTANT_ALPHA: number;\n readonly CONSTANT_COLOR: number;\n readonly CONTEXT_LOST_WEBGL: number;\n readonly CULL_FACE: number;\n readonly CULL_FACE_MODE: number;\n readonly CURRENT_PROGRAM: number;\n readonly CURRENT_VERTEX_ATTRIB: number;\n readonly CW: number;\n readonly DECR: number;\n readonly DECR_WRAP: number;\n readonly DELETE_STATUS: number;\n readonly DEPTH_ATTACHMENT: number;\n readonly DEPTH_BITS: number;\n readonly DEPTH_BUFFER_BIT: number;\n readonly DEPTH_CLEAR_VALUE: number;\n readonly DEPTH_COMPONENT: number;\n readonly DEPTH_COMPONENT16: number;\n readonly DEPTH_FUNC: number;\n readonly DEPTH_RANGE: number;\n readonly DEPTH_STENCIL: number;\n readonly DEPTH_STENCIL_ATTACHMENT: number;\n readonly DEPTH_TEST: number;\n readonly DEPTH_WRITEMASK: number;\n readonly DITHER: number;\n readonly DONT_CARE: number;\n readonly DST_ALPHA: number;\n readonly DST_COLOR: number;\n readonly DYNAMIC_DRAW: number;\n readonly ELEMENT_ARRAY_BUFFER: number;\n readonly ELEMENT_ARRAY_BUFFER_BINDING: number;\n readonly EQUAL: number;\n readonly FASTEST: number;\n readonly FLOAT: number;\n readonly FLOAT_MAT2: number;\n readonly FLOAT_MAT3: number;\n readonly FLOAT_MAT4: number;\n readonly FLOAT_VEC2: number;\n readonly FLOAT_VEC3: number;\n readonly FLOAT_VEC4: number;\n readonly FRAGMENT_SHADER: number;\n readonly FRAMEBUFFER: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: number;\n readonly FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE: number;\n readonly FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL: number;\n readonly FRAMEBUFFER_BINDING: number;\n readonly FRAMEBUFFER_COMPLETE: number;\n readonly FRAMEBUFFER_INCOMPLETE_ATTACHMENT: number;\n readonly FRAMEBUFFER_INCOMPLETE_DIMENSIONS: number;\n readonly FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: number;\n readonly FRAMEBUFFER_UNSUPPORTED: number;\n readonly FRONT: number;\n readonly FRONT_AND_BACK: number;\n readonly FRONT_FACE: number;\n readonly FUNC_ADD: number;\n readonly FUNC_REVERSE_SUBTRACT: number;\n readonly FUNC_SUBTRACT: number;\n readonly GENERATE_MIPMAP_HINT: number;\n readonly GEQUAL: number;\n readonly GREATER: number;\n readonly GREEN_BITS: number;\n readonly HIGH_FLOAT: number;\n readonly HIGH_INT: number;\n readonly IMPLEMENTATION_COLOR_READ_FORMAT: number;\n readonly IMPLEMENTATION_COLOR_READ_TYPE: number;\n readonly INCR: number;\n readonly INCR_WRAP: number;\n readonly INT: number;\n readonly INT_VEC2: number;\n readonly INT_VEC3: number;\n readonly INT_VEC4: number;\n readonly INVALID_ENUM: number;\n readonly INVALID_FRAMEBUFFER_OPERATION: number;\n readonly INVALID_OPERATION: number;\n readonly INVALID_VALUE: number;\n readonly INVERT: number;\n readonly KEEP: number;\n readonly LEQUAL: number;\n readonly LESS: number;\n readonly LINEAR: number;\n readonly LINEAR_MIPMAP_LINEAR: number;\n readonly LINEAR_MIPMAP_NEAREST: number;\n readonly LINES: number;\n readonly LINE_LOOP: number;\n readonly LINE_STRIP: number;\n readonly LINE_WIDTH: number;\n readonly LINK_STATUS: number;\n readonly LOW_FLOAT: number;\n readonly LOW_INT: number;\n readonly LUMINANCE: number;\n readonly LUMINANCE_ALPHA: number;\n readonly MAX_COMBINED_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_CUBE_MAP_TEXTURE_SIZE: number;\n readonly MAX_FRAGMENT_UNIFORM_VECTORS: number;\n readonly MAX_RENDERBUFFER_SIZE: number;\n readonly MAX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_TEXTURE_SIZE: number;\n readonly MAX_VARYING_VECTORS: number;\n readonly MAX_VERTEX_ATTRIBS: number;\n readonly MAX_VERTEX_TEXTURE_IMAGE_UNITS: number;\n readonly MAX_VERTEX_UNIFORM_VECTORS: number;\n readonly MAX_VIEWPORT_DIMS: number;\n readonly MEDIUM_FLOAT: number;\n readonly MEDIUM_INT: number;\n readonly MIRRORED_REPEAT: number;\n readonly NEAREST: number;\n readonly NEAREST_MIPMAP_LINEAR: number;\n readonly NEAREST_MIPMAP_NEAREST: number;\n readonly NEVER: number;\n readonly NICEST: number;\n readonly NONE: number;\n readonly NOTEQUAL: number;\n readonly NO_ERROR: number;\n readonly ONE: number;\n readonly ONE_MINUS_CONSTANT_ALPHA: number;\n readonly ONE_MINUS_CONSTANT_COLOR: number;\n readonly ONE_MINUS_DST_ALPHA: number;\n readonly ONE_MINUS_DST_COLOR: number;\n readonly ONE_MINUS_SRC_ALPHA: number;\n readonly ONE_MINUS_SRC_COLOR: number;\n readonly OUT_OF_MEMORY: number;\n readonly PACK_ALIGNMENT: number;\n readonly POINTS: number;\n readonly POLYGON_OFFSET_FACTOR: number;\n readonly POLYGON_OFFSET_FILL: number;\n readonly POLYGON_OFFSET_UNITS: number;\n readonly RED_BITS: number;\n readonly RENDERBUFFER: number;\n readonly RENDERBUFFER_ALPHA_SIZE: number;\n readonly RENDERBUFFER_BINDING: number;\n readonly RENDERBUFFER_BLUE_SIZE: number;\n readonly RENDERBUFFER_DEPTH_SIZE: number;\n readonly RENDERBUFFER_GREEN_SIZE: number;\n readonly RENDERBUFFER_HEIGHT: number;\n readonly RENDERBUFFER_INTERNAL_FORMAT: number;\n readonly RENDERBUFFER_RED_SIZE: number;\n readonly RENDERBUFFER_STENCIL_SIZE: number;\n readonly RENDERBUFFER_WIDTH: number;\n readonly RENDERER: number;\n readonly REPEAT: number;\n readonly REPLACE: number;\n readonly RGB: number;\n readonly RGB565: number;\n readonly RGB5_A1: number;\n readonly RGBA: number;\n readonly RGBA4: number;\n readonly SAMPLER_2D: number;\n readonly SAMPLER_CUBE: number;\n readonly SAMPLES: number;\n readonly SAMPLE_ALPHA_TO_COVERAGE: number;\n readonly SAMPLE_BUFFERS: number;\n readonly SAMPLE_COVERAGE: number;\n readonly SAMPLE_COVERAGE_INVERT: number;\n readonly SAMPLE_COVERAGE_VALUE: number;\n readonly SCISSOR_BOX: number;\n readonly SCISSOR_TEST: number;\n readonly SHADER_TYPE: number;\n readonly SHADING_LANGUAGE_VERSION: number;\n readonly SHORT: number;\n readonly SRC_ALPHA: number;\n readonly SRC_ALPHA_SATURATE: number;\n readonly SRC_COLOR: number;\n readonly STATIC_DRAW: number;\n readonly STENCIL_ATTACHMENT: number;\n readonly STENCIL_BACK_FAIL: number;\n readonly STENCIL_BACK_FUNC: number;\n readonly STENCIL_BACK_PASS_DEPTH_FAIL: number;\n readonly STENCIL_BACK_PASS_DEPTH_PASS: number;\n readonly STENCIL_BACK_REF: number;\n readonly STENCIL_BACK_VALUE_MASK: number;\n readonly STENCIL_BACK_WRITEMASK: number;\n readonly STENCIL_BITS: number;\n readonly STENCIL_BUFFER_BIT: number;\n readonly STENCIL_CLEAR_VALUE: number;\n readonly STENCIL_FAIL: number;\n readonly STENCIL_FUNC: number;\n readonly STENCIL_INDEX: number;\n readonly STENCIL_INDEX8: number;\n readonly STENCIL_PASS_DEPTH_FAIL: number;\n readonly STENCIL_PASS_DEPTH_PASS: number;\n readonly STENCIL_REF: number;\n readonly STENCIL_TEST: number;\n readonly STENCIL_VALUE_MASK: number;\n readonly STENCIL_WRITEMASK: number;\n readonly STREAM_DRAW: number;\n readonly SUBPIXEL_BITS: number;\n readonly TEXTURE: number;\n readonly TEXTURE0: number;\n readonly TEXTURE1: number;\n readonly TEXTURE10: number;\n readonly TEXTURE11: number;\n readonly TEXTURE12: number;\n readonly TEXTURE13: number;\n readonly TEXTURE14: number;\n readonly TEXTURE15: number;\n readonly TEXTURE16: number;\n readonly TEXTURE17: number;\n readonly TEXTURE18: number;\n readonly TEXTURE19: number;\n readonly TEXTURE2: number;\n readonly TEXTURE20: number;\n readonly TEXTURE21: number;\n readonly TEXTURE22: number;\n readonly TEXTURE23: number;\n readonly TEXTURE24: number;\n readonly TEXTURE25: number;\n readonly TEXTURE26: number;\n readonly TEXTURE27: number;\n readonly TEXTURE28: number;\n readonly TEXTURE29: number;\n readonly TEXTURE3: number;\n readonly TEXTURE30: number;\n readonly TEXTURE31: number;\n readonly TEXTURE4: number;\n readonly TEXTURE5: number;\n readonly TEXTURE6: number;\n readonly TEXTURE7: number;\n readonly TEXTURE8: number;\n readonly TEXTURE9: number;\n readonly TEXTURE_2D: number;\n readonly TEXTURE_BINDING_2D: number;\n readonly TEXTURE_BINDING_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_X: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_NEGATIVE_Z: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_X: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Y: number;\n readonly TEXTURE_CUBE_MAP_POSITIVE_Z: number;\n readonly TEXTURE_MAG_FILTER: number;\n readonly TEXTURE_MIN_FILTER: number;\n readonly TEXTURE_WRAP_S: number;\n readonly TEXTURE_WRAP_T: number;\n readonly TRIANGLES: number;\n readonly TRIANGLE_FAN: number;\n readonly TRIANGLE_STRIP: number;\n readonly UNPACK_ALIGNMENT: number;\n readonly UNPACK_COLORSPACE_CONVERSION_WEBGL: number;\n readonly UNPACK_FLIP_Y_WEBGL: number;\n readonly UNPACK_PREMULTIPLY_ALPHA_WEBGL: number;\n readonly UNSIGNED_BYTE: number;\n readonly UNSIGNED_INT: number;\n readonly UNSIGNED_SHORT: number;\n readonly UNSIGNED_SHORT_4_4_4_4: number;\n readonly UNSIGNED_SHORT_5_5_5_1: number;\n readonly UNSIGNED_SHORT_5_6_5: number;\n readonly VALIDATE_STATUS: number;\n readonly VENDOR: number;\n readonly VERSION: number;\n readonly VERTEX_ATTRIB_ARRAY_BUFFER_BINDING: number;\n readonly VERTEX_ATTRIB_ARRAY_ENABLED: number;\n readonly VERTEX_ATTRIB_ARRAY_NORMALIZED: number;\n readonly VERTEX_ATTRIB_ARRAY_POINTER: number;\n readonly VERTEX_ATTRIB_ARRAY_SIZE: number;\n readonly VERTEX_ATTRIB_ARRAY_STRIDE: number;\n readonly VERTEX_ATTRIB_ARRAY_TYPE: number;\n readonly VERTEX_SHADER: number;\n readonly VIEWPORT: number;\n readonly ZERO: number;\n};\n\ninterface WebGLShader extends WebGLObject {\n}\n\ndeclare var WebGLShader: {\n prototype: WebGLShader;\n new(): WebGLShader;\n};\n\ninterface WebGLShaderPrecisionFormat {\n readonly precision: number;\n readonly rangeMax: number;\n readonly rangeMin: number;\n}\n\ndeclare var WebGLShaderPrecisionFormat: {\n prototype: WebGLShaderPrecisionFormat;\n new(): WebGLShaderPrecisionFormat;\n};\n\ninterface WebGLTexture extends WebGLObject {\n}\n\ndeclare var WebGLTexture: {\n prototype: WebGLTexture;\n new(): WebGLTexture;\n};\n\ninterface WebGLUniformLocation {\n}\n\ndeclare var WebGLUniformLocation: {\n prototype: WebGLUniformLocation;\n new(): WebGLUniformLocation;\n};\n\ninterface WebGLVertexArrayObjectOES {\n}\n\ninterface WebKitCSSMatrix {\n a: number;\n b: number;\n c: number;\n d: number;\n e: number;\n f: number;\n m11: number;\n m12: number;\n m13: number;\n m14: number;\n m21: number;\n m22: number;\n m23: number;\n m24: number;\n m31: number;\n m32: number;\n m33: number;\n m34: number;\n m41: number;\n m42: number;\n m43: number;\n m44: number;\n inverse(): WebKitCSSMatrix;\n multiply(secondMatrix: WebKitCSSMatrix): WebKitCSSMatrix;\n rotate(angleX: number, angleY?: number, angleZ?: number): WebKitCSSMatrix;\n rotateAxisAngle(x: number, y: number, z: number, angle: number): WebKitCSSMatrix;\n scale(scaleX: number, scaleY?: number, scaleZ?: number): WebKitCSSMatrix;\n setMatrixValue(value: string): void;\n skewX(angle: number): WebKitCSSMatrix;\n skewY(angle: number): WebKitCSSMatrix;\n toString(): string;\n translate(x: number, y: number, z?: number): WebKitCSSMatrix;\n}\n\ndeclare var WebKitCSSMatrix: {\n prototype: WebKitCSSMatrix;\n new(text?: string): WebKitCSSMatrix;\n};\n\ninterface WebKitDirectoryEntry extends WebKitEntry {\n createReader(): WebKitDirectoryReader;\n}\n\ndeclare var WebKitDirectoryEntry: {\n prototype: WebKitDirectoryEntry;\n new(): WebKitDirectoryEntry;\n};\n\ninterface WebKitDirectoryReader {\n readEntries(successCallback: WebKitEntriesCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitDirectoryReader: {\n prototype: WebKitDirectoryReader;\n new(): WebKitDirectoryReader;\n};\n\ninterface WebKitEntry {\n readonly filesystem: WebKitFileSystem;\n readonly fullPath: string;\n readonly isDirectory: boolean;\n readonly isFile: boolean;\n readonly name: string;\n}\n\ndeclare var WebKitEntry: {\n prototype: WebKitEntry;\n new(): WebKitEntry;\n};\n\ninterface WebKitFileEntry extends WebKitEntry {\n file(successCallback: WebKitFileCallback, errorCallback?: WebKitErrorCallback): void;\n}\n\ndeclare var WebKitFileEntry: {\n prototype: WebKitFileEntry;\n new(): WebKitFileEntry;\n};\n\ninterface WebKitFileSystem {\n readonly name: string;\n readonly root: WebKitDirectoryEntry;\n}\n\ndeclare var WebKitFileSystem: {\n prototype: WebKitFileSystem;\n new(): WebKitFileSystem;\n};\n\ninterface WebKitPoint {\n x: number;\n y: number;\n}\n\ndeclare var WebKitPoint: {\n prototype: WebKitPoint;\n new(x?: number, y?: number): WebKitPoint;\n};\n\ninterface WebSocketEventMap {\n \"close\": CloseEvent;\n \"error\": Event;\n \"message\": MessageEvent;\n \"open\": Event;\n}\n\ninterface WebSocket extends EventTarget {\n binaryType: BinaryType;\n readonly bufferedAmount: number;\n readonly extensions: string;\n onclose: ((this: WebSocket, ev: CloseEvent) => any) | null;\n onerror: ((this: WebSocket, ev: Event) => any) | null;\n onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;\n onopen: ((this: WebSocket, ev: Event) => any) | null;\n readonly protocol: string;\n readonly readyState: number;\n readonly url: string;\n close(code?: number, reason?: string): void;\n send(data: string | ArrayBuffer | Blob | ArrayBufferView): void;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n addEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WebSocket, ev: WebSocketEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var WebSocket: {\n prototype: WebSocket;\n new(url: string, protocols?: string | string[]): WebSocket;\n readonly CLOSED: number;\n readonly CLOSING: number;\n readonly CONNECTING: number;\n readonly OPEN: number;\n};\n\ninterface WheelEvent extends MouseEvent {\n readonly deltaMode: number;\n readonly deltaX: number;\n readonly deltaY: number;\n readonly deltaZ: number;\n readonly wheelDelta: number;\n readonly wheelDeltaX: number;\n readonly wheelDeltaY: number;\n getCurrentPoint(element: Element): void;\n initWheelEvent(typeArg: string, canBubbleArg: boolean, cancelableArg: boolean, viewArg: Window, detailArg: number, screenXArg: number, screenYArg: number, clientXArg: number, clientYArg: number, buttonArg: number, relatedTargetArg: EventTarget, modifiersListArg: string, deltaXArg: number, deltaYArg: number, deltaZArg: number, deltaMode: number): void;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n}\n\ndeclare var WheelEvent: {\n prototype: WheelEvent;\n new(typeArg: string, eventInitDict?: WheelEventInit): WheelEvent;\n readonly DOM_DELTA_LINE: number;\n readonly DOM_DELTA_PAGE: number;\n readonly DOM_DELTA_PIXEL: number;\n};\n\ninterface WindowEventMap extends GlobalEventHandlersEventMap {\n \"abort\": UIEvent;\n \"beforeunload\": BeforeUnloadEvent;\n \"blur\": FocusEvent;\n \"canplay\": Event;\n \"canplaythrough\": Event;\n \"change\": Event;\n \"click\": MouseEvent;\n \"compassneedscalibration\": Event;\n \"contextmenu\": PointerEvent;\n \"dblclick\": MouseEvent;\n \"devicelight\": DeviceLightEvent;\n \"devicemotion\": DeviceMotionEvent;\n \"deviceorientation\": DeviceOrientationEvent;\n \"drag\": DragEvent;\n \"dragend\": DragEvent;\n \"dragenter\": DragEvent;\n \"dragleave\": DragEvent;\n \"dragover\": DragEvent;\n \"dragstart\": DragEvent;\n \"drop\": DragEvent;\n \"durationchange\": Event;\n \"emptied\": Event;\n \"ended\": Event;\n \"error\": ErrorEvent;\n \"focus\": FocusEvent;\n \"hashchange\": HashChangeEvent;\n \"input\": Event;\n \"invalid\": Event;\n \"keydown\": KeyboardEvent;\n \"keypress\": KeyboardEvent;\n \"keyup\": KeyboardEvent;\n \"load\": Event;\n \"loadeddata\": Event;\n \"loadedmetadata\": Event;\n \"loadstart\": Event;\n \"message\": MessageEvent;\n \"mousedown\": MouseEvent;\n \"mouseenter\": MouseEvent;\n \"mouseleave\": MouseEvent;\n \"mousemove\": MouseEvent;\n \"mouseout\": MouseEvent;\n \"mouseover\": MouseEvent;\n \"mouseup\": MouseEvent;\n \"mousewheel\": WheelEvent;\n \"MSGestureChange\": Event;\n \"MSGestureDoubleTap\": Event;\n \"MSGestureEnd\": Event;\n \"MSGestureHold\": Event;\n \"MSGestureStart\": Event;\n \"MSGestureTap\": Event;\n \"MSInertiaStart\": Event;\n \"MSPointerCancel\": Event;\n \"MSPointerDown\": Event;\n \"MSPointerEnter\": Event;\n \"MSPointerLeave\": Event;\n \"MSPointerMove\": Event;\n \"MSPointerOut\": Event;\n \"MSPointerOver\": Event;\n \"MSPointerUp\": Event;\n \"offline\": Event;\n \"online\": Event;\n \"orientationchange\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"pause\": Event;\n \"play\": Event;\n \"playing\": Event;\n \"popstate\": PopStateEvent;\n \"progress\": ProgressEvent;\n \"ratechange\": Event;\n \"readystatechange\": ProgressEvent;\n \"reset\": Event;\n \"resize\": UIEvent;\n \"scroll\": UIEvent;\n \"seeked\": Event;\n \"seeking\": Event;\n \"select\": UIEvent;\n \"stalled\": Event;\n \"storage\": StorageEvent;\n \"submit\": Event;\n \"suspend\": Event;\n \"timeupdate\": Event;\n \"touchcancel\": Event;\n \"touchend\": Event;\n \"touchmove\": Event;\n \"touchstart\": Event;\n \"unload\": Event;\n \"volumechange\": Event;\n \"vrdisplayactivate\": Event;\n \"vrdisplayblur\": Event;\n \"vrdisplayconnect\": Event;\n \"vrdisplaydeactivate\": Event;\n \"vrdisplaydisconnect\": Event;\n \"vrdisplayfocus\": Event;\n \"vrdisplaypointerrestricted\": Event;\n \"vrdisplaypointerunrestricted\": Event;\n \"vrdisplaypresentchange\": Event;\n \"waiting\": Event;\n}\n\ninterface Window extends EventTarget, WindowTimers, WindowSessionStorage, WindowLocalStorage, WindowConsole, GlobalEventHandlers, IDBEnvironment, WindowBase64, GlobalFetch {\n Blob: typeof Blob;\n URL: typeof URL;\n URLSearchParams: typeof URLSearchParams;\n readonly applicationCache: ApplicationCache;\n readonly caches: CacheStorage;\n readonly clientInformation: Navigator;\n readonly closed: boolean;\n readonly crypto: Crypto;\n customElements: CustomElementRegistry;\n defaultStatus: string;\n readonly devicePixelRatio: number;\n readonly doNotTrack: string;\n readonly document: Document;\n event: Event | undefined;\n readonly external: External;\n readonly frameElement: Element;\n readonly frames: Window;\n readonly history: History;\n readonly innerHeight: number;\n readonly innerWidth: number;\n readonly isSecureContext: boolean;\n readonly length: number;\n location: Location;\n readonly locationbar: BarProp;\n readonly menubar: BarProp;\n readonly msContentScript: ExtensionScriptApis;\n readonly msCredentials: MSCredentials;\n name: string;\n readonly navigator: Navigator;\n offscreenBuffering: string | boolean;\n onabort: ((this: Window, ev: UIEvent) => any) | null;\n onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;\n onblur: ((this: Window, ev: FocusEvent) => any) | null;\n oncanplay: ((this: Window, ev: Event) => any) | null;\n oncanplaythrough: ((this: Window, ev: Event) => any) | null;\n onchange: ((this: Window, ev: Event) => any) | null;\n onclick: ((this: Window, ev: MouseEvent) => any) | null;\n oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\n oncontextmenu: ((this: Window, ev: PointerEvent) => any) | null;\n ondblclick: ((this: Window, ev: MouseEvent) => any) | null;\n ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\n ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\n ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\n ondrag: ((this: Window, ev: DragEvent) => any) | null;\n ondragend: ((this: Window, ev: DragEvent) => any) | null;\n ondragenter: ((this: Window, ev: DragEvent) => any) | null;\n ondragleave: ((this: Window, ev: DragEvent) => any) | null;\n ondragover: ((this: Window, ev: DragEvent) => any) | null;\n ondragstart: ((this: Window, ev: DragEvent) => any) | null;\n ondrop: ((this: Window, ev: DragEvent) => any) | null;\n ondurationchange: ((this: Window, ev: Event) => any) | null;\n onemptied: ((this: Window, ev: Event) => any) | null;\n onended: ((this: Window, ev: Event) => any) | null;\n onerror: ErrorEventHandler;\n onfocus: ((this: Window, ev: FocusEvent) => any) | null;\n onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null;\n oninput: ((this: Window, ev: Event) => any) | null;\n oninvalid: ((this: Window, ev: Event) => any) | null;\n onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null;\n onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null;\n onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null;\n onload: ((this: Window, ev: Event) => any) | null;\n onloadeddata: ((this: Window, ev: Event) => any) | null;\n onloadedmetadata: ((this: Window, ev: Event) => any) | null;\n onloadstart: ((this: Window, ev: Event) => any) | null;\n onmessage: ((this: Window, ev: MessageEvent) => any) | null;\n onmousedown: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseenter: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseleave: ((this: Window, ev: MouseEvent) => any) | null;\n onmousemove: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseout: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseover: ((this: Window, ev: MouseEvent) => any) | null;\n onmouseup: ((this: Window, ev: MouseEvent) => any) | null;\n onmousewheel: ((this: Window, ev: WheelEvent) => any) | null;\n onmsgesturechange: ((this: Window, ev: Event) => any) | null;\n onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\n onmsgestureend: ((this: Window, ev: Event) => any) | null;\n onmsgesturehold: ((this: Window, ev: Event) => any) | null;\n onmsgesturestart: ((this: Window, ev: Event) => any) | null;\n onmsgesturetap: ((this: Window, ev: Event) => any) | null;\n onmsinertiastart: ((this: Window, ev: Event) => any) | null;\n onmspointercancel: ((this: Window, ev: Event) => any) | null;\n onmspointerdown: ((this: Window, ev: Event) => any) | null;\n onmspointerenter: ((this: Window, ev: Event) => any) | null;\n onmspointerleave: ((this: Window, ev: Event) => any) | null;\n onmspointermove: ((this: Window, ev: Event) => any) | null;\n onmspointerout: ((this: Window, ev: Event) => any) | null;\n onmspointerover: ((this: Window, ev: Event) => any) | null;\n onmspointerup: ((this: Window, ev: Event) => any) | null;\n onoffline: ((this: Window, ev: Event) => any) | null;\n ononline: ((this: Window, ev: Event) => any) | null;\n onorientationchange: ((this: Window, ev: Event) => any) | null;\n onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null;\n onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null;\n onpause: ((this: Window, ev: Event) => any) | null;\n onplay: ((this: Window, ev: Event) => any) | null;\n onplaying: ((this: Window, ev: Event) => any) | null;\n onpopstate: ((this: Window, ev: PopStateEvent) => any) | null;\n onprogress: ((this: Window, ev: ProgressEvent) => any) | null;\n onratechange: ((this: Window, ev: Event) => any) | null;\n onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null;\n onreset: ((this: Window, ev: Event) => any) | null;\n onresize: ((this: Window, ev: UIEvent) => any) | null;\n onscroll: ((this: Window, ev: UIEvent) => any) | null;\n onseeked: ((this: Window, ev: Event) => any) | null;\n onseeking: ((this: Window, ev: Event) => any) | null;\n onselect: ((this: Window, ev: UIEvent) => any) | null;\n onstalled: ((this: Window, ev: Event) => any) | null;\n onstorage: ((this: Window, ev: StorageEvent) => any) | null;\n onsubmit: ((this: Window, ev: Event) => any) | null;\n onsuspend: ((this: Window, ev: Event) => any) | null;\n ontimeupdate: ((this: Window, ev: Event) => any) | null;\n ontouchcancel: (ev: TouchEvent) => any;\n ontouchend: (ev: TouchEvent) => any;\n ontouchmove: (ev: TouchEvent) => any;\n ontouchstart: (ev: TouchEvent) => any;\n onunload: ((this: Window, ev: Event) => any) | null;\n onvolumechange: ((this: Window, ev: Event) => any) | null;\n onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\n onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\n onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\n onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\n onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\n onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\n onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\n onwaiting: ((this: Window, ev: Event) => any) | null;\n readonly opener: any;\n readonly orientation: string | number;\n readonly outerHeight: number;\n readonly outerWidth: number;\n readonly pageXOffset: number;\n readonly pageYOffset: number;\n readonly parent: Window;\n readonly performance: Performance;\n readonly personalbar: BarProp;\n readonly screen: Screen;\n readonly screenLeft: number;\n readonly screenTop: number;\n readonly screenX: number;\n readonly screenY: number;\n readonly scrollX: number;\n readonly scrollY: number;\n readonly scrollbars: BarProp;\n readonly self: Window;\n readonly speechSynthesis: SpeechSynthesis;\n status: string;\n readonly statusbar: BarProp;\n readonly styleMedia: StyleMedia;\n readonly toolbar: BarProp;\n readonly top: Window;\n readonly window: Window;\n alert(message?: any): void;\n blur(): void;\n cancelAnimationFrame(handle: number): void;\n captureEvents(): void;\n close(): void;\n confirm(message?: string): boolean;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\n createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\n departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\n focus(): void;\n getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\n getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\n getSelection(): Selection;\n matchMedia(mediaQuery: string): MediaQueryList;\n moveBy(x?: number, y?: number): void;\n moveTo(x?: number, y?: number): void;\n msWriteProfilerMark(profilerMarkName: string): void;\n open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\n postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\n prompt(message?: string, _default?: string): string | null;\n releaseEvents(): void;\n requestAnimationFrame(callback: FrameRequestCallback): number;\n resizeBy(x?: number, y?: number): void;\n resizeTo(x?: number, y?: number): void;\n scroll(options?: ScrollToOptions): void;\n scroll(x?: number, y?: number): void;\n scrollBy(options?: ScrollToOptions): void;\n scrollBy(x?: number, y?: number): void;\n scrollTo(options?: ScrollToOptions): void;\n scrollTo(x?: number, y?: number): void;\n stop(): void;\n webkitCancelAnimationFrame(handle: number): void;\n webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\n webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\n addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Window: {\n prototype: Window;\n new(): Window;\n};\n\ninterface WindowBase64 {\n atob(encodedString: string): string;\n btoa(rawString: string): string;\n}\n\ninterface WindowConsole {\n readonly console: Console;\n}\n\ninterface WindowEventHandlersEventMap {\n \"afterprint\": Event;\n \"beforeprint\": Event;\n \"beforeunload\": BeforeUnloadEvent;\n \"hashchange\": HashChangeEvent;\n \"message\": MessageEvent;\n \"offline\": Event;\n \"online\": Event;\n \"pagehide\": PageTransitionEvent;\n \"pageshow\": PageTransitionEvent;\n \"popstate\": PopStateEvent;\n \"storage\": StorageEvent;\n \"unload\": Event;\n}\n\ninterface WindowEventHandlers {\n onafterprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onbeforeprint: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onbeforeunload: ((this: WindowEventHandlers, ev: BeforeUnloadEvent) => any) | null;\n onhashchange: ((this: WindowEventHandlers, ev: HashChangeEvent) => any) | null;\n onmessage: ((this: WindowEventHandlers, ev: MessageEvent) => any) | null;\n onoffline: ((this: WindowEventHandlers, ev: Event) => any) | null;\n ononline: ((this: WindowEventHandlers, ev: Event) => any) | null;\n onpagehide: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\n onpageshow: ((this: WindowEventHandlers, ev: PageTransitionEvent) => any) | null;\n onpopstate: ((this: WindowEventHandlers, ev: PopStateEvent) => any) | null;\n onstorage: ((this: WindowEventHandlers, ev: StorageEvent) => any) | null;\n onunload: ((this: WindowEventHandlers, ev: Event) => any) | null;\n addEventListener(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: WindowEventHandlers, ev: WindowEventHandlersEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface WindowLocalStorage {\n readonly localStorage: Storage;\n}\n\ninterface WindowSessionStorage {\n readonly sessionStorage: Storage;\n}\n\ninterface WindowTimers extends WindowTimersExtension {\n clearInterval(handle?: number): void;\n clearTimeout(handle?: number): void;\n setInterval(handler: (...args: any[]) => void, timeout: number): number;\n setInterval(handler: any, timeout?: any, ...args: any[]): number;\n setTimeout(handler: (...args: any[]) => void, timeout: number): number;\n setTimeout(handler: any, timeout?: any, ...args: any[]): number;\n}\n\ninterface WindowTimersExtension {\n clearImmediate(handle: number): void;\n setImmediate(handler: (...args: any[]) => void): number;\n setImmediate(handler: any, ...args: any[]): number;\n}\n\ninterface WorkerEventMap extends AbstractWorkerEventMap {\n \"message\": MessageEvent;\n}\n\ninterface Worker extends EventTarget, AbstractWorker {\n onmessage: ((this: Worker, ev: MessageEvent) => any) | null;\n /** @deprecated */\n postMessage(message: any, transfer?: any[]): void;\n terminate(): void;\n addEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: Worker, ev: WorkerEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var Worker: {\n prototype: Worker;\n new(stringUrl: string): Worker;\n};\n\ninterface WritableStream {\n readonly locked: boolean;\n abort(reason?: any): Promise;\n getWriter(): WritableStreamDefaultWriter;\n}\n\ndeclare var WritableStream: {\n prototype: WritableStream;\n new(underlyingSink?: UnderlyingSink, strategy?: QueuingStrategy): WritableStream;\n};\n\ninterface WritableStreamDefaultController {\n error(error?: any): void;\n}\n\ndeclare var WritableStreamDefaultController: {\n prototype: WritableStreamDefaultController;\n new(): WritableStreamDefaultController;\n};\n\ninterface WritableStreamDefaultWriter {\n readonly closed: Promise;\n readonly desiredSize: number;\n readonly ready: Promise;\n abort(reason?: any): Promise;\n close(): Promise;\n releaseLock(): void;\n write(chunk?: any): Promise;\n}\n\ndeclare var WritableStreamDefaultWriter: {\n prototype: WritableStreamDefaultWriter;\n new(): WritableStreamDefaultWriter;\n};\n\ninterface XMLDocument extends Document {\n addEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLDocument, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLDocument: {\n prototype: XMLDocument;\n new(): XMLDocument;\n};\n\ninterface XMLHttpRequestEventMap extends XMLHttpRequestEventTargetEventMap {\n \"readystatechange\": Event;\n}\n\ninterface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {\n msCaching: string;\n onreadystatechange: ((this: XMLHttpRequest, ev: Event) => any) | null;\n readonly readyState: number;\n readonly response: any;\n readonly responseText: string;\n responseType: XMLHttpRequestResponseType;\n readonly responseURL: string;\n readonly responseXML: Document | null;\n readonly status: number;\n readonly statusText: string;\n timeout: number;\n readonly upload: XMLHttpRequestUpload;\n withCredentials: boolean;\n abort(): void;\n getAllResponseHeaders(): string;\n getResponseHeader(header: string): string | null;\n msCachingEnabled(): boolean;\n open(method: string, url: string, async?: boolean, user?: string | null, password?: string | null): void;\n overrideMimeType(mime: string): void;\n send(data?: any): void;\n setRequestHeader(header: string, value: string): void;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n addEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequest, ev: XMLHttpRequestEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequest: {\n prototype: XMLHttpRequest;\n new(): XMLHttpRequest;\n readonly DONE: number;\n readonly HEADERS_RECEIVED: number;\n readonly LOADING: number;\n readonly OPENED: number;\n readonly UNSENT: number;\n};\n\ninterface XMLHttpRequestEventTargetEventMap {\n \"abort\": Event;\n \"error\": ErrorEvent;\n \"load\": Event;\n \"loadend\": ProgressEvent;\n \"loadstart\": Event;\n \"progress\": ProgressEvent;\n \"timeout\": ProgressEvent;\n}\n\ninterface XMLHttpRequestEventTarget {\n onabort: ((this: XMLHttpRequest, ev: Event) => any) | null;\n onerror: ((this: XMLHttpRequest, ev: ErrorEvent) => any) | null;\n onload: ((this: XMLHttpRequest, ev: Event) => any) | null;\n onloadend: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n onloadstart: ((this: XMLHttpRequest, ev: Event) => any) | null;\n onprogress: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n ontimeout: ((this: XMLHttpRequest, ev: ProgressEvent) => any) | null;\n addEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestEventTarget, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ninterface XMLHttpRequestUpload extends EventTarget, XMLHttpRequestEventTarget {\n addEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: XMLHttpRequestUpload, ev: XMLHttpRequestEventTargetEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var XMLHttpRequestUpload: {\n prototype: XMLHttpRequestUpload;\n new(): XMLHttpRequestUpload;\n};\n\ninterface XMLSerializer {\n serializeToString(target: Node): string;\n}\n\ndeclare var XMLSerializer: {\n prototype: XMLSerializer;\n new(): XMLSerializer;\n};\n\ninterface XPathEvaluator {\n createExpression(expression: string, resolver: XPathNSResolver): XPathExpression;\n createNSResolver(nodeResolver?: Node): XPathNSResolver;\n evaluate(expression: string, contextNode: Node, resolver: XPathNSResolver | null, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathEvaluator: {\n prototype: XPathEvaluator;\n new(): XPathEvaluator;\n};\n\ninterface XPathExpression {\n evaluate(contextNode: Node, type: number, result: XPathResult | null): XPathResult;\n}\n\ndeclare var XPathExpression: {\n prototype: XPathExpression;\n new(): XPathExpression;\n};\n\ninterface XPathNSResolver {\n lookupNamespaceURI(prefix: string): string;\n}\n\ndeclare var XPathNSResolver: {\n prototype: XPathNSResolver;\n new(): XPathNSResolver;\n};\n\ninterface XPathResult {\n readonly booleanValue: boolean;\n readonly invalidIteratorState: boolean;\n readonly numberValue: number;\n readonly resultType: number;\n readonly singleNodeValue: Node;\n readonly snapshotLength: number;\n readonly stringValue: string;\n iterateNext(): Node;\n snapshotItem(index: number): Node;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n}\n\ndeclare var XPathResult: {\n prototype: XPathResult;\n new(): XPathResult;\n readonly ANY_TYPE: number;\n readonly ANY_UNORDERED_NODE_TYPE: number;\n readonly BOOLEAN_TYPE: number;\n readonly FIRST_ORDERED_NODE_TYPE: number;\n readonly NUMBER_TYPE: number;\n readonly ORDERED_NODE_ITERATOR_TYPE: number;\n readonly ORDERED_NODE_SNAPSHOT_TYPE: number;\n readonly STRING_TYPE: number;\n readonly UNORDERED_NODE_ITERATOR_TYPE: number;\n readonly UNORDERED_NODE_SNAPSHOT_TYPE: number;\n};\n\ninterface XSLTProcessor {\n clearParameters(): void;\n getParameter(namespaceURI: string, localName: string): any;\n importStylesheet(style: Node): void;\n removeParameter(namespaceURI: string, localName: string): void;\n reset(): void;\n setParameter(namespaceURI: string, localName: string, value: any): void;\n transformToDocument(source: Node): Document;\n transformToFragment(source: Node, document: Document): DocumentFragment;\n}\n\ndeclare var XSLTProcessor: {\n prototype: XSLTProcessor;\n new(): XSLTProcessor;\n};\n\ninterface webkitRTCPeerConnection extends RTCPeerConnection {\n addEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\n addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\n removeEventListener(type: K, listener: (this: webkitRTCPeerConnection, ev: RTCPeerConnectionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\n removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\n}\n\ndeclare var webkitRTCPeerConnection: {\n prototype: webkitRTCPeerConnection;\n new(configuration: RTCConfiguration): webkitRTCPeerConnection;\n};\n\ndeclare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;\n\ninterface DecodeErrorCallback {\n (error: DOMException): void;\n}\n\ninterface DecodeSuccessCallback {\n (decodedData: AudioBuffer): void;\n}\n\ninterface ErrorEventHandler {\n (event: Event | string, source?: string, fileno?: number, columnNumber?: number, error?: Error): void;\n}\n\ninterface EventHandlerNonNull {\n (event: Event): any;\n}\n\ninterface ForEachCallback {\n (keyId: Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer | null, status: MediaKeyStatus): void;\n}\n\ninterface FrameRequestCallback {\n (time: number): void;\n}\n\ninterface FunctionStringCallback {\n (data: string): void;\n}\n\ninterface IntersectionObserverCallback {\n (entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;\n}\n\ninterface MSLaunchUriCallback {\n (): void;\n}\n\ninterface MediaQueryListListener {\n (mql: MediaQueryList): void;\n}\n\ninterface MutationCallback {\n (mutations: MutationRecord[], observer: MutationObserver): void;\n}\n\ninterface NavigatorUserMediaErrorCallback {\n (error: MediaStreamError): void;\n}\n\ninterface NavigatorUserMediaSuccessCallback {\n (stream: MediaStream): void;\n}\n\ninterface NotificationPermissionCallback {\n (permission: NotificationPermission): void;\n}\n\ninterface PositionCallback {\n (position: Position): void;\n}\n\ninterface PositionErrorCallback {\n (error: PositionError): void;\n}\n\ninterface RTCPeerConnectionErrorCallback {\n (error: DOMError): void;\n}\n\ninterface RTCSessionDescriptionCallback {\n (sdp: RTCSessionDescription): void;\n}\n\ninterface RTCStatsCallback {\n (report: RTCStatsReport): void;\n}\n\ninterface VoidFunction {\n (): void;\n}\n\ninterface WritableStreamChunkCallback {\n (chunk: any, controller: WritableStreamDefaultController): void;\n}\n\ninterface WritableStreamDefaultControllerCallback {\n (controller: WritableStreamDefaultController): void;\n}\n\ninterface WritableStreamErrorCallback {\n (reason: string): void;\n}\n\ninterface HTMLElementTagNameMap {\n \"a\": HTMLAnchorElement;\n \"abbr\": HTMLElement;\n \"acronym\": HTMLElement;\n \"address\": HTMLElement;\n \"applet\": HTMLAppletElement;\n \"area\": HTMLAreaElement;\n \"article\": HTMLElement;\n \"aside\": HTMLElement;\n \"audio\": HTMLAudioElement;\n \"b\": HTMLElement;\n \"base\": HTMLBaseElement;\n \"basefont\": HTMLBaseFontElement;\n \"bdo\": HTMLElement;\n \"big\": HTMLElement;\n \"blockquote\": HTMLQuoteElement;\n \"body\": HTMLBodyElement;\n \"br\": HTMLBRElement;\n \"button\": HTMLButtonElement;\n \"canvas\": HTMLCanvasElement;\n \"caption\": HTMLTableCaptionElement;\n \"center\": HTMLElement;\n \"cite\": HTMLElement;\n \"code\": HTMLElement;\n \"col\": HTMLTableColElement;\n \"colgroup\": HTMLTableColElement;\n \"data\": HTMLDataElement;\n \"datalist\": HTMLDataListElement;\n \"dd\": HTMLElement;\n \"del\": HTMLModElement;\n \"dfn\": HTMLElement;\n \"dir\": HTMLDirectoryElement;\n \"div\": HTMLDivElement;\n \"dl\": HTMLDListElement;\n \"dt\": HTMLElement;\n \"em\": HTMLElement;\n \"embed\": HTMLEmbedElement;\n \"fieldset\": HTMLFieldSetElement;\n \"figcaption\": HTMLElement;\n \"figure\": HTMLElement;\n \"font\": HTMLFontElement;\n \"footer\": HTMLElement;\n \"form\": HTMLFormElement;\n \"frame\": HTMLFrameElement;\n \"frameset\": HTMLFrameSetElement;\n \"h1\": HTMLHeadingElement;\n \"h2\": HTMLHeadingElement;\n \"h3\": HTMLHeadingElement;\n \"h4\": HTMLHeadingElement;\n \"h5\": HTMLHeadingElement;\n \"h6\": HTMLHeadingElement;\n \"head\": HTMLHeadElement;\n \"header\": HTMLElement;\n \"hgroup\": HTMLElement;\n \"hr\": HTMLHRElement;\n \"html\": HTMLHtmlElement;\n \"i\": HTMLElement;\n \"iframe\": HTMLIFrameElement;\n \"img\": HTMLImageElement;\n \"input\": HTMLInputElement;\n \"ins\": HTMLModElement;\n \"isindex\": HTMLUnknownElement;\n \"kbd\": HTMLElement;\n \"keygen\": HTMLElement;\n \"label\": HTMLLabelElement;\n \"legend\": HTMLLegendElement;\n \"li\": HTMLLIElement;\n \"link\": HTMLLinkElement;\n \"listing\": HTMLPreElement;\n \"map\": HTMLMapElement;\n \"mark\": HTMLElement;\n \"marquee\": HTMLMarqueeElement;\n \"menu\": HTMLMenuElement;\n \"meta\": HTMLMetaElement;\n \"meter\": HTMLMeterElement;\n \"nav\": HTMLElement;\n \"nextid\": HTMLUnknownElement;\n \"nobr\": HTMLElement;\n \"noframes\": HTMLElement;\n \"noscript\": HTMLElement;\n \"object\": HTMLObjectElement;\n \"ol\": HTMLOListElement;\n \"optgroup\": HTMLOptGroupElement;\n \"option\": HTMLOptionElement;\n \"output\": HTMLOutputElement;\n \"p\": HTMLParagraphElement;\n \"param\": HTMLParamElement;\n \"picture\": HTMLPictureElement;\n \"plaintext\": HTMLElement;\n \"pre\": HTMLPreElement;\n \"progress\": HTMLProgressElement;\n \"q\": HTMLQuoteElement;\n \"rt\": HTMLElement;\n \"ruby\": HTMLElement;\n \"s\": HTMLElement;\n \"samp\": HTMLElement;\n \"script\": HTMLScriptElement;\n \"section\": HTMLElement;\n \"select\": HTMLSelectElement;\n \"slot\": HTMLSlotElement;\n \"small\": HTMLElement;\n \"source\": HTMLSourceElement;\n \"span\": HTMLSpanElement;\n \"strike\": HTMLElement;\n \"strong\": HTMLElement;\n \"style\": HTMLStyleElement;\n \"sub\": HTMLElement;\n \"sup\": HTMLElement;\n \"table\": HTMLTableElement;\n \"tbody\": HTMLTableSectionElement;\n \"td\": HTMLTableDataCellElement;\n \"template\": HTMLTemplateElement;\n \"textarea\": HTMLTextAreaElement;\n \"tfoot\": HTMLTableSectionElement;\n \"th\": HTMLTableHeaderCellElement;\n \"thead\": HTMLTableSectionElement;\n \"time\": HTMLTimeElement;\n \"title\": HTMLTitleElement;\n \"tr\": HTMLTableRowElement;\n \"track\": HTMLTrackElement;\n \"tt\": HTMLElement;\n \"u\": HTMLElement;\n \"ul\": HTMLUListElement;\n \"var\": HTMLElement;\n \"video\": HTMLVideoElement;\n \"wbr\": HTMLElement;\n \"xmp\": HTMLPreElement;\n}\n\ninterface SVGElementTagNameMap {\n \"circle\": SVGCircleElement;\n \"clippath\": SVGClipPathElement;\n \"defs\": SVGDefsElement;\n \"desc\": SVGDescElement;\n \"ellipse\": SVGEllipseElement;\n \"feblend\": SVGFEBlendElement;\n \"fecolormatrix\": SVGFEColorMatrixElement;\n \"fecomponenttransfer\": SVGFEComponentTransferElement;\n \"fecomposite\": SVGFECompositeElement;\n \"feconvolvematrix\": SVGFEConvolveMatrixElement;\n \"fediffuselighting\": SVGFEDiffuseLightingElement;\n \"fedisplacementmap\": SVGFEDisplacementMapElement;\n \"fedistantlight\": SVGFEDistantLightElement;\n \"feflood\": SVGFEFloodElement;\n \"fefunca\": SVGFEFuncAElement;\n \"fefuncb\": SVGFEFuncBElement;\n \"fefuncg\": SVGFEFuncGElement;\n \"fefuncr\": SVGFEFuncRElement;\n \"fegaussianblur\": SVGFEGaussianBlurElement;\n \"feimage\": SVGFEImageElement;\n \"femerge\": SVGFEMergeElement;\n \"femergenode\": SVGFEMergeNodeElement;\n \"femorphology\": SVGFEMorphologyElement;\n \"feoffset\": SVGFEOffsetElement;\n \"fepointlight\": SVGFEPointLightElement;\n \"fespecularlighting\": SVGFESpecularLightingElement;\n \"fespotlight\": SVGFESpotLightElement;\n \"fetile\": SVGFETileElement;\n \"feturbulence\": SVGFETurbulenceElement;\n \"filter\": SVGFilterElement;\n \"foreignobject\": SVGForeignObjectElement;\n \"g\": SVGGElement;\n \"image\": SVGImageElement;\n \"line\": SVGLineElement;\n \"lineargradient\": SVGLinearGradientElement;\n \"marker\": SVGMarkerElement;\n \"mask\": SVGMaskElement;\n \"metadata\": SVGMetadataElement;\n \"path\": SVGPathElement;\n \"pattern\": SVGPatternElement;\n \"polygon\": SVGPolygonElement;\n \"polyline\": SVGPolylineElement;\n \"radialgradient\": SVGRadialGradientElement;\n \"rect\": SVGRectElement;\n \"stop\": SVGStopElement;\n \"svg\": SVGSVGElement;\n \"switch\": SVGSwitchElement;\n \"symbol\": SVGSymbolElement;\n \"text\": SVGTextElement;\n \"textpath\": SVGTextPathElement;\n \"tspan\": SVGTSpanElement;\n \"use\": SVGUseElement;\n \"view\": SVGViewElement;\n}\n\n/** @deprecated Directly use HTMLElementTagNameMap or SVGElementTagNameMap as appropriate, instead. */\ninterface ElementTagNameMap extends HTMLElementTagNameMap, SVGElementTagNameMap { }\n\ndeclare var Audio: {\n new(src?: string): HTMLAudioElement;\n};\ndeclare var Image: {\n new(width?: number, height?: number): HTMLImageElement;\n};\ndeclare var Option: {\n new(text?: string, value?: string, defaultSelected?: boolean, selected?: boolean): HTMLOptionElement;\n};\ndeclare var Blob: typeof Blob;\ndeclare var URL: typeof URL;\ndeclare var URLSearchParams: typeof URLSearchParams;\ndeclare var applicationCache: ApplicationCache;\ndeclare var caches: CacheStorage;\ndeclare var clientInformation: Navigator;\ndeclare var closed: boolean;\ndeclare var crypto: Crypto;\ndeclare var customElements: CustomElementRegistry;\ndeclare var defaultStatus: string;\ndeclare var devicePixelRatio: number;\ndeclare var doNotTrack: string;\ndeclare var document: Document;\ndeclare var event: Event | undefined;\ndeclare var external: External;\ndeclare var frameElement: Element;\ndeclare var frames: Window;\ndeclare var history: History;\ndeclare var innerHeight: number;\ndeclare var innerWidth: number;\ndeclare var isSecureContext: boolean;\ndeclare var length: number;\ndeclare var location: Location;\ndeclare var locationbar: BarProp;\ndeclare var menubar: BarProp;\ndeclare var msContentScript: ExtensionScriptApis;\ndeclare var msCredentials: MSCredentials;\ndeclare const name: never;\ndeclare var navigator: Navigator;\ndeclare var offscreenBuffering: string | boolean;\ndeclare var onabort: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onbeforeunload: ((this: Window, ev: BeforeUnloadEvent) => any) | null;\ndeclare var onblur: ((this: Window, ev: FocusEvent) => any) | null;\ndeclare var oncanplay: ((this: Window, ev: Event) => any) | null;\ndeclare var oncanplaythrough: ((this: Window, ev: Event) => any) | null;\ndeclare var onchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onclick: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var oncompassneedscalibration: ((this: Window, ev: Event) => any) | null;\ndeclare var oncontextmenu: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var ondblclick: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var ondevicelight: ((this: Window, ev: DeviceLightEvent) => any) | null;\ndeclare var ondevicemotion: ((this: Window, ev: DeviceMotionEvent) => any) | null;\ndeclare var ondeviceorientation: ((this: Window, ev: DeviceOrientationEvent) => any) | null;\ndeclare var ondrag: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragend: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragenter: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragleave: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragover: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondragstart: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondrop: ((this: Window, ev: DragEvent) => any) | null;\ndeclare var ondurationchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onemptied: ((this: Window, ev: Event) => any) | null;\ndeclare var onended: ((this: Window, ev: Event) => any) | null;\ndeclare var onerror: ErrorEventHandler;\ndeclare var onfocus: ((this: Window, ev: FocusEvent) => any) | null;\ndeclare var onhashchange: ((this: Window, ev: HashChangeEvent) => any) | null;\ndeclare var oninput: ((this: Window, ev: Event) => any) | null;\ndeclare var oninvalid: ((this: Window, ev: Event) => any) | null;\ndeclare var onkeydown: ((this: Window, ev: KeyboardEvent) => any) | null;\ndeclare var onkeypress: ((this: Window, ev: KeyboardEvent) => any) | null;\ndeclare var onkeyup: ((this: Window, ev: KeyboardEvent) => any) | null;\ndeclare var onload: ((this: Window, ev: Event) => any) | null;\ndeclare var onloadeddata: ((this: Window, ev: Event) => any) | null;\ndeclare var onloadedmetadata: ((this: Window, ev: Event) => any) | null;\ndeclare var onloadstart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmessage: ((this: Window, ev: MessageEvent) => any) | null;\ndeclare var onmousedown: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseenter: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseleave: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmousemove: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseout: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseover: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmouseup: ((this: Window, ev: MouseEvent) => any) | null;\ndeclare var onmousewheel: ((this: Window, ev: WheelEvent) => any) | null;\ndeclare var onmsgesturechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturedoubletap: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgestureend: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturehold: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturestart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsgesturetap: ((this: Window, ev: Event) => any) | null;\ndeclare var onmsinertiastart: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointercancel: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerdown: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerenter: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerleave: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointermove: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerout: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerover: ((this: Window, ev: Event) => any) | null;\ndeclare var onmspointerup: ((this: Window, ev: Event) => any) | null;\ndeclare var onoffline: ((this: Window, ev: Event) => any) | null;\ndeclare var ononline: ((this: Window, ev: Event) => any) | null;\ndeclare var onorientationchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onpagehide: ((this: Window, ev: PageTransitionEvent) => any) | null;\ndeclare var onpageshow: ((this: Window, ev: PageTransitionEvent) => any) | null;\ndeclare var onpause: ((this: Window, ev: Event) => any) | null;\ndeclare var onplay: ((this: Window, ev: Event) => any) | null;\ndeclare var onplaying: ((this: Window, ev: Event) => any) | null;\ndeclare var onpopstate: ((this: Window, ev: PopStateEvent) => any) | null;\ndeclare var onprogress: ((this: Window, ev: ProgressEvent) => any) | null;\ndeclare var onratechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onreadystatechange: ((this: Window, ev: ProgressEvent) => any) | null;\ndeclare var onreset: ((this: Window, ev: Event) => any) | null;\ndeclare var onresize: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onscroll: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onseeked: ((this: Window, ev: Event) => any) | null;\ndeclare var onseeking: ((this: Window, ev: Event) => any) | null;\ndeclare var onselect: ((this: Window, ev: UIEvent) => any) | null;\ndeclare var onstalled: ((this: Window, ev: Event) => any) | null;\ndeclare var onstorage: ((this: Window, ev: StorageEvent) => any) | null;\ndeclare var onsubmit: ((this: Window, ev: Event) => any) | null;\ndeclare var onsuspend: ((this: Window, ev: Event) => any) | null;\ndeclare var ontimeupdate: ((this: Window, ev: Event) => any) | null;\ndeclare var ontouchcancel: (ev: TouchEvent) => any;\ndeclare var ontouchend: (ev: TouchEvent) => any;\ndeclare var ontouchmove: (ev: TouchEvent) => any;\ndeclare var ontouchstart: (ev: TouchEvent) => any;\ndeclare var onunload: ((this: Window, ev: Event) => any) | null;\ndeclare var onvolumechange: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayactivate: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayblur: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayconnect: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaydeactivate: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaydisconnect: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplayfocus: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypointerrestricted: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypointerunrestricted: ((this: Window, ev: Event) => any) | null;\ndeclare var onvrdisplaypresentchange: ((this: Window, ev: Event) => any) | null;\ndeclare var onwaiting: ((this: Window, ev: Event) => any) | null;\ndeclare var opener: any;\ndeclare var orientation: string | number;\ndeclare var outerHeight: number;\ndeclare var outerWidth: number;\ndeclare var pageXOffset: number;\ndeclare var pageYOffset: number;\ndeclare var parent: Window;\ndeclare var performance: Performance;\ndeclare var personalbar: BarProp;\ndeclare var screen: Screen;\ndeclare var screenLeft: number;\ndeclare var screenTop: number;\ndeclare var screenX: number;\ndeclare var screenY: number;\ndeclare var scrollX: number;\ndeclare var scrollY: number;\ndeclare var scrollbars: BarProp;\ndeclare var self: Window;\ndeclare var speechSynthesis: SpeechSynthesis;\ndeclare var status: string;\ndeclare var statusbar: BarProp;\ndeclare var styleMedia: StyleMedia;\ndeclare var toolbar: BarProp;\ndeclare var top: Window;\ndeclare var window: Window;\ndeclare function alert(message?: any): void;\ndeclare function blur(): void;\ndeclare function cancelAnimationFrame(handle: number): void;\ndeclare function captureEvents(): void;\ndeclare function close(): void;\ndeclare function confirm(message?: string): boolean;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise;\ndeclare function createImageBitmap(image: HTMLImageElement | SVGImageElement | HTMLVideoElement | HTMLCanvasElement | ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise;\ndeclare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;\ndeclare function focus(): void;\ndeclare function getComputedStyle(elt: Element, pseudoElt?: string | null): CSSStyleDeclaration;\ndeclare function getMatchedCSSRules(elt: Element, pseudoElt?: string | null): CSSRuleList;\ndeclare function getSelection(): Selection;\ndeclare function matchMedia(mediaQuery: string): MediaQueryList;\ndeclare function moveBy(x?: number, y?: number): void;\ndeclare function moveTo(x?: number, y?: number): void;\ndeclare function msWriteProfilerMark(profilerMarkName: string): void;\ndeclare function open(url?: string, target?: string, features?: string, replace?: boolean): Window | null;\ndeclare function postMessage(message: any, targetOrigin: string, transfer?: any[]): void;\ndeclare function prompt(message?: string, _default?: string): string | null;\ndeclare function releaseEvents(): void;\ndeclare function requestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function resizeBy(x?: number, y?: number): void;\ndeclare function resizeTo(x?: number, y?: number): void;\ndeclare function scroll(options?: ScrollToOptions): void;\ndeclare function scroll(x?: number, y?: number): void;\ndeclare function scrollBy(options?: ScrollToOptions): void;\ndeclare function scrollBy(x?: number, y?: number): void;\ndeclare function scrollTo(options?: ScrollToOptions): void;\ndeclare function scrollTo(x?: number, y?: number): void;\ndeclare function stop(): void;\ndeclare function webkitCancelAnimationFrame(handle: number): void;\ndeclare function webkitConvertPointFromNodeToPage(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitConvertPointFromPageToNode(node: Node, pt: WebKitPoint): WebKitPoint;\ndeclare function webkitRequestAnimationFrame(callback: FrameRequestCallback): number;\ndeclare function toString(): string;\ndeclare function dispatchEvent(evt: Event): boolean;\ndeclare function clearInterval(handle?: number): void;\ndeclare function clearTimeout(handle?: number): void;\ndeclare function setInterval(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setInterval(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function setTimeout(handler: (...args: any[]) => void, timeout: number): number;\ndeclare function setTimeout(handler: any, timeout?: any, ...args: any[]): number;\ndeclare function clearImmediate(handle: number): void;\ndeclare function setImmediate(handler: (...args: any[]) => void): number;\ndeclare function setImmediate(handler: any, ...args: any[]): number;\ndeclare var sessionStorage: Storage;\ndeclare var localStorage: Storage;\ndeclare var console: Console;\ndeclare var onpointercancel: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerdown: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerenter: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerleave: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointermove: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerout: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerover: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onpointerup: ((this: Window, ev: PointerEvent) => any) | null;\ndeclare var onwheel: ((this: Window, ev: WheelEvent) => any) | null;\ndeclare var indexedDB: IDBFactory;\ndeclare function atob(encodedString: string): string;\ndeclare function btoa(rawString: string): string;\ndeclare function fetch(input?: Request | string, init?: RequestInit): Promise;\ndeclare function addEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;\ndeclare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;\ndeclare function removeEventListener(type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | EventListenerOptions): void;\ndeclare function removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;\ntype ScrollBehavior = \"auto\" | \"instant\" | \"smooth\";\ntype ScrollLogicalPosition = \"start\" | \"center\" | \"end\" | \"nearest\";\ntype MouseWheelEvent = WheelEvent;\ntype ScrollRestoration = \"auto\" | \"manual\";\ntype FormDataEntryValue = string | File;\ntype InsertPosition = \"beforebegin\" | \"afterbegin\" | \"beforeend\" | \"afterend\";\ntype HeadersInit = Headers | string[][] | { [key: string]: string };\ntype OrientationLockType = \"any\" | \"natural\" | \"portrait\" | \"landscape\" | \"portrait-primary\" | \"portrait-secondary\" | \"landscape-primary\"| \"landscape-secondary\";\ntype IDBValidKey = number | string | Date | IDBArrayKey;\ntype AlgorithmIdentifier = string | Algorithm;\ntype MutationRecordType = \"attributes\" | \"characterData\" | \"childList\";\ntype AAGUID = string;\ntype BodyInit = any;\ntype ByteString = string;\ntype ConstrainBoolean = boolean | ConstrainBooleanParameters;\ntype ConstrainDOMString = string | string[] | ConstrainDOMStringParameters;\ntype ConstrainDouble = number | ConstrainDoubleRange;\ntype ConstrainLong = number | ConstrainLongRange;\ntype CryptoOperationData = ArrayBufferView;\ntype GLbitfield = number;\ntype GLboolean = boolean;\ntype GLbyte = number;\ntype GLclampf = number;\ntype GLenum = number;\ntype GLfloat = number;\ntype GLint = number;\ntype GLintptr = number;\ntype GLshort = number;\ntype GLsizei = number;\ntype GLsizeiptr = number;\ntype GLubyte = number;\ntype GLuint = number;\ntype GLushort = number;\ntype IDBKeyPath = string;\ntype MSInboundPayload = MSVideoRecvPayload | MSAudioRecvPayload;\ntype MSLocalClientEvent = MSLocalClientEventBase | MSAudioLocalClientEvent;\ntype MSOutboundPayload = MSVideoSendPayload | MSAudioSendPayload;\ntype RTCIceGatherCandidate = RTCIceCandidateDictionary | RTCIceCandidateComplete;\ntype RTCTransport = RTCDtlsTransport | RTCSrtpSdesTransport;\ntype RequestInfo = Request | string;\ntype USVString = string;\ntype payloadtype = number;\ntype BufferSource = ArrayBuffer | ArrayBufferView;\ntype ClientTypes = \"window\" | \"worker\" | \"sharedworker\" | \"all\";\ntype AppendMode = \"segments\" | \"sequence\";\ntype AudioContextLatencyCategory = \"balanced\" | \"interactive\" | \"playback\";\ntype AudioContextState = \"suspended\" | \"running\" | \"closed\";\ntype BinaryType = \"blob\" | \"arraybuffer\";\ntype BiquadFilterType = \"lowpass\" | \"highpass\" | \"bandpass\" | \"lowshelf\" | \"highshelf\" | \"peaking\" | \"notch\" | \"allpass\";\ntype CanPlayTypeResult = \"\" | \"maybe\" | \"probably\";\ntype CanvasFillRule = \"nonzero\" | \"evenodd\";\ntype ChannelCountMode = \"max\" | \"clamped-max\" | \"explicit\";\ntype ChannelInterpretation = \"speakers\" | \"discrete\";\ntype DisplayCaptureSurfaceType = \"monitor\" | \"window\" | \"application\" | \"browser\";\ntype DistanceModelType = \"linear\" | \"inverse\" | \"exponential\";\ntype EndOfStreamError = \"network\" | \"decode\";\ntype ExpandGranularity = \"character\" | \"word\" | \"sentence\" | \"textedit\";\ntype GamepadHand = \"\" | \"left\" | \"right\";\ntype GamepadHapticActuatorType = \"vibration\";\ntype GamepadInputEmulationType = \"mouse\" | \"keyboard\" | \"gamepad\";\ntype GamepadMappingType = \"\" | \"standard\";\ntype IDBCursorDirection = \"next\" | \"nextunique\" | \"prev\" | \"prevunique\";\ntype IDBRequestReadyState = \"pending\" | \"done\";\ntype IDBTransactionMode = \"readonly\" | \"readwrite\" | \"versionchange\";\ntype KeyFormat = \"raw\" | \"spki\" | \"pkcs8\" | \"jwk\";\ntype KeyType = \"public\" | \"private\" | \"secret\";\ntype KeyUsage = \"encrypt\" | \"decrypt\" | \"sign\" | \"verify\" | \"deriveKey\" | \"deriveBits\" | \"wrapKey\" | \"unwrapKey\";\ntype ListeningState = \"inactive\" | \"active\" | \"disambiguation\";\ntype MSCredentialType = \"FIDO_2_0\";\ntype MSIceAddrType = \"os\" | \"stun\" | \"turn\" | \"peer-derived\";\ntype MSIceType = \"failed\" | \"direct\" | \"relay\";\ntype MSStatsType = \"description\" | \"localclientevent\" | \"inbound-network\" | \"outbound-network\" | \"inbound-payload\" | \"outbound-payload\" | \"transportdiagnostics\";\ntype MSTransportType = \"Embedded\" | \"USB\" | \"NFC\" | \"BT\";\ntype MSWebViewPermissionState = \"unknown\" | \"defer\" | \"allow\" | \"deny\";\ntype MSWebViewPermissionType = \"geolocation\" | \"unlimitedIndexedDBQuota\" | \"media\" | \"pointerlock\" | \"webnotifications\";\ntype MediaDeviceKind = \"audioinput\" | \"audiooutput\" | \"videoinput\";\ntype MediaKeyMessageType = \"license-request\" | \"license-renewal\" | \"license-release\" | \"individualization-request\";\ntype MediaKeySessionType = \"temporary\" | \"persistent-license\" | \"persistent-release-message\";\ntype MediaKeyStatus = \"usable\" | \"expired\" | \"output-downscaled\" | \"output-not-allowed\" | \"status-pending\" | \"internal-error\";\ntype MediaKeysRequirement = \"required\" | \"optional\" | \"not-allowed\";\ntype MediaStreamTrackState = \"live\" | \"ended\";\ntype NavigationReason = \"up\" | \"down\" | \"left\" | \"right\";\ntype NavigationType = \"navigate\" | \"reload\" | \"back_forward\" | \"prerender\";\ntype NotificationDirection = \"auto\" | \"ltr\" | \"rtl\";\ntype NotificationPermission = \"default\" | \"denied\" | \"granted\";\ntype OscillatorType = \"sine\" | \"square\" | \"sawtooth\" | \"triangle\" | \"custom\";\ntype OverSampleType = \"none\" | \"2x\" | \"4x\";\ntype PanningModelType = \"equalpower\" | \"HRTF\";\ntype PaymentComplete = \"success\" | \"fail\" | \"unknown\";\ntype PaymentShippingType = \"shipping\" | \"delivery\" | \"pickup\";\ntype PushEncryptionKeyName = \"p256dh\" | \"auth\";\ntype PushPermissionState = \"granted\" | \"denied\" | \"prompt\";\ntype RTCBundlePolicy = \"balanced\" | \"max-compat\" | \"max-bundle\";\ntype RTCDegradationPreference = \"maintain-framerate\" | \"maintain-resolution\" | \"balanced\";\ntype RTCDtlsRole = \"auto\" | \"client\" | \"server\";\ntype RTCDtlsTransportState = \"new\" | \"connecting\" | \"connected\" | \"closed\";\ntype RTCIceCandidateType = \"host\" | \"srflx\" | \"prflx\" | \"relay\";\ntype RTCIceComponent = \"RTP\" | \"RTCP\";\ntype RTCIceConnectionState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"failed\" | \"disconnected\" | \"closed\";\ntype RTCIceGatherPolicy = \"all\" | \"nohost\" | \"relay\";\ntype RTCIceGathererState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceGatheringState = \"new\" | \"gathering\" | \"complete\";\ntype RTCIceProtocol = \"udp\" | \"tcp\";\ntype RTCIceRole = \"controlling\" | \"controlled\";\ntype RTCIceTcpCandidateType = \"active\" | \"passive\" | \"so\";\ntype RTCIceTransportPolicy = \"none\" | \"relay\" | \"all\";\ntype RTCIceTransportState = \"new\" | \"checking\" | \"connected\" | \"completed\" | \"disconnected\" | \"closed\";\ntype RTCSdpType = \"offer\" | \"pranswer\" | \"answer\";\ntype RTCSignalingState = \"stable\" | \"have-local-offer\" | \"have-remote-offer\" | \"have-local-pranswer\" | \"have-remote-pranswer\" | \"closed\";\ntype RTCStatsIceCandidatePairState = \"frozen\" | \"waiting\" | \"inprogress\" | \"failed\" | \"succeeded\" | \"cancelled\";\ntype RTCStatsIceCandidateType = \"host\" | \"serverreflexive\" | \"peerreflexive\" | \"relayed\";\ntype RTCStatsType = \"inboundrtp\" | \"outboundrtp\" | \"session\" | \"datachannel\" | \"track\" | \"transport\" | \"candidatepair\" | \"localcandidate\" | \"remotecandidate\";\ntype ReadyState = \"closed\" | \"open\" | \"ended\";\ntype ReferrerPolicy = \"\" | \"no-referrer\" | \"no-referrer-when-downgrade\" | \"origin-only\" | \"origin-when-cross-origin\" | \"unsafe-url\";\ntype RequestCache = \"default\" | \"no-store\" | \"reload\" | \"no-cache\" | \"force-cache\";\ntype RequestCredentials = \"omit\" | \"same-origin\" | \"include\";\ntype RequestDestination = \"\" | \"document\" | \"sharedworker\" | \"subresource\" | \"unknown\" | \"worker\";\ntype RequestMode = \"navigate\" | \"same-origin\" | \"no-cors\" | \"cors\";\ntype RequestRedirect = \"follow\" | \"error\" | \"manual\";\ntype RequestType = \"\" | \"audio\" | \"font\" | \"image\" | \"script\" | \"style\" | \"track\" | \"video\";\ntype ResponseType = \"basic\" | \"cors\" | \"default\" | \"error\" | \"opaque\" | \"opaqueredirect\";\ntype ScopedCredentialType = \"ScopedCred\";\ntype ServiceWorkerState = \"installing\" | \"installed\" | \"activating\" | \"activated\" | \"redundant\";\ntype TextTrackKind = \"subtitles\" | \"captions\" | \"descriptions\" | \"chapters\" | \"metadata\";\ntype TextTrackMode = \"disabled\" | \"hidden\" | \"showing\";\ntype Transport = \"usb\" | \"nfc\" | \"ble\";\ntype VRDisplayEventReason = \"mounted\" | \"navigation\" | \"requested\" | \"unmounted\";\ntype VREye = \"left\" | \"right\";\ntype VideoFacingModeEnum = \"user\" | \"environment\" | \"left\" | \"right\";\ntype VisibilityState = \"hidden\" | \"visible\" | \"prerender\" | \"unloaded\";\ntype XMLHttpRequestResponseType = \"\" | \"arraybuffer\" | \"blob\" | \"document\" | \"json\" | \"text\";\n\n\n/////////////////////////////\n/// WorkerGlobalScope APIs\n/////////////////////////////\n// These are only available in a Web Worker\ndeclare function importScripts(...urls: string[]): void;\n\n\n\n\n/////////////////////////////\n/// Windows Script Host APIS\n/////////////////////////////\n\n\ninterface ActiveXObject {\n new (s: string): any;\n}\ndeclare var ActiveXObject: ActiveXObject;\n\ninterface ITextWriter {\n Write(s: string): void;\n WriteLine(s: string): void;\n Close(): void;\n}\n\ninterface TextStreamBase {\n /**\n * The column number of the current character position in an input stream.\n */\n Column: number;\n\n /**\n * The current line number in an input stream.\n */\n Line: number;\n\n /**\n * Closes a text stream.\n * It is not necessary to close standard streams; they close automatically when the process ends. If\n * you close a standard stream, be aware that any other pointers to that standard stream become invalid.\n */\n Close(): void;\n}\n\ninterface TextStreamWriter extends TextStreamBase {\n /**\n * Sends a string to an output stream.\n */\n Write(s: string): void;\n\n /**\n * Sends a specified number of blank lines (newline characters) to an output stream.\n */\n WriteBlankLines(intLines: number): void;\n\n /**\n * Sends a string followed by a newline character to an output stream.\n */\n WriteLine(s: string): void;\n}\n\ninterface TextStreamReader extends TextStreamBase {\n /**\n * Returns a specified number of characters from an input stream, starting at the current pointer position.\n * Does not return until the ENTER key is pressed.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n Read(characters: number): string;\n\n /**\n * Returns all characters from an input stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadAll(): string;\n\n /**\n * Returns an entire line from an input stream.\n * Although this method extracts the newline character, it does not add it to the returned string.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n */\n ReadLine(): string;\n\n /**\n * Skips a specified number of characters when reading from an input text stream.\n * Can only be used on a stream in reading mode; causes an error in writing or appending mode.\n * @param characters Positive number of characters to skip forward. (Backward skipping is not supported.)\n */\n Skip(characters: number): void;\n\n /**\n * Skips the next line when reading from an input text stream.\n * Can only be used on a stream in reading mode, not writing or appending mode.\n */\n SkipLine(): void;\n\n /**\n * Indicates whether the stream pointer position is at the end of a line.\n */\n AtEndOfLine: boolean;\n\n /**\n * Indicates whether the stream pointer position is at the end of a stream.\n */\n AtEndOfStream: boolean;\n}\n\ndeclare var WScript: {\n /**\n * Outputs text to either a message box (under WScript.exe) or the command console window followed by\n * a newline (under CScript.exe).\n */\n Echo(s: any): void;\n\n /**\n * Exposes the write-only error output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdErr: TextStreamWriter;\n\n /**\n * Exposes the write-only output stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdOut: TextStreamWriter;\n Arguments: { length: number; Item(n: number): string; };\n\n /**\n * The full path of the currently running script.\n */\n ScriptFullName: string;\n\n /**\n * Forces the script to stop immediately, with an optional exit code.\n */\n Quit(exitCode?: number): number;\n\n /**\n * The Windows Script Host build version number.\n */\n BuildVersion: number;\n\n /**\n * Fully qualified path of the host executable.\n */\n FullName: string;\n\n /**\n * Gets/sets the script mode - interactive(true) or batch(false).\n */\n Interactive: boolean;\n\n /**\n * The name of the host executable (WScript.exe or CScript.exe).\n */\n Name: string;\n\n /**\n * Path of the directory containing the host executable.\n */\n Path: string;\n\n /**\n * The filename of the currently running script.\n */\n ScriptName: string;\n\n /**\n * Exposes the read-only input stream for the current script.\n * Can be accessed only while using CScript.exe.\n */\n StdIn: TextStreamReader;\n\n /**\n * Windows Script Host version\n */\n Version: string;\n\n /**\n * Connects a COM object's event sources to functions named with a given prefix, in the form prefix_event.\n */\n ConnectObject(objEventSource: any, strPrefix: string): void;\n\n /**\n * Creates a COM object.\n * @param strProgiID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n CreateObject(strProgID: string, strPrefix?: string): any;\n\n /**\n * Disconnects a COM object from its event sources.\n */\n DisconnectObject(obj: any): void;\n\n /**\n * Retrieves an existing object with the specified ProgID from memory, or creates a new one from a file.\n * @param strPathname Fully qualified path to the file containing the object persisted to disk.\n * For objects in memory, pass a zero-length string.\n * @param strProgID\n * @param strPrefix Function names in the form prefix_event will be bound to this object's COM events.\n */\n GetObject(strPathname: string, strProgID?: string, strPrefix?: string): any;\n\n /**\n * Suspends script execution for a specified length of time, then continues execution.\n * @param intTime Interval (in milliseconds) to suspend script execution.\n */\n Sleep(intTime: number): void;\n};\n\n/**\n * Represents an Automation SAFEARRAY\n */\ndeclare class SafeArray {\n private constructor();\n private SafeArray_typekey: SafeArray;\n}\n\n/**\n * Allows enumerating over a COM collection, which may not have indexed item access.\n */\ninterface Enumerator {\n /**\n * Returns true if the current item is the last one in the collection, or the collection is empty,\n * or the current item is undefined.\n */\n atEnd(): boolean;\n\n /**\n * Returns the current item in the collection\n */\n item(): T;\n\n /**\n * Resets the current item in the collection to the first item. If there are no items in the collection,\n * the current item is set to undefined.\n */\n moveFirst(): void;\n\n /**\n * Moves the current item to the next item in the collection. If the enumerator is at the end of\n * the collection or the collection is empty, the current item is set to undefined.\n */\n moveNext(): void;\n}\n\ninterface EnumeratorConstructor {\n new (safearray: SafeArray): Enumerator;\n new (collection: { Item(index: any): T }): Enumerator;\n new (collection: any): Enumerator;\n}\n\ndeclare var Enumerator: EnumeratorConstructor;\n\n/**\n * Enables reading from a COM safe array, which might have an alternate lower bound, or multiple dimensions.\n */\ninterface VBArray {\n /**\n * Returns the number of dimensions (1-based).\n */\n dimensions(): number;\n\n /**\n * Takes an index for each dimension in the array, and returns the item at the corresponding location.\n */\n getItem(dimension1Index: number, ...dimensionNIndexes: number[]): T;\n\n /**\n * Returns the smallest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n lbound(dimension?: number): number;\n\n /**\n * Returns the largest available index for a given dimension.\n * @param dimension 1-based dimension (defaults to 1)\n */\n ubound(dimension?: number): number;\n\n /**\n * Returns a Javascript array with all the elements in the VBArray. If there are multiple dimensions,\n * each successive dimension is appended to the end of the array.\n * Example: [[1,2,3],[4,5,6]] becomes [1,2,3,4,5,6]\n */\n toArray(): T[];\n}\n\ninterface VBArrayConstructor {\n new (safeArray: SafeArray): VBArray;\n}\n\ndeclare var VBArray: VBArrayConstructor;\n\n/**\n * Automation date (VT_DATE)\n */\ndeclare class VarDate {\n private constructor();\n private VarDate_typekey: VarDate;\n}\n\ninterface DateConstructor {\n new (vd: VarDate): Date;\n}\n\ninterface Date {\n getVarDate: () => VarDate;\n}\n"; diff --git a/src/lib/typescriptServices-amd.js b/src/lib/typescriptServices-amd.js index 450b5a43..1b506da1 100644 --- a/src/lib/typescriptServices-amd.js +++ b/src/lib/typescriptServices-amd.js @@ -182,198 +182,201 @@ var ts; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 140] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 141] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 142] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 143] = "OfKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 126] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 127] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 128] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 129] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 130] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 131] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 132] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 133] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 134] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 135] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 136] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 137] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 138] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 142] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 143] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 144] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 144] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 145] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 145] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 146] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 146] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 147] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 148] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 147] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 148] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 149] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 149] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 150] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 151] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 152] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 153] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 154] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 155] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 156] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 157] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 158] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 150] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 151] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 152] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 153] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 154] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 155] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 156] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 157] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 158] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 159] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 159] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 160] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 161] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 162] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 163] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 164] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 165] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 166] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 167] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 168] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 169] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 170] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 171] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 172] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 173] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 174] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 160] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 161] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 162] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 163] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 164] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 165] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 166] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 167] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 168] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 169] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 170] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 171] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 172] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 173] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 174] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 175] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 176] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 177] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 175] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 176] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 177] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 178] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 179] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 180] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 180] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 181] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 182] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 183] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 184] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 185] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 186] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 187] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 188] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 189] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 190] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 191] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 192] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 193] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 194] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 195] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 196] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 197] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 198] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 199] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 200] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 201] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 202] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 203] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 204] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 205] = "MetaProperty"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 181] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 182] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 183] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 184] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 185] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 186] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 187] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 188] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 189] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 190] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 191] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 192] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 193] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 194] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 195] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 196] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 197] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 198] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 199] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 200] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 201] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 202] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 203] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 204] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 205] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 206] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 207] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 208] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 206] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 207] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 209] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 210] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 208] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 209] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 210] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 211] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 212] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 213] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 214] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 215] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 216] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 217] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 218] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 219] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 220] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 221] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 222] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 223] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 224] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 225] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 226] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 227] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 228] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 229] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 230] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 231] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 232] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 233] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 234] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 235] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 236] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 237] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 238] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 239] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 240] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 241] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 242] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 243] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 244] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 245] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 246] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 247] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 248] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 211] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 212] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 213] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 214] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 215] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 216] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 217] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 218] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 219] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 220] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 221] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 222] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 223] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 224] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 225] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 226] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 227] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 228] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 229] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 230] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 231] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 232] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 233] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 234] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 235] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 236] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 237] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 238] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 239] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 240] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 241] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 242] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 243] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 244] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 245] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 246] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 247] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 248] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 249] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 250] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 251] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 249] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 252] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 250] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 251] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 252] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 253] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 254] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 255] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 256] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 257] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 258] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 259] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 260] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 253] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 254] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 255] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 256] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 257] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 258] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 259] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 260] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 261] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 262] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 263] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 261] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 262] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 263] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 264] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 264] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 265] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 266] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 267] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 265] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 266] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 267] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 268] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 269] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 270] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 268] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 271] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 269] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 270] = "Bundle"; + SyntaxKind[SyntaxKind["SourceFile"] = 272] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 273] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 271] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 274] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 272] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 275] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 273] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 274] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 275] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 276] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 277] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 278] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 279] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 280] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocTag"] = 281] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 282] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 283] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 284] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 285] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 286] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 287] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 288] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 289] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 276] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 277] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 278] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 279] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 280] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 281] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 283] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocTag"] = 284] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 285] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 286] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 287] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 288] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 289] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 290] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 291] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 292] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 290] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 291] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 292] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 293] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 294] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 295] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 296] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 297] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 298] = "EndOfDeclarationMarker"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 296] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 299] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; @@ -382,15 +385,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 143] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 144] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 159] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 174] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 160] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 177] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 143] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 144] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -399,13 +402,13 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 144] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 271] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 289] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 281] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 289] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 145] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 274] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 284] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 143] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 144] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -601,6 +604,7 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; @@ -725,32 +729,32 @@ var ts; SymbolFlags[SymbolFlags["All"] = 67108863] = "All"; SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; - SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; - SymbolFlags[SymbolFlags["Type"] = 793064] = "Type"; + SymbolFlags[SymbolFlags["Value"] = 67216319] = "Value"; + SymbolFlags[SymbolFlags["Type"] = 67901928] = "Type"; SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace"; SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; // Variables can be redeclared, but can not redeclare a block-scoped declaration with the // same name, or any other value that is not a variable, e.g. ValueModule or Class - SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 67216318] = "FunctionScopedVariableExcludes"; // Block-scoped declarations are not allowed to be re-declared // they can not merge with anything in the value space - SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 67216319] = "BlockScopedVariableExcludes"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = 67216319] = "ParameterExcludes"; SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; - SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 68008959] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = 67215791] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = 68008383] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = 67901832] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 68008191] = "RegularEnumExcludes"; + SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 68008831] = "ConstEnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 67215503] = "ValueModuleExcludes"; SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = 67208127] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 67150783] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 67183551] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 67639784] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 67901928] = "TypeAliasExcludes"; SymbolFlags[SymbolFlags["AliasExcludes"] = 2097152] = "AliasExcludes"; SymbolFlags[SymbolFlags["ModuleMember"] = 2623475] = "ModuleMember"; SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal"; @@ -856,18 +860,19 @@ var ts; TypeFlags[TypeFlags["Intersection"] = 262144] = "Intersection"; TypeFlags[TypeFlags["Index"] = 524288] = "Index"; TypeFlags[TypeFlags["IndexedAccess"] = 1048576] = "IndexedAccess"; + TypeFlags[TypeFlags["Conditional"] = 2097152] = "Conditional"; + TypeFlags[TypeFlags["Substitution"] = 4194304] = "Substitution"; /* @internal */ - TypeFlags[TypeFlags["FreshLiteral"] = 2097152] = "FreshLiteral"; + TypeFlags[TypeFlags["FreshLiteral"] = 8388608] = "FreshLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsWideningType"] = 4194304] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsWideningType"] = 16777216] = "ContainsWideningType"; /* @internal */ - TypeFlags[TypeFlags["ContainsObjectLiteral"] = 8388608] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 33554432] = "ContainsObjectLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 16777216] = "ContainsAnyFunctionType"; - TypeFlags[TypeFlags["NonPrimitive"] = 33554432] = "NonPrimitive"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 67108864] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 134217728] = "NonPrimitive"; /* @internal */ - TypeFlags[TypeFlags["JsxAttributes"] = 67108864] = "JsxAttributes"; - TypeFlags[TypeFlags["MarkerType"] = 134217728] = "MarkerType"; + TypeFlags[TypeFlags["GenericMappedType"] = 536870912] = "GenericMappedType"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 12288] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; @@ -879,7 +884,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 14560] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 14574] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 33585807] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 134249103] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 16382] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 524322] = "StringLike"; @@ -889,16 +894,20 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 1536] = "ESSymbolLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 393216] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 458752] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 2064384] = "StructuredOrTypeVariable"; TypeFlags[TypeFlags["TypeVariable"] = 1081344] = "TypeVariable"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 7372800] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 524288] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 7897088] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 8355840] = "StructuredOrInstantiable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 35620607] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33620481] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 142575359] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 134283777] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 12582912] = "RequiresWidening"; + TypeFlags[TypeFlags["RequiresWidening"] = 50331648] = "RequiresWidening"; + /* @internal */ + TypeFlags[TypeFlags["PropagatingFlags"] = 117440512] = "PropagatingFlags"; /* @internal */ - TypeFlags[TypeFlags["PropagatingFlags"] = 29360128] = "PropagatingFlags"; })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); var ObjectFlags; (function (ObjectFlags) { @@ -914,6 +923,8 @@ var ts; ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; ObjectFlags[ObjectFlags["ContainsSpread"] = 1024] = "ContainsSpread"; ObjectFlags[ObjectFlags["ReverseMapped"] = 2048] = "ReverseMapped"; + ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes"; + ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ @@ -938,9 +949,15 @@ var ts; var InferencePriority; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; - InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; - InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + InferencePriority[InferencePriority["HomomorphicMappedType"] = 2] = "HomomorphicMappedType"; + InferencePriority[InferencePriority["MappedTypeConstraint"] = 4] = "MappedTypeConstraint"; + InferencePriority[InferencePriority["ReturnType"] = 8] = "ReturnType"; + InferencePriority[InferencePriority["LiteralKeyof"] = 16] = "LiteralKeyof"; + InferencePriority[InferencePriority["NoConstraints"] = 32] = "NoConstraints"; + InferencePriority[InferencePriority["AlwaysStrict"] = 64] = "AlwaysStrict"; + InferencePriority[InferencePriority["PriorityImpliesCombination"] = 28] = "PriorityImpliesCombination"; })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); + /* @internal */ var InferenceFlags; (function (InferenceFlags) { InferenceFlags[InferenceFlags["None"] = 0] = "None"; @@ -957,6 +974,7 @@ var ts; * x | y is Maybe if either x or y is Maybe, but neither x or y is True. * x | y is True if either x or y is True. */ + /* @internal */ var Ternary; (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; @@ -977,13 +995,23 @@ var ts; SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; // F.name = expr SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; + // F.prototype = { ... } + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Prototype"] = 6] = "Prototype"; })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; + DiagnosticCategory[DiagnosticCategory["Suggestion"] = 2] = "Suggestion"; + DiagnosticCategory[DiagnosticCategory["Message"] = 3] = "Message"; })(DiagnosticCategory = ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); + /* @internal */ + function diagnosticCategoryName(d, lowerCase) { + if (lowerCase === void 0) { lowerCase = true; } + var name = DiagnosticCategory[d.category]; + return lowerCase ? name.toLowerCase() : name; + } + ts.diagnosticCategoryName = diagnosticCategoryName; var ModuleResolutionKind; (function (ModuleResolutionKind) { ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic"; @@ -1413,6 +1441,68 @@ var ts; ListFormat[ListFormat["Parameters"] = 1296] = "Parameters"; ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; })(ListFormat = ts.ListFormat || (ts.ListFormat = {})); + /* @internal */ + var PragmaKindFlags; + (function (PragmaKindFlags) { + PragmaKindFlags[PragmaKindFlags["None"] = 0] = "None"; + /** + * Triple slash comment of the form + * /// + */ + PragmaKindFlags[PragmaKindFlags["TripleSlashXML"] = 1] = "TripleSlashXML"; + /** + * Single line comment of the form + * // @pragma-name argval1 argval2 + * or + * /// @pragma-name argval1 argval2 + */ + PragmaKindFlags[PragmaKindFlags["SingleLine"] = 2] = "SingleLine"; + /** + * Multiline non-jsdoc pragma of the form + * /* @pragma-name argval1 argval2 * / + */ + PragmaKindFlags[PragmaKindFlags["MultiLine"] = 4] = "MultiLine"; + PragmaKindFlags[PragmaKindFlags["All"] = 7] = "All"; + PragmaKindFlags[PragmaKindFlags["Default"] = 7] = "Default"; + })(PragmaKindFlags = ts.PragmaKindFlags || (ts.PragmaKindFlags = {})); + /** + * This function only exists to cause exact types to be inferred for all the literals within `commentPragmas` + */ + /* @internal */ + function _contextuallyTypePragmas(args) { + return args; + } + // While not strictly a type, this is here because `PragmaMap` needs to be here to be used with `SourceFile`, and we don't + // fancy effectively defining it twice, once in value-space and once in type-space + /* @internal */ + ts.commentPragmas = _contextuallyTypePragmas({ + "reference": { + args: [ + { name: "types", optional: true, captureSpan: true }, + { name: "path", optional: true, captureSpan: true }, + { name: "no-default-lib", optional: true } + ], + kind: 1 /* TripleSlashXML */ + }, + "amd-dependency": { + args: [{ name: "path" }, { name: "name", optional: true }], + kind: 1 /* TripleSlashXML */ + }, + "amd-module": { + args: [{ name: "name" }], + kind: 1 /* TripleSlashXML */ + }, + "ts-check": { + kind: 2 /* SingleLine */ + }, + "ts-nocheck": { + kind: 2 /* SingleLine */ + }, + "jsx": { + args: [{ name: "factory" }], + kind: 4 /* MultiLine */ + }, + }); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1513,9 +1603,9 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "2.7"; + ts.versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".2"; + ts.version = ts.versionMajorMinor + ".1"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -1525,10 +1615,18 @@ var ts; return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); /* @internal */ (function (ts) { ts.emptyArray = []; + function closeFileWatcher(watcher) { + watcher.close(); + } + ts.closeFileWatcher = closeFileWatcher; /** Create a MapLike with good performance. */ function createDictionaryObject() { var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword @@ -1816,6 +1914,11 @@ var ts; return false; } ts.contains = contains; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); + } + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -1896,23 +1999,21 @@ var ts; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; /** @@ -2229,6 +2330,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -2721,19 +2833,21 @@ var ts; } ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { + if (makeValue === void 0) { makeValue = identity; } var result = createMap(); for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { var value = array_6[_i]; - result.set(makeKey(value), makeValue ? makeValue(value) : value); + result.set(makeKey(value), makeValue(value)); } return result; } ts.arrayToMap = arrayToMap; function arrayToNumericMap(array, makeKey, makeValue) { + if (makeValue === void 0) { makeValue = identity; } var result = []; for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { var value = array_7[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result[makeKey(value)] = makeValue(value); } return result; } @@ -2742,6 +2856,20 @@ var ts; return arrayToMap(array, makeKey || (function (s) { return s; }), function () { return true; }); } ts.arrayToSet = arrayToSet; + function arrayToMultiMap(values, makeKey, makeValue) { + if (makeValue === void 0) { makeValue = identity; } + var result = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + result.add(makeKey(value), makeValue(value)); + } + return result; + } + ts.arrayToMultiMap = arrayToMultiMap; + function group(values, getGroupId) { + return arrayFrom(arrayToMultiMap(values, getGroupId).values()); + } + ts.group = group; function cloneMap(map) { var clone = createMap(); copyEntries(map, clone); @@ -2824,7 +2952,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; /** Does nothing. */ @@ -2913,7 +3046,6 @@ var ts; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } ts.formatStringFromArgs = formatStringFromArgs; - ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; } @@ -3203,6 +3335,11 @@ var ts; 0 /* EqualTo */; } ts.compareDiagnostics = compareDiagnostics; + /** True is greater than false. */ + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { // We still have both chains. @@ -3222,10 +3359,6 @@ var ts; // We still have one chain remaining. The shorter chain should come first. return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -3763,7 +3896,6 @@ var ts; function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) { path = normalizePath(path); currentDirectory = normalizePath(currentDirectory); - var comparer = useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive; var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); @@ -3796,7 +3928,7 @@ var ts; } } }; - for (var _i = 0, _b = sort(files, comparer); _i < _b.length; _i++) { + for (var _i = 0, _b = sort(files, compareStringsCaseSensitive); _i < _b.length; _i++) { var current = _b[_i]; _loop_1(current); } @@ -3806,7 +3938,7 @@ var ts; return; } } - for (var _c = 0, _d = sort(directories, comparer); _c < _d.length; _c++) { + for (var _c = 0, _d = sort(directories, compareStringsCaseSensitive); _c < _d.length; _c++) { var current = _d[_c]; var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); @@ -3838,7 +3970,7 @@ var ts; // Sort the offsets array using either the literal or canonical path representations. includeBasePaths.sort(useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive); var _loop_2 = function (includeBasePath) { - if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { + if (every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } }; @@ -4014,6 +4146,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -4106,6 +4242,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -4124,6 +4273,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); /** Remove an item from an array, moving everything to its right one space left. */ function orderedRemoveItem(array, item) { @@ -4201,16 +4370,16 @@ var ts; */ function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; /** Return the object corresponding to the best pattern to match `candidate`. */ function findBestPatternMatch(values, getPattern, candidate) { - var matchedValue = undefined; + var matchedValue; // use length of prefix as betterness criteria var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -4299,6 +4468,38 @@ var ts; return t === undefined ? undefined : [t]; } ts.singleElementArray = singleElementArray; + function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { + unchanged = unchanged || noop; + var newIndex = 0; + var oldIndex = 0; + var newLen = newItems.length; + var oldLen = oldItems.length; + while (newIndex < newLen && oldIndex < oldLen) { + var newItem = newItems[newIndex]; + var oldItem = oldItems[oldIndex]; + var compareResult = comparer(newItem, oldItem); + if (compareResult === -1 /* LessThan */) { + inserted(newItem); + newIndex++; + } + else if (compareResult === 1 /* GreaterThan */) { + deleted(oldItem); + oldIndex++; + } + else { + unchanged(oldItem, newItem); + newIndex++; + oldIndex++; + } + } + while (newIndex < newLen) { + inserted(newItems[newIndex++]); + } + while (oldIndex < oldLen) { + deleted(oldItems[oldIndex++]); + } + } + ts.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; })(ts || (ts = {})); /// var ts; @@ -4310,7 +4511,7 @@ var ts; */ /* @internal */ function setStackTraceLimit() { - if (Error.stackTraceLimit < 100) { + if (Error.stackTraceLimit < 100) { // Also tests that we won't set the property if it doesn't exist. Error.stackTraceLimit = 100; } } @@ -4321,6 +4522,314 @@ var ts; FileWatcherEventKind[FileWatcherEventKind["Changed"] = 1] = "Changed"; FileWatcherEventKind[FileWatcherEventKind["Deleted"] = 2] = "Deleted"; })(FileWatcherEventKind = ts.FileWatcherEventKind || (ts.FileWatcherEventKind = {})); + /* @internal */ + var PollingInterval; + (function (PollingInterval) { + PollingInterval[PollingInterval["High"] = 2000] = "High"; + PollingInterval[PollingInterval["Medium"] = 500] = "Medium"; + PollingInterval[PollingInterval["Low"] = 250] = "Low"; + })(PollingInterval = ts.PollingInterval || (ts.PollingInterval = {})); + function getPriorityValues(highPriorityValue) { + var mediumPriorityValue = highPriorityValue * 2; + var lowPriorityValue = mediumPriorityValue * 4; + return [highPriorityValue, mediumPriorityValue, lowPriorityValue]; + } + function pollingInterval(watchPriority) { + return pollingIntervalsForPriority[watchPriority]; + } + var pollingIntervalsForPriority = getPriorityValues(250); + /* @internal */ + function watchFileUsingPriorityPollingInterval(host, fileName, callback, watchPriority) { + return host.watchFile(fileName, callback, pollingInterval(watchPriority)); + } + ts.watchFileUsingPriorityPollingInterval = watchFileUsingPriorityPollingInterval; + /* @internal */ + ts.missingFileModifiedTime = new Date(0); // Any subsequent modification will occur after this time + function createPollingIntervalBasedLevels(levels) { + return _a = {}, + _a[PollingInterval.Low] = levels.Low, + _a[PollingInterval.Medium] = levels.Medium, + _a[PollingInterval.High] = levels.High, + _a; + var _a; + } + var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; + var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); + /* @internal */ + ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); + /* @internal */ + function setCustomPollingValues(system) { + if (!system.getEnvironmentVariable) { + return; + } + var pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval); + pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize; + ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds; + function getLevel(envVar, level) { + return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase()); + } + function getCustomLevels(baseVariable) { + var customLevels; + setCustomLevel("Low"); + setCustomLevel("Medium"); + setCustomLevel("High"); + return customLevels; + function setCustomLevel(level) { + var customLevel = getLevel(baseVariable, level); + if (customLevel) { + (customLevels || (customLevels = {}))[level] = Number(customLevel); + } + } + } + function setCustomLevels(baseVariable, levels) { + var customLevels = getCustomLevels(baseVariable); + if (customLevels) { + setLevel("Low"); + setLevel("Medium"); + setLevel("High"); + return true; + } + return false; + function setLevel(level) { + levels[level] = customLevels[level] || levels[level]; + } + } + function getCustomPollingBasedLevels(baseVariable, defaultLevels) { + var customLevels = getCustomLevels(baseVariable); + return (pollingIntervalChanged || customLevels) && + createPollingIntervalBasedLevels(customLevels ? __assign({}, defaultLevels, customLevels) : defaultLevels); + } + } + ts.setCustomPollingValues = setCustomPollingValues; + /* @internal */ + function createDynamicPriorityPollingWatchFile(host) { + var watchedFiles = []; + var changedFilesInLastPoll = []; + var lowPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Low); + var mediumPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Medium); + var highPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.High); + return watchFile; + function watchFile(fileName, callback, defaultPollingInterval) { + var file = { + fileName: fileName, + callback: callback, + unchangedPolls: 0, + mtime: getModifiedTime(fileName) + }; + watchedFiles.push(file); + addToPollingIntervalQueue(file, defaultPollingInterval); + return { + close: function () { + file.isClosed = true; + // Remove from watchedFiles + ts.unorderedRemoveItem(watchedFiles, file); + // Do not update polling interval queue since that will happen as part of polling + } + }; + } + function createPollingIntervalQueue(pollingInterval) { + var queue = []; + queue.pollingInterval = pollingInterval; + queue.pollIndex = 0; + queue.pollScheduled = false; + return queue; + } + function pollPollingIntervalQueue(queue) { + queue.pollIndex = pollQueue(queue, queue.pollingInterval, queue.pollIndex, pollingChunkSize[queue.pollingInterval]); + // Set the next polling index and timeout + if (queue.length) { + scheduleNextPoll(queue.pollingInterval); + } + else { + ts.Debug.assert(queue.pollIndex === 0); + queue.pollScheduled = false; + } + } + function pollLowPollingIntervalQueue(queue) { + // Always poll complete list of changedFilesInLastPoll + pollQueue(changedFilesInLastPoll, PollingInterval.Low, /*pollIndex*/ 0, changedFilesInLastPoll.length); + // Finally do the actual polling of the queue + pollPollingIntervalQueue(queue); + // Schedule poll if there are files in changedFilesInLastPoll but no files in the actual queue + // as pollPollingIntervalQueue wont schedule for next poll + if (!queue.pollScheduled && changedFilesInLastPoll.length) { + scheduleNextPoll(PollingInterval.Low); + } + } + function pollQueue(queue, pollingInterval, pollIndex, chunkSize) { + // Max visit would be all elements of the queue + var needsVisit = queue.length; + var definedValueCopyToIndex = pollIndex; + for (var polled = 0; polled < chunkSize && needsVisit > 0; nextPollIndex(), needsVisit--) { + var watchedFile = queue[pollIndex]; + if (!watchedFile) { + continue; + } + else if (watchedFile.isClosed) { + queue[pollIndex] = undefined; + continue; + } + polled++; + var fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(watchedFile.fileName)); + if (watchedFile.isClosed) { + // Closed watcher as part of callback + queue[pollIndex] = undefined; + } + else if (fileChanged) { + watchedFile.unchangedPolls = 0; + // Changed files go to changedFilesInLastPoll queue + if (queue !== changedFilesInLastPoll) { + queue[pollIndex] = undefined; + addChangedFileToLowPollingIntervalQueue(watchedFile); + } + } + else if (watchedFile.unchangedPolls !== ts.unchangedPollThresholds[pollingInterval]) { + watchedFile.unchangedPolls++; + } + else if (queue === changedFilesInLastPoll) { + // Restart unchangedPollCount for unchanged file and move to low polling interval queue + watchedFile.unchangedPolls = 1; + queue[pollIndex] = undefined; + addToPollingIntervalQueue(watchedFile, PollingInterval.Low); + } + else if (pollingInterval !== PollingInterval.High) { + watchedFile.unchangedPolls++; + queue[pollIndex] = undefined; + addToPollingIntervalQueue(watchedFile, pollingInterval === PollingInterval.Low ? PollingInterval.Medium : PollingInterval.High); + } + if (queue[pollIndex]) { + // Copy this file to the non hole location + if (definedValueCopyToIndex < pollIndex) { + queue[definedValueCopyToIndex] = watchedFile; + queue[pollIndex] = undefined; + } + definedValueCopyToIndex++; + } + } + // Return next poll index + return pollIndex; + function nextPollIndex() { + pollIndex++; + if (pollIndex === queue.length) { + if (definedValueCopyToIndex < pollIndex) { + // There are holes from nextDefinedValueIndex to end of queue, change queue size + queue.length = definedValueCopyToIndex; + } + pollIndex = 0; + definedValueCopyToIndex = 0; + } + } + } + function pollingIntervalQueue(pollingInterval) { + switch (pollingInterval) { + case PollingInterval.Low: + return lowPollingIntervalQueue; + case PollingInterval.Medium: + return mediumPollingIntervalQueue; + case PollingInterval.High: + return highPollingIntervalQueue; + } + } + function addToPollingIntervalQueue(file, pollingInterval) { + pollingIntervalQueue(pollingInterval).push(file); + scheduleNextPollIfNotAlreadyScheduled(pollingInterval); + } + function addChangedFileToLowPollingIntervalQueue(file) { + changedFilesInLastPoll.push(file); + scheduleNextPollIfNotAlreadyScheduled(PollingInterval.Low); + } + function scheduleNextPollIfNotAlreadyScheduled(pollingInterval) { + if (!pollingIntervalQueue(pollingInterval).pollScheduled) { + scheduleNextPoll(pollingInterval); + } + } + function scheduleNextPoll(pollingInterval) { + pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval)); + } + function getModifiedTime(fileName) { + return host.getModifiedTime(fileName) || ts.missingFileModifiedTime; + } + } + ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile; + /** + * Returns true if file status changed + */ + /*@internal*/ + function onWatchedFileStat(watchedFile, modifiedTime) { + var oldTime = watchedFile.mtime.getTime(); + var newTime = modifiedTime.getTime(); + if (oldTime !== newTime) { + watchedFile.mtime = modifiedTime; + var eventKind = oldTime === 0 + ? FileWatcherEventKind.Created + : newTime === 0 + ? FileWatcherEventKind.Deleted + : FileWatcherEventKind.Changed; + watchedFile.callback(watchedFile.fileName, eventKind); + return true; + } + return false; + } + ts.onWatchedFileStat = onWatchedFileStat; + /** + * Watch the directory recursively using host provided method to watch child directories + * that means if this is recursive watcher, watch the children directories as well + * (eg on OS that dont support recursive watch using fs.watch use fs.watchFile) + */ + /*@internal*/ + function createRecursiveDirectoryWatcher(host) { + return createDirectoryWatcher; + /** + * Create the directory watcher for the dirPath. + */ + function createDirectoryWatcher(dirName, callback) { + var watcher = host.watchDirectory(dirName, function (fileName) { + // Call the actual callback + callback(fileName); + // Iterate through existing children and update the watches if needed + updateChildWatches(result, callback); + }); + var result = { + close: function () { + watcher.close(); + result.childWatches.forEach(ts.closeFileWatcher); + result = undefined; + }, + dirName: dirName, + childWatches: ts.emptyArray + }; + updateChildWatches(result, callback); + return result; + } + function updateChildWatches(watcher, callback) { + // Iterate through existing children and update the watches if needed + if (watcher) { + watcher.childWatches = watchChildDirectories(watcher.dirName, watcher.childWatches, callback); + } + } + /** + * Watch the directories in the parentDir + */ + function watchChildDirectories(parentDir, existingChildWatches, callback) { + var newChildWatches; + ts.enumerateInsertsAndDeletes(host.directoryExists(parentDir) ? host.getAccessileSortedChildDirectories(parentDir) : ts.emptyArray, existingChildWatches, function (child, childWatcher) { return host.filePathComparer(ts.getNormalizedAbsolutePath(child, parentDir), childWatcher.dirName); }, createAndAddChildDirectoryWatcher, ts.closeFileWatcher, addChildDirectoryWatcher); + return newChildWatches || ts.emptyArray; + /** + * Create new childDirectoryWatcher and add it to the new ChildDirectoryWatcher list + */ + function createAndAddChildDirectoryWatcher(childName) { + var result = createDirectoryWatcher(ts.getNormalizedAbsolutePath(childName, parentDir), callback); + addChildDirectoryWatcher(result); + } + /** + * Add child directory watcher to the new ChildDirectoryWatcher list + */ + function addChildDirectoryWatcher(childWatcher) { + (newChildWatches || (newChildWatches = [])).push(childWatcher); + } + } + } + ts.createRecursiveDirectoryWatcher = createRecursiveDirectoryWatcher; function getNodeMajorVersion() { if (typeof process === "undefined") { return undefined; @@ -4345,70 +4854,107 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); - var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; - function createWatchedFileSet() { - var dirWatchers = ts.createMap(); - // One file can have multiple watchers - var fileWatcherCallbacks = ts.createMultiMap(); - return { addFile: addFile, removeFile: removeFile }; - function reduceDirWatcherRefCountForFile(fileName) { - var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers.get(dirName); - if (watcher) { - watcher.referenceCount -= 1; - if (watcher.referenceCount <= 0) { - watcher.close(); - dirWatchers.delete(dirName); - } - } - } - function addDirWatcher(dirPath) { - var watcher = dirWatchers.get(dirPath); - if (watcher) { - watcher.referenceCount += 1; - return; - } - watcher = fsWatchDirectory(dirPath || ".", function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); - watcher.referenceCount = 1; - dirWatchers.set(dirPath, watcher); - return; - } - function addFileWatcherCallback(filePath, callback) { - fileWatcherCallbacks.add(filePath, callback); - } - function addFile(fileName, callback) { - addFileWatcherCallback(fileName, callback); - addDirWatcher(ts.getDirectoryPath(fileName)); - return { fileName: fileName, callback: callback }; - } - function removeFile(watchedFile) { - removeFileWatcherCallback(watchedFile.fileName, watchedFile.callback); - reduceDirWatcherRefCountForFile(watchedFile.fileName); - } - function removeFileWatcherCallback(filePath, callback) { - fileWatcherCallbacks.remove(filePath, callback); - } - function fileEventHandler(eventName, relativeFileName, baseDirPath) { - // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" - var fileName = !ts.isString(relativeFileName) - ? undefined - : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); - // Some applications save a working file via rename operations - if ((eventName === "change" || eventName === "rename")) { - var callbacks = fileWatcherCallbacks.get(fileName); - if (callbacks) { - for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { - var fileCallback = callbacks_1[_i]; - fileCallback(fileName, FileWatcherEventKind.Changed); - } - } - } - } + // crypto can be absent on reduced node installations + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; } - var watchedFileSet = createWatchedFileSet(); var nodeVersion = getNodeMajorVersion(); var isNode4OrLater = nodeVersion >= 4; + var platform = _os.platform(); + var useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + var FileSystemEntryKind; + (function (FileSystemEntryKind) { + FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; + FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; + })(FileSystemEntryKind || (FileSystemEntryKind = {})); + var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + var tscWatchFile = process.env.TSC_WATCHFILE; + var tscWatchDirectory = process.env.TSC_WATCHDIRECTORY; + var dynamicPollingWatchFile; + var nodeSystem = { + args: process.argv.slice(2), + newLine: _os.EOL, + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + write: function (s) { + process.stdout.write(s); + }, + readFile: readFile, + writeFile: writeFile, + watchFile: getWatchFile(), + watchDirectory: getWatchDirectory(), + resolvePath: function (path) { return _path.resolve(path); }, + fileExists: fileExists, + directoryExists: directoryExists, + createDirectory: function (directoryName) { + if (!nodeSystem.directoryExists(directoryName)) { + _fs.mkdirSync(directoryName); + } + }, + getExecutingFilePath: function () { + return __filename; + }, + getCurrentDirectory: function () { + return process.cwd(); + }, + getDirectories: getDirectories, + getEnvironmentVariable: function (name) { + return process.env[name] || ""; + }, + readDirectory: readDirectory, + getModifiedTime: getModifiedTime, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, + getMemoryUsage: function () { + if (global.gc) { + global.gc(); + } + return process.memoryUsage().heapUsed; + }, + getFileSize: function (path) { + try { + var stat = _fs.statSync(path); + if (stat.isFile()) { + return stat.size; + } + } + catch ( /*ignore*/_a) { /*ignore*/ } + return 0; + }, + exit: function (exitCode) { + process.exit(exitCode); + }, + realpath: function (path) { + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } + }, + debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), + tryEnableSourceMapsForHost: function () { + try { + require("source-map-support").install(); + } + catch (_a) { + // Could not enable source maps. + } + }, + setTimeout: setTimeout, + clearTimeout: clearTimeout, + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, + setBlocking: function () { + if (process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) { + process.stdout._handle.setBlocking(true); + } + } + }; + return nodeSystem; function isFileSystemCaseSensitive() { // win32\win64 are case insensitive platforms if (platform === "win32" || platform === "win64") { @@ -4424,46 +4970,187 @@ var ts; return ch === up ? ch.toLowerCase() : up; }); } - var platform = _os.platform(); - var useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + function getWatchFile() { + switch (tscWatchFile) { + case "PriorityPollingInterval": + // Use polling interval based on priority when create watch using host.watchFile + return fsWatchFile; + case "DynamicPriorityPolling": + // Use polling interval but change the interval depending on file changes and their default polling interval + return createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }); + case "UseFsEvents": + // Use notifications from FS to watch with falling back to fs.watchFile + return watchFileUsingFsWatch; + case "UseFsEventsWithFallbackDynamicPolling": + // Use notifications from FS to watch with falling back to dynamic watch file + dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }); + return createWatchFileUsingDynamicWatchFile(dynamicPollingWatchFile); + case "UseFsEventsOnParentDirectory": + // Use notifications from FS to watch with falling back to fs.watchFile + return createNonPollingWatchFile(); + } + return useNonPollingWatchers ? + createNonPollingWatchFile() : + // Default to do not use polling interval as it is before this experiment branch + function (fileName, callback) { return fsWatchFile(fileName, callback); }; + } + function getWatchDirectory() { + // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows + // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) + var fsSupportsRecursive = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + if (fsSupportsRecursive) { + return watchDirectoryUsingFsWatch; + } + var watchDirectory = tscWatchDirectory === "RecursiveDirectoryUsingFsWatchFile" ? + createWatchDirectoryUsing(fsWatchFile) : + tscWatchDirectory === "RecursiveDirectoryUsingDynamicPriorityPolling" ? + createWatchDirectoryUsing(dynamicPollingWatchFile || createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout })) : + watchDirectoryUsingFsWatch; + var watchDirectoryRecursively = createRecursiveDirectoryWatcher({ + filePathComparer: useCaseSensitiveFileNames ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive, + directoryExists: directoryExists, + getAccessileSortedChildDirectories: function (path) { return getAccessibleFileSystemEntries(path).directories; }, + watchDirectory: watchDirectory + }); + return function (directoryName, callback, recursive) { + if (recursive) { + return watchDirectoryRecursively(directoryName, callback); + } + watchDirectory(directoryName, callback); + }; + } + function createNonPollingWatchFile() { + // One file can have multiple watchers + var fileWatcherCallbacks = ts.createMultiMap(); + var dirWatchers = ts.createMap(); + var toCanonicalName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + return nonPollingWatchFile; + function nonPollingWatchFile(fileName, callback) { + var filePath = toCanonicalName(fileName); + fileWatcherCallbacks.add(filePath, callback); + var dirPath = ts.getDirectoryPath(filePath) || "."; + var watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(ts.getDirectoryPath(fileName) || ".", dirPath); + watcher.referenceCount++; + return { + close: function () { + if (watcher.referenceCount === 1) { + watcher.close(); + dirWatchers.delete(dirPath); + } + else { + watcher.referenceCount--; + } + fileWatcherCallbacks.remove(filePath, callback); + } + }; + } + function createDirectoryWatcher(dirName, dirPath) { + var watcher = fsWatchDirectory(dirName, function (_eventName, relativeFileName) { + // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" + var fileName = !ts.isString(relativeFileName) + ? undefined + : ts.getNormalizedAbsolutePath(relativeFileName, dirName); + // Some applications save a working file via rename operations + var callbacks = fileWatcherCallbacks.get(toCanonicalName(fileName)); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName, FileWatcherEventKind.Changed); + } + } + }); + watcher.referenceCount = 0; + dirWatchers.set(dirPath, watcher); + return watcher; + } + } function fsWatchFile(fileName, callback, pollingInterval) { _fs.watchFile(fileName, { persistent: true, interval: pollingInterval || 250 }, fileChanged); + var eventKind; return { close: function () { return _fs.unwatchFile(fileName, fileChanged); } }; function fileChanged(curr, prev) { - var isCurrZero = +curr.mtime === 0; - var isPrevZero = +prev.mtime === 0; - var created = !isCurrZero && isPrevZero; - var deleted = isCurrZero && !isPrevZero; - var eventKind = created - ? FileWatcherEventKind.Created - : deleted - ? FileWatcherEventKind.Deleted - : FileWatcherEventKind.Changed; - if (eventKind === FileWatcherEventKind.Changed && +curr.mtime <= +prev.mtime) { + // previous event kind check is to ensure we recongnize the file as previously also missing when it is restored or renamed twice (that is it disappears and reappears) + // In such case, prevTime returned is same as prev time of event when file was deleted as per node documentation + var isPreviouslyDeleted = +prev.mtime === 0 || eventKind === FileWatcherEventKind.Deleted; + if (+curr.mtime === 0) { + if (isPreviouslyDeleted) { + // Already deleted file, no need to callback again + return; + } + eventKind = FileWatcherEventKind.Deleted; + } + else if (isPreviouslyDeleted) { + eventKind = FileWatcherEventKind.Created; + } + // If there is no change in modified time, ignore the event + else if (+curr.mtime === +prev.mtime) { return; } + else { + // File changed + eventKind = FileWatcherEventKind.Changed; + } callback(fileName, eventKind); } } - function fsWatchDirectory(directoryName, callback, recursive) { + function createFileWatcherCallback(callback) { + return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); }; + } + function createFsWatchCallbackForFileWatcherCallback(fileName, callback) { + return function (eventName) { + if (eventName === "rename") { + callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted); + } + else { + // Change + callback(fileName, FileWatcherEventKind.Changed); + } + }; + } + function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback) { + return function (eventName, relativeFileName) { + // In watchDirectory we only care about adding and removing files (when event name is + // "rename"); changes made within files are handled by corresponding fileWatchers (when + // event name is "change") + if (eventName === "rename") { + // When deleting a file, the passed baseFileName is null + callback(!relativeFileName ? directoryName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); + } + }; + } + function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingWatchFile, pollingInterval) { var options; - /** Watcher for the directory depending on whether it is missing or present */ - var watcher = !directoryExists(directoryName) ? - watchMissingDirectory() : - watchPresentDirectory(); + /** Watcher for the file system entry depending on whether it is missing or present */ + var watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ? + watchMissingFileSystemEntry() : + watchPresentFileSystemEntry(); return { close: function () { - // Close the watcher (either existing directory watcher or missing directory watcher) + // Close the watcher (either existing file system entry watcher or missing file system entry watcher) watcher.close(); + watcher = undefined; } }; /** - * Watch the directory that is currently present - * and when the watched directory is deleted, switch to missing directory watcher + * Invoke the callback with rename and update the watcher if not closed + * @param createWatcher */ - function watchPresentDirectory() { + function invokeCallbackAndUpdateWatcher(createWatcher) { + // Call the callback for current directory + callback("rename", ""); + // If watcher is not closed, update it + if (watcher) { + watcher.close(); + watcher = createWatcher(); + } + } + /** + * Watch the file or directory that is currently present + * and when the watched file or directory is deleted, switch to missing file system entry watcher + */ + function watchPresentFileSystemEntry() { // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) if (options === undefined) { @@ -4474,34 +5161,56 @@ var ts; options = { persistent: true }; } } - var dirWatcher = _fs.watch(directoryName, options, callback); - dirWatcher.on("error", function () { - if (!directoryExists(directoryName)) { - // Deleting directory - watcher = watchMissingDirectory(); - // Call the callback for current directory - callback("rename", ""); - } - }); - return dirWatcher; + try { + var presentWatcher = _fs.watch(fileOrDirectory, options, callback); + // Watch the missing file or directory or error + presentWatcher.on("error", function () { return invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry); }); + return presentWatcher; + } + catch (e) { + // Catch the exception and use polling instead + // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point + // so instead of throwing error, use fs.watchFile + return watchPresentFileSystemEntryWithFsWatchFile(); + } } /** - * Watch the directory that is missing - * and switch to existing directory when the directory is created + * Watch the file or directory using fs.watchFile since fs.watch threw exception + * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point */ - function watchMissingDirectory() { - return fsWatchFile(directoryName, function (_fileName, eventKind) { - if (eventKind === FileWatcherEventKind.Created && directoryExists(directoryName)) { - watcher.close(); - watcher = watchPresentDirectory(); - // Call the callback for current directory + function watchPresentFileSystemEntryWithFsWatchFile() { + return fallbackPollingWatchFile(fileOrDirectory, createFileWatcherCallback(callback), pollingInterval); + } + /** + * Watch the file or directory that is missing + * and switch to existing file or directory when the missing filesystem entry is created + */ + function watchMissingFileSystemEntry() { + return fallbackPollingWatchFile(fileOrDirectory, function (_fileName, eventKind) { + if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) { + // Call the callback for current file or directory // For now it could be callback for the inner directory creation, // but just return current directory, better than current no-op - callback("rename", ""); + invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry); } - }); + }, pollingInterval); } } + function watchFileUsingFsWatch(fileName, callback, pollingInterval) { + return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback), /*recursive*/ false, fsWatchFile, pollingInterval); + } + function createWatchFileUsingDynamicWatchFile(watchFile) { + return function (fileName, callback, pollingInterval) { return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback), /*recursive*/ false, watchFile, pollingInterval); }; + } + function fsWatchDirectory(directoryName, callback, recursive) { + return fsWatch(directoryName, 1 /* Directory */, callback, !!recursive, fsWatchFile); + } + function watchDirectoryUsingFsWatch(directoryName, callback, recursive) { + return fsWatchDirectory(directoryName, createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback), recursive); + } + function createWatchDirectoryUsing(fsWatchFile) { + return function (directoryName, callback) { return fsWatchFile(directoryName, function () { return callback(directoryName); }, PollingInterval.Medium); }; + } function readFile(fileName, _encoding) { if (!fileExists(fileName)) { return undefined; @@ -4582,11 +5291,6 @@ var ts; function readDirectory(path, extensions, excludes, includes, depth) { return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries); } - var FileSystemEntryKind; - (function (FileSystemEntryKind) { - FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; - FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; - })(FileSystemEntryKind || (FileSystemEntryKind = {})); function fileSystemEntryExists(path, entryKind) { try { var stat = _fs.statSync(path); @@ -4608,114 +5312,27 @@ var ts; function getDirectories(path) { return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1 /* Directory */); }); } - var nodeSystem = { - clearScreen: function () { - process.stdout.write("\x1Bc"); - }, - args: process.argv.slice(2), - newLine: _os.EOL, - useCaseSensitiveFileNames: useCaseSensitiveFileNames, - write: function (s) { - process.stdout.write(s); - }, - readFile: readFile, - writeFile: writeFile, - watchFile: function (fileName, callback, pollingInterval) { - if (useNonPollingWatchers) { - var watchedFile_1 = watchedFileSet.addFile(fileName, callback); - return { - close: function () { return watchedFileSet.removeFile(watchedFile_1); } - }; - } - else { - return fsWatchFile(fileName, callback, pollingInterval); - } - }, - watchDirectory: function (directoryName, callback, recursive) { - // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows - // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) - return fsWatchDirectory(directoryName, function (eventName, relativeFileName) { - // In watchDirectory we only care about adding and removing files (when event name is - // "rename"); changes made within files are handled by corresponding fileWatchers (when - // event name is "change") - if (eventName === "rename") { - // When deleting a file, the passed baseFileName is null - callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); - } - }, recursive); - }, - resolvePath: function (path) { return _path.resolve(path); }, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: function (directoryName) { - if (!nodeSystem.directoryExists(directoryName)) { - _fs.mkdirSync(directoryName); - } - }, - getExecutingFilePath: function () { - return __filename; - }, - getCurrentDirectory: function () { - return process.cwd(); - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return process.env[name] || ""; - }, - readDirectory: readDirectory, - getModifiedTime: function (path) { - try { - return _fs.statSync(path).mtime; - } - catch (e) { - return undefined; - } - }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, - getMemoryUsage: function () { - if (global.gc) { - global.gc(); - } - return process.memoryUsage().heapUsed; - }, - getFileSize: function (path) { - try { - var stat = _fs.statSync(path); - if (stat.isFile()) { - return stat.size; - } - } - catch (_a) { } - return 0; - }, - exit: function (exitCode) { - process.exit(exitCode); - }, - realpath: function (path) { - try { - return _fs.realpathSync(path); - } - catch (_a) { - return path; - } - }, - debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), - tryEnableSourceMapsForHost: function () { - try { - require("source-map-support").install(); - } - catch (_a) { - // Could not enable source maps. - } - }, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }; - return nodeSystem; + function getModifiedTime(path) { + try { + return _fs.statSync(path).mtime; + } + catch (e) { + return undefined; + } + } + /** + * djb2 hashing algorithm + * http://www.cse.yorku.ca/~oz/hash.html + */ + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } } function getChakraSystem() { var realpath = ChakraHost.realpath && (function (path) { return ChakraHost.realpath(path); }); @@ -4784,6 +5401,7 @@ var ts; return sys; })(); if (ts.sys && ts.sys.getEnvironmentVariable) { + setCustomPollingValues(ts.sys); ts.Debug.currentAssertionLevel = /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */; @@ -5040,6 +5658,7 @@ var ts; unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -5298,6 +5917,7 @@ var ts; Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5380,6 +6000,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5451,7 +6072,7 @@ var ts; Exported_type_alias_0_has_or_is_using_private_name_1: diag(4081, ts.DiagnosticCategory.Error, "Exported_type_alias_0_has_or_is_using_private_name_1_4081", "Exported type alias '{0}' has or is using private name '{1}'."), Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, ts.DiagnosticCategory.Error, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."), Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."), - Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, ts.DiagnosticCategory.Message, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."), + Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, ts.DiagnosticCategory.Error, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."), Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, ts.DiagnosticCategory.Error, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."), Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, ts.DiagnosticCategory.Error, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."), Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, ts.DiagnosticCategory.Error, "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094", "Property '{0}' of exported class expression may not be private or protected."), @@ -5624,7 +6245,7 @@ var ts; Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: diag(6144, ts.DiagnosticCategory.Message, "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", "Module '{0}' was resolved as locally declared ambient module in file '{1}'."), Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: diag(6145, ts.DiagnosticCategory.Message, "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."), Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: diag(6146, ts.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."), - Resolution_for_module_0_was_found_in_cache: diag(6147, ts.DiagnosticCategory.Message, "Resolution_for_module_0_was_found_in_cache_6147", "Resolution for module '{0}' was found in cache."), + Resolution_for_module_0_was_found_in_cache_from_location_1: diag(6147, ts.DiagnosticCategory.Message, "Resolution_for_module_0_was_found_in_cache_from_location_1_6147", "Resolution for module '{0}' was found in cache from location '{1}'."), Directory_0_does_not_exist_skipping_all_lookups_in_it: diag(6148, ts.DiagnosticCategory.Message, "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", "Directory '{0}' does not exist, skipping all lookups in it."), Show_diagnostic_information: diag(6149, ts.DiagnosticCategory.Message, "Show_diagnostic_information_6149", "Show diagnostic information."), Show_verbose_diagnostic_information: diag(6150, ts.DiagnosticCategory.Message, "Show_verbose_diagnostic_information_6150", "Show verbose diagnostic information."), @@ -5668,6 +6289,8 @@ var ts; Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), + Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, ts.DiagnosticCategory.Message, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."), + All_imports_in_import_declaration_are_unused: diag(6192, ts.DiagnosticCategory.Error, "All_imports_in_import_declaration_are_unused_6192", "All imports in import declaration are unused."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -5727,6 +6350,7 @@ var ts; Expected_0_type_arguments_provide_these_with_an_extends_tag: diag(8026, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026", "Expected {0} type arguments; provide these with an '@extends' tag."), Expected_0_1_type_arguments_provide_these_with_an_extends_tag: diag(8027, ts.DiagnosticCategory.Error, "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027", "Expected {0}-{1} type arguments; provide these with an '@extends' tag."), JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: diag(8028, ts.DiagnosticCategory.Error, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."), + JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, ts.DiagnosticCategory.Error, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: diag(9002, ts.DiagnosticCategory.Error, "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause."), class_expressions_are_not_currently_supported: diag(9003, ts.DiagnosticCategory.Error, "class_expressions_are_not_currently_supported_9003", "'class' expressions are not currently supported."), Language_service_is_disabled: diag(9004, ts.DiagnosticCategory.Error, "Language_service_is_disabled_9004", "Language service is disabled."), @@ -5747,14 +6371,20 @@ var ts; JSX_fragment_has_no_corresponding_closing_tag: diag(17014, ts.DiagnosticCategory.Error, "JSX_fragment_has_no_corresponding_closing_tag_17014", "JSX fragment has no corresponding closing tag."), Expected_corresponding_closing_tag_for_JSX_fragment: diag(17015, ts.DiagnosticCategory.Error, "Expected_corresponding_closing_tag_for_JSX_fragment_17015", "Expected corresponding closing tag for JSX fragment."), JSX_fragment_is_not_supported_when_using_jsxFactory: diag(17016, ts.DiagnosticCategory.Error, "JSX_fragment_is_not_supported_when_using_jsxFactory_17016", "JSX fragment is not supported when using --jsxFactory"), + JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma: diag(17017, ts.DiagnosticCategory.Error, "JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma_17017", "JSX fragment is not supported when using an inline JSX factory pragma"), Circularity_detected_while_resolving_configuration_Colon_0: diag(18000, ts.DiagnosticCategory.Error, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"), A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: diag(18001, ts.DiagnosticCategory.Error, "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", "A path in an 'extends' option must be relative or rooted, but '{0}' is not."), The_files_list_in_config_file_0_is_empty: diag(18002, ts.DiagnosticCategory.Error, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."), No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, ts.DiagnosticCategory.Error, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."), + File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module: diag(80001, ts.DiagnosticCategory.Suggestion, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module_80001", "File is a CommonJS module; it may be converted to an ES6 module."), + This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, ts.DiagnosticCategory.Suggestion, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."), + Import_may_be_converted_to_a_default_import: diag(80003, ts.DiagnosticCategory.Suggestion, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."), + JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, ts.DiagnosticCategory.Suggestion, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."), Add_missing_super_call: diag(90001, ts.DiagnosticCategory.Message, "Add_missing_super_call_90001", "Add missing 'super()' call"), Make_super_call_the_first_statement_in_the_constructor: diag(90002, ts.DiagnosticCategory.Message, "Make_super_call_the_first_statement_in_the_constructor_90002", "Make 'super()' call the first statement in the constructor"), Change_extends_to_implements: diag(90003, ts.DiagnosticCategory.Message, "Change_extends_to_implements_90003", "Change 'extends' to 'implements'"), Remove_declaration_for_Colon_0: diag(90004, ts.DiagnosticCategory.Message, "Remove_declaration_for_Colon_0_90004", "Remove declaration for: '{0}'"), + Remove_import_from_0: diag(90005, ts.DiagnosticCategory.Message, "Remove_import_from_0_90005", "Remove import from '{0}'"), Implement_interface_0: diag(90006, ts.DiagnosticCategory.Message, "Implement_interface_0_90006", "Implement interface '{0}'"), Implement_inherited_abstract_class: diag(90007, ts.DiagnosticCategory.Message, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"), Add_this_to_unresolved_variable: diag(90008, ts.DiagnosticCategory.Message, "Add_this_to_unresolved_variable_90008", "Add 'this.' to unresolved variable"), @@ -5791,6 +6421,9 @@ var ts; Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), + Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), + Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), + Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), }; })(ts || (ts = {})); /// @@ -5831,47 +6464,48 @@ var ts; "false": 86 /* FalseKeyword */, "finally": 87 /* FinallyKeyword */, "for": 88 /* ForKeyword */, - "from": 141 /* FromKeyword */, + "from": 142 /* FromKeyword */, "function": 89 /* FunctionKeyword */, "get": 125 /* GetKeyword */, "if": 90 /* IfKeyword */, "implements": 108 /* ImplementsKeyword */, "import": 91 /* ImportKeyword */, "in": 92 /* InKeyword */, + "infer": 126 /* InferKeyword */, "instanceof": 93 /* InstanceOfKeyword */, "interface": 109 /* InterfaceKeyword */, - "is": 126 /* IsKeyword */, - "keyof": 127 /* KeyOfKeyword */, + "is": 127 /* IsKeyword */, + "keyof": 128 /* KeyOfKeyword */, "let": 110 /* LetKeyword */, - "module": 128 /* ModuleKeyword */, - "namespace": 129 /* NamespaceKeyword */, - "never": 130 /* NeverKeyword */, + "module": 129 /* ModuleKeyword */, + "namespace": 130 /* NamespaceKeyword */, + "never": 131 /* NeverKeyword */, "new": 94 /* NewKeyword */, "null": 95 /* NullKeyword */, - "number": 133 /* NumberKeyword */, - "object": 134 /* ObjectKeyword */, + "number": 134 /* NumberKeyword */, + "object": 135 /* ObjectKeyword */, "package": 111 /* PackageKeyword */, "private": 112 /* PrivateKeyword */, "protected": 113 /* ProtectedKeyword */, "public": 114 /* PublicKeyword */, - "readonly": 131 /* ReadonlyKeyword */, - "require": 132 /* RequireKeyword */, - "global": 142 /* GlobalKeyword */, + "readonly": 132 /* ReadonlyKeyword */, + "require": 133 /* RequireKeyword */, + "global": 143 /* GlobalKeyword */, "return": 96 /* ReturnKeyword */, - "set": 135 /* SetKeyword */, + "set": 136 /* SetKeyword */, "static": 115 /* StaticKeyword */, - "string": 136 /* StringKeyword */, + "string": 137 /* StringKeyword */, "super": 97 /* SuperKeyword */, "switch": 98 /* SwitchKeyword */, - "symbol": 137 /* SymbolKeyword */, + "symbol": 138 /* SymbolKeyword */, "this": 99 /* ThisKeyword */, "throw": 100 /* ThrowKeyword */, "true": 101 /* TrueKeyword */, "try": 102 /* TryKeyword */, - "type": 138 /* TypeKeyword */, + "type": 139 /* TypeKeyword */, "typeof": 103 /* TypeOfKeyword */, - "undefined": 139 /* UndefinedKeyword */, - "unique": 140 /* UniqueKeyword */, + "undefined": 140 /* UndefinedKeyword */, + "unique": 141 /* UniqueKeyword */, "var": 104 /* VarKeyword */, "void": 105 /* VoidKeyword */, "while": 106 /* WhileKeyword */, @@ -5879,7 +6513,7 @@ var ts; "yield": 116 /* YieldKeyword */, "async": 120 /* AsyncKeyword */, "await": 121 /* AwaitKeyword */, - "of": 143 /* OfKeyword */, + "of": 144 /* OfKeyword */, "{": 17 /* OpenBraceToken */, "}": 18 /* CloseBraceToken */, "(": 19 /* OpenParenToken */, @@ -6070,7 +6704,9 @@ var ts; ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -7816,7 +8452,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269 /* SourceFile */) { + while (node && node.kind !== 272 /* SourceFile */) { node = node.parent; } return node; @@ -7824,11 +8460,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return true; } return false; @@ -7937,7 +8573,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 290 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 293 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -7952,18 +8588,15 @@ var ts; ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } - if (nodeIsMissing(node)) { - return ""; - } - var text = sourceFile.text; - return text.substring(includeTrivia ? node.pos : ts.skipTrivia(text, node.pos), node.end); + return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia); } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; - function getTextOfNodeFromSourceText(sourceText, node) { + function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { + if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { return ""; } - return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); + return sourceText.substring(includeTrivia ? node.pos : ts.skipTrivia(sourceText, node.pos), node.end); } ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; function getTextOfNode(node, includeTrivia) { @@ -8054,12 +8687,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 /* VariableDeclaration */ && node.parent.kind === 264 /* CatchClause */; + return node.kind === 230 /* VariableDeclaration */ && node.parent.kind === 267 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 /* ModuleDeclaration */ && - (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); + return ts.isModuleDeclaration(node) && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; function isModuleWithStringLiteralName(node) { @@ -8077,11 +8709,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 234 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 237 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 /* SourceFile */ || - node.kind === 234 /* ModuleDeclaration */ || + return node.kind === 272 /* SourceFile */ || + node.kind === 237 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -8090,43 +8722,44 @@ var ts; } ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; function isExternalModuleAugmentation(node) { + return isAmbientModule(node) && isModuleAugmentationExternal(node); + } + ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isModuleAugmentationExternal(node) { // external module augmentation is a ambient module declaration that is either: // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module - if (!node || !isAmbientModule(node)) { - return false; - } switch (node.parent.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node.parent); - case 235 /* ModuleBlock */: - return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); + case 238 /* ModuleBlock */: + return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; } - ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + ts.isModuleAugmentationExternal = isModuleAugmentationExternal; function isEffectiveExternalModule(node, compilerOptions) { return ts.isExternalModule(node) || compilerOptions.isolatedModules || ((ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS) && !!node.commonJsModuleIndicator); } ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 264 /* CatchClause */: - case 234 /* ModuleDeclaration */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 267 /* CatchClause */: + case 237 /* ModuleDeclaration */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; - case 208 /* Block */: + case 211 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !ts.isFunctionLike(parentNode); @@ -8136,25 +8769,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: ts.assertTypeIsNever(node); @@ -8164,8 +8797,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: return true; default: return false; @@ -8202,21 +8835,20 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return escapeLeadingUnderscores(name.text); - case 145 /* ComputedPropertyName */: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146 /* ComputedPropertyName */: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -8226,11 +8858,21 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile; + function createDiagnosticForNodeSpan(sourceFile, startNode, endNode, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, startNode.pos); + return ts.createFileDiagnostic(sourceFile, start, endNode.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeSpan = createDiagnosticForNodeSpan; function createDiagnosticForNodeFromMessageChain(node, messageChain) { var sourceFile = getSourceFileOfNode(node); var span = getErrorSpanForNode(sourceFile, node); @@ -8253,7 +8895,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208 /* Block */) { + if (node.body && node.body.kind === 211 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -8267,7 +8909,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -8276,23 +8918,23 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 232 /* TypeAliasDeclaration */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -8300,9 +8942,19 @@ var ts; // construct. return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + // These asserts should all be satisfied for a properly constructed `errorNode`. + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -8311,7 +8963,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */ && isConst(node); + return node.kind === 236 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -8324,15 +8976,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 /* ExpressionStatement */ + return node.kind === 214 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -8341,11 +8993,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 /* Parameter */ || - node.kind === 146 /* TypeParameter */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 188 /* ArrowFunction */ || - node.kind === 186 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 148 /* Parameter */ || + node.kind === 147 /* TypeParameter */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 191 /* ArrowFunction */ || + node.kind === 189 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -8361,40 +9013,42 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 /* FirstTypeNode */ <= node.kind && node.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= node.kind && node.kind <= 177 /* LastTypeNode */) { return true; } switch (node.kind) { case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: + case 138 /* SymbolKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: return true; case 105 /* VoidKeyword */: - return node.parent.kind !== 191 /* VoidExpression */; - case 202 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 194 /* VoidExpression */; + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147 /* TypeParameter */: + return node.parent.kind === 176 /* MappedType */ || node.parent.kind === 171 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 71 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */ || node.kind === 180 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */ || node.kind === 183 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 144 /* QualifiedName */: - case 180 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: var parent = node.parent; - if (parent.kind === 163 /* TypeQuery */) { + if (parent.kind === 164 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -8403,38 +9057,38 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (159 /* FirstTypeNode */ <= parent.kind && parent.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= parent.kind && parent.kind <= 177 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return node === parent.constraint; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: return node === parent.type; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node === parent.type; - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return node === parent.type; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return node === parent.type; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -8458,23 +9112,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitor(node); - case 236 /* CaseBlock */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 223 /* LabeledStatement */: - case 225 /* TryStatement */: - case 264 /* CatchClause */: + case 239 /* CaseBlock */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -8484,30 +9138,29 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(name.expression); + traverse(node.name.expression); return; } } @@ -8527,10 +9180,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 165 /* ArrayType */) { + if (node && node.kind === 166 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 160 /* TypeReference */) { + else if (node && node.kind === 161 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -8540,12 +9193,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 164 /* TypeLiteral */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 165 /* TypeLiteral */: return node.members; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.properties; } } @@ -8553,14 +9206,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177 /* BindingElement */: - case 268 /* EnumMember */: - case 147 /* Parameter */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 266 /* ShorthandPropertyAssignment */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 271 /* EnumMember */: + case 148 /* Parameter */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 269 /* ShorthandPropertyAssignment */: + case 230 /* VariableDeclaration */: return true; } } @@ -8568,8 +9221,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 /* VariableDeclarationList */ - && node.parent.parent.kind === 209 /* VariableStatement */; + return node.parent.kind === 231 /* VariableDeclarationList */ + && node.parent.parent.kind === 212 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -8580,13 +9233,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return true; } return false; @@ -8597,7 +9250,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223 /* LabeledStatement */) { + if (node.statement.kind !== 226 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -8605,17 +9258,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 211 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 /* MethodDeclaration */ && node.parent.kind === 179 /* ObjectLiteralExpression */; + return node && node.kind === 153 /* MethodDeclaration */ && node.parent.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 /* MethodDeclaration */ && - (node.parent.kind === 179 /* ObjectLiteralExpression */ || - node.parent.kind === 200 /* ClassExpression */); + return node.kind === 153 /* MethodDeclaration */ && + (node.parent.kind === 182 /* ObjectLiteralExpression */ || + node.parent.kind === 203 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -8628,7 +9281,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265 /* PropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -8650,7 +9303,7 @@ var ts; return undefined; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -8665,9 +9318,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8678,26 +9331,26 @@ var ts; node = node.parent; } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 234 /* ModuleDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 233 /* EnumDeclaration */: - case 269 /* SourceFile */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 237 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 236 /* EnumDeclaration */: + case 272 /* SourceFile */: return node; } } @@ -8707,9 +9360,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return container; } } @@ -8731,27 +9384,27 @@ var ts; return node; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: node = node.parent; break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8767,14 +9420,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */) { + if (func.kind === 190 /* FunctionExpression */ || func.kind === 191 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 186 /* ParenthesizedExpression */) { + while (parent.kind === 189 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 185 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -8785,7 +9438,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 97 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -8794,57 +9447,58 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 99 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { - return node.tag; + switch (node.kind) { + case 187 /* TaggedTemplateExpression */: + return node.tag; + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - // Will either be a CallExpression, NewExpression, or Decorator. - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // classes are valid targets return true; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 230 /* ClassDeclaration */; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + return parent.kind === 233 /* ClassDeclaration */; + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 230 /* ClassDeclaration */; - case 147 /* Parameter */: + && parent.kind === 233 /* ClassDeclaration */; + case 148 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 153 /* Constructor */ - || parent.kind === 152 /* MethodDeclaration */ - || parent.kind === 155 /* SetAccessor */) - && grandparent.kind === 230 /* ClassDeclaration */; + && (parent.kind === 154 /* Constructor */ + || parent.kind === 153 /* MethodDeclaration */ + || parent.kind === 156 /* SetAccessor */) + && grandparent.kind === 233 /* ClassDeclaration */; } return false; } @@ -8860,19 +9514,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152 /* MethodDeclaration */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 156 /* SetAccessor */: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 /* JsxOpeningElement */ || - parent.kind === 251 /* JsxSelfClosingElement */ || - parent.kind === 253 /* JsxClosingElement */) { + if (parent.kind === 255 /* JsxOpeningElement */ || + parent.kind === 254 /* JsxSelfClosingElement */ || + parent.kind === 256 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -8885,45 +9539,45 @@ var ts; case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 12 /* RegularExpressionLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 203 /* AsExpression */: - case 185 /* TypeAssertionExpression */: - case 204 /* NonNullExpression */: - case 186 /* ParenthesizedExpression */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 199 /* SpreadElement */: - case 197 /* TemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 206 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 207 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 202 /* SpreadElement */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: - case 201 /* OmittedExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 198 /* YieldExpression */: - case 192 /* AwaitExpression */: - case 205 /* MetaProperty */: + case 204 /* OmittedExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 201 /* YieldExpression */: + case 195 /* AwaitExpression */: + case 208 /* MetaProperty */: return true; - case 144 /* QualifiedName */: - while (node.parent.kind === 144 /* QualifiedName */) { + case 145 /* QualifiedName */: + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node); case 71 /* Identifier */: - if (node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -8939,47 +9593,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 180 /* BindingElement */: return parent.initializer === node; - case 211 /* ExpressionStatement */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 220 /* ReturnStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 224 /* ThrowStatement */: + case 214 /* ExpressionStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 223 /* ReturnStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 227 /* ThrowStatement */: return parent.expression === node; - case 215 /* ForStatement */: + case 218 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forInStatement.expression === node; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return node === parent.expression; - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return node === parent.expression; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return node === parent.expression; - case 148 /* Decorator */: - case 260 /* JsxExpression */: - case 259 /* JsxSpreadAttribute */: - case 267 /* SpreadAssignment */: + case 149 /* Decorator */: + case 263 /* JsxExpression */: + case 262 /* JsxSpreadAttribute */: + case 270 /* SpreadAssignment */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -8987,7 +9641,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -8996,7 +9650,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 252 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -9016,11 +9670,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 /* StringKeyword */ || node.typeArguments[0].kind === 133 /* NumberKeyword */); + (node.typeArguments[0].kind === 137 /* StringKeyword */ || node.typeArguments[0].kind === 134 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182 /* CallExpression */) { + if (callExpression.kind !== 185 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -9043,17 +9697,117 @@ var ts; } ts.isStringDoubleQuoted = isStringDoubleQuoted; /** - * Returns true if the node is a variable declaration whose initializer is a function or class expression. - * This function does not test if the node is in a JavaScript file or not. + * Given the symbol of a declaration, find the symbol of its Javascript container-like initializer, + * if it has one. Otherwise just return the original symbol. + * + * Container-like initializer behave like namespaces, so the binder needs to add contained symbols + * to their exports. An example is a function with assignments to `this` inside. */ - function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227 /* VariableDeclaration */) { - var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 /* FunctionExpression */ || declaration.initializer.kind === 200 /* ClassExpression */); + function getJSInitializerSymbol(symbol) { + if (!symbol || !symbol.valueDeclaration) { + return symbol; + } + var declaration = symbol.valueDeclaration; + var e = getDeclaredJavascriptInitializer(declaration) || getAssignedJavascriptInitializer(declaration); + return e && e.symbol ? e.symbol : symbol; + } + ts.getJSInitializerSymbol = getJSInitializerSymbol; + /** Get the declaration initializer, when the initializer is container-like (See getJavascriptInitializer) */ + function getDeclaredJavascriptInitializer(node) { + if (node && ts.isVariableDeclaration(node) && node.initializer) { + return getJavascriptInitializer(node.initializer, /*isPrototypeAssignment*/ false) || + ts.isIdentifier(node.name) && getDefaultedJavascriptInitializer(node.name, node.initializer, /*isPrototypeAssignment*/ false); + } + } + ts.getDeclaredJavascriptInitializer = getDeclaredJavascriptInitializer; + /** + * Get the assignment 'initializer' -- the righthand side-- when the initializer is container-like (See getJavascriptInitializer). + * We treat the right hand side of assignments with container-like initalizers as declarations. + */ + function getAssignedJavascriptInitializer(node) { + if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 /* EqualsToken */) { + var isPrototypeAssignment = ts.isPropertyAccessExpression(node.parent.left) && node.parent.left.name.escapedText === "prototype"; + return getJavascriptInitializer(node.parent.right, isPrototypeAssignment) || + getDefaultedJavascriptInitializer(node.parent.left, node.parent.right, isPrototypeAssignment); + } + } + ts.getAssignedJavascriptInitializer = getAssignedJavascriptInitializer; + /** + * Recognized Javascript container-like initializers are: + * 1. (function() {})() -- IIFEs + * 2. function() { } -- Function expressions + * 3. class { } -- Class expressions + * 4. {} -- Empty object literals + * 5. { ... } -- Non-empty object literals, when used to initialize a prototype, like `C.prototype = { m() { } }` + * + * This function returns the provided initializer, or undefined if it is not valid. + */ + function getJavascriptInitializer(initializer, isPrototypeAssignment) { + if (ts.isCallExpression(initializer)) { + var e = skipParentheses(initializer.expression); + return e.kind === 190 /* FunctionExpression */ || e.kind === 191 /* ArrowFunction */ ? initializer : undefined; + } + if (initializer.kind === 190 /* FunctionExpression */ || initializer.kind === 203 /* ClassExpression */) { + return initializer; + } + if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { + return initializer; + } + } + ts.getJavascriptInitializer = getJavascriptInitializer; + /** + * A defaulted Javascript initializer matches the pattern + * `Lhs = Lhs || JavascriptInitializer` + * or `var Lhs = Lhs || JavascriptInitializer` + * + * The second Lhs is required to be the same as the first except that it may be prefixed with + * 'window.', 'global.' or 'self.' The second Lhs is otherwise ignored by the binder and checker. + */ + function getDefaultedJavascriptInitializer(name, initializer, isPrototypeAssignment) { + var e = ts.isBinaryExpression(initializer) && initializer.operatorToken.kind === 54 /* BarBarToken */ && getJavascriptInitializer(initializer.right, isPrototypeAssignment); + if (e && isSameEntityName(name, initializer.left)) { + return e; + } + } + /** Given a Javascript initializer, return the outer name. That is, the lhs of the assignment or the declaration name. */ + function getOuterNameOfJsInitializer(node) { + if (ts.isBinaryExpression(node.parent)) { + var parent = (node.parent.operatorToken.kind === 54 /* BarBarToken */ && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent; + if (parent.operatorToken.kind === 58 /* EqualsToken */ && ts.isIdentifier(parent.left)) { + return parent.left; + } + } + else if (ts.isVariableDeclaration(node.parent)) { + return node.parent.name; + } + } + ts.getOuterNameOfJsInitializer = getOuterNameOfJsInitializer; + /** + * Is the 'declared' name the same as the one in the initializer? + * @return true for identical entity names, as well as ones where the initializer is prefixed with + * 'window', 'self' or 'global'. For example: + * + * var my = my || {} + * var min = window.min || {} + * my.app = self.my.app || class { } + */ + function isSameEntityName(name, initializer) { + if (ts.isIdentifier(name) && ts.isIdentifier(initializer)) { + return name.escapedText === initializer.escapedText; + } + if (ts.isIdentifier(name) && ts.isPropertyAccessExpression(initializer)) { + return (initializer.expression.kind === 99 /* ThisKeyword */ || + ts.isIdentifier(initializer.expression) && + (initializer.expression.escapedText === "window" || + initializer.expression.escapedText === "self" || + initializer.expression.escapedText === "global")) && + isSameEntityName(name, initializer.name); + } + if (ts.isPropertyAccessExpression(name) && ts.isPropertyAccessExpression(initializer)) { + return name.name.escapedText === initializer.name.escapedText && isSameEntityName(name.expression, initializer.expression); } return false; } - ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, /*excludeCompoundAssignements*/ true)) { node = node.right; @@ -9072,65 +9826,62 @@ var ts; /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property /// assignments we treat as special in the binder function getSpecialPropertyAssignmentKind(expr) { - if (!isInJavaScriptFile(expr)) { - return 0 /* None */; - } - if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 180 /* PropertyAccessExpression */) { + if (!isInJavaScriptFile(expr) || + expr.operatorToken.kind !== 58 /* EqualsToken */ || + !ts.isPropertyAccessExpression(expr.left)) { return 0 /* None */; } var lhs = expr.left; - if (lhs.expression.kind === 71 /* Identifier */) { - var lhsId = lhs.expression; - if (lhsId.escapedText === "exports") { - // exports.name = expr - return 1 /* ExportsProperty */; - } - else if (lhsId.escapedText === "module" && lhs.name.escapedText === "exports") { - // module.exports = expr - return 2 /* ModuleExports */; - } - else { - // F.x = expr - return 5 /* Property */; - } - } - else if (lhs.expression.kind === 99 /* ThisKeyword */) { + if (lhs.expression.kind === 99 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 180 /* PropertyAccessExpression */) { - // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part - var innerPropertyAccess = lhs.expression; - if (innerPropertyAccess.expression.kind === 71 /* Identifier */) { - // module.exports.name = expr - var innerPropertyAccessIdentifier = innerPropertyAccess.expression; - if (innerPropertyAccessIdentifier.escapedText === "module" && innerPropertyAccess.name.escapedText === "exports") { - return 1 /* ExportsProperty */; - } - if (innerPropertyAccess.name.escapedText === "prototype") { - return 3 /* PrototypeProperty */; - } + else if (ts.isIdentifier(lhs.expression) && lhs.expression.escapedText === "module" && lhs.name.escapedText === "exports") { + // module.exports = expr + return 2 /* ModuleExports */; + } + else if (isEntityNameExpression(lhs.expression)) { + if (lhs.name.escapedText === "prototype" && ts.isObjectLiteralExpression(expr.right)) { + // F.prototype = { ... } + return 6 /* Prototype */; } + else if (ts.isPropertyAccessExpression(lhs.expression) && lhs.expression.name.escapedText === "prototype") { + // F.G....prototype.x = expr + return 3 /* PrototypeProperty */; + } + var nextToLast = lhs; + while (ts.isPropertyAccessExpression(nextToLast.expression)) { + nextToLast = nextToLast.expression; + } + ts.Debug.assert(ts.isIdentifier(nextToLast.expression)); + var id = nextToLast.expression; + if (id.escapedText === "exports" || + id.escapedText === "module" && nextToLast.name.escapedText === "exports") { + // exports.name = expr OR module.exports.name = expr + return 1 /* ExportsProperty */; + } + // F.G...x = expr + return 5 /* Property */; } return 0 /* None */; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 214 /* ExpressionStatement */ && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 238 /* ImportEqualsDeclaration */) { + if (node.kind === 241 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 249 /* ExternalModuleReference */) { + if (reference.kind === 252 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 245 /* ExportDeclaration */) { + if (node.kind === 248 /* ExportDeclaration */) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -9139,31 +9890,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238 /* ImportEqualsDeclaration */) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241 /* NamespaceImport */) { - return importClause.namedBindings; + switch (node.kind) { + case 242 /* ImportDeclaration */: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241 /* ImportEqualsDeclaration */: + return node; + case 248 /* ExportDeclaration */: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 /* ImportDeclaration */ - && node.importClause - && !!node.importClause.name; + return node.kind === 242 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147 /* Parameter */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 266 /* ShorthandPropertyAssignment */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 269 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -9171,7 +9923,7 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 /* JSDocFunctionType */ && + return node.kind === 280 /* JSDocFunctionType */ && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; @@ -9183,22 +9935,32 @@ var ts; node.expression.operatorToken.kind === 58 /* EqualsToken */ && node.expression.right; } - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSourceOfDefaultedAssignment(node) { + return ts.isExpressionStatement(node) && + ts.isBinaryExpression(node.expression) && + getSpecialPropertyAssignmentKind(node.expression) !== 0 /* None */ && + ts.isBinaryExpression(node.expression.right) && + node.expression.right.operatorToken.kind === 54 /* BarBarToken */ && + node.expression.right.right; } - function getSingleVariableOfVariableStatement(node, child) { + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212 /* VariableStatement */: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151 /* PropertyDeclaration */: + return node.initializer; + } + } + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } function getNestedModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && + return node.kind === 237 /* ModuleDeclaration */ && node.body && - node.body.kind === 234 /* ModuleDeclaration */ && + node.body.kind === 237 /* ModuleDeclaration */ && node.body; } function getJSDocCommentsAndTags(node) { @@ -9207,7 +9969,7 @@ var ts; return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 /* PropertyAssignment */ || parent.kind === 151 /* PropertyDeclaration */ || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. @@ -9217,18 +9979,19 @@ var ts; // */ // var x = function(name) { return name.length; } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && + (getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node || getSourceOfDefaultedAssignment(parent.parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 /* None */ || - node.kind === 180 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 211 /* ExpressionStatement */) { + node.kind === 183 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 214 /* ExpressionStatement */) { getJSDocCommentsAndTagsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { @@ -9259,8 +10022,9 @@ var ts; ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); - var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + var decl = getSourceOfDefaultedAssignment(host) || + getSourceOfAssignment(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -9268,7 +10032,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 282 /* JSDocComment */); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -9297,30 +10061,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 43 /* PlusPlusToken */ || unaryOperator === 44 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 186 /* ParenthesizedExpression */: - case 178 /* ArrayLiteralExpression */: - case 199 /* SpreadElement */: + case 189 /* ParenthesizedExpression */: + case 181 /* ArrayLiteralExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: node = parent; break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -9347,22 +10112,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 208 /* Block */: - case 209 /* VariableStatement */: - case 221 /* WithStatement */: - case 212 /* IfStatement */: - case 222 /* SwitchStatement */: - case 236 /* CaseBlock */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 223 /* LabeledStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 225 /* TryStatement */: - case 264 /* CatchClause */: + case 211 /* Block */: + case 212 /* VariableStatement */: + case 224 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: return true; } return false; @@ -9375,20 +10140,27 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169 /* ParenthesizedType */); + return walkUp(node, 172 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186 /* ParenthesizedExpression */); + return walkUp(node, 189 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; + function skipParentheses(node) { + while (node.kind === 189 /* ParenthesizedExpression */) { + node = node.expression; + } + return node; + } + ts.skipParentheses = skipParentheses; // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189 /* DeleteExpression */; + return node && node.kind === 192 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -9400,16 +10172,9 @@ var ts; return false; } ts.isNodeDescendantOf = isNodeDescendantOf; - // True if the given identifier, string literal, or number literal is the name of a declaration node + // True if `name` is the name of a declaration node function isDeclarationName(name) { - switch (name.kind) { - case 71 /* Identifier */: - case 9 /* StringLiteral */: - case 8 /* NumericLiteral */: - return ts.isDeclaration(name.parent) && name.parent.name === name; - default: - return false; - } + return !ts.isSourceFile(name) && !ts.isBindingPattern(name) && ts.isDeclaration(name.parent) && name.parent.name === name; } ts.isDeclarationName = isDeclarationName; // See GH#16030 @@ -9430,7 +10195,7 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 145 /* ComputedPropertyName */ && + node.parent.kind === 146 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -9438,32 +10203,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 180 /* PropertyAccessExpression */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 183 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 144 /* QualifiedName */) { + while (parent.kind === 145 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 163 /* TypeQuery */; + return parent.kind === 164 /* TypeQuery */; } return false; - case 177 /* BindingElement */: - case 243 /* ImportSpecifier */: + case 180 /* BindingElement */: + case 246 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 247 /* ExportSpecifier */: - case 257 /* JsxAttribute */: + case 250 /* ExportSpecifier */: + case 260 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -9479,13 +10244,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 237 /* NamespaceExportDeclaration */ || - node.kind === 240 /* ImportClause */ && !!node.name || - node.kind === 241 /* NamespaceImport */ || - node.kind === 243 /* ImportSpecifier */ || - node.kind === 247 /* ExportSpecifier */ || - node.kind === 244 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 240 /* NamespaceExportDeclaration */ || + node.kind === 243 /* ImportClause */ && !!node.name || + node.kind === 244 /* NamespaceImport */ || + node.kind === 246 /* ImportSpecifier */ || + node.kind === 250 /* ExportSpecifier */ || + node.kind === 247 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -9536,44 +10301,12 @@ var ts; return undefined; } ts.getAncestor = getAncestor; - function getFileReferenceFromReferencePath(comment, commentRange) { - var simpleReferenceRegEx = /^\/\/\/\s*= 48 /* _0 */ && lookAhead <= 57 /* _9 */) { + // If the null character is followed by digits, print as a hex escape to prevent the result from parsing as an octal (which is forbidden in strict mode) + return "\\x00"; + } + // Otherwise, keep printing a literal \0 for the null character + return "\\0"; + } return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); } function isIntrinsicJsxName(name) { @@ -10268,7 +10984,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -10314,10 +11030,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 155 /* SetAccessor */) { + else if (accessor.kind === 156 /* SetAccessor */) { setAccessor = accessor; } else { @@ -10326,7 +11042,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 /* GetAccessor */ || member.kind === 155 /* SetAccessor */) + if ((member.kind === 155 /* GetAccessor */ || member.kind === 156 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -10337,10 +11053,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 /* GetAccessor */ && !getAccessor) { + if (member.kind === 155 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 155 /* SetAccessor */ && !setAccessor) { + if (member.kind === 156 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -10359,49 +11075,38 @@ var ts; * Gets the effective type annotation of a variable, parameter, or property. If the node was * parsed in a JavaScript file, gets the type annotation from JSDoc. */ - function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (ts.hasType(node)) { - return node.type; - } - if (checkJSDoc || isInJavaScriptFile(node)) { - return ts.getJSDocType(node); - } + function getEffectiveTypeAnnotationNode(node) { + return node.type || (isInJavaScriptFile(node) ? ts.getJSDocType(node) : undefined); } ts.getEffectiveTypeAnnotationNode = getEffectiveTypeAnnotationNode; /** * Gets the effective return type annotation of a signature. If the node was parsed in a * JavaScript file, gets the return type annotation from JSDoc. */ - function getEffectiveReturnTypeNode(node, checkJSDoc) { - if (node.type) { - return node.type; - } - if (checkJSDoc || isInJavaScriptFile(node)) { - return ts.getJSDocReturnType(node); - } + function getEffectiveReturnTypeNode(node) { + return node.type || (isInJavaScriptFile(node) ? ts.getJSDocReturnType(node) : undefined); } ts.getEffectiveReturnTypeNode = getEffectiveReturnTypeNode; /** * Gets the effective type parameters. If the node was parsed in a * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. */ - function getEffectiveTypeParameterDeclarations(node, checkJSDoc) { - if (node.typeParameters) { - return node.typeParameters; - } - if (checkJSDoc || isInJavaScriptFile(node)) { - var templateTag = ts.getJSDocTemplateTag(node); - return templateTag && templateTag.typeParameters; - } + function getEffectiveTypeParameterDeclarations(node) { + return node.typeParameters || (isInJavaScriptFile(node) ? getJSDocTypeParameterDeclarations(node) : undefined); } ts.getEffectiveTypeParameterDeclarations = getEffectiveTypeParameterDeclarations; + function getJSDocTypeParameterDeclarations(node) { + var templateTag = ts.getJSDocTemplateTag(node); + return templateTag && templateTag.typeParameters; + } + ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** * Gets the effective type annotation of the value parameter of a set accessor. If the node * was parsed in a JavaScript file, gets the type annotation from JSDoc. */ - function getEffectiveSetAccessorTypeAnnotationNode(node, checkJSDoc) { + function getEffectiveSetAccessorTypeAnnotationNode(node) { var parameter = getSetAccessorValueParameter(node); - return parameter && getEffectiveTypeAnnotationNode(parameter, checkJSDoc); + return parameter && getEffectiveTypeAnnotationNode(parameter); } ts.getEffectiveSetAccessorTypeAnnotationNode = getEffectiveSetAccessorTypeAnnotationNode; function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { @@ -10651,7 +11356,7 @@ var ts; case 76 /* ConstKeyword */: return 2048 /* Const */; case 79 /* DefaultKeyword */: return 512 /* Default */; case 120 /* AsyncKeyword */: return 256 /* Async */; - case 131 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 132 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -10668,7 +11373,7 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ && + if (node.kind === 205 /* ExpressionWithTypeArguments */ && node.parent.token === 85 /* ExtendsKeyword */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -10686,8 +11391,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 179 /* ObjectLiteralExpression */ - || kind === 178 /* ArrayLiteralExpression */; + return kind === 182 /* ObjectLiteralExpression */ + || kind === 181 /* ArrayLiteralExpression */; } return false; } @@ -10697,7 +11402,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */ + return node.kind === 205 /* ExpressionWithTypeArguments */ && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 /* ImplementsKeyword */ @@ -10707,21 +11412,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + node.kind === 183 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 /* ObjectLiteralExpression */ && + return expression.kind === 182 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 /* ArrayLiteralExpression */ && + return expression.kind === 181 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -10990,8 +11695,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -11064,21 +11769,21 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 43 /* PlusPlusToken */ || operator === 44 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0 /* Read */; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && parent.parent.kind === 211 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && parent.parent.kind === 214 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function compareDataObjects(dst, src) { @@ -11122,6 +11827,7 @@ var ts; map.delete(key); onDeleteValue(existingValue, key); } + // If present notify about existing values else if (onExistingValue) { onExistingValue(existingValue, valueInNewMap, key); } @@ -11179,6 +11885,15 @@ var ts; return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); } ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; + function showModuleSpecifier(_a) { + var moduleSpecifier = _a.moduleSpecifier; + return ts.isStringLiteral(moduleSpecifier) ? moduleSpecifier.text : getTextOfNode(moduleSpecifier); + } + ts.showModuleSpecifier = showModuleSpecifier; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -11214,27 +11929,20 @@ var ts; } ts.textSpanContainsTextSpan = textSpanContainsTextSpan; function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; + return textSpanOverlap(span, other) !== undefined; } ts.textSpanOverlapsWith = textSpanOverlapsWith; function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; + var overlap = textSpanIntersection(span1, span2); + return overlap && overlap.length === 0 ? undefined : overlap; } ts.textSpanOverlap = textSpanOverlap; function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length); } ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; + return decodedTextSpanIntersectsWith(span.start, span.length, start, length); } ts.textSpanIntersectsWith = textSpanIntersectsWith; function decodedTextSpanIntersectsWith(start1, length1, start2, length2) { @@ -11248,12 +11956,9 @@ var ts; } ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; + var start = Math.max(span1.start, span2.start); + var end = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + return start <= end ? createTextSpanFromBounds(start, end) : undefined; } ts.textSpanIntersection = textSpanIntersection; function createTextSpan(start, length) { @@ -11402,9 +12107,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146 /* TypeParameter */) { + if (d && d.kind === 147 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234 /* InterfaceDeclaration */) { return current; } } @@ -11412,7 +12117,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 153 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 154 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11430,7 +12135,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -11438,14 +12143,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -11461,14 +12166,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -11518,6 +12223,7 @@ var ts; return false; } try { + // tslint:disable-next-line no-unnecessary-qualifier (making clear this is a global mutation!) ts.localizedDiagnosticMessages = JSON.parse(fileContents); } catch (e) { @@ -11604,18 +12310,17 @@ var ts; } // Covers remaining cases switch (hostNode.kind) { - case 209 /* VariableStatement */: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212 /* VariableStatement */: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: var expr = hostNode.expression; switch (expr.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return expr.name; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -11624,10 +12329,10 @@ var ts; return undefined; case 1 /* EndOfFileToken */: return undefined; - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 223 /* LabeledStatement */: { + case 226 /* LabeledStatement */: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11645,6 +12350,11 @@ var ts; return declaration.name || nameForNamelessJSDocTypedef(declaration); } ts.getNameOfJSDocTypedef = getNameOfJSDocTypedef; + /** @internal */ + function isNamedDeclaration(node) { + return !!node.name; // A 'name' property should always be a DeclarationName. + } + ts.isNamedDeclaration = isNamedDeclaration; function getNameOfDeclaration(declaration) { if (!declaration) { return undefined; @@ -11652,15 +12362,15 @@ var ts; switch (declaration.kind) { case 71 /* Identifier */: return declaration; - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: { + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { return name.right; } break; } - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1 /* ExportsProperty */: @@ -11672,9 +12382,9 @@ var ts; return undefined; } } - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 244 /* ExportAssignment */: { + case 247 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -11711,33 +12421,33 @@ var ts; * for example on a variable declaration whose initializer is a function expression. */ function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284 /* JSDocParameterTag */); + return !!getFirstJSDocTag(node, 287 /* JSDocParameterTag */); } ts.hasJSDocParameterTags = hasJSDocParameterTags; /** Gets the JSDoc augments tag for the node if present */ function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 285 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; /** Gets the JSDoc class tag for the node if present */ function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283 /* JSDocClassTag */); + return getFirstJSDocTag(node, 286 /* JSDocClassTag */); } ts.getJSDocClassTag = getJSDocClassTag; /** Gets the JSDoc return tag for the node if present */ function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 288 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; /** Gets the JSDoc template tag for the node if present */ function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 290 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; /** Gets the JSDoc type tag for the node if present and valid */ function getJSDocTypeTag(node) { // We should have already issued an error if there were multiple type jsdocs, so just use the first one. - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -11756,8 +12466,8 @@ var ts; * tag directly on the node would be returned. */ function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); - if (!tag && node.kind === 147 /* Parameter */) { + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); + if (!tag && node.kind === 148 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -11841,608 +12551,616 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 144 /* QualifiedName */; + return node.kind === 145 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145 /* ComputedPropertyName */; + return node.kind === 146 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 146 /* TypeParameter */; + return node.kind === 147 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147 /* Parameter */; + return node.kind === 148 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 149 /* PropertySignature */; + return node.kind === 150 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150 /* PropertyDeclaration */; + return node.kind === 151 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151 /* MethodSignature */; + return node.kind === 152 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153 /* Constructor */; + return node.kind === 154 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156 /* CallSignature */; + return node.kind === 157 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157 /* ConstructSignature */; + return node.kind === 158 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158 /* IndexSignature */; + return node.kind === 159 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 159 /* TypePredicate */; + return node.kind === 160 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160 /* TypeReference */; + return node.kind === 161 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161 /* FunctionType */; + return node.kind === 162 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162 /* ConstructorType */; + return node.kind === 163 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163 /* TypeQuery */; + return node.kind === 164 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164 /* TypeLiteral */; + return node.kind === 165 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165 /* ArrayType */; + return node.kind === 166 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166 /* TupleType */; + return node.kind === 167 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167 /* UnionType */; + return node.kind === 168 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168 /* IntersectionType */; + return node.kind === 169 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170 /* ConditionalType */; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171 /* InferType */; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169 /* ParenthesizedType */; + return node.kind === 172 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170 /* ThisType */; + return node.kind === 173 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171 /* TypeOperator */; + return node.kind === 174 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172 /* IndexedAccessType */; + return node.kind === 175 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173 /* MappedType */; + return node.kind === 176 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174 /* LiteralType */; + return node.kind === 177 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 175 /* ObjectBindingPattern */; + return node.kind === 178 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176 /* ArrayBindingPattern */; + return node.kind === 179 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177 /* BindingElement */; + return node.kind === 180 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 178 /* ArrayLiteralExpression */; + return node.kind === 181 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179 /* ObjectLiteralExpression */; + return node.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180 /* PropertyAccessExpression */; + return node.kind === 183 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181 /* ElementAccessExpression */; + return node.kind === 184 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182 /* CallExpression */; + return node.kind === 185 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183 /* NewExpression */; + return node.kind === 186 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184 /* TaggedTemplateExpression */; + return node.kind === 187 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185 /* TypeAssertionExpression */; + return node.kind === 188 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186 /* ParenthesizedExpression */; + return node.kind === 189 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292 /* PartiallyEmittedExpression */) { + while (node.kind === 295 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187 /* FunctionExpression */; + return node.kind === 190 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188 /* ArrowFunction */; + return node.kind === 191 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189 /* DeleteExpression */; + return node.kind === 192 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 190 /* TypeOfExpression */; + return node.kind === 193 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191 /* VoidExpression */; + return node.kind === 194 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 195 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193 /* PrefixUnaryExpression */; + return node.kind === 196 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194 /* PostfixUnaryExpression */; + return node.kind === 197 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195 /* BinaryExpression */; + return node.kind === 198 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196 /* ConditionalExpression */; + return node.kind === 199 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197 /* TemplateExpression */; + return node.kind === 200 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198 /* YieldExpression */; + return node.kind === 201 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199 /* SpreadElement */; + return node.kind === 202 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200 /* ClassExpression */; + return node.kind === 203 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201 /* OmittedExpression */; + return node.kind === 204 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */; + return node.kind === 205 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203 /* AsExpression */; + return node.kind === 206 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204 /* NonNullExpression */; + return node.kind === 207 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205 /* MetaProperty */; + return node.kind === 208 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 206 /* TemplateSpan */; + return node.kind === 209 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207 /* SemicolonClassElement */; + return node.kind === 210 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 208 /* Block */; + return node.kind === 211 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209 /* VariableStatement */; + return node.kind === 212 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210 /* EmptyStatement */; + return node.kind === 213 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211 /* ExpressionStatement */; + return node.kind === 214 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212 /* IfStatement */; + return node.kind === 215 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213 /* DoStatement */; + return node.kind === 216 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214 /* WhileStatement */; + return node.kind === 217 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215 /* ForStatement */; + return node.kind === 218 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216 /* ForInStatement */; + return node.kind === 219 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217 /* ForOfStatement */; + return node.kind === 220 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218 /* ContinueStatement */; + return node.kind === 221 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219 /* BreakStatement */; + return node.kind === 222 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */; + return node.kind === 222 /* BreakStatement */ || node.kind === 221 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220 /* ReturnStatement */; + return node.kind === 223 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221 /* WithStatement */; + return node.kind === 224 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222 /* SwitchStatement */; + return node.kind === 225 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223 /* LabeledStatement */; + return node.kind === 226 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224 /* ThrowStatement */; + return node.kind === 227 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225 /* TryStatement */; + return node.kind === 228 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226 /* DebuggerStatement */; + return node.kind === 229 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227 /* VariableDeclaration */; + return node.kind === 230 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228 /* VariableDeclarationList */; + return node.kind === 231 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229 /* FunctionDeclaration */; + return node.kind === 232 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230 /* ClassDeclaration */; + return node.kind === 233 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231 /* InterfaceDeclaration */; + return node.kind === 234 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232 /* TypeAliasDeclaration */; + return node.kind === 235 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */; + return node.kind === 236 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */; + return node.kind === 237 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235 /* ModuleBlock */; + return node.kind === 238 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236 /* CaseBlock */; + return node.kind === 239 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237 /* NamespaceExportDeclaration */; + return node.kind === 240 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */; + return node.kind === 241 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239 /* ImportDeclaration */; + return node.kind === 242 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240 /* ImportClause */; + return node.kind === 243 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241 /* NamespaceImport */; + return node.kind === 244 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242 /* NamedImports */; + return node.kind === 245 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243 /* ImportSpecifier */; + return node.kind === 246 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244 /* ExportAssignment */; + return node.kind === 247 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245 /* ExportDeclaration */; + return node.kind === 248 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246 /* NamedExports */; + return node.kind === 249 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247 /* ExportSpecifier */; + return node.kind === 250 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248 /* MissingDeclaration */; + return node.kind === 251 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 249 /* ExternalModuleReference */; + return node.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 250 /* JsxElement */; + return node.kind === 253 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251 /* JsxSelfClosingElement */; + return node.kind === 254 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252 /* JsxOpeningElement */; + return node.kind === 255 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253 /* JsxClosingElement */; + return node.kind === 256 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254 /* JsxFragment */; + return node.kind === 257 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255 /* JsxOpeningFragment */; + return node.kind === 258 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256 /* JsxClosingFragment */; + return node.kind === 259 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257 /* JsxAttribute */; + return node.kind === 260 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258 /* JsxAttributes */; + return node.kind === 261 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259 /* JsxSpreadAttribute */; + return node.kind === 262 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260 /* JsxExpression */; + return node.kind === 263 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 261 /* CaseClause */; + return node.kind === 264 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262 /* DefaultClause */; + return node.kind === 265 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263 /* HeritageClause */; + return node.kind === 266 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264 /* CatchClause */; + return node.kind === 267 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 265 /* PropertyAssignment */; + return node.kind === 268 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266 /* ShorthandPropertyAssignment */; + return node.kind === 269 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267 /* SpreadAssignment */; + return node.kind === 270 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 269 /* SourceFile */; + return node.kind === 272 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270 /* Bundle */; + return node.kind === 273 /* Bundle */; } ts.isBundle = isBundle; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 271 /* JSDocTypeExpression */; + return node.kind === 274 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272 /* JSDocAllType */; + return node.kind === 275 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273 /* JSDocUnknownType */; + return node.kind === 276 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274 /* JSDocNullableType */; + return node.kind === 277 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275 /* JSDocNonNullableType */; + return node.kind === 278 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276 /* JSDocOptionalType */; + return node.kind === 279 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277 /* JSDocFunctionType */; + return node.kind === 280 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278 /* JSDocVariadicType */; + return node.kind === 281 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279 /* JSDocComment */; + return node.kind === 282 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282 /* JSDocAugmentsTag */; + return node.kind === 285 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284 /* JSDocParameterTag */; + return node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285 /* JSDocReturnTag */; + return node.kind === 288 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286 /* JSDocTypeTag */; + return node.kind === 289 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287 /* JSDocTemplateTag */; + return node.kind === 290 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288 /* JSDocTypedefTag */; + return node.kind === 291 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289 /* JSDocPropertyTag */; + return node.kind === 292 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 /* JSDocPropertyTag */ || node.kind === 284 /* JSDocParameterTag */; + return node.kind === 292 /* JSDocPropertyTag */ || node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280 /* JSDocTypeLiteral */; + return node.kind === 283 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); @@ -12453,7 +13171,7 @@ var ts; (function (ts) { /* @internal */ function isSyntaxList(n) { - return n.kind === 290 /* SyntaxList */; + return n.kind === 293 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -12463,15 +13181,16 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 144 /* FirstNode */; + return kind >= 145 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 143 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 144 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12526,7 +13245,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 115 /* StaticKeyword */: return true; } @@ -12539,7 +13258,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 /* QualifiedName */ + return kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12548,14 +13267,14 @@ var ts; return kind === 71 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 145 /* ComputedPropertyName */; + || kind === 146 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 175 /* ObjectBindingPattern */ - || kind === 176 /* ArrayBindingPattern */; + || kind === 178 /* ObjectBindingPattern */ + || kind === 179 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12570,13 +13289,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: return false; @@ -12585,13 +13304,13 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12606,30 +13325,30 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 150 /* PropertyDeclaration */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 158 /* IndexSignature */ - || kind === 207 /* SemicolonClassElement */ - || kind === 248 /* MissingDeclaration */; + return kind === 154 /* Constructor */ + || kind === 151 /* PropertyDeclaration */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 159 /* IndexSignature */ + || kind === 210 /* SemicolonClassElement */ + || kind === 251 /* MissingDeclaration */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */); + return node && (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */); + return node && (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; default: return false; @@ -12639,47 +13358,47 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 157 /* ConstructSignature */ - || kind === 156 /* CallSignature */ - || kind === 149 /* PropertySignature */ - || kind === 151 /* MethodSignature */ - || kind === 158 /* IndexSignature */ - || kind === 248 /* MissingDeclaration */; + return kind === 158 /* ConstructSignature */ + || kind === 157 /* CallSignature */ + || kind === 150 /* PropertySignature */ + || kind === 152 /* MethodSignature */ + || kind === 159 /* IndexSignature */ + || kind === 251 /* MissingDeclaration */; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 /* PropertyAssignment */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 267 /* SpreadAssignment */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 248 /* MissingDeclaration */; + return kind === 268 /* PropertyAssignment */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 270 /* SpreadAssignment */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 251 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) + return (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) || kind === 119 /* AnyKeyword */ - || kind === 133 /* NumberKeyword */ - || kind === 134 /* ObjectKeyword */ + || kind === 134 /* NumberKeyword */ + || kind === 135 /* ObjectKeyword */ || kind === 122 /* BooleanKeyword */ - || kind === 136 /* StringKeyword */ - || kind === 137 /* SymbolKeyword */ + || kind === 137 /* StringKeyword */ + || kind === 138 /* SymbolKeyword */ || kind === 99 /* ThisKeyword */ || kind === 105 /* VoidKeyword */ - || kind === 139 /* UndefinedKeyword */ + || kind === 140 /* UndefinedKeyword */ || kind === 95 /* NullKeyword */ - || kind === 130 /* NeverKeyword */ - || kind === 202 /* ExpressionWithTypeArguments */ - || kind === 272 /* JSDocAllType */ - || kind === 273 /* JSDocUnknownType */ - || kind === 274 /* JSDocNullableType */ - || kind === 275 /* JSDocNonNullableType */ - || kind === 276 /* JSDocOptionalType */ - || kind === 277 /* JSDocFunctionType */ - || kind === 278 /* JSDocVariadicType */; + || kind === 131 /* NeverKeyword */ + || kind === 205 /* ExpressionWithTypeArguments */ + || kind === 275 /* JSDocAllType */ + || kind === 276 /* JSDocUnknownType */ + || kind === 277 /* JSDocNullableType */ + || kind === 278 /* JSDocNonNullableType */ + || kind === 279 /* JSDocOptionalType */ + || kind === 280 /* JSDocFunctionType */ + || kind === 281 /* JSDocVariadicType */; } /** * Node test that determines whether a node is a valid type node. @@ -12692,8 +13411,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return true; } return false; @@ -12704,8 +13423,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 /* ArrayBindingPattern */ - || kind === 175 /* ObjectBindingPattern */; + return kind === 179 /* ArrayBindingPattern */ + || kind === 178 /* ObjectBindingPattern */; } return false; } @@ -12713,15 +13432,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 /* ArrayLiteralExpression */ - || kind === 179 /* ObjectLiteralExpression */; + return kind === 181 /* ArrayLiteralExpression */ + || kind === 182 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 /* BindingElement */ - || kind === 201 /* OmittedExpression */; + return kind === 180 /* BindingElement */ + || kind === 204 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12730,9 +13449,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 180 /* BindingElement */: return true; } return false; @@ -12753,8 +13472,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return true; } return false; @@ -12766,8 +13485,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return true; } return false; @@ -12776,18 +13495,18 @@ var ts; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 /* PropertyAccessExpression */ - || kind === 144 /* QualifiedName */; + return kind === 183 /* PropertyAccessExpression */ + || kind === 145 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 148 /* Decorator */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 149 /* Decorator */: return true; default: return false; @@ -12795,12 +13514,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 /* CallExpression */ || node.kind === 183 /* NewExpression */; + return node.kind === 185 /* CallExpression */ || node.kind === 186 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 /* TemplateExpression */ + return kind === 200 /* TemplateExpression */ || kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12811,33 +13530,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 183 /* NewExpression */: - case 182 /* CallExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 184 /* TaggedTemplateExpression */: - case 178 /* ArrayLiteralExpression */: - case 186 /* ParenthesizedExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 187 /* FunctionExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 186 /* NewExpression */: + case 185 /* CallExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 187 /* TaggedTemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 189 /* ParenthesizedExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 190 /* FunctionExpression */: case 71 /* Identifier */: case 12 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 101 /* TrueKeyword */: case 97 /* SuperKeyword */: - case 204 /* NonNullExpression */: - case 205 /* MetaProperty */: - case 91 /* ImportKeyword */:// technically this is only an Expression if it's in a CallExpression + case 207 /* NonNullExpression */: + case 208 /* MetaProperty */: + case 91 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: return false; @@ -12850,13 +13569,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 185 /* TypeAssertionExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 188 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12865,9 +13584,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; default: @@ -12886,15 +13605,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: - case 188 /* ArrowFunction */: - case 195 /* BinaryExpression */: - case 199 /* SpreadElement */: - case 203 /* AsExpression */: - case 201 /* OmittedExpression */: - case 293 /* CommaListExpression */: - case 292 /* PartiallyEmittedExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: + case 191 /* ArrowFunction */: + case 198 /* BinaryExpression */: + case 202 /* SpreadElement */: + case 206 /* AsExpression */: + case 204 /* OmittedExpression */: + case 296 /* CommaListExpression */: + case 295 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12902,18 +13621,18 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 /* TypeAssertionExpression */ - || kind === 203 /* AsExpression */; + return kind === 188 /* TypeAssertionExpression */ + || kind === 206 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 292 /* PartiallyEmittedExpression */; + return node.kind === 295 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 291 /* NotEmittedStatement */; + return node.kind === 294 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ @@ -12922,16 +13641,15 @@ var ts; || isPartiallyEmittedExpression(node); } ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; - // Statement function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return true; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12939,7 +13657,7 @@ var ts; ts.isIterationStatement = isIterationStatement; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 216 /* ForInStatement */ || node.kind === 217 /* ForOfStatement */; + return node.kind === 219 /* ForInStatement */ || node.kind === 220 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12963,111 +13681,111 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */ + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */ || kind === 71 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */; + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 234 /* ModuleDeclaration */; + || kind === 237 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 /* NamedImports */ - || kind === 241 /* NamespaceImport */; + return kind === 245 /* NamedImports */ + || kind === 244 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ || node.kind === 233 /* EnumDeclaration */; + return node.kind === 237 /* ModuleDeclaration */ || node.kind === 236 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 /* ArrowFunction */ - || kind === 177 /* BindingElement */ - || kind === 230 /* ClassDeclaration */ - || kind === 200 /* ClassExpression */ - || kind === 153 /* Constructor */ - || kind === 233 /* EnumDeclaration */ - || kind === 268 /* EnumMember */ - || kind === 247 /* ExportSpecifier */ - || kind === 229 /* FunctionDeclaration */ - || kind === 187 /* FunctionExpression */ - || kind === 154 /* GetAccessor */ - || kind === 240 /* ImportClause */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 243 /* ImportSpecifier */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 257 /* JsxAttribute */ - || kind === 152 /* MethodDeclaration */ - || kind === 151 /* MethodSignature */ - || kind === 234 /* ModuleDeclaration */ - || kind === 237 /* NamespaceExportDeclaration */ - || kind === 241 /* NamespaceImport */ - || kind === 147 /* Parameter */ - || kind === 265 /* PropertyAssignment */ - || kind === 150 /* PropertyDeclaration */ - || kind === 149 /* PropertySignature */ - || kind === 155 /* SetAccessor */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 146 /* TypeParameter */ - || kind === 227 /* VariableDeclaration */ - || kind === 288 /* JSDocTypedefTag */; + return kind === 191 /* ArrowFunction */ + || kind === 180 /* BindingElement */ + || kind === 233 /* ClassDeclaration */ + || kind === 203 /* ClassExpression */ + || kind === 154 /* Constructor */ + || kind === 236 /* EnumDeclaration */ + || kind === 271 /* EnumMember */ + || kind === 250 /* ExportSpecifier */ + || kind === 232 /* FunctionDeclaration */ + || kind === 190 /* FunctionExpression */ + || kind === 155 /* GetAccessor */ + || kind === 243 /* ImportClause */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 246 /* ImportSpecifier */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 260 /* JsxAttribute */ + || kind === 153 /* MethodDeclaration */ + || kind === 152 /* MethodSignature */ + || kind === 237 /* ModuleDeclaration */ + || kind === 240 /* NamespaceExportDeclaration */ + || kind === 244 /* NamespaceImport */ + || kind === 148 /* Parameter */ + || kind === 268 /* PropertyAssignment */ + || kind === 151 /* PropertyDeclaration */ + || kind === 150 /* PropertySignature */ + || kind === 156 /* SetAccessor */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 147 /* TypeParameter */ + || kind === 230 /* VariableDeclaration */ + || kind === 291 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 229 /* FunctionDeclaration */ - || kind === 248 /* MissingDeclaration */ - || kind === 230 /* ClassDeclaration */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 233 /* EnumDeclaration */ - || kind === 234 /* ModuleDeclaration */ - || kind === 239 /* ImportDeclaration */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 245 /* ExportDeclaration */ - || kind === 244 /* ExportAssignment */ - || kind === 237 /* NamespaceExportDeclaration */; + return kind === 232 /* FunctionDeclaration */ + || kind === 251 /* MissingDeclaration */ + || kind === 233 /* ClassDeclaration */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 236 /* EnumDeclaration */ + || kind === 237 /* ModuleDeclaration */ + || kind === 242 /* ImportDeclaration */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 248 /* ExportDeclaration */ + || kind === 247 /* ExportAssignment */ + || kind === 240 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 /* BreakStatement */ - || kind === 218 /* ContinueStatement */ - || kind === 226 /* DebuggerStatement */ - || kind === 213 /* DoStatement */ - || kind === 211 /* ExpressionStatement */ - || kind === 210 /* EmptyStatement */ - || kind === 216 /* ForInStatement */ - || kind === 217 /* ForOfStatement */ - || kind === 215 /* ForStatement */ - || kind === 212 /* IfStatement */ - || kind === 223 /* LabeledStatement */ - || kind === 220 /* ReturnStatement */ - || kind === 222 /* SwitchStatement */ - || kind === 224 /* ThrowStatement */ - || kind === 225 /* TryStatement */ - || kind === 209 /* VariableStatement */ - || kind === 214 /* WhileStatement */ - || kind === 221 /* WithStatement */ - || kind === 291 /* NotEmittedStatement */ - || kind === 295 /* EndOfDeclarationMarker */ - || kind === 294 /* MergeDeclarationMarker */; + return kind === 222 /* BreakStatement */ + || kind === 221 /* ContinueStatement */ + || kind === 229 /* DebuggerStatement */ + || kind === 216 /* DoStatement */ + || kind === 214 /* ExpressionStatement */ + || kind === 213 /* EmptyStatement */ + || kind === 219 /* ForInStatement */ + || kind === 220 /* ForOfStatement */ + || kind === 218 /* ForStatement */ + || kind === 215 /* IfStatement */ + || kind === 226 /* LabeledStatement */ + || kind === 223 /* ReturnStatement */ + || kind === 225 /* SwitchStatement */ + || kind === 227 /* ThrowStatement */ + || kind === 228 /* TryStatement */ + || kind === 212 /* VariableStatement */ + || kind === 217 /* WhileStatement */ + || kind === 224 /* WithStatement */ + || kind === 294 /* NotEmittedStatement */ + || kind === 298 /* EndOfDeclarationMarker */ + || kind === 297 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 146 /* TypeParameter */) { - return node.parent.kind !== 287 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); + if (node.kind === 147 /* TypeParameter */) { + return node.parent.kind !== 290 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -13094,10 +13812,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208 /* Block */) + if (node.kind !== 211 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 /* TryStatement */ || node.parent.kind === 264 /* CatchClause */) { + if (node.parent.kind === 228 /* TryStatement */ || node.parent.kind === 267 /* CatchClause */) { return false; } } @@ -13107,8 +13825,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 249 /* ExternalModuleReference */ - || kind === 144 /* QualifiedName */ + return kind === 252 /* ExternalModuleReference */ + || kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -13118,70 +13836,70 @@ var ts; var kind = node.kind; return kind === 99 /* ThisKeyword */ || kind === 71 /* Identifier */ - || kind === 180 /* PropertyAccessExpression */; + || kind === 183 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 250 /* JsxElement */ - || kind === 260 /* JsxExpression */ - || kind === 251 /* JsxSelfClosingElement */ + return kind === 253 /* JsxElement */ + || kind === 263 /* JsxExpression */ + || kind === 254 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */ - || kind === 254 /* JsxFragment */; + || kind === 257 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 /* JsxAttribute */ - || kind === 259 /* JsxSpreadAttribute */; + return kind === 260 /* JsxAttribute */ + || kind === 262 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 260 /* JsxExpression */; + || kind === 263 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 /* JsxOpeningElement */ - || kind === 251 /* JsxSelfClosingElement */; + return kind === 255 /* JsxOpeningElement */ + || kind === 254 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 /* CaseClause */ - || kind === 262 /* DefaultClause */; + return kind === 264 /* CaseClause */ + || kind === 265 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 271 /* FirstJSDocNode */ && node.kind <= 289 /* LastJSDocNode */; + return node.kind >= 274 /* FirstJSDocNode */ && node.kind <= 292 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 279 /* JSDocComment */ || isJSDocTag(node); + return node.kind === 282 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 281 /* FirstJSDocTagNode */ && node.kind <= 289 /* LastJSDocTagNode */; + return node.kind >= 284 /* FirstJSDocTagNode */ && node.kind <= 292 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13210,19 +13928,28 @@ var ts; ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { switch (node.kind) { - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; default: return false; } } ts.isObjectLiteralElement = isObjectLiteralElement; + /* @internal */ + function isTypeReferenceType(node) { + return node.kind === 161 /* TypeReference */ || node.kind === 205 /* ExpressionWithTypeArguments */; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); /// /// @@ -13245,7 +13972,7 @@ var ts; var SourceFileConstructor; // tslint:enable variable-name function createNode(kind, pos, end) { - if (kind === 269 /* SourceFile */) { + if (kind === 272 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71 /* Identifier */) { @@ -13290,28 +14017,28 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143 /* LastToken */) { + if (!node || node.kind <= 144 /* LastToken */) { return; } switch (node.kind) { - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -13319,7 +14046,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -13327,51 +14054,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13382,291 +14109,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 166 /* TupleType */: + case 167 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 169 /* ParenthesizedType */: - case 171 /* TypeOperator */: + case 170 /* ConditionalType */: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); + case 171 /* InferType */: + return visitNode(cbNode, node.typeParameter); + case 172 /* ParenthesizedType */: + case 174 /* TypeOperator */: return visitNode(cbNode, node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173 /* MappedType */: + case 176 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return visitNode(cbNode, node.literal); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitNode(cbNode, node.name); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return visitNode(cbNode, node.label); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148 /* Decorator */: + case 149 /* Decorator */: return visitNode(cbNode, node.expression); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -13675,17 +14409,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return visitNode(cbNode, node.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return visitNodes(cbNode, cbNodes, node.typeParameters); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: if (node.typeExpression && - node.typeExpression.kind === 271 /* JSDocTypeExpression */) { + node.typeExpression.kind === 274 /* JSDocTypeExpression */) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -13693,7 +14427,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280 /* JSDocTypeLiteral */: + case 283 /* JSDocTypeLiteral */: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -13701,7 +14435,7 @@ var ts; } } return; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -13899,7 +14633,7 @@ var ts; else if (token() === 17 /* OpenBraceToken */ || lookAhead(function () { return token() === 9 /* StringLiteral */; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token); } else { parseExpected(17 /* OpenBraceToken */); @@ -13962,7 +14696,9 @@ var ts; sourceFile.flags = contextFlags; // Prime the scanner. nextToken(); - processReferenceComments(sourceFile); + // A member of ReadonlyArray isn't assignable to a member of T[] (and prevents a direct cast) - but this is where we set up those members so they can be readonly in the future + processCommentPragmas(sourceFile, sourceText); + processPragmasIntoFields(sourceFile, reportPragmaDiagnostic); sourceFile.statements = parseList(0 /* SourceElements */, parseStatement); ts.Debug.assert(token() === 1 /* EndOfFileToken */); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); @@ -13975,6 +14711,9 @@ var ts; fixupParentReferences(sourceFile); } return sourceFile; + function reportPragmaDiagnostic(pos, end, diagnostic) { + parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, pos, end, diagnostic)); + } } function addJSDocComment(node) { var comments = ts.getJSDocCommentRanges(node, sourceFile.text); @@ -14019,7 +14758,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(269 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(272 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14265,9 +15004,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -14403,7 +15142,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(145 /* ComputedPropertyName */); + var node = createNode(146 /* ComputedPropertyName */); parseExpected(21 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -14579,6 +15318,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } // True if positioned at a list terminator function isListTerminator(kind) { if (token() === 1 /* EndOfFileToken */) { @@ -14810,14 +15553,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153 /* Constructor */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 150 /* PropertyDeclaration */: - case 207 /* SemicolonClassElement */: + case 154 /* Constructor */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 210 /* SemicolonClassElement */: return true; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -14832,8 +15575,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: return true; } } @@ -14842,58 +15585,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 209 /* VariableStatement */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 211 /* ExpressionStatement */: - case 224 /* ThrowStatement */: - case 220 /* ReturnStatement */: - case 222 /* SwitchStatement */: - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 210 /* EmptyStatement */: - case 225 /* TryStatement */: - case 223 /* LabeledStatement */: - case 213 /* DoStatement */: - case 226 /* DebuggerStatement */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 212 /* VariableStatement */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 214 /* ExpressionStatement */: + case 227 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 225 /* SwitchStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 213 /* EmptyStatement */: + case 228 /* TryStatement */: + case 226 /* LabeledStatement */: + case 216 /* DoStatement */: + case 229 /* DebuggerStatement */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 149 /* PropertySignature */: - case 156 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 150 /* PropertySignature */: + case 157 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227 /* VariableDeclaration */) { + if (node.kind !== 230 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -14914,7 +15657,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147 /* Parameter */) { + if (node.kind !== 148 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -15043,7 +15786,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144 /* QualifiedName */, entity.pos); + var node = createNode(145 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -15080,7 +15823,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197 /* TemplateExpression */); + var template = createNode(200 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -15092,7 +15835,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206 /* TemplateSpan */); + var span = createNode(209 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18 /* CloseBraceToken */) { @@ -15100,7 +15843,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); + literal = parseExpectedToken(16 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -15143,7 +15886,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */); @@ -15152,18 +15895,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159 /* TypePredicate */, lhs.pos); + var node = createNode(160 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170 /* ThisType */); + var node = createNode(173 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272 /* JSDocAllType */); + var result = createNode(275 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -15186,28 +15929,28 @@ var ts; token() === 29 /* GreaterThanToken */ || token() === 58 /* EqualsToken */ || token() === 49 /* BarToken */) { - var result = createNode(273 /* JSDocUnknownType */, pos); + var result = createNode(276 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(274 /* JSDocNullableType */, pos); + var result = createNode(277 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(280 /* JSDocFunctionType */); nextToken(); fillSignature(56 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147 /* Parameter */); + var parameter = createNode(148 /* Parameter */); if (token() === 99 /* ThisKeyword */ || token() === 94 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(56 /* ColonToken */); @@ -15222,13 +15965,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163 /* TypeQuery */); + var node = createNode(164 /* TypeQuery */); parseExpected(103 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(85 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -15273,7 +16016,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ true); } function parseParameter() { - var node = createNodeWithJSDoc(147 /* Parameter */); + var node = createNodeWithJSDoc(148 /* Parameter */); if (token() === 99 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -15372,7 +16115,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157 /* ConstructSignature */) { + if (kind === 158 /* ConstructSignature */) { parseExpected(94 /* NewKeyword */); } fillSignature(56 /* ColonToken */, 4 /* Type */, node); @@ -15433,7 +16176,7 @@ var ts; return token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 22 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 158 /* IndexSignature */; + node.kind = 159 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -15443,13 +16186,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55 /* QuestionToken */); if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - node.kind = 151 /* MethodSignature */; + node.kind = 152 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(56 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 149 /* PropertySignature */; + node.kind = 150 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 58 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -15495,10 +16238,10 @@ var ts; } function parseTypeMember() { if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - return parseSignatureMember(156 /* CallSignature */); + return parseSignatureMember(157 /* CallSignature */); } if (token() === 94 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157 /* ConstructSignature */); + return parseSignatureMember(158 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -15512,7 +16255,7 @@ var ts; return token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(164 /* TypeLiteral */); + var node = createNode(165 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -15529,38 +16272,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131 /* ReadonlyKeyword */) { + if (token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + return nextToken() === 132 /* ReadonlyKeyword */; + } + if (token() === 132 /* ReadonlyKeyword */) { nextToken(); } return token() === 21 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 92 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(92 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173 /* MappedType */); + var node = createNode(176 /* MappedType */); parseExpected(17 /* OpenBraceToken */); - node.readonlyToken = parseOptionalToken(131 /* ReadonlyKeyword */); + if (token() === 132 /* ReadonlyKeyword */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + parseExpectedToken(132 /* ReadonlyKeyword */); + } + } parseExpected(21 /* OpenBracketToken */); node.typeParameter = parseMappedTypeParameter(); parseExpected(22 /* CloseBracketToken */); - node.questionToken = parseOptionalToken(55 /* QuestionToken */); + if (token() === 55 /* QuestionToken */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + parseExpectedToken(55 /* QuestionToken */); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseTupleType() { - var node = createNode(166 /* TupleType */); + var node = createNode(167 /* TupleType */); node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169 /* ParenthesizedType */); + var node = createNode(172 /* ParenthesizedType */); parseExpected(19 /* OpenParenToken */); node.type = parseType(); parseExpected(20 /* CloseParenToken */); @@ -15568,7 +16324,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162 /* ConstructorType */) { + if (kind === 163 /* ConstructorType */) { parseExpected(94 /* NewKeyword */); } fillSignature(36 /* EqualsGreaterThanToken */, 4 /* Type */, node); @@ -15579,10 +16335,10 @@ var ts; return token() === 23 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174 /* LiteralType */); + var node = createNode(177 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(196 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 38 /* MinusToken */; nextToken(); } @@ -15603,13 +16359,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 137 /* SymbolKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 138 /* SymbolKeyword */: case 122 /* BooleanKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39 /* AsteriskToken */: @@ -15619,7 +16375,7 @@ var ts; case 89 /* FunctionKeyword */: return parseJSDocFunctionType(); case 51 /* ExclamationToken */: - return parseJSDocNodeWithType(275 /* JSDocNonNullableType */); + return parseJSDocNodeWithType(278 /* JSDocNonNullableType */); case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -15633,7 +16389,7 @@ var ts; return parseTokenNode(); case 99 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -15655,17 +16411,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 140 /* UniqueKeyword */: + case 138 /* SymbolKeyword */: + case 141 /* UniqueKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 103 /* TypeOfKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: case 17 /* OpenBraceToken */: case 21 /* OpenBracketToken */: case 27 /* LessThanToken */: @@ -15676,11 +16432,12 @@ var ts; case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: case 39 /* AsteriskToken */: case 55 /* QuestionToken */: case 51 /* ExclamationToken */: case 24 /* DotDotDotToken */: + case 126 /* InferKeyword */: return true; case 38 /* MinusToken */: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -15705,25 +16462,29 @@ var ts; if (!(contextFlags & 1048576 /* JSDoc */)) { return type; } - type = createJSDocPostfixType(276 /* JSDocOptionalType */, type); + type = createJSDocPostfixType(279 /* JSDocOptionalType */, type); break; case 51 /* ExclamationToken */: - type = createJSDocPostfixType(275 /* JSDocNonNullableType */, type); + type = createJSDocPostfixType(278 /* JSDocNonNullableType */, type); break; case 55 /* QuestionToken */: - type = createJSDocPostfixType(274 /* JSDocNullableType */, type); + // If not in JSDoc and next token is start of a type we have a conditional type + if (!(contextFlags & 1048576 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277 /* JSDocNullableType */, type); break; case 21 /* OpenBracketToken */: parseExpected(21 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(172 /* IndexedAccessType */, type.pos); + var node = createNode(175 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(165 /* ArrayType */, type.pos); + var node = createNode(166 /* ArrayType */, type.pos); node.elementType = type; parseExpected(22 /* CloseBracketToken */); type = finishNode(node); @@ -15742,20 +16503,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171 /* TypeOperator */); + var node = createNode(174 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171 /* InferType */); + parseExpected(126 /* InferKeyword */); + var typeParameter = createNode(147 /* TypeParameter */); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127 /* KeyOfKeyword */: - case 140 /* UniqueKeyword */: + case 128 /* KeyOfKeyword */: + case 141 /* UniqueKeyword */: return parseTypeOperator(operator); + case 126 /* InferKeyword */: + return parseInferType(); case 24 /* DotDotDotToken */: { - var result = createNode(278 /* JSDocVariadicType */); + var result = createNode(281 /* JSDocVariadicType */); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -15778,10 +16549,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); + return parseUnionOrIntersectionType(169 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); + return parseUnionOrIntersectionType(168 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); } function isStartOfFunctionType() { if (token() === 27 /* LessThanToken */) { @@ -15838,7 +16609,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(160 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -15849,7 +16620,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -15859,14 +16630,26 @@ var ts; // apply to 'type' contexts. So we disable these parameters here before moving on. return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161 /* FunctionType */); + return parseFunctionOrConstructorType(162 /* FunctionType */); } if (token() === 94 /* NewKeyword */) { - return parseFunctionOrConstructorType(162 /* ConstructorType */); + return parseFunctionOrConstructorType(163 /* ConstructorType */); } - return parseUnionTypeOrHigher(); + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85 /* ExtendsKeyword */)) { + var node = createNode(170 /* ConditionalType */, type.pos); + node.checkType = type; + // The type following 'extends' is not permitted to be another conditional type + node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); + parseExpected(55 /* QuestionToken */); + node.trueType = parseTypeWorker(); + parseExpected(56 /* ColonToken */); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56 /* ColonToken */) ? parseType() : undefined; @@ -16049,7 +16832,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198 /* YieldExpression */); + var node = createNode(201 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -16071,17 +16854,17 @@ var ts; ts.Debug.assert(token() === 36 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188 /* ArrowFunction */, asyncModifier.pos); + node = createNode(191 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188 /* ArrowFunction */, identifier.pos); + node = createNode(191 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(147 /* Parameter */, identifier.pos); + var parameter = createNode(148 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -16106,7 +16889,7 @@ var ts; // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); arrowFunction.body = (lastToken === 36 /* EqualsGreaterThanToken */ || lastToken === 17 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -16273,7 +17056,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188 /* ArrowFunction */); + var node = createNodeWithJSDoc(191 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -16339,11 +17122,11 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(196 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(199 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); + node.colonToken = parseExpectedToken(56 /* ColonToken */); node.whenFalse = ts.nodeIsPresent(node.colonToken) ? parseAssignmentExpressionOrHigher() : createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); @@ -16354,7 +17137,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 /* InKeyword */ || t === 143 /* OfKeyword */; + return t === 92 /* InKeyword */ || t === 144 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16462,39 +17245,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195 /* BinaryExpression */, left.pos); + var node = createNode(198 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203 /* AsExpression */, left.pos); + var node = createNode(206 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189 /* DeleteExpression */); + var node = createNode(192 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190 /* TypeOfExpression */); + var node = createNode(193 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191 /* VoidExpression */); + var node = createNode(194 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16510,7 +17293,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192 /* AwaitExpression */); + var node = createNode(195 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16553,7 +17336,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 188 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -16650,7 +17433,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -16663,7 +17446,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(197 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -16778,9 +17561,9 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(180 /* PropertyAccessExpression */, expression.pos); + var node = createNode(183 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - parseExpectedToken(23 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } @@ -16803,8 +17586,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252 /* JsxOpeningElement */) { - var node = createNode(250 /* JsxElement */, opening.pos); + if (opening.kind === 255 /* JsxOpeningElement */) { + var node = createNode(253 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -16813,15 +17596,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255 /* JsxOpeningFragment */) { - var node = createNode(254 /* JsxFragment */, opening.pos); + else if (opening.kind === 258 /* JsxOpeningFragment */) { + var node = createNode(257 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 254 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -16836,7 +17619,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195 /* BinaryExpression */, result.pos); + var badNode = createNode(198 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -16900,7 +17683,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258 /* JsxAttributes */); + var jsxAttributes = createNode(261 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -16908,8 +17691,9 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(27 /* LessThanToken */); if (token() === 29 /* GreaterThanToken */) { - parseExpected(29 /* GreaterThanToken */); - var node_1 = createNode(255 /* JsxOpeningFragment */, fullStart); + // See below for explanation of scanJsxText + var node_1 = createNode(258 /* JsxOpeningFragment */, fullStart); + scanJsxText(); return finishNode(node_1); } var tagName = parseJsxElementName(); @@ -16919,7 +17703,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(252 /* JsxOpeningElement */, fullStart); + node = createNode(255 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -16931,7 +17715,7 @@ var ts; parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(251 /* JsxSelfClosingElement */, fullStart); + node = createNode(254 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -16947,7 +17731,7 @@ var ts; var expression = token() === 99 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23 /* DotToken */)) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16955,8 +17739,10 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260 /* JsxExpression */); - parseExpected(17 /* OpenBraceToken */); + var node = createNode(263 /* JsxExpression */); + if (!parseExpected(17 /* OpenBraceToken */)) { + return undefined; + } if (token() !== 18 /* CloseBraceToken */) { node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); @@ -16975,7 +17761,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257 /* JsxAttribute */); + var node = createNode(260 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 58 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -16990,7 +17776,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259 /* JsxSpreadAttribute */); + var node = createNode(262 /* JsxSpreadAttribute */); parseExpected(17 /* OpenBraceToken */); parseExpected(24 /* DotDotDotToken */); node.expression = parseExpression(); @@ -16998,7 +17784,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253 /* JsxClosingElement */); + var node = createNode(256 /* JsxClosingElement */); parseExpected(28 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -17011,7 +17797,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256 /* JsxClosingFragment */); + var node = createNode(259 /* JsxClosingFragment */); parseExpected(28 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -17027,7 +17813,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185 /* TypeAssertionExpression */); + var node = createNode(188 /* TypeAssertionExpression */); parseExpected(27 /* LessThanToken */); node.type = parseType(); parseExpected(29 /* GreaterThanToken */); @@ -17038,7 +17824,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -17046,14 +17832,14 @@ var ts; } if (token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(207 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(21 /* OpenBracketToken */)) { - var indexedAccess = createNode(181 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(184 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -17069,7 +17855,7 @@ var ts; continue; } if (token() === 13 /* NoSubstitutionTemplateLiteral */ || token() === 14 /* TemplateHead */) { - var tagExpression = createNode(184 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(187 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -17092,7 +17878,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -17100,7 +17886,7 @@ var ts; continue; } else if (token() === 19 /* OpenParenToken */) { - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -17151,7 +17937,7 @@ var ts; case 48 /* AmpersandToken */: // foo & case 49 /* BarToken */: // foo | case 18 /* CloseBraceToken */: // foo } - case 1 /* EndOfFileToken */:// foo + case 1 /* EndOfFileToken */: // foo // these cases can't legally follow a type arg list. However, they're not legal // expressions either. The user is probably in the middle of a generic type. So // treat it as such. @@ -17210,28 +17996,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(189 /* ParenthesizedExpression */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199 /* SpreadElement */); + var node = createNode(202 /* SpreadElement */); parseExpected(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 26 /* CommaToken */ ? createNode(201 /* OmittedExpression */) : + token() === 26 /* CommaToken */ ? createNode(204 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178 /* ArrayLiteralExpression */); + var node = createNode(181 /* ArrayLiteralExpression */); parseExpected(21 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17243,17 +18029,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(24 /* DotDotDotToken */)) { - node.kind = 267 /* SpreadAssignment */; + node.kind = 270 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } var asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -17270,7 +18056,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 /* CommaToken */ || token() === 18 /* CloseBraceToken */ || token() === 58 /* EqualsToken */); if (isShorthandPropertyAssignment) { - node.kind = 266 /* ShorthandPropertyAssignment */; + node.kind = 269 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(58 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -17278,14 +18064,14 @@ var ts; } } else { - node.kind = 265 /* PropertyAssignment */; + node.kind = 268 /* PropertyAssignment */; parseExpected(56 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179 /* ObjectLiteralExpression */); + var node = createNode(182 /* ObjectLiteralExpression */); parseExpected(17 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17304,7 +18090,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(187 /* FunctionExpression */); + var node = createNodeWithJSDoc(190 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); @@ -17329,12 +18115,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94 /* NewKeyword */); if (parseOptional(23 /* DotToken */)) { - var node_2 = createNode(205 /* MetaProperty */, fullStart); + var node_2 = createNode(208 /* MetaProperty */, fullStart); node_2.keywordToken = 94 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183 /* NewExpression */, fullStart); + var node = createNode(186 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19 /* OpenParenToken */) { @@ -17344,7 +18130,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208 /* Block */); + var node = createNode(211 /* Block */); if (parseExpected(17 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17377,12 +18163,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210 /* EmptyStatement */); + var node = createNode(213 /* EmptyStatement */); parseExpected(25 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(212 /* IfStatement */); + var node = createNode(215 /* IfStatement */); parseExpected(90 /* IfKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17392,7 +18178,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213 /* DoStatement */); + var node = createNode(216 /* DoStatement */); parseExpected(81 /* DoKeyword */); node.statement = parseStatement(); parseExpected(106 /* WhileKeyword */); @@ -17407,7 +18193,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214 /* WhileStatement */); + var node = createNode(217 /* WhileStatement */); parseExpected(106 /* WhileKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17420,7 +18206,7 @@ var ts; parseExpected(88 /* ForKeyword */); var awaitToken = parseOptionalToken(121 /* AwaitKeyword */); parseExpected(19 /* OpenParenToken */); - var initializer = undefined; + var initializer; if (token() !== 25 /* SemicolonToken */) { if (token() === 104 /* VarKeyword */ || token() === 110 /* LetKeyword */ || token() === 76 /* ConstKeyword */) { initializer = parseVariableDeclarationList(/*inForStatementInitializer*/ true); @@ -17430,8 +18216,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143 /* OfKeyword */) : parseOptional(143 /* OfKeyword */)) { - var forOfStatement = createNode(217 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(144 /* OfKeyword */) : parseOptional(144 /* OfKeyword */)) { + var forOfStatement = createNode(220 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -17439,14 +18225,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92 /* InKeyword */)) { - var forInStatement = createNode(216 /* ForInStatement */, pos); + var forInStatement = createNode(219 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215 /* ForStatement */, pos); + var forStatement = createNode(218 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(25 /* SemicolonToken */); if (token() !== 25 /* SemicolonToken */ && token() !== 20 /* CloseParenToken */) { @@ -17464,7 +18250,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); + parseExpected(kind === 222 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17472,7 +18258,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220 /* ReturnStatement */); + var node = createNode(223 /* ReturnStatement */); parseExpected(96 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -17481,7 +18267,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221 /* WithStatement */); + var node = createNode(224 /* WithStatement */); parseExpected(107 /* WithKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17490,7 +18276,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261 /* CaseClause */); + var node = createNode(264 /* CaseClause */); parseExpected(73 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(56 /* ColonToken */); @@ -17498,7 +18284,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262 /* DefaultClause */); + var node = createNode(265 /* DefaultClause */); parseExpected(79 /* DefaultKeyword */); parseExpected(56 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -17508,12 +18294,12 @@ var ts; return token() === 73 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222 /* SwitchStatement */); + var node = createNode(225 /* SwitchStatement */); parseExpected(98 /* SwitchKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); - var caseBlock = createNode(236 /* CaseBlock */); + var caseBlock = createNode(239 /* CaseBlock */); parseExpected(17 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(18 /* CloseBraceToken */); @@ -17528,7 +18314,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(224 /* ThrowStatement */); + var node = createNode(227 /* ThrowStatement */); parseExpected(100 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -17536,7 +18322,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(225 /* TryStatement */); + var node = createNode(228 /* TryStatement */); parseExpected(102 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -17549,7 +18335,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264 /* CatchClause */); + var result = createNode(267 /* CatchClause */); parseExpected(74 /* CatchKeyword */); if (parseOptional(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -17563,7 +18349,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226 /* DebuggerStatement */); + var node = createNode(229 /* DebuggerStatement */); parseExpected(78 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -17575,12 +18361,12 @@ var ts; var node = createNodeWithJSDoc(0 /* Unknown */); var expression = allowInAnd(parseExpression); if (expression.kind === 71 /* Identifier */ && parseOptional(56 /* ColonToken */)) { - node.kind = 223 /* LabeledStatement */; + node.kind = 226 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211 /* ExpressionStatement */; + node.kind = 214 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -17634,10 +18420,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117 /* AbstractKeyword */: case 120 /* AsyncKeyword */: @@ -17645,14 +18431,14 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 114 /* PublicKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142 /* GlobalKeyword */: + case 143 /* GlobalKeyword */: nextToken(); return token() === 17 /* OpenBraceToken */ || token() === 71 /* Identifier */ || token() === 84 /* ExportKeyword */; case 91 /* ImportKeyword */: @@ -17713,17 +18499,17 @@ var ts; case 120 /* AsyncKeyword */: case 124 /* DeclareKeyword */: case 109 /* InterfaceKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: - case 138 /* TypeKeyword */: - case 142 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 143 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -17747,16 +18533,16 @@ var ts; case 17 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 104 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); case 110 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); } break; case 89 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(229 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(232 /* FunctionDeclaration */)); case 75 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(230 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(233 /* ClassDeclaration */)); case 90 /* IfKeyword */: return parseIfStatement(); case 81 /* DoKeyword */: @@ -17766,9 +18552,9 @@ var ts; case 88 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 77 /* ContinueKeyword */: - return parseBreakOrContinueStatement(218 /* ContinueStatement */); + return parseBreakOrContinueStatement(221 /* ContinueStatement */); case 72 /* BreakKeyword */: - return parseBreakOrContinueStatement(219 /* BreakStatement */); + return parseBreakOrContinueStatement(222 /* BreakStatement */); case 96 /* ReturnKeyword */: return parseReturnStatement(); case 107 /* WithKeyword */: @@ -17788,9 +18574,9 @@ var ts; return parseDeclaration(); case 120 /* AsyncKeyword */: case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: case 83 /* EnumKeyword */: @@ -17801,8 +18587,8 @@ var ts; case 114 /* PublicKeyword */: case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: - case 142 /* GlobalKeyword */: + case 132 /* ReadonlyKeyword */: + case 143 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -17840,13 +18626,13 @@ var ts; return parseClassDeclaration(node); case 109 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 83 /* EnumKeyword */: return parseEnumDeclaration(node); - case 142 /* GlobalKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 143 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 91 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -17865,7 +18651,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(248 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -17887,16 +18673,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 26 /* CommaToken */) { - return createNode(201 /* OmittedExpression */); + return createNode(204 /* OmittedExpression */); } - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -17912,14 +18698,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175 /* ObjectBindingPattern */); + var node = createNode(178 /* ObjectBindingPattern */); parseExpected(17 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176 /* ArrayBindingPattern */); + var node = createNode(179 /* ArrayBindingPattern */); parseExpected(21 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(22 /* CloseBracketToken */); @@ -17941,7 +18727,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227 /* VariableDeclaration */); + var node = createNode(230 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 /* Identifier */ && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -17954,7 +18740,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228 /* VariableDeclarationList */); + var node = createNode(231 /* VariableDeclarationList */); switch (token()) { case 104 /* VarKeyword */: break; @@ -17977,7 +18763,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 143 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -17992,13 +18778,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 209 /* VariableStatement */; + node.kind = 212 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229 /* FunctionDeclaration */; + node.kind = 232 /* FunctionDeclaration */; parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); node.name = ts.hasModifier(node, 512 /* Default */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -18009,14 +18795,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153 /* Constructor */; + node.kind = 154 /* Constructor */; parseExpected(123 /* ConstructorKeyword */); fillSignature(56 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152 /* MethodDeclaration */; + node.kind = 153 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; @@ -18025,7 +18811,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150 /* PropertyDeclaration */; + node.kind = 151 /* PropertyDeclaration */; if (!node.questionToken && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -18069,7 +18855,7 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; default: return false; @@ -18110,7 +18896,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 135 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 136 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -18121,7 +18907,7 @@ var ts; case 51 /* ExclamationToken */: // Non-null assertion on property name case 56 /* ColonToken */: // Type Annotation for declaration case 58 /* EqualsToken */: // Initializer for declaration - case 55 /* QuestionToken */:// Not valid, but permitted so that it gets caught later on. + case 55 /* QuestionToken */: // Not valid, but permitted so that it gets caught later on. return true; default: // Covers @@ -18142,7 +18928,7 @@ var ts; if (!parseOptional(57 /* AtToken */)) { break; } - var decorator = createNode(148 /* Decorator */, decoratorStart); + var decorator = createNode(149 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -18192,7 +18978,7 @@ var ts; } function parseClassElement() { if (token() === 25 /* SemicolonToken */) { - var result = createNode(207 /* SemicolonClassElement */); + var result = createNode(210 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -18200,10 +18986,10 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } if (token() === 123 /* ConstructorKeyword */) { return parseConstructorDeclaration(node); @@ -18229,10 +19015,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 200 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 203 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 233 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -18275,7 +19061,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 /* ExtendsKeyword */ || tok === 108 /* ImplementsKeyword */) { - var node = createNode(263 /* HeritageClause */); + var node = createNode(266 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -18284,7 +19070,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -18301,7 +19087,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231 /* InterfaceDeclaration */; + node.kind = 234 /* InterfaceDeclaration */; parseExpected(109 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -18310,8 +19096,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232 /* TypeAliasDeclaration */; - parseExpected(138 /* TypeKeyword */); + node.kind = 235 /* TypeAliasDeclaration */; + parseExpected(139 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58 /* EqualsToken */); @@ -18324,13 +19110,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(268 /* EnumMember */); + var node = createNodeWithJSDoc(271 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233 /* EnumDeclaration */; + node.kind = 236 /* EnumDeclaration */; parseExpected(83 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(17 /* OpenBraceToken */)) { @@ -18343,7 +19129,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235 /* ModuleBlock */); + var node = createNode(238 /* ModuleBlock */); if (parseExpected(17 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(18 /* CloseBraceToken */); @@ -18354,7 +19140,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234 /* ModuleDeclaration */; + node.kind = 237 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -18366,8 +19152,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234 /* ModuleDeclaration */; - if (token() === 142 /* GlobalKeyword */) { + node.kind = 237 /* ModuleDeclaration */; + if (token() === 143 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18386,15 +19172,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142 /* GlobalKeyword */) { + if (token() === 143 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129 /* NamespaceKeyword */)) { + else if (parseOptional(130 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(128 /* ModuleKeyword */); + parseExpected(129 /* ModuleKeyword */); if (token() === 9 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -18402,7 +19188,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 /* RequireKeyword */ && + return token() === 133 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -18412,9 +19198,9 @@ var ts; return nextToken() === 41 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 237 /* NamespaceExportDeclaration */; + node.kind = 240 /* NamespaceExportDeclaration */; parseExpected(118 /* AsKeyword */); - parseExpected(129 /* NamespaceKeyword */); + parseExpected(130 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -18425,27 +19211,27 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 /* CommaToken */ && token() !== 141 /* FromKeyword */) { + if (token() !== 26 /* CommaToken */ && token() !== 142 /* FromKeyword */) { return parseImportEqualsDeclaration(node, identifier); } } // Import statement - node.kind = 239 /* ImportDeclaration */; + node.kind = 242 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; if (identifier || // import id token() === 39 /* AsteriskToken */ || // import * - token() === 17 /* OpenBraceToken */) { + token() === 17 /* OpenBraceToken */) { // import { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238 /* ImportEqualsDeclaration */; + node.kind = 241 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(58 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -18459,7 +19245,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(240 /* ImportClause */, fullStart); + var importClause = createNode(243 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18469,7 +19255,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(26 /* CommaToken */)) { - importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(242 /* NamedImports */); + importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(245 /* NamedImports */); } return finishNode(importClause); } @@ -18479,8 +19265,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(249 /* ExternalModuleReference */); - parseExpected(132 /* RequireKeyword */); + var node = createNode(252 /* ExternalModuleReference */); + parseExpected(133 /* RequireKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(20 /* CloseParenToken */); @@ -18502,7 +19288,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(241 /* NamespaceImport */); + var namespaceImport = createNode(244 /* NamespaceImport */); parseExpected(39 /* AsteriskToken */); parseExpected(118 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -18517,14 +19303,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 242 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 245 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247 /* ExportSpecifier */); + return parseImportOrExportSpecifier(250 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243 /* ImportSpecifier */); + return parseImportOrExportSpecifier(246 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18549,25 +19335,25 @@ var ts; else { node.name = identifierName; } - if (kind === 243 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 246 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245 /* ExportDeclaration */; + node.kind = 248 /* ExportDeclaration */; if (parseOptional(39 /* AsteriskToken */)) { - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(249 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 141 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(141 /* FromKeyword */); + if (token() === 142 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18575,7 +19361,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244 /* ExportAssignment */; + node.kind = 247 /* ExportAssignment */; if (parseOptional(58 /* EqualsToken */)) { node.isExportEquals = true; } @@ -18586,94 +19372,13 @@ var ts; parseSemicolon(); return finishNode(node); } - function processReferenceComments(sourceFile) { - var triviaScanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ false, 0 /* Standard */, sourceText); - var referencedFiles = []; - var typeReferenceDirectives = []; - var amdDependencies = []; - var amdModuleName; - var checkJsDirective = undefined; - // Keep scanning all the leading trivia in the file until we get to something that - // isn't trivia. Any single line comment will be analyzed to see if it is a - // reference comment. - while (true) { - var kind = triviaScanner.scan(); - if (kind !== 2 /* SingleLineCommentTrivia */) { - if (ts.isTrivia(kind)) { - continue; - } - else { - break; - } - } - var range = { - kind: triviaScanner.getToken(), - pos: triviaScanner.getTokenPos(), - end: triviaScanner.getTextPos(), - }; - var comment = sourceText.substring(range.pos, range.end); - var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); - if (referencePathMatchResult) { - var fileReference = referencePathMatchResult.fileReference; - sourceFile.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - var diagnosticMessage = referencePathMatchResult.diagnosticMessage; - if (fileReference) { - if (referencePathMatchResult.isTypeReferenceDirective) { - typeReferenceDirectives.push(fileReference); - } - else { - referencedFiles.push(fileReference); - } - } - if (diagnosticMessage) { - parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, range.pos, range.end - range.pos, diagnosticMessage)); - } - } - else { - var amdModuleNameRegEx = /^\/\/\/\s* context.checkJsDirective.pos) { + context.checkJsDirective = { + enabled: key === "ts-check", + end: entry.range.end, + pos: entry.range.pos + }; + } + }); + break; + } + case "jsx": return; // Accessed directly + default: ts.Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? + } + }); + } + ts.processPragmasIntoFields = processPragmasIntoFields; + var namedArgRegExCache = ts.createMap(); + function getNamedArgRegEx(name) { + if (namedArgRegExCache.has(name)) { + return namedArgRegExCache.get(name); + } + var result = new RegExp("(\\s" + name + "\\s*=\\s*)('|\")(.+?)\\2", "im"); + namedArgRegExCache.set(name, result); + return result; + } + var tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; + var singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im; + function extractPragmas(pragmas, range, text) { + var tripleSlash = tripleSlashXMLCommentStartRegEx.exec(text); + if (tripleSlash) { + var name = tripleSlash[1].toLowerCase(); // Technically unsafe cast, but we do it so the below check to make it safe typechecks + var pragma = ts.commentPragmas[name]; + if (!pragma || !(pragma.kind & 1 /* TripleSlashXML */)) { + return; + } + if (pragma.args) { + var argument = {}; + for (var _i = 0, _a = pragma.args; _i < _a.length; _i++) { + var arg = _a[_i]; + var matcher = getNamedArgRegEx(arg.name); + var matchResult = matcher.exec(text); + if (!matchResult && !arg.optional) { + return; // Missing required argument, don't parse + } + else if (matchResult) { + if (arg.captureSpan) { + var startPos = range.pos + matchResult.index + matchResult[1].length + matchResult[2].length; + argument[arg.name] = { + value: matchResult[3], + pos: startPos, + end: startPos + matchResult[3].length + }; + } + else { + argument[arg.name] = matchResult[3]; + } + } + } + pragmas.push({ name: name, args: { arguments: argument, range: range } }); + } + else { + pragmas.push({ name: name, args: { arguments: {}, range: range } }); + } + return; + } + var singleLine = singleLinePragmaRegEx.exec(text); + if (singleLine) { + return addPragmaForMatch(pragmas, range, 2 /* SingleLine */, singleLine); + } + var multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating) + var multiLineMatch; + while (multiLineMatch = multiLinePragmaRegEx.exec(text)) { + addPragmaForMatch(pragmas, range, 4 /* MultiLine */, multiLineMatch); + } + } + function addPragmaForMatch(pragmas, range, kind, match) { + if (!match) + return; + var name = match[1].toLowerCase(); // Technically unsafe cast, but we do it so they below check to make it safe typechecks + var pragma = ts.commentPragmas[name]; + if (!pragma || !(pragma.kind & kind)) { + return; + } + var args = match[2]; // Split on spaces and match up positionally with definition + var argument = getNamedPragmaArguments(pragma, args); + if (argument === "fail") + return; // Missing required argument, fail to parse it + pragmas.push({ name: name, args: { arguments: argument, range: range } }); + return; + } + function getNamedPragmaArguments(pragma, text) { + if (!text) + return {}; + if (!pragma.args) + return {}; + var args = text.split(/\s+/); + var argMap = {}; + for (var i = 0; i < pragma.args.length; i++) { + var argument = pragma.args[i]; + if (!args[i] && !argument.optional) { + return "fail"; + } + if (argument.captureSpan) { + return ts.Debug.fail("Capture spans not yet implemented for non-xml pragmas"); + } + argMap[argument.name] = args[i]; + } + return argMap; + } })(ts || (ts = {})); /// /// @@ -19899,24 +20807,24 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (ts.isConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. other uninstantiated module declarations. - case 235 /* ModuleBlock */: { + case 238 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -19938,7 +20846,7 @@ var ts; }); return state_1; } - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return getModuleInstanceState(node); case 71 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -20085,10 +20993,10 @@ var ts; if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { symbol.members = ts.createSymbolTable(); } - if (symbolFlags & 107455 /* Value */) { + if (symbolFlags & 67216319 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 234 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 237 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -20097,7 +21005,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -20106,7 +21014,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -20115,47 +21023,47 @@ var ts; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); } - return ts.getEscapedTextOfIdentifierOrLiteral(name); + return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "__constructor" /* Constructor */; - case 161 /* FunctionType */: - case 156 /* CallSignature */: + case 162 /* FunctionType */: + case 157 /* CallSignature */: return "__call" /* Call */; - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: return "__new" /* New */; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "__index" /* Index */; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: return (ts.hasModifier(node, 512 /* Default */) ? "default" /* Default */ : undefined); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 147 /* Parameter */: + case 148 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 277 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 280 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: var name_2 = ts.getNameOfJSDocTypedef(node); return typeof name_2 !== "undefined" ? name_2.escapedText : undefined; } } function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : ts.unescapeLeadingUnderscores(getDeclarationName(node)); + return ts.isNamedDeclaration(node) ? ts.declarationNameToString(node.name) : ts.unescapeLeadingUnderscores(getDeclarationName(node)); } /** * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. @@ -20218,7 +21126,7 @@ var ts; symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); } else { - if (node.name) { + if (ts.isNamedDeclaration(node)) { node.name.parent = node; } // Report errors every position with duplicate declaration @@ -20226,6 +21134,9 @@ var ts; var message_1 = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) { + message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } if (symbol.declarations && symbol.declarations.length) { // If the current node is a default export of some sort, then check if // there are any other default exports that we need to error on. @@ -20239,7 +21150,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 244 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 247 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -20253,13 +21164,18 @@ var ts; } } addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; + if (symbol.parent) { + ts.Debug.assert(symbol.parent === parent, "Existing symbol parent should match new one"); + } + else { + symbol.parent = parent; + } return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 247 /* ExportSpecifier */ || (node.kind === 238 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 250 /* ExportSpecifier */ || (node.kind === 241 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -20281,14 +21197,11 @@ var ts; // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - if (node.kind === 288 /* JSDocTypedefTag */) + if (node.kind === 291 /* JSDocTypedefTag */) ts.Debug.assert(ts.isInJavaScriptFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - var isJSDocTypedefInJSDocNamespace = node.kind === 288 /* JSDocTypedefTag */ && - node.name && - node.name.kind === 71 /* Identifier */ && - node.name.isInJSDocNamespace; + var isJSDocTypedefInJSDocNamespace = ts.isJSDocTypedefTag(node) && node.name && node.name.kind === 71 /* Identifier */ && node.name.isInJSDocNamespace; if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 32 /* ExportContext */)) || isJSDocTypedefInJSDocNamespace) { - var exportKind = symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0; + var exportKind = symbolFlags & 67216319 /* Value */ ? 1048576 /* ExportValue */ : 0; var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); node.localSymbol = local; @@ -20354,7 +21267,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property intialization checks. - currentReturnTarget = isIIFE || node.kind === 153 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 154 /* Constructor */ ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -20367,13 +21280,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -20460,70 +21373,70 @@ var ts; return; } switch (node.kind) { - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: bindWhileStatement(node); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: bindDoStatement(node); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: bindForStatement(node); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: bindIfStatement(node); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: bindTryStatement(node); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: bindSwitchStatement(node); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: bindCaseBlock(node); break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: bindCaseClause(node); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: bindLabeledStatement(node); break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: bindCallExpressionFlow(node); break; - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: bindJSDocComment(node); break; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: bindJSDocTypedefTag(node); break; default: @@ -20535,15 +21448,15 @@ var ts; switch (expr.kind) { case 71 /* Identifier */: case 99 /* ThisKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return hasNarrowableArgument(expr); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 51 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; @@ -20552,7 +21465,7 @@ var ts; return expr.kind === 71 /* Identifier */ || expr.kind === 99 /* ThisKeyword */ || expr.kind === 97 /* SuperKeyword */ || - expr.kind === 180 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + expr.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -20563,17 +21476,17 @@ var ts; } } } - if (expr.expression.kind === 180 /* PropertyAccessExpression */ && + if (expr.expression.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 190 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && (expr2.kind === 9 /* StringLiteral */ || expr2.kind === 13 /* NoSubstitutionTemplateLiteral */); + return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2); } function isNarrowableInOperands(left, right) { - return (left.kind === 9 /* StringLiteral */ || left.kind === 13 /* NoSubstitutionTemplateLiteral */) && isNarrowingExpression(right); + return ts.isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -20596,9 +21509,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -20676,33 +21589,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: return parent.expression === node; - case 215 /* ForStatement */: - case 196 /* ConditionalExpression */: + case 218 /* ForStatement */: + case 199 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 186 /* ParenthesizedExpression */) { + if (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 193 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { + else if (node.kind === 196 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 195 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || + return node.kind === 198 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 54 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 186 /* ParenthesizedExpression */ || - node.parent.kind === 193 /* PrefixUnaryExpression */ && + while (node.parent.kind === 189 /* ParenthesizedExpression */ || + node.parent.kind === 196 /* PrefixUnaryExpression */ && node.parent.operator === 51 /* ExclamationToken */) { node = node.parent; } @@ -20744,7 +21657,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 223 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 226 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -20778,13 +21691,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 228 /* VariableDeclarationList */) { + if (node.initializer.kind !== 231 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -20806,7 +21719,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 220 /* ReturnStatement */) { + if (node.kind === 223 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -20826,7 +21739,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 219 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 222 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -20922,7 +21835,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 262 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 265 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -20989,14 +21902,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 213 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 216 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -21007,10 +21920,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 178 /* ArrayLiteralExpression */) { + else if (node.kind === 181 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 199 /* SpreadElement */) { + if (e.kind === 202 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -21018,16 +21931,16 @@ var ts; } } } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 265 /* PropertyAssignment */) { + if (p.kind === 268 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 266 /* ShorthandPropertyAssignment */) { + else if (p.kind === 269 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 267 /* SpreadAssignment */) { + else if (p.kind === 270 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -21083,7 +21996,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 58 /* EqualsToken */ && node.left.kind === 181 /* ElementAccessExpression */) { + if (operator === 58 /* EqualsToken */ && node.left.kind === 184 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21094,7 +22007,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -21133,7 +22046,7 @@ var ts; } function bindJSDocComment(node) { ts.forEachChild(node, function (n) { - if (n.kind !== 288 /* JSDocTypedefTag */) { + if (n.kind !== 291 /* JSDocTypedefTag */) { bind(n); } }); @@ -21154,10 +22067,10 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = node.expression; - while (expr.kind === 186 /* ParenthesizedExpression */) { + while (expr.kind === 189 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 187 /* FunctionExpression */ || expr.kind === 188 /* ArrowFunction */) { + if (expr.kind === 190 /* FunctionExpression */ || expr.kind === 191 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -21165,7 +22078,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21174,53 +22087,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 258 /* JsxAttributes */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 261 /* JsxAttributes */: return 1 /* IsContainer */; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 269 /* SourceFile */: + case 272 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 277 /* JSDocFunctionType */: - case 161 /* FunctionType */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 162 /* ConstructorType */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 280 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 163 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 264 /* CatchClause */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 236 /* CaseBlock */: + case 267 /* CatchClause */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 239 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 208 /* Block */: + case 211 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -21253,42 +22166,42 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 179 /* ObjectLiteralExpression */: - case 231 /* InterfaceDeclaration */: - case 258 /* JsxAttributes */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 182 /* ObjectLiteralExpression */: + case 234 /* InterfaceDeclaration */: + case 261 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -21309,11 +22222,11 @@ var ts; : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 269 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 269 /* SourceFile */ || body.kind === 235 /* ModuleBlock */)) { + var body = node.kind === 272 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 272 /* SourceFile */ || body.kind === 238 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 245 /* ExportDeclaration */ || stat.kind === 244 /* ExportAssignment */) { + if (stat.kind === 248 /* ExportDeclaration */ || stat.kind === 247 /* ExportAssignment */) { return true; } } @@ -21336,7 +22249,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } - if (ts.isExternalModuleAugmentation(node)) { + if (ts.isModuleAugmentationExternal(node)) { declareModuleSymbol(node); } else { @@ -21350,10 +22263,8 @@ var ts; errorOnFirstToken(node.name, ts.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text); } } - var symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - if (pattern) { - (file.patternAmbientModules || (file.patternAmbientModules = [])).push({ pattern: pattern, symbol: symbol }); - } + var symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 67215503 /* ValueModuleExcludes */); + file.patternAmbientModules = ts.append(file.patternAmbientModules, pattern && { pattern: pattern, symbol: symbol }); } } else { @@ -21372,7 +22283,7 @@ var ts; function declareModuleSymbol(node) { var state = getModuleInstanceState(node); var instantiated = state !== 0 /* NonInstantiated */; - declareSymbolAndAddToSymbolTable(node, instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, instantiated ? 106639 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */); + declareSymbolAndAddToSymbolTable(node, instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, instantiated ? 67215503 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */); return state; } function bindFunctionOrConstructorType(node) { @@ -21399,7 +22310,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { + if (prop.kind === 270 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { continue; } var identifier = prop.name; @@ -21411,7 +22322,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 265 /* PropertyAssignment */ || prop.kind === 266 /* ShorthandPropertyAssignment */ || prop.kind === 152 /* MethodDeclaration */ + var currentKind = prop.kind === 268 /* PropertyAssignment */ || prop.kind === 269 /* ShorthandPropertyAssignment */ || prop.kind === 153 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -21442,10 +22353,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -21460,7 +22371,7 @@ var ts; } } function bindBlockScopedVariableDeclaration(node) { - bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 67216319 /* BlockScopedVariableExcludes */); } // The binder visits every node in the syntax tree so it is a convenient place to perform a single localized // check for reserved words used as identifiers in strict mode code. @@ -21555,8 +22466,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 269 /* SourceFile */ && - blockScopeContainer.kind !== 234 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 272 /* SourceFile */ && + blockScopeContainer.kind !== 237 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -21630,7 +22541,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 143 /* LastToken */) { + if (node.kind > 144 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -21658,7 +22569,7 @@ var ts; } for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { var tag = _c[_b]; - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { var savedParent = parent; parent = jsDoc; bind(tag); @@ -21683,7 +22594,7 @@ var ts; } /// Should be called only on prologue directives (isPrologueDirective(node) should be true) function isUseStrictPrologueDirective(node) { - var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); + var nodeText = ts.getSourceTextOfNodeFromSourceFile(file, node.expression); // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the // string to contain unicode escapes (as per ES5). return nodeText === '"use strict"' || nodeText === "'use strict'"; @@ -21697,19 +22608,19 @@ var ts; // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 288 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 291 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } - bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); + bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 67901928 /* TypeAliasExcludes */); break; } // falls through case 99 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 266 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 269 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -21717,7 +22628,7 @@ var ts; bindSpecialPropertyDeclaration(node); } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -21727,13 +22638,16 @@ var ts; bindModuleExportsAssignment(node); break; case 3 /* PrototypeProperty */: - bindPrototypePropertyAssignment(node); + bindPrototypePropertyAssignment(node.left, node); + break; + case 6 /* Prototype */: + bindPrototypeAssignment(node); break; case 4 /* ThisProperty */: bindThisPropertyAssignment(node); break; case 5 /* Property */: - bindStaticPropertyAssignment(node); + bindSpecialPropertyAssignment(node); break; case 0 /* None */: // Nothing to do @@ -21742,135 +22656,135 @@ var ts; ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return checkStrictModeCatchClause(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkStrictModeWithStatement(node); - case 170 /* ThisType */: + case 173 /* ThisType */: seenThisKeyword = true; return; - case 159 /* TypePredicate */: - return checkTypePredicate(node); - case 146 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 147 /* Parameter */: + case 160 /* TypePredicate */: + break; // Binding the children will handle everything + case 147 /* TypeParameter */: + return bindTypeParameter(node); + case 148 /* Parameter */: return bindParameter(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return bindPropertyWorker(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 268 /* EnumMember */: - return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 271 /* EnumMember */: + return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 68008959 /* EnumMemberExcludes */); + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 229 /* FunctionDeclaration */: + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 67208127 /* MethodExcludes */); + case 232 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 154 /* GetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 155 /* SetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 155 /* GetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 67150783 /* GetAccessorExcludes */); + case 156 /* SetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 67183551 /* SetAccessorExcludes */); + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 173 /* MappedType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 176 /* MappedType */: return bindAnonymousTypeWorker(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return bindFunctionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 231 /* InterfaceDeclaration */: - return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 232 /* TypeAliasDeclaration */: - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 233 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + return bindBlockScopedDeclaration(node, 64 /* Interface */, 67901832 /* InterfaceExcludes */); + case 235 /* TypeAliasDeclaration */: + return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 67901928 /* TypeAliasExcludes */); + case 236 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return bindJsxAttributes(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return bindImportClause(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return bindExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return bindExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 208 /* Block */: + case 211 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 284 /* JSDocParameterTag */: - if (node.parent.kind !== 280 /* JSDocTypeLiteral */) { + case 287 /* JSDocParameterTag */: + if (node.parent.kind !== 283 /* JSDocTypeLiteral */) { break; } // falls through - case 289 /* JSDocPropertyTag */: + case 292 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 276 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 279 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 288 /* JSDocTypedefTag */: { + case 291 /* JSDocTypedefTag */: { var fullName = node.fullName; if (!fullName || fullName.kind === 71 /* Identifier */) { - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); + return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 67901928 /* TypeAliasExcludes */); } break; } @@ -21882,16 +22796,6 @@ var ts; function bindAnonymousTypeWorker(node) { return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type" /* Type */); } - function checkTypePredicate(node) { - var parameterName = node.parameterName, type = node.type; - if (parameterName && parameterName.kind === 71 /* Identifier */) { - checkStrictModeIdentifier(parameterName); - } - if (parameterName && parameterName.kind === 170 /* ThisType */) { - seenThisKeyword = true; - } - bind(type); - } function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (ts.isExternalModule(file)) { @@ -21907,7 +22811,7 @@ var ts; bindAnonymousDeclaration(node, 2097152 /* Alias */, getDeclarationName(node)); } else { - var flags = node.kind === 244 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 247 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) // An export default clause with an EntityNameExpression exports all meanings of that identifier ? 2097152 /* Alias */ // An export default clause with any other expression exports a value @@ -21921,7 +22825,7 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 269 /* SourceFile */) { + if (node.parent.kind !== 272 /* SourceFile */) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } @@ -21966,7 +22870,18 @@ var ts; // When we create a property via 'exports.foo = bar', the 'exports.foo' property access // expression is the declaration setCommonJsModuleIndicator(node); - declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); + var lhs = node.left; + var symbol = forEachIdentifierInEntityName(lhs.expression, function (id, original) { + if (!original) { + return undefined; + } + var s = ts.getJSInitializerSymbol(original); + addDeclarationToSymbol(s, id, 1536 /* Module */ | 67108864 /* JSContainer */); + return s; + }); + if (symbol) { + declareSymbol(symbol.exports, symbol, lhs, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); + } } function bindModuleExportsAssignment(node) { // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' @@ -21987,18 +22902,18 @@ var ts; ts.Debug.assert(ts.isInJavaScriptFile(node)); var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (container.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Declare a 'member' if the container is an ES5 class or ES6 constructor container.symbol.members = container.symbol.members || ts.createSymbolTable(); // It's acceptable for multiple 'this' assignments of the same identifier to occur declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); break; - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = container.parent; @@ -22008,93 +22923,122 @@ var ts; } } function bindSpecialPropertyDeclaration(node) { - ts.Debug.assert(ts.isInJavaScriptFile(node)); if (node.expression.kind === 99 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */) && - node.parent.parent.kind === 269 /* SourceFile */) { - bindStaticPropertyAssignment(node); + else if (ts.isEntityNameExpression(node) && node.parent.parent.kind === 272 /* SourceFile */) { + if (ts.isPropertyAccessExpression(node.expression) && node.expression.name.escapedText === "prototype") { + bindPrototypePropertyAssignment(node, node.parent); + } + else { + bindStaticPropertyAssignment(node); + } } } - function bindPrototypePropertyAssignment(node) { - // We saw a node of the form 'x.prototype.y = z'. Declare a 'member' y on x if x is a function or class, or not declared. - // Look up the function in the local scope, since prototype assignments should - // follow the function declaration - var leftSideOfAssignment = node.left; - var classPrototype = leftSideOfAssignment.expression; - var constructorFunction = classPrototype.expression; - // Fix up parent pointers since we're going to use these nodes before we bind into them - leftSideOfAssignment.parent = node; - constructorFunction.parent = classPrototype; - classPrototype.parent = leftSideOfAssignment; - bindPropertyAssignment(constructorFunction.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ true); + /** For `x.prototype = { p, ... }`, declare members p,... if `x` is function/class/{}, or not declared. */ + function bindPrototypeAssignment(node) { + node.left.parent = node; + node.right.parent = node; + var lhs = node.left; + bindPropertyAssignment(lhs, lhs, /*isPrototypeProperty*/ false); } /** - * For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function or class, or not declared. + * For `x.prototype.y = z`, declare a member `y` on `x` if `x` is a function or class, or not declared. + * Note that jsdoc preceding an ExpressionStatement like `x.prototype.y;` is also treated as a declaration. + */ + function bindPrototypePropertyAssignment(lhs, parent) { + // Look up the function in the local scope, since prototype assignments should + // follow the function declaration + var classPrototype = lhs.expression; + var constructorFunction = classPrototype.expression; + // Fix up parent pointers since we're going to use these nodes before we bind into them + lhs.parent = parent; + constructorFunction.parent = classPrototype; + classPrototype.parent = lhs; + bindPropertyAssignment(constructorFunction, lhs, /*isPrototypeProperty*/ true); + } + function bindSpecialPropertyAssignment(node) { + var lhs = node.left; + // Fix up parent pointers since we're going to use these nodes before we bind into them + node.left.parent = node; + node.right.parent = node; + if (ts.isIdentifier(lhs.expression) && container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, lhs.expression)) { + // This can be an alias for the 'exports' or 'module.exports' names, e.g. + // var util = module.exports; + // util.property = function ... + bindExportsPropertyAssignment(node); + } + else { + bindStaticPropertyAssignment(lhs); + } + } + /** + * For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function (or IIFE) or class or {}, or not declared. * Also works for expression statements preceded by JSDoc, like / ** @type number * / x.y; */ function bindStaticPropertyAssignment(node) { - // Look up the function in the local scope, since static assignments should - // follow the function declaration - var leftSideOfAssignment = node.kind === 180 /* PropertyAccessExpression */ ? node : node.left; - var target = leftSideOfAssignment.expression; - if (ts.isIdentifier(target)) { - // Fix up parent pointers since we're going to use these nodes before we bind into them - target.parent = leftSideOfAssignment; - if (node.kind === 195 /* BinaryExpression */) { - leftSideOfAssignment.parent = node; - } - if (container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, target)) { - // This can be an alias for the 'exports' or 'module.exports' names, e.g. - // var util = module.exports; - // util.property = function ... - bindExportsPropertyAssignment(node); - } - else { - bindPropertyAssignment(target.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ false); - } - } + node.expression.parent = node; + bindPropertyAssignment(node.expression, node, /*isPrototypeProperty*/ false); } - function lookupSymbolForName(name) { - return lookupSymbolForNameWorker(container, name); - } - function bindPropertyAssignment(functionName, propertyAccess, isPrototypeProperty) { - var symbol = lookupSymbolForName(functionName); - var targetSymbol = symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol) ? - symbol.valueDeclaration.initializer.symbol : - symbol; - ts.Debug.assert(propertyAccess.parent.kind === 195 /* BinaryExpression */ || propertyAccess.parent.kind === 211 /* ExpressionStatement */); - var isLegalPosition; - if (propertyAccess.parent.kind === 195 /* BinaryExpression */) { - var initializerKind = propertyAccess.parent.right.kind; - isLegalPosition = (initializerKind === 200 /* ClassExpression */ || initializerKind === 187 /* FunctionExpression */) && - propertyAccess.parent.parent.parent.kind === 269 /* SourceFile */; + function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) { + var symbol = ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(name)); + var isToplevelNamespaceableInitializer; + if (ts.isBinaryExpression(propertyAccess.parent)) { + var isPrototypeAssignment = ts.isPropertyAccessExpression(propertyAccess.parent.left) && propertyAccess.parent.left.name.escapedText === "prototype"; + isToplevelNamespaceableInitializer = propertyAccess.parent.parent.parent.kind === 272 /* SourceFile */ && + !!ts.getJavascriptInitializer(propertyAccess.parent.right, isPrototypeAssignment); } else { - isLegalPosition = propertyAccess.parent.parent.kind === 269 /* SourceFile */; + isToplevelNamespaceableInitializer = propertyAccess.parent.parent.kind === 272 /* SourceFile */; } - if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & 1920 /* Namespace */)) && isLegalPosition) { - ts.Debug.assert(ts.isIdentifier(propertyAccess.expression)); - var identifier = propertyAccess.expression; - var flags = 1536 /* Module */ | 67108864 /* JSContainer */; - var excludeFlags = 106639 /* ValueModuleExcludes */ & ~67108864 /* JSContainer */; - if (targetSymbol) { - addDeclarationToSymbol(symbol, identifier, flags); - } - else { - targetSymbol = declareSymbol(container.locals, /*parent*/ undefined, identifier, flags, excludeFlags); - } + if (!isPrototypeProperty && (!symbol || !(symbol.flags & 1920 /* Namespace */)) && isToplevelNamespaceableInitializer) { + // make symbols or add declarations for intermediate containers + var flags_1 = 1536 /* Module */ | 67108864 /* JSContainer */; + var excludeFlags_1 = 67215503 /* ValueModuleExcludes */ & ~67108864 /* JSContainer */; + forEachIdentifierInEntityName(propertyAccess.expression, function (id, original) { + if (original) { + // Note: add declaration to original symbol, not the special-syntax's symbol, so that namespaces work for type lookup + addDeclarationToSymbol(original, id, flags_1); + return original; + } + else { + return symbol = declareSymbol(symbol ? symbol.exports : container.locals, symbol, id, flags_1, excludeFlags_1); + } + }); } - if (!targetSymbol || !(targetSymbol.flags & (16 /* Function */ | 32 /* Class */ | 1024 /* NamespaceModule */))) { + if (!symbol || !(symbol.flags & (16 /* Function */ | 32 /* Class */ | 1024 /* NamespaceModule */ | 4096 /* ObjectLiteral */))) { return; } // Set up the members collection if it doesn't exist already var symbolTable = isPrototypeProperty ? - (targetSymbol.members || (targetSymbol.members = ts.createSymbolTable())) : - (targetSymbol.exports || (targetSymbol.exports = ts.createSymbolTable())); + (symbol.members || (symbol.members = ts.createSymbolTable())) : + (symbol.exports || (symbol.exports = ts.createSymbolTable())); // Declare the method/property - declareSymbol(symbolTable, targetSymbol, propertyAccess, 4 /* Property */, 0 /* PropertyExcludes */); + var symbolFlags = 4 /* Property */ | (isToplevelNamespaceableInitializer ? 67108864 /* JSContainer */ : 0); + var symbolExcludes = 0 /* PropertyExcludes */ & ~(isToplevelNamespaceableInitializer ? 67108864 /* JSContainer */ : 0); + declareSymbol(symbolTable, symbol, propertyAccess, symbolFlags, symbolExcludes); + } + function lookupSymbolForPropertyAccess(node) { + if (ts.isIdentifier(node)) { + return lookupSymbolForNameWorker(container, node.escapedText); + } + else { + var symbol = ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(node.expression)); + return symbol && symbol.exports && symbol.exports.get(node.name.escapedText); + } + } + function forEachIdentifierInEntityName(e, action) { + if (isExportsOrModuleExportsOrAlias(file, e)) { + return file.symbol; + } + else if (ts.isIdentifier(e)) { + return action(e, lookupSymbolForPropertyAccess(e)); + } + else { + var s = ts.getJSInitializerSymbol(forEachIdentifierInEntityName(e.expression, action)); + ts.Debug.assert(!!s && !!s.exports); + return action(e.name, s.exports.get(e.name.escapedText)); + } } function bindCallExpression(node) { // We're only inspecting call expressions to detect CommonJS modules, so we can skip @@ -22104,8 +23048,8 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 230 /* ClassDeclaration */) { - bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); + if (node.kind === 233 /* ClassDeclaration */) { + bindBlockScopedDeclaration(node, 32 /* Class */, 68008383 /* ClassExcludes */); } else { var bindingName = node.name ? node.name.escapedText : "__class" /* Class */; @@ -22138,8 +23082,8 @@ var ts; } function bindEnumDeclaration(node) { return ts.isConst(node) - ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) - : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); + ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 68008831 /* ConstEnumExcludes */) + : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 68008191 /* RegularEnumExcludes */); } function bindVariableDeclarationOrBindingElement(node) { if (inStrictMode) { @@ -22159,10 +23103,10 @@ var ts; // function foo([a,a]) {} // Duplicate Identifier error // function bar(a,a) {} // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter // // which correctly set excluded symbols - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 67216319 /* ParameterExcludes */); } else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */); + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 67216318 /* FunctionScopedVariableExcludes */); } } } @@ -22176,7 +23120,7 @@ var ts; bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + node.parent.parameters.indexOf(node)); } else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 67216319 /* ParameterExcludes */); } // If this is a property-parameter, then also declare the property symbol into the // containing class. @@ -22194,10 +23138,10 @@ var ts; checkStrictModeFunctionName(node); if (inStrictMode) { checkStrictModeFunctionDeclaration(node); - bindBlockScopedDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */); + bindBlockScopedDeclaration(node, 16 /* Function */, 67215791 /* FunctionExcludes */); } else { - declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); + declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 67215791 /* FunctionExcludes */); } } function bindFunctionExpression(node) { @@ -22224,6 +23168,33 @@ var ts; ? bindAnonymousDeclaration(node, symbolFlags, "__computed" /* Computed */) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + function getInferTypeContainer(node) { + while (node) { + var parent_2 = node.parent; + if (parent_2 && parent_2.kind === 170 /* ConditionalType */ && parent_2.extendsType === node) { + return parent_2; + } + node = parent_2; + } + return undefined; + } + function bindTypeParameter(node) { + if (node.parent.kind === 171 /* InferType */) { + var container_1 = getInferTypeContainer(node.parent); + if (container_1) { + if (!container_1.locals) { + container_1.locals = ts.createSymbolTable(); + } + declareSymbol(container_1.locals, /*parent*/ undefined, node, 262144 /* TypeParameter */, 67639784 /* TypeParameterExcludes */); + } + else { + bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); + } + } + else { + declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 67639784 /* TypeParameterExcludes */); + } + } // reachability checks function shouldReportErrorOnModuleDeclaration(node) { var instanceState = getModuleInstanceState(node); @@ -22236,13 +23207,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 210 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 213 /* EmptyStatement */) || // report error on class declarations - node.kind === 230 /* ClassDeclaration */ || + node.kind === 233 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 234 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 237 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 233 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 236 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -22256,7 +23227,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !(node.flags & 2097152 /* Ambient */) && - (node.kind !== 209 /* VariableStatement */ || + (node.kind !== 212 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -22281,7 +23252,7 @@ var ts; } function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { return isExportsOrModuleExportsOrAlias(sourceFile, node) || - (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); + (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); } function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); @@ -22299,58 +23270,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 147 /* Parameter */: + case 148 /* Parameter */: return computeParameter(node, subtreeFlags); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 153 /* Constructor */: + case 154 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -22402,12 +23373,12 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 179 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 182 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ESNext if they contain rest transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 178 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 181 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } @@ -22456,8 +23427,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 203 /* AsExpression */ - || expressionKind === 185 /* TypeAssertionExpression */) { + if (expressionKind === 206 /* AsExpression */ + || expressionKind === 188 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -22834,13 +23805,13 @@ var ts; var excludeFlags = 939525441 /* NodeExcludes */; switch (kind) { case 120 /* AsyncKeyword */: - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 292 /* PartiallyEmittedExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; excludeFlags = 536872257 /* OuterExpressionExcludes */; @@ -22851,25 +23822,25 @@ var ts; case 117 /* AbstractKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 204 /* NonNullExpression */: - case 131 /* ReadonlyKeyword */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 207 /* NonNullExpression */: + case 132 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: case 10 /* JsxText */: - case 253 /* JsxClosingElement */: - case 254 /* JsxFragment */: - case 255 /* JsxOpeningFragment */: - case 256 /* JsxClosingFragment */: - case 257 /* JsxAttribute */: - case 258 /* JsxAttributes */: - case 259 /* JsxSpreadAttribute */: - case 260 /* JsxExpression */: + case 256 /* JsxClosingElement */: + case 257 /* JsxFragment */: + case 258 /* JsxOpeningFragment */: + case 259 /* JsxClosingFragment */: + case 260 /* JsxAttribute */: + case 261 /* JsxAttributes */: + case 262 /* JsxSpreadAttribute */: + case 263 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; @@ -22877,11 +23848,11 @@ var ts; case 14 /* TemplateHead */: case 15 /* TemplateMiddle */: case 16 /* TemplateTail */: - case 197 /* TemplateExpression */: - case 184 /* TaggedTemplateExpression */: - case 266 /* ShorthandPropertyAssignment */: + case 200 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 269 /* ShorthandPropertyAssignment */: case 115 /* StaticKeyword */: - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; @@ -22895,56 +23866,58 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 8 /* AssertESNext */; } transformFlags |= 192 /* AssertES2015 */; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; break; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 159 /* TypePredicate */: - case 160 /* TypeReference */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 163 /* TypeQuery */: - case 164 /* TypeLiteral */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: - case 237 /* NamespaceExportDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 160 /* TypePredicate */: + case 161 /* TypeReference */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 164 /* TypeQuery */: + case 165 /* TypeLiteral */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 171 /* InferType */: + case 172 /* ParenthesizedType */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: + case 240 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. @@ -22961,10 +23934,10 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; case 97 /* SuperKeyword */: @@ -22976,28 +23949,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: excludeFlags = 942740801 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -23015,8 +23988,8 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 178 /* ArrayLiteralExpression */: - case 183 /* NewExpression */: + case 181 /* ArrayLiteralExpression */: + case 186 /* NewExpression */: excludeFlags = 940049729 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 @@ -23024,23 +23997,23 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 220 /* ReturnStatement */: - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 223 /* ReturnStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -23056,66 +24029,66 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) { + if (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 178 /* ArrayLiteralExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 181 /* ArrayLiteralExpression */: return 940049729 /* ArrayLiteralOrCallOrNewExcludes */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return 977327425 /* ModuleExcludes */; - case 147 /* Parameter */: + case 148 /* Parameter */: return 939525441 /* ParameterExcludes */; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return 1003902273 /* ArrowFunctionExcludes */; - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: return 1003935041 /* FunctionExcludes */; - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return 948962625 /* VariableDeclarationListExcludes */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return 942011713 /* ClassExcludes */; - case 153 /* Constructor */: + case 154 /* Constructor */: return 1003668801 /* ConstructorExcludes */; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return 1003668801 /* MethodOrAccessorExcludes */; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 136 /* StringKeyword */: - case 134 /* ObjectKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 135 /* ObjectKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return 942740801 /* ObjectLiteralExcludes */; - case 264 /* CatchClause */: + case 267 /* CatchClause */: return 940574017 /* CatchClauseExcludes */; - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return 940049729 /* BindingPatternExcludes */; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 292 /* PartiallyEmittedExpression */: - case 186 /* ParenthesizedExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + case 189 /* ParenthesizedExpression */: case 97 /* SuperKeyword */: return 536872257 /* OuterExpressionExcludes */; - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return 671089985 /* PropertyAccessExcludes */; default: return 939525441 /* NodeExcludes */; @@ -23290,7 +24263,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 163 /* TypeQuery */) { + if (d.type && d.type.kind === 164 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -23546,8 +24519,11 @@ var ts; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { - var directoryToModuleNameMap = ts.createMap(); - var moduleNameToDirectoryMap = ts.createMap(); + return createModuleResolutionCacheWithMaps(ts.createMap(), ts.createMap(), currentDirectory, getCanonicalFileName); + } + ts.createModuleResolutionCache = createModuleResolutionCache; + /*@internal*/ + function createModuleResolutionCacheWithMaps(directoryToModuleNameMap, moduleNameToDirectoryMap, currentDirectory, getCanonicalFileName) { return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; function getOrCreateCacheForDirectory(directoryName) { var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); @@ -23631,7 +24607,7 @@ var ts; } } } - ts.createModuleResolutionCache = createModuleResolutionCache; + ts.createModuleResolutionCacheWithMaps = createModuleResolutionCacheWithMaps; function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); if (traceEnabled) { @@ -23642,7 +24618,7 @@ var ts; var result = perFolderCache && perFolderCache.get(moduleName); if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } } else { @@ -23832,7 +24808,7 @@ var ts; trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, state.compilerOptions.baseUrl, moduleName); } // string is for exact match - var matchedPattern = undefined; + var matchedPattern; if (state.compilerOptions.paths) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); @@ -24108,7 +25084,7 @@ var ts; var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { var packageJsonContent = readJson(packageJsonPath, host); - if (subModuleName === "") { + if (subModuleName === "") { // looking up the root - need to handle types/typings/main redirects for subModuleName var path = tryReadPackageJsonFields(/*readTypes*/ true, packageJsonContent, nodeModuleDirectory, state); if (typeof path === "string") { subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); @@ -24204,7 +25180,7 @@ var ts; } else { var _a = getPackageName(moduleName), packageName = _a.packageName, rest = _a.rest; - if (rest !== "") { + if (rest !== "") { // If "rest" is empty, we just did this search above. var packageRootPath = ts.combinePaths(nodeModulesFolder, packageName); // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId. packageId = getPackageJsonInfo(packageRootPath, rest, failedLookupLocations, !nodeModulesFolderExists, state).packageId; @@ -24234,7 +25210,7 @@ var ts; var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); return ts.forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host, failedLookupLocations); if (resolutionFromCache) { return resolutionFromCache; } @@ -24281,6 +25257,7 @@ var ts; return "@types/" + getMangledNameForScopedPackage(packageName); } ts.getTypesPackageName = getTypesPackageName; + /* @internal */ function getMangledNameForScopedPackage(packageName) { if (ts.startsWith(packageName, "@")) { var replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator); @@ -24290,6 +25267,7 @@ var ts; } return packageName; } + ts.getMangledNameForScopedPackage = getMangledNameForScopedPackage; /* @internal */ function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); @@ -24306,12 +25284,13 @@ var ts; typesPackageName; } ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; - function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host, failedLookupLocations) { var result = cache && cache.get(containingDirectory); if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } + failedLookupLocations.push.apply(failedLookupLocations, result.failedLookupLocations); return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -24332,7 +25311,7 @@ var ts; if (!ts.isExternalModuleNameRelative(moduleName)) { // Climb up parent directories looking for a module. var resolved_3 = ts.forEachAncestorDirectory(containingDirectory, function (directory) { - var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host, failedLookupLocations); if (resolutionFromCache) { return resolutionFromCache; } @@ -24560,6 +25539,14 @@ var ts; node = ts.getParseTreeNode(node, ts.isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: function (node, argIndex) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) { @@ -24609,7 +25596,7 @@ var ts; node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; }, - getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, + getJsxIntrinsicTagNamesAt: getJsxIntrinsicTagNamesAt, isOptionalParameter: function (node) { node = ts.getParseTreeNode(node, ts.isParameter); return node ? isOptionalParameter(node) : false; @@ -24648,7 +25635,7 @@ var ts; resolveName: function (name, location, meaning, excludeGlobals) { return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals); }, - getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, + getJsxNamespace: function (n) { return ts.unescapeLeadingUnderscores(getJsxNamespace(n)); }, getAccessibleSymbolChain: getAccessibleSymbolChain, getTypePredicateOfSignature: getTypePredicateOfSignature, resolveExternalModuleSymbol: resolveExternalModuleSymbol, @@ -24656,6 +25643,11 @@ var ts; node = ts.getParseTreeNode(node); return node && tryGetThisTypeAt(node); }, + getTypeArgumentConstraint: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, + getSuggestionDiagnostics: function (file) { return suggestionDiagnostics.get(file.fileName) || ts.emptyArray; }, }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -24668,11 +25660,12 @@ var ts; var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); var undefinedType = createIntrinsicType(4096 /* Undefined */, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 4194304 /* ContainsWideningType */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 16777216 /* ContainsWideningType */, "undefined"); var nullType = createIntrinsicType(8192 /* Null */, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 4194304 /* ContainsWideningType */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 16777216 /* ContainsWideningType */, "null"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); var trueType = createIntrinsicType(128 /* BooleanLiteral */, "true"); @@ -24683,7 +25676,7 @@ var ts; var neverType = createIntrinsicType(16384 /* Never */, "never"); var silentNeverType = createIntrinsicType(16384 /* Never */, "never"); var implicitNeverType = createIntrinsicType(16384 /* Never */, "never"); - var nonPrimitiveType = createIntrinsicType(33554432 /* NonPrimitive */, "object"); + var nonPrimitiveType = createIntrinsicType(134217728 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = ts.createSymbolTable(); @@ -24693,7 +25686,7 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. - anyFunctionType.flags |= 16777216 /* ContainsAnyFunctionType */; + anyFunctionType.flags |= 67108864 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -24729,6 +25722,7 @@ var ts; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; // The library files are only loaded when the feature is used. // This allows users to just specify library files they want to used through --lib // and they will not get an error from not having unrelated library files @@ -24745,9 +25739,6 @@ var ts; var deferredGlobalAsyncIteratorType; var deferredGlobalAsyncIterableIteratorType; var deferredGlobalTemplateStringsArrayType; - var deferredJsxElementClassType; - var deferredJsxElementType; - var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -24774,6 +25765,19 @@ var ts; var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); + // Suggestion diagnostics must have a file. Keyed by source file name. + var suggestionDiagnostics = ts.createMultiMap(); + function addSuggestionDiagnostic(diag) { + suggestionDiagnostics.add(diag.file.fileName, __assign({}, diag, { category: ts.DiagnosticCategory.Suggestion })); + } + function addErrorOrSuggestionDiagnostic(isError, diag) { + if (isError) { + diagnostics.add(diag); + } + else { + addSuggestionDiagnostic(diag); + } + } var TypeFacts; (function (TypeFacts) { TypeFacts[TypeFacts["None"] = 0] = "None"; @@ -24799,8 +25803,7 @@ var ts; TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull"; TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy"; TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy"; - TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable"; - TypeFacts[TypeFacts["All"] = 8388607] = "All"; + TypeFacts[TypeFacts["All"] = 4194303] = "All"; // The following members encode facts about particular kinds of types for use in the getTypeFacts function. // The presence of a particular fact means that the given test is true for some (and possibly all) values // of that kind of type. @@ -24830,10 +25833,10 @@ var ts; TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts"; TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts"; TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts"; - TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts"; - TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts"; - TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts"; - TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts"; + TypeFacts[TypeFacts["ObjectStrictFacts"] = 1972176] = "ObjectStrictFacts"; + TypeFacts[TypeFacts["ObjectFacts"] = 4184016] = "ObjectFacts"; + TypeFacts[TypeFacts["FunctionStrictFacts"] = 1970144] = "FunctionStrictFacts"; + TypeFacts[TypeFacts["FunctionFacts"] = 4181984] = "FunctionFacts"; TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; })(TypeFacts || (TypeFacts = {})); @@ -24865,14 +25868,9 @@ var ts; var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; - var _jsxElementPropertiesName; - var _hasComputedJsxElementPropertiesName = false; - var _jsxElementChildrenPropertyName; - var _hasComputedJsxElementChildrenPropertyName = false; - /** Things we lazy load from the JSX namespace */ - var jsxTypes = ts.createUnderscoreEscapedMap(); var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); + var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); @@ -24899,8 +25897,10 @@ var ts; })(CallbackCheck || (CallbackCheck = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { - MappedTypeModifiers[MappedTypeModifiers["Readonly"] = 1] = "Readonly"; - MappedTypeModifiers[MappedTypeModifiers["Optional"] = 2] = "Optional"; + MappedTypeModifiers[MappedTypeModifiers["IncludeReadonly"] = 1] = "IncludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeReadonly"] = 2] = "ExcludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["IncludeOptional"] = 4] = "IncludeOptional"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeOptional"] = 8] = "ExcludeOptional"; })(MappedTypeModifiers || (MappedTypeModifiers = {})); var ExpandingFlags; (function (ExpandingFlags) { @@ -24909,6 +25909,22 @@ var ts; ExpandingFlags[ExpandingFlags["Target"] = 2] = "Target"; ExpandingFlags[ExpandingFlags["Both"] = 3] = "Both"; })(ExpandingFlags || (ExpandingFlags = {})); + var TypeIncludes; + (function (TypeIncludes) { + TypeIncludes[TypeIncludes["Any"] = 1] = "Any"; + TypeIncludes[TypeIncludes["Undefined"] = 2] = "Undefined"; + TypeIncludes[TypeIncludes["Null"] = 4] = "Null"; + TypeIncludes[TypeIncludes["Never"] = 8] = "Never"; + TypeIncludes[TypeIncludes["NonWideningType"] = 16] = "NonWideningType"; + TypeIncludes[TypeIncludes["String"] = 32] = "String"; + TypeIncludes[TypeIncludes["Number"] = 64] = "Number"; + TypeIncludes[TypeIncludes["ESSymbol"] = 128] = "ESSymbol"; + TypeIncludes[TypeIncludes["LiteralOrUniqueESSymbol"] = 256] = "LiteralOrUniqueESSymbol"; + TypeIncludes[TypeIncludes["ObjectType"] = 512] = "ObjectType"; + TypeIncludes[TypeIncludes["EmptyObject"] = 1024] = "EmptyObject"; + TypeIncludes[TypeIncludes["Union"] = 2048] = "Union"; + TypeIncludes[TypeIncludes["Wildcard"] = 4096] = "Wildcard"; + })(TypeIncludes || (TypeIncludes = {})); var MembersOrExportsResolutionKind; (function (MembersOrExportsResolutionKind) { MembersOrExportsResolutionKind["resolvedExports"] = "resolvedExports"; @@ -25055,7 +26071,23 @@ var ts; }; } } - function getJsxNamespace() { + function getJsxNamespace(location) { + if (location) { + var file = ts.getSourceFileOfNode(location); + if (file) { + if (file.localJsxNamespace) { + return file.localJsxNamespace; + } + var jsxPragma = file.pragmas.get("jsx"); + if (jsxPragma) { + var chosenpragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; + file.localJsxFactory = ts.parseIsolatedEntityName(chosenpragma.arguments.factory, languageVersion); + if (file.localJsxFactory) { + return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; + } + } + } + } if (!_jsxNamespace) { _jsxNamespace = "React"; if (compilerOptions.jsxFactory) { @@ -25094,35 +26126,35 @@ var ts; function getExcludedSymbolFlags(flags) { var result = 0; if (flags & 2 /* BlockScopedVariable */) - result |= 107455 /* BlockScopedVariableExcludes */; + result |= 67216319 /* BlockScopedVariableExcludes */; if (flags & 1 /* FunctionScopedVariable */) - result |= 107454 /* FunctionScopedVariableExcludes */; + result |= 67216318 /* FunctionScopedVariableExcludes */; if (flags & 4 /* Property */) result |= 0 /* PropertyExcludes */; if (flags & 8 /* EnumMember */) - result |= 900095 /* EnumMemberExcludes */; + result |= 68008959 /* EnumMemberExcludes */; if (flags & 16 /* Function */) - result |= 106927 /* FunctionExcludes */; + result |= 67215791 /* FunctionExcludes */; if (flags & 32 /* Class */) - result |= 899519 /* ClassExcludes */; + result |= 68008383 /* ClassExcludes */; if (flags & 64 /* Interface */) - result |= 792968 /* InterfaceExcludes */; + result |= 67901832 /* InterfaceExcludes */; if (flags & 256 /* RegularEnum */) - result |= 899327 /* RegularEnumExcludes */; + result |= 68008191 /* RegularEnumExcludes */; if (flags & 128 /* ConstEnum */) - result |= 899967 /* ConstEnumExcludes */; + result |= 68008831 /* ConstEnumExcludes */; if (flags & 512 /* ValueModule */) - result |= 106639 /* ValueModuleExcludes */; + result |= 67215503 /* ValueModuleExcludes */; if (flags & 8192 /* Method */) - result |= 99263 /* MethodExcludes */; + result |= 67208127 /* MethodExcludes */; if (flags & 32768 /* GetAccessor */) - result |= 41919 /* GetAccessorExcludes */; + result |= 67150783 /* GetAccessorExcludes */; if (flags & 65536 /* SetAccessor */) - result |= 74687 /* SetAccessorExcludes */; + result |= 67183551 /* SetAccessorExcludes */; if (flags & 262144 /* TypeParameter */) - result |= 530920 /* TypeParameterExcludes */; + result |= 67639784 /* TypeParameterExcludes */; if (flags & 524288 /* TypeAlias */) - result |= 793064 /* TypeAliasExcludes */; + result |= 67901928 /* TypeAliasExcludes */; if (flags & 2097152 /* Alias */) result |= 2097152 /* AliasExcludes */; return result; @@ -25151,7 +26183,7 @@ var ts; } function mergeSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags)) || - source.flags & 67108864 /* JSContainer */ || target.flags & 67108864 /* JSContainer */) { + (source.flags | target.flags) & 67108864 /* JSContainer */) { // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { // reset flag when merging instantiated module into value module that has only const enums @@ -25160,7 +26192,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 234 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 234 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 237 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 237 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -25175,19 +26207,31 @@ var ts; target.exports = ts.createSymbolTable(); mergeSymbolTable(target.exports, source.exports); } + if ((source.flags | target.flags) & 67108864 /* JSContainer */) { + var sourceInitializer = ts.getJSInitializerSymbol(source); + var targetInitializer = ts.getJSInitializerSymbol(target); + if (sourceInitializer !== source || targetInitializer !== target) { + mergeSymbol(targetInitializer, sourceInitializer); + } + } recordMergedSymbol(target, source); } else if (target.flags & 1024 /* NamespaceModule */) { error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - var message_2 = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message_2 = target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */ + ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); + var errorNode = (ts.getJavascriptInitializer(node, /*isPrototypeAssignment*/ false) ? ts.getOuterNameOfJsInitializer(node) : ts.getNameOfDeclaration(node)) || node; + error(errorNode, message_2, symbolToString(source)); }); ts.forEach(target.declarations, function (node) { - error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); + var errorNode = (ts.getJavascriptInitializer(node, /*isPrototypeAssignment*/ false) ? ts.getOuterNameOfJsInitializer(node) : ts.getNameOfDeclaration(node)) || node; + error(errorNode, message_2, symbolToString(source)); }); } } @@ -25278,7 +26322,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -25308,8 +26352,8 @@ var ts; function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { var constructorDeclaration = parameter.parent; var classDeclaration = parameter.parent.parent; - var parameterSymbol = getSymbol(constructorDeclaration.locals, parameterName, 107455 /* Value */); - var propertySymbol = getSymbol(getMembersOfSymbol(classDeclaration.symbol), parameterName, 107455 /* Value */); + var parameterSymbol = getSymbol(constructorDeclaration.locals, parameterName, 67216319 /* Value */); + var propertySymbol = getSymbol(getMembersOfSymbol(classDeclaration.symbol), parameterName, 67216319 /* Value */); if (parameterSymbol && propertySymbol) { return [parameterSymbol, propertySymbol]; } @@ -25336,17 +26380,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 177 /* BindingElement */) { + if (declaration.kind === 180 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 177 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 180 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 227 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 230 /* VariableDeclaration */), usage); } - else if (declaration.kind === 227 /* VariableDeclaration */) { + else if (declaration.kind === 230 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -25360,12 +26404,12 @@ var ts; // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === 247 /* ExportSpecifier */ || (usage.parent.kind === 244 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 250 /* ExportSpecifier */ || (usage.parent.kind === 247 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 244 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 247 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -25373,9 +26417,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 209 /* VariableStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 212 /* VariableStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -25395,16 +26439,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 150 /* PropertyDeclaration */ && + current.parent.kind === 151 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 152 /* MethodDeclaration */) { + if (declaration.kind === 153 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 150 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -25428,7 +26472,7 @@ var ts; var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; var lastLocation; - var lastNonBlockLocation; + var lastSelfReferenceLocation; var propertyWithInvalidInitializer; var errorLocation = location; var grandparent; @@ -25445,26 +26489,31 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 279 /* JSDocComment */) { + if (meaning & result.flags & 67901928 /* Type */ && lastLocation.kind !== 282 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 147 /* Parameter */ || - lastLocation.kind === 146 /* TypeParameter */ + lastLocation.kind === 148 /* Parameter */ || + lastLocation.kind === 147 /* TypeParameter */ // local types not visible outside the function body : false; } - if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { + if (meaning & 67216319 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { // parameters are visible only inside function body, parameter list and return type // technically for parameter list case here we might mix parameters and variables declared in function, // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 147 /* Parameter */ || + lastLocation.kind === 148 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 147 /* Parameter */); + result.valueDeclaration.kind === 148 /* Parameter */); } } + else if (location.kind === 170 /* ConditionalType */) { + // A type parameter declared using 'infer T' in a conditional type is visible only in + // the true branch of the conditional type. + useResult = lastLocation === location.trueType; + } if (useResult) { break loop; } @@ -25474,14 +26523,14 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 269 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -25505,7 +26554,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - ts.getDeclarationOfKind(moduleExport, 247 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExport, 250 /* ExportSpecifier */)) { break; } } @@ -25513,13 +26562,13 @@ var ts; break loop; } break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -25529,17 +26578,17 @@ var ts; if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (lookup(ctor.locals, name, meaning & 107455 /* Value */)) { + if (lookup(ctor.locals, name, meaning & 67216319 /* Value */)) { // Remember the property node, it will be used later to report appropriate error propertyWithInvalidInitializer = location; } } } break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 793064 /* Type */)) { + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 67901928 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { // ignore type parameters not declared in this container result = undefined; @@ -25554,7 +26603,7 @@ var ts; } break loop; } - if (location.kind === 200 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 203 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -25562,11 +26611,11 @@ var ts; } } break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 85 /* ExtendsKeyword */) { var container = location.parent.parent; - if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064 /* Type */))) { + if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 67901928 /* Type */))) { if (nameNotFoundMessage) { error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); } @@ -25582,29 +26631,29 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 231 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 234 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error - if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { + if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 67901928 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -25617,7 +26666,7 @@ var ts; } } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -25626,7 +26675,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 147 /* Parameter */) { + if (location.parent && location.parent.kind === 148 /* Parameter */) { location = location.parent; } // @@ -25640,21 +26689,21 @@ var ts; } break; } - if (isNonBlockLocation(location)) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. - // If `result === lastNonBlockLocation.symbol`, that means that we are somewhere inside `lastNonBlockLocation` looking up a name, and resolving to `lastLocation` itself. + // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { - result.isReferenced = true; + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + result.isReferenced |= meaning; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 269 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 272 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports") { return lastLocation.symbol; } @@ -25708,34 +26757,33 @@ var ts; // we want to check for block-scoped if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || - ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */))) { + ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 67216319 /* Value */) === 67216319 /* Value */))) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } // If we're in an external module, we can't reference value symbols created from UMD export declarations - if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { + if (result && isInExternalModule && (meaning & 67216319 /* Value */) === 67216319 /* Value */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 237 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 240 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); } } } return result; } - function isNonBlockLocation(_a) { - var kind = _a.kind; - switch (kind) { - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 222 /* SwitchStatement */: - case 236 /* CaseBlock */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - return false; - default: + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 237 /* ModuleDeclaration */: // For `namespace N { N; }` return true; + default: + return false; } } function diagnosticName(nameArg) { @@ -25744,14 +26792,14 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 146 /* TypeParameter */ && decl.parent === container) { + if (decl.kind === 147 /* TypeParameter */ && decl.parent === container) { return true; } } return false; } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 71 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); @@ -25797,9 +26845,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -25809,8 +26857,9 @@ var ts; } } function checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) { - if (meaning === 1920 /* Namespace */) { - var symbol = resolveSymbol(resolveName(errorLocation, name, 793064 /* Type */ & ~1920 /* Namespace */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJavaScriptFile(errorLocation) ? 67216319 /* Value */ : 0); + if (meaning === namespaceMeaning) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 67901928 /* Type */ & ~namespaceMeaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); var parent = errorLocation.parent; if (symbol) { if (ts.isQualifiedName(parent)) { @@ -25829,12 +26878,12 @@ var ts; return false; } function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) { - if (meaning & (107455 /* Value */ & ~1024 /* NamespaceModule */)) { + if (meaning & (67216319 /* Value */ & ~1024 /* NamespaceModule */)) { if (name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never") { error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name)); return true; } - var symbol = resolveSymbol(resolveName(errorLocation, name, 793064 /* Type */ & ~107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + var symbol = resolveSymbol(resolveName(errorLocation, name, 67901928 /* Type */ & ~67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) { error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name)); return true; @@ -25843,15 +26892,15 @@ var ts; return false; } function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) { - if (meaning & (107455 /* Value */ & ~1024 /* NamespaceModule */ & ~793064 /* Type */)) { - var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + if (meaning & (67216319 /* Value */ & ~1024 /* NamespaceModule */ & ~67901928 /* Type */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol) { error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, ts.unescapeLeadingUnderscores(name)); return true; } } - else if (meaning & (793064 /* Type */ & ~1024 /* NamespaceModule */ & ~107455 /* Value */)) { - var symbol = resolveSymbol(resolveName(errorLocation, name, (512 /* ValueModule */ | 1024 /* NamespaceModule */) & ~793064 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + else if (meaning & (67901928 /* Type */ & ~1024 /* NamespaceModule */ & ~67216319 /* Value */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, (512 /* ValueModule */ | 1024 /* NamespaceModule */) & ~67901928 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol) { error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, ts.unescapeLeadingUnderscores(name)); return true; @@ -25862,7 +26911,7 @@ var ts; function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 233 /* EnumDeclaration */) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 236 /* EnumDeclaration */) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { if (result.flags & 2 /* BlockScopedVariable */) { @@ -25885,13 +26934,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return node; - case 240 /* ImportClause */: + case 243 /* ImportClause */: return node.parent; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return node.parent.parent; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -25901,7 +26950,7 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); @@ -25989,7 +27038,7 @@ var ts; if (valueSymbol === unknownSymbol && typeSymbol === unknownSymbol) { return unknownSymbol; } - if (valueSymbol.flags & (793064 /* Type */ | 1920 /* Namespace */)) { + if (valueSymbol.flags & (67901928 /* Type */ | 1920 /* Namespace */)) { return valueSymbol; } var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); @@ -26044,7 +27093,15 @@ var ts; combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); + var moduleName = getFullyQualifiedName(moduleSymbol); + var declarationName = ts.declarationNameToString(name); + var suggestion = getSuggestionForNonexistentModule(name, targetSymbol); + if (suggestion !== undefined) { + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestion); + } + else { + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); + } } return symbol; } @@ -26062,23 +27119,23 @@ var ts; resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias); } function getTargetOfExportAssignment(node, dontResolveAlias) { - return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); + return resolveEntityName(node.expression, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 247 /* ExportSpecifier */: - return getTargetOfExportSpecifier(node, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 244 /* ExportAssignment */: + case 250 /* ExportSpecifier */: + return getTargetOfExportSpecifier(node, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); + case 247 /* ExportAssignment */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } @@ -26086,7 +27143,7 @@ var ts; * Indicates that a symbol is an alias that does not merge with a local declaration. */ function isNonLocalAlias(symbol, excludes) { - if (excludes === void 0) { excludes = 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */; } + if (excludes === void 0) { excludes = 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */; } return symbol && (symbol.flags & (2097152 /* Alias */ | excludes)) === 2097152 /* Alias */; } function resolveSymbol(symbol, dontResolveAlias) { @@ -26118,7 +27175,7 @@ var ts; var target = resolveAlias(symbol); if (target) { var markAlias = target === unknownSymbol || - ((target.flags & 107455 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target)); + ((target.flags & 67216319 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target)); if (markAlias) { markAliasSymbolAsReferenced(symbol); } @@ -26133,11 +27190,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 247 /* ExportSpecifier */) { + else if (node.kind === 250 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -26159,14 +27216,14 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 144 /* QualifiedName */) { + if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 145 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 238 /* ImportEqualsDeclaration */); - return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); + ts.Debug.assert(entityName.parent.kind === 241 /* ImportEqualsDeclaration */); + return resolveEntityName(entityName, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } function getFullyQualifiedName(symbol) { @@ -26179,40 +27236,43 @@ var ts; if (ts.nodeIsMissing(name)) { return undefined; } + var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJavaScriptFile(name) ? meaning & 67216319 /* Value */ : 0); var symbol; if (name.kind === 71 /* Identifier */) { - var message = meaning === 1920 /* Namespace */ ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; + var message = meaning === namespaceMeaning ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; symbol = resolveName(location || name, name.escapedText, meaning, ignoreErrors ? undefined : message, name, /*isUse*/ true); if (!symbol) { return undefined; } } - else if (name.kind === 144 /* QualifiedName */ || name.kind === 180 /* PropertyAccessExpression */) { - var left = void 0; - if (name.kind === 144 /* QualifiedName */) { - left = name.left; - } - else if (name.kind === 180 /* PropertyAccessExpression */ && - (name.expression.kind === 186 /* ParenthesizedExpression */ || ts.isEntityNameExpression(name.expression))) { - left = name.expression; - } - else { - // If the expression in property-access expression is not entity-name or parenthsizedExpression (e.g. it is a call expression), it won't be able to successfully resolve the name. - // This is the case when we are trying to do any language service operation in heritage clauses. By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression - // will attempt to checkPropertyAccessExpression to resolve symbol. - // i.e class C extends foo()./*do language service operation here*/B {} - return undefined; - } - var right = name.kind === 144 /* QualifiedName */ ? name.right : name.name; - var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); + else if (name.kind === 145 /* QualifiedName */ || name.kind === 183 /* PropertyAccessExpression */) { + var left = name.kind === 145 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 145 /* QualifiedName */ ? name.right : name.name; + var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; } else if (namespace === unknownSymbol) { return namespace; } - if (ts.isInJavaScriptFile(name) && ts.isDeclarationOfFunctionOrClassExpression(namespace)) { - namespace = getSymbolOfNode(namespace.valueDeclaration.initializer); + if (ts.isInJavaScriptFile(name)) { + var initializer = ts.getDeclaredJavascriptInitializer(namespace.valueDeclaration) || ts.getAssignedJavascriptInitializer(namespace.valueDeclaration); + if (initializer) { + namespace = getSymbolOfNode(initializer); + } + if (namespace.valueDeclaration && + ts.isVariableDeclaration(namespace.valueDeclaration) && + namespace.valueDeclaration.initializer && + isCommonJsRequire(namespace.valueDeclaration.initializer)) { + var moduleName = namespace.valueDeclaration.initializer.arguments[0]; + var moduleSym = resolveExternalModuleName(moduleName, moduleName); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + namespace = resolvedModuleSymbol; + } + } + } } symbol = getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning); if (!symbol) { @@ -26222,15 +27282,6 @@ var ts; return undefined; } } - else if (name.kind === 186 /* ParenthesizedExpression */) { - // If the expression in parenthesizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. - // This is the case when we are trying to do any language service operation in heritage clauses. - // By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression will attempt to checkPropertyAccessExpression to resolve symbol. - // i.e class C extends foo()./*do language service operation here*/B {} - return ts.isEntityNameExpression(name.expression) ? - resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : - undefined; - } else { ts.Debug.assertNever(name, "Unknown entity name kind."); } @@ -26242,11 +27293,9 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 13 /* NoSubstitutionTemplateLiteral */) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return ts.isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -26267,6 +27316,9 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { + if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTypeScript(resolvedModule.extension)) { + addSuggestionDiagnostic(createModuleImplicitlyAnyDiagnostic(errorNode, resolvedModule, moduleReference)); + } // merged symbol is module declaration symbol combined with all augmentations return getMergedSymbol(sourceFile.symbol); } @@ -26288,10 +27340,8 @@ var ts; var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (noImplicitAny && moduleNotFoundError) { - var errorInfo = resolvedModule.packageId && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, resolvedModule.packageId.name); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); - diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); + else { + addErrorOrSuggestionDiagnostic(noImplicitAny && !!moduleNotFoundError, createModuleImplicitlyAnyDiagnostic(errorNode, resolvedModule, moduleReference)); } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. return undefined; @@ -26314,6 +27364,12 @@ var ts; } return undefined; } + function createModuleImplicitlyAnyDiagnostic(errorNode, _a, moduleReference) { + var packageId = _a.packageId, resolvedFileName = _a.resolvedFileName; + var errorInfo = packageId && ts.chainDiagnosticMessages( + /*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, ts.getMangledNameForScopedPackage(packageId.name)); + return ts.createDiagnosticForNodeFromMessageChain(errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); + } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { @@ -26489,13 +27545,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - return !!(symbol.flags & 107455 /* Value */ || symbol.flags & 2097152 /* Alias */ && resolveAlias(symbol).flags & 107455 /* Value */); + return !!(symbol.flags & 67216319 /* Value */ || symbol.flags & 2097152 /* Alias */ && resolveAlias(symbol).flags & 67216319 /* Value */); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 153 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -26573,12 +27629,12 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -26589,13 +27645,21 @@ var ts; } function getQualifiedLeftMeaning(rightMeaning) { // If we are looking in value space, the parent meaning is value, other wise it is namespace - return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1920 /* Namespace */; + return rightMeaning === 67216319 /* Value */ ? 67216319 /* Value */ : 1920 /* Namespace */; } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing, visitedSymbolTablesMap) { + if (visitedSymbolTablesMap === void 0) { visitedSymbolTablesMap = ts.createMap(); } if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) { return undefined; } - var visitedSymbolTables = []; + var id = "" + getSymbolId(symbol); + var visitedSymbolTables; + if (visitedSymbolTablesMap.has(id)) { + visitedSymbolTables = visitedSymbolTablesMap.get(id); + } + else { + visitedSymbolTablesMap.set(id, visitedSymbolTables = []); + } return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); /** * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already) @@ -26612,7 +27676,7 @@ var ts; // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning) || // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too - !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); + !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing, visitedSymbolTablesMap); } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) && @@ -26622,9 +27686,6 @@ var ts; !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning)); } - function isUMDExportSymbol(symbol) { - return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); - } function trySymbolTable(symbols, ignoreQualification) { // If symbol is directly available by its name in the symbol table if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification)) { @@ -26633,8 +27694,9 @@ var ts; // Check if symbol is any of the alias return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 2097152 /* Alias */ - && symbolFromSymbolTable.escapedName !== "export=" - && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) + && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ + && symbolFromSymbolTable.escapedName !== "default" /* Default */ + && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -26667,7 +27729,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 247 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 250 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -26682,10 +27744,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: continue; default: return false; @@ -26696,11 +27758,11 @@ var ts; return false; } function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { - var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 67901928 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); return access.accessibility === 0 /* Accessible */; } function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { - var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 107455 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false); + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 67216319 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false); return access.accessibility === 0 /* Accessible */; } /** @@ -26771,7 +27833,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -26805,21 +27867,21 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 163 /* TypeQuery */ || + if (entityName.parent.kind === 164 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 145 /* ComputedPropertyName */) { + entityName.parent.kind === 146 /* ComputedPropertyName */) { // Typeof value - meaning = 107455 /* Value */ | 1048576 /* ExportValue */; + meaning = 67216319 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 144 /* QualifiedName */ || entityName.kind === 180 /* PropertyAccessExpression */ || - entityName.parent.kind === 238 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 145 /* QualifiedName */ || entityName.kind === 183 /* PropertyAccessExpression */ || + entityName.parent.kind === 241 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; } else { // Type Reference or TypeAlias entity = Identifier - meaning = 793064 /* Type */; + meaning = 67901928 /* Type */; } var firstIdentifier = getFirstIdentifier(entityName); var symbol = resolveName(enclosingDeclaration, firstIdentifier.escapedText, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); @@ -26857,10 +27919,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 162 /* ConstructorType */ : 161 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 163 /* ConstructorType */ : 162 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 157 /* ConstructSignature */ : 156 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 158 /* ConstructSignature */ : 157 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -26870,6 +27932,7 @@ var ts; } } function typeToString(type, enclosingDeclaration, flags, writer) { + if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */; } if (writer === void 0) { writer = ts.createTextWriter(""); } var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); ts.Debug.assert(typeNode !== undefined, "should always get typenode"); @@ -26952,7 +28015,8 @@ var ts; flags: flags, tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop }, encounteredError: false, - symbolStack: undefined + symbolStack: undefined, + inferTypeParameters: undefined }; } function typeToTypeNodeHelper(type, context) { @@ -26966,22 +28030,22 @@ var ts; return ts.createKeywordTypeNode(119 /* AnyKeyword */); } if (type.flags & 2 /* String */) { - return ts.createKeywordTypeNode(136 /* StringKeyword */); + return ts.createKeywordTypeNode(137 /* StringKeyword */); } if (type.flags & 4 /* Number */) { - return ts.createKeywordTypeNode(133 /* NumberKeyword */); + return ts.createKeywordTypeNode(134 /* NumberKeyword */); } if (type.flags & 8 /* Boolean */) { return ts.createKeywordTypeNode(122 /* BooleanKeyword */); } if (type.flags & 256 /* EnumLiteral */ && !(type.flags & 131072 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); - var parentName = symbolToName(parentSymbol, context, 793064 /* Type */, /*expectsIdentifier*/ false); + var parentName = symbolToName(parentSymbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false); var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type ? parentName : ts.createQualifiedName(parentName, ts.symbolName(type.symbol)); return ts.createTypeReferenceNode(enumLiteralName, /*typeArguments*/ undefined); } if (type.flags & 272 /* EnumLike */) { - var name = symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ false); + var name = symbolToName(type.symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false); return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } if (type.flags & (32 /* StringLiteral */)) { @@ -26995,29 +28059,32 @@ var ts; } if (type.flags & 1024 /* UniqueESSymbol */) { if (!(context.flags & 1048576 /* AllowUniqueESSymbolType */)) { + if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) { + return ts.createTypeQueryNode(symbolToName(type.symbol, context, 67216319 /* Value */, /*expectsIdentifier*/ false)); + } if (context.tracker.reportInaccessibleUniqueSymbolError) { context.tracker.reportInaccessibleUniqueSymbolError(); } } - return ts.createTypeOperatorNode(140 /* UniqueKeyword */, ts.createKeywordTypeNode(137 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(141 /* UniqueKeyword */, ts.createKeywordTypeNode(138 /* SymbolKeyword */)); } if (type.flags & 2048 /* Void */) { return ts.createKeywordTypeNode(105 /* VoidKeyword */); } if (type.flags & 4096 /* Undefined */) { - return ts.createKeywordTypeNode(139 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(140 /* UndefinedKeyword */); } if (type.flags & 8192 /* Null */) { return ts.createKeywordTypeNode(95 /* NullKeyword */); } if (type.flags & 16384 /* Never */) { - return ts.createKeywordTypeNode(130 /* NeverKeyword */); + return ts.createKeywordTypeNode(131 /* NeverKeyword */); } if (type.flags & 512 /* ESSymbol */) { - return ts.createKeywordTypeNode(137 /* SymbolKeyword */); + return ts.createKeywordTypeNode(138 /* SymbolKeyword */); } - if (type.flags & 33554432 /* NonPrimitive */) { - return ts.createKeywordTypeNode(134 /* ObjectKeyword */); + if (type.flags & 134217728 /* NonPrimitive */) { + return ts.createKeywordTypeNode(135 /* ObjectKeyword */); } if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -27036,7 +28103,10 @@ var ts; return typeReferenceToTypeNode(type); } if (type.flags & 32768 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) { - var name = type.symbol ? symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier("?"); + if (type.flags & 32768 /* TypeParameter */ && ts.contains(context.inferTypeParameters, type)) { + return ts.createInferTypeNode(ts.createTypeParameterDeclaration(getNameOfSymbolAsWritten(type.symbol))); + } + var name = type.symbol ? symbolToName(type.symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier("?"); // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } @@ -27049,7 +28119,7 @@ var ts; var types = type.flags & 131072 /* Union */ ? formatUnionTypes(type.types) : type.types; var typeNodes = mapToTypeNodes(types, context); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 167 /* UnionType */ : 168 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 168 /* UnionType */ : 169 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -27074,11 +28144,24 @@ var ts; var indexTypeNode = typeToTypeNodeHelper(type.indexType, context); return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 2097152 /* Conditional */) { + var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); + var saveInferTypeParameters = context.inferTypeParameters; + context.inferTypeParameters = type.root.inferTypeParameters; + var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); + context.inferTypeParameters = saveInferTypeParameters; + var trueTypeNode = typeToTypeNodeHelper(getTrueTypeFromConditionalType(type), context); + var falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context); + return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + if (type.flags & 4194304 /* Substitution */) { + return typeToTypeNodeHelper(type.typeVariable, context); + } ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { ts.Debug.assert(!!(type.flags & 65536 /* Object */)); - var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131 /* ReadonlyKeyword */) : undefined; - var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55 /* QuestionToken */) : undefined; + var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined; + var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined; var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); var mappedTypeNode = ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); @@ -27088,17 +28171,17 @@ var ts; var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 200 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 203 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return createTypeQueryNodeFromSymbol(symbol, 107455 /* Value */); + return createTypeQueryNodeFromSymbol(symbol, 67216319 /* Value */); } else if (ts.contains(context.symbolStack, symbol)) { // If type is an anonymous type literal in a type alias declaration, use type alias name var typeAlias = getTypeAliasForTypeLiteral(type); if (typeAlias) { // The specified symbol flags need to be reinterpreted as type flags - var entityName = symbolToName(typeAlias, context, 793064 /* Type */, /*expectsIdentifier*/ false); + var entityName = symbolToName(typeAlias, context, 67901928 /* Type */, /*expectsIdentifier*/ false); return ts.createTypeReferenceNode(entityName, /*typeArguments*/ undefined); } else { @@ -27133,7 +28216,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; + return declaration.parent.kind === 272 /* SourceFile */ || declaration.parent.kind === 238 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -27153,12 +28236,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 161 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 163 /* ConstructorType */, context); return signatureNode; } } @@ -27175,7 +28258,7 @@ var ts; } function symbolToTypeReferenceName(symbol) { // Unnamed function expressions and arrow functions have reserved names that we don't want to display - var entityName = symbol.flags & 32 /* Class */ || !isReservedMemberName(symbol.escapedName) ? symbolToName(symbol, context, 793064 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier(""); + var entityName = symbol.flags & 32 /* Class */ || !isReservedMemberName(symbol.escapedName) ? symbolToName(symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier(""); return entityName; } function typeReferenceToTypeNode(type) { @@ -27203,7 +28286,7 @@ var ts; } else if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && type.symbol.valueDeclaration && - type.symbol.valueDeclaration.kind === 200 /* ClassExpression */) { + type.symbol.valueDeclaration.kind === 203 /* ClassExpression */) { return createAnonymousTypeNode(type); } else { @@ -27237,7 +28320,7 @@ var ts; } } } - var entityName = undefined; + var entityName = void 0; var nameIdentifier = symbolToTypeReferenceName(type.symbol); if (qualifiedName) { ts.Debug.assert(!qualifiedName.right); @@ -27277,11 +28360,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 156 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 158 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? @@ -27306,32 +28389,36 @@ var ts; context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName)); } } - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ ? anyType : getTypeOfSymbol(propertySymbol); + var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; if (ts.getCheckFlags(propertySymbol) & 1024 /* Late */) { var decl = ts.firstOrUndefined(propertySymbol.declarations); - var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); + var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 67216319 /* Value */); if (name && context.tracker.trackSymbol) { - context.tracker.trackSymbol(name, saveEnclosingDeclaration, 107455 /* Value */); + context.tracker.trackSymbol(name, saveEnclosingDeclaration, 67216319 /* Value */); } } - var propertyName = symbolToName(propertySymbol, context, 107455 /* Value */, /*expectsIdentifier*/ true); + var propertyName = symbolToName(propertySymbol, context, 67216319 /* Value */, /*expectsIdentifier*/ true); context.enclosingDeclaration = saveEnclosingDeclaration; var optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? ts.createToken(55 /* QuestionToken */) : undefined; if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length) { var signatures = getSignaturesOfType(propertyType, 0 /* Call */); for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { var signature = signatures_1[_e]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 151 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(methodDeclaration); } } else { + var savedFlags = context.flags; + context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119 /* AnyKeyword */); - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined; + context.flags = savedFlags; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined; var propertySignature = ts.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode, /*initializer*/ undefined); typeElements.push(propertySignature); @@ -27355,7 +28442,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 136 /* StringKeyword */ : 133 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 137 /* StringKeyword */ : 134 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -27367,7 +28454,7 @@ var ts; context.encounteredError = true; } return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var typeParameters; @@ -27410,7 +28497,7 @@ var ts; if (constraint === void 0) { constraint = getConstraintFromTypeParameter(type); } var savedContextFlags = context.flags; context.flags &= ~512 /* WriteTypeParametersInQualifiedName */; // Avoids potential infinite loop when building for a claimspace with a generic - var name = symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ true); + var name = symbolToName(type.symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ true); var constraintNode = constraint && typeToTypeNodeHelper(constraint, context); var defaultParameter = getDefaultFromTypeParameter(type); var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); @@ -27418,7 +28505,7 @@ var ts; return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); } function symbolToParameterDeclaration(parameterSymbol, context) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 147 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148 /* Parameter */); ts.Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter); var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -27444,7 +28531,7 @@ var ts; function elideInitializerAndSetEmitFlags(node) { var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 177 /* BindingElement */) { + if (clone.kind === 180 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -27632,8 +28719,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 169 /* ParenthesizedType */; }); - if (node.kind === 232 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 172 /* ParenthesizedType */; }); + if (node.kind === 235 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -27641,14 +28728,14 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 235 /* ModuleBlock */ && + node.parent.kind === 238 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? '"' + ts.escapeString(type.value) + '"' : "" + type.value; } function isDefaultBindingContext(location) { - return location.kind === 269 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location); } /** * Gets a human-readable name for a symbol. @@ -27673,22 +28760,22 @@ var ts; if (name) { return ts.declarationNameToString(name); } - if (declaration.parent && declaration.parent.kind === 227 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } switch (declaration.kind) { - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return "(Anonymous class)"; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return "(Anonymous function)"; } } - if (symbol.syntheticLiteralTypeOrigin) { - var stringValue = symbol.syntheticLiteralTypeOrigin.value; + if (symbol.nameType && symbol.nameType.flags & 32 /* StringLiteral */) { + var stringValue = symbol.nameType.value; if (!ts.isIdentifierText(stringValue, compilerOptions.target)) { return "\"" + ts.escapeString(stringValue, 34 /* doubleQuote */) + "\""; } @@ -27706,22 +28793,22 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 229 /* FunctionDeclaration */: - case 233 /* EnumDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 236 /* EnumDeclaration */: + case 241 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -27729,53 +28816,53 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 238 /* ImportEqualsDeclaration */ && parent.kind !== 269 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { + !(node.kind !== 241 /* ImportEqualsDeclaration */ && parent.kind !== 272 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 153 /* Constructor */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: - case 147 /* Parameter */: - case 235 /* ModuleBlock */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 160 /* TypeReference */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: + case 148 /* Parameter */: + case 238 /* ModuleBlock */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 161 /* TypeReference */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 172 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: return false; // Type parameters are always visible - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: // Source file and namespace export are always visible - case 269 /* SourceFile */: - case 237 /* NamespaceExportDeclaration */: + case 272 /* SourceFile */: + case 240 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return false; default: return false; @@ -27784,11 +28871,11 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 244 /* ExportAssignment */) { - exportSymbol = resolveName(node, node.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); + if (node.parent && node.parent.kind === 247 /* ExportAssignment */) { + exportSymbol = resolveName(node, node.escapedText, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 247 /* ExportSpecifier */) { - exportSymbol = getTargetOfExportSpecifier(node.parent, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); + else if (node.parent.kind === 250 /* ExportSpecifier */) { + exportSymbol = getTargetOfExportSpecifier(node.parent, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; if (exportSymbol) { @@ -27809,7 +28896,7 @@ var ts; // Add the referenced top container visible var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); - var importSymbol = resolveName(declaration, firstIdentifier.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, undefined, undefined, /*isUse*/ false); + var importSymbol = resolveName(declaration, firstIdentifier.escapedText, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, undefined, undefined, /*isUse*/ false); if (importSymbol) { buildVisibleNodeList(importSymbol.declarations); } @@ -27883,12 +28970,12 @@ var ts; function getDeclarationContainer(node) { node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 227 /* VariableDeclaration */: - case 228 /* VariableDeclarationList */: - case 243 /* ImportSpecifier */: - case 242 /* NamedImports */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 230 /* VariableDeclaration */: + case 231 /* VariableDeclarationList */: + case 246 /* ImportSpecifier */: + case 245 /* NamedImports */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: return false; default: return true; @@ -27919,7 +29006,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 145 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 146 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 12288 /* Nullable */); }); @@ -27966,7 +29053,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 175 /* ObjectBindingPattern */) { + if (pattern.kind === 178 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -27996,7 +29083,7 @@ var ts; parentType = getNonNullableType(parentType); } var propType = getTypeOfPropertyOfType(parentType, text); - var declaredType = propType && getApparentTypeForLocation(propType, declaration.name); + var declaredType = propType && getConstraintForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); @@ -28054,7 +29141,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 178 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 181 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -28064,11 +29151,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 216 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 219 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (32768 /* TypeParameter */ | 524288 /* Index */) ? indexType : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 217 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 220 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -28079,14 +29166,23 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } - var isOptional = !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken && includeOptionality; + var isOptional = false; + if (includeOptionality) { + if (ts.isInJavaScriptFile(declaration) && ts.isParameter(declaration)) { + var parameterTags = ts.getJSDocParameterTags(declaration); + isOptional = !!(parameterTags && parameterTags.length > 0 && ts.find(parameterTags, function (tag) { return tag.isBracketed; })); + } + if (!ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken) { + isOptional = true; + } + } // Use type from type annotation if one is present var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); if (declaredType) { return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) && - declaration.kind === 227 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 230 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 2097152 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -28100,11 +29196,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 155 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 154 /* GetAccessor */); + if (func.kind === 156 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -28146,20 +29242,25 @@ var ts; return undefined; } function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + // function/class/{} assignments are fresh declarations, not property assignments, so only add prototype assignments + var specialDeclaration = ts.getAssignedJavascriptInitializer(symbol.valueDeclaration); + if (specialDeclaration) { + return getWidenedLiteralType(checkExpressionCached(specialDeclaration)); + } var types = []; var definedInConstructor = false; var definedInMethod = false; var jsDocType; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - var expression = declaration.kind === 195 /* BinaryExpression */ ? declaration : - declaration.kind === 180 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 195 /* BinaryExpression */) : + var expression = declaration.kind === 198 /* BinaryExpression */ ? declaration : + declaration.kind === 183 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 198 /* BinaryExpression */) : undefined; if (!expression) { return unknownType; } if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99 /* ThisKeyword */) { - if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 153 /* Constructor */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 154 /* Constructor */) { definedInConstructor = true; } else { @@ -28258,7 +29359,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 175 /* ObjectBindingPattern */ + return pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -28295,7 +29396,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 147 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 148 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -28317,7 +29418,7 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 244 /* ExportAssignment */) { + if (declaration.kind === 247 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) { @@ -28333,8 +29434,8 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 195 /* BinaryExpression */ || - declaration.kind === 180 /* PropertyAccessExpression */ && declaration.parent.kind === 195 /* BinaryExpression */) { + if (declaration.kind === 198 /* BinaryExpression */ || + declaration.kind === 183 /* PropertyAccessExpression */ && declaration.parent.kind === 198 /* BinaryExpression */) { type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else if (ts.isJSDocPropertyTag(declaration) @@ -28368,7 +29469,7 @@ var ts; type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } else { - ts.Debug.fail("Unhandled declaration kind! " + ts.SyntaxKind[declaration.kind]); + ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration)); } if (!popTypeResolution()) { type = reportCircularityError(symbol); @@ -28379,7 +29480,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); } @@ -28400,8 +29501,8 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 155 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 156 /* SetAccessor */); if (getter && ts.isInJavaScriptFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -28428,6 +29529,7 @@ var ts; if (getter && getter.body) { type = getReturnTypeFromBody(getter); } + // Otherwise, fall back to 'any'. else { if (noImplicitAny) { if (setter) { @@ -28445,7 +29547,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -28492,7 +29594,7 @@ var ts; // type symbol, call getDeclaredTypeOfSymbol. // This check is important because without it, a call to getTypeOfSymbol could end // up recursively calling getTypeOfAlias, causing a stack overflow. - links.type = targetSymbol.flags & 107455 /* Value */ + links.type = targetSymbol.flags & 67216319 /* Value */ ? getTypeOfSymbol(targetSymbol) : unknownType; } @@ -28596,29 +29698,33 @@ var ts; return undefined; } switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 173 /* MappedType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 176 /* MappedType */: + case 170 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 173 /* MappedType */) { + if (node.kind === 176 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } + else if (node.kind === 170 /* ConditionalType */) { + return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node) || ts.emptyArray); var thisType = includeThisTypes && - (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */ || node.kind === 231 /* InterfaceDeclaration */) && + (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */ || node.kind === 234 /* InterfaceDeclaration */) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -28626,7 +29732,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); return getOuterTypeParameters(declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -28635,8 +29741,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 231 /* InterfaceDeclaration */ || node.kind === 230 /* ClassDeclaration */ || - node.kind === 200 /* ClassExpression */ || node.kind === 232 /* TypeAliasDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */ || node.kind === 233 /* ClassDeclaration */ || + node.kind === 203 /* ClassExpression */ || node.kind === 235 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -28816,14 +29922,14 @@ var ts; // A valid base type is `any`, any non-generic object type or intersection of non-generic // object types. function isValidBaseType(type) { - return type.flags & (65536 /* Object */ | 33554432 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + return type.flags & (65536 /* Object */ | 134217728 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || type.flags & 262144 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 234 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -28859,7 +29965,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */) { + if (declaration.kind === 234 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -28868,7 +29974,7 @@ var ts; for (var _b = 0, baseTypeNodes_1 = baseTypeNodes; _b < baseTypeNodes_1.length; _b++) { var node = baseTypeNodes_1[_b]; if (ts.isEntityNameExpression(node.expression)) { - var baseSymbol = resolveEntityName(node.expression, 793064 /* Type */, /*ignoreErrors*/ true); + var baseSymbol = resolveEntityName(node.expression, 67901928 /* Type */, /*ignoreErrors*/ true); if (!baseSymbol || !(baseSymbol.flags & 64 /* Interface */) || getDeclaredTypeOfClassOrInterface(baseSymbol).thisType) { return false; } @@ -28917,9 +30023,9 @@ var ts; return unknownType; } var declaration = ts.find(symbol.declarations, function (d) { - return d.kind === 288 /* JSDocTypedefTag */ || d.kind === 232 /* TypeAliasDeclaration */; + return d.kind === 291 /* JSDocTypedefTag */ || d.kind === 235 /* TypeAliasDeclaration */; }); - var typeNode = declaration.kind === 288 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; + var typeNode = declaration.kind === 291 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; // If typeNode is missing, we will error in checkJSDocTypedefTag. var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType; if (popTypeResolution()) { @@ -28949,7 +30055,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 71 /* Identifier */: @@ -28966,7 +30072,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 9 /* StringLiteral */) { @@ -28993,7 +30099,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)); @@ -29073,20 +30179,20 @@ var ts; function isThislessType(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 134 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 177 /* LiteralType */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isThislessType(node.elementType); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -29110,7 +30216,7 @@ var ts; */ function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); - return (node.kind === 153 /* Constructor */ || (returnType && isThislessType(returnType))) && + return (node.kind === 154 /* Constructor */ || (returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter)); } @@ -29126,12 +30232,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -29232,7 +30338,7 @@ var ts; else { symbol.declarations.push(member); } - if (symbolFlags & 107455 /* Value */) { + if (symbolFlags & 67216319 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || valueDeclaration.kind !== member.kind) { symbol.valueDeclaration = member; @@ -29295,8 +30401,18 @@ var ts; error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_3); lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */); } + var symbolLinks_1 = getSymbolLinks(lateSymbol); + if (!symbolLinks_1.nameType) { + // Retain link to name type so that it can be reused later + symbolLinks_1.nameType = type; + } addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); - lateSymbol.parent = parent; + if (lateSymbol.parent) { + ts.Debug.assert(lateSymbol.parent === parent, "Existing symbol parent should match new one"); + } + else { + lateSymbol.parent = parent; + } return links.resolvedSymbol = lateSymbol; } } @@ -29444,6 +30560,8 @@ var ts; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasLiteralTypes = hasLiteralTypes; + sig.target = undefined; + sig.mapper = undefined; return sig; } function cloneSignature(sig) { @@ -29496,7 +30614,7 @@ var ts; } return [signature]; } - var result = undefined; + var result; for (var i = 0; i < signatureLists.length; i++) { // Allow matching non-generic signatures to have excess parameters and different return types var match = i === listIndex ? signature : findMatchingSignature(signatureLists[i], signature, /*partialMatch*/ true, /*ignoreThisTypes*/ true, /*ignoreReturnTypes*/ true); @@ -29513,7 +30631,7 @@ var ts; // type is the union of the constituent return types. function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); - var result = undefined; + var result; for (var i = 0; i < signatureLists.length; i++) { for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i++) { var signature = _a[_i]; @@ -29644,7 +30762,7 @@ var ts; else { // Combinations of function, class, enum and module var members = emptySymbols; - var stringIndexInfo = undefined; + var stringIndexInfo = void 0; if (symbol.exports) { members = getExportsOfSymbol(symbol); } @@ -29682,8 +30800,9 @@ var ts; } function resolveReverseMappedTypeMembers(type) { var indexInfo = getIndexInfoOfType(type.source, 0 /* String */); - var readonlyMask = type.mappedType.declaration.readonlyToken ? false : true; - var optionalMask = type.mappedType.declaration.questionToken ? 0 : 16777216 /* Optional */; + var modifiers = getMappedTypeModifiers(type.mappedType); + var readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true; + var optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */; var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); var members = ts.createSymbolTable(); for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { @@ -29707,13 +30826,12 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var templateType = getTemplateTypeFromMappedType(type); + var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' - var templateReadonly = !!type.declaration.readonlyToken; - var templateOptional = !!type.declaration.questionToken; + var templateModifiers = getMappedTypeModifiers(type); var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // We have a { [P in keyof T]: X } for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { var propertySymbol = _a[_i]; @@ -29727,7 +30845,7 @@ var ts; // First, if the constraint type is a type parameter, obtain the base constraint. Then, // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. // Finally, iterate over the constituents of the resulting iteration type. - var keyType = constraintType.flags & 1081344 /* TypeVariable */ ? getApparentType(constraintType) : constraintType; + var keyType = constraintType.flags & 7372800 /* InstantiableNonPrimitive */ ? getApparentType(constraintType) : constraintType; var iterationType = keyType.flags & 524288 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; forEachType(iterationType, addMemberForKeyType); } @@ -29743,27 +30861,33 @@ var ts; // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var iterationMapper = createTypeMapper([typeParameter], [t]); - var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; + var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); var propType = instantiateType(templateType, templateMapper); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. if (t.flags & 32 /* StringLiteral */) { - var propName = ts.escapeLeadingUnderscores(t.value); + var propName = getLateBoundNameFromType(t); var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 16777216 /* Optional */); - var checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; - var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, checkFlags); - prop.type = propType; + var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || + !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); + var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || + !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp)); + var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, isReadonly ? 8 /* Readonly */ : 0); + // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the + // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks + // mode, if the underlying property is optional we remove 'undefined' from the type. + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */ ? getTypeWithFacts(propType, 131072 /* NEUndefined */) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; } - prop.syntheticLiteralTypeOrigin = t; + prop.nameType = t; members.set(propName, prop); } else if (t.flags & (1 /* Any */ | 2 /* String */)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } } } @@ -29778,14 +30902,14 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : unknownType); } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. @@ -29804,16 +30928,21 @@ var ts; return type.modifiersType; } function getMappedTypeModifiers(type) { - return (type.declaration.readonlyToken ? 1 /* Readonly */ : 0) | - (type.declaration.questionToken ? 2 /* Optional */ : 0); + var declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 /* MinusToken */ ? 2 /* ExcludeReadonly */ : 1 /* IncludeReadonly */ : 0) | + (declaration.questionToken ? declaration.questionToken.kind === 38 /* MinusToken */ ? 8 /* ExcludeOptional */ : 4 /* IncludeOptional */ : 0); } - function getCombinedMappedTypeModifiers(type) { + function getMappedTypeOptionality(type) { + var modifiers = getMappedTypeModifiers(type); + return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type) { + var optionality = getMappedTypeOptionality(type); var modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type) { - return ts.getObjectFlags(type) & 32 /* Mapped */ && !!type.declaration.questionToken; + return !!(ts.getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */); } function isGenericMappedType(type) { return ts.getObjectFlags(type) & 32 /* Mapped */ && isGenericIndexType(getConstraintTypeFromMappedType(type)); @@ -29906,7 +31035,10 @@ var ts; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { - props.set(escapedName, createUnionOrIntersectionProperty(unionType, escapedName)); + var prop = createUnionOrIntersectionProperty(unionType, escapedName); + // May be undefined if the property is private + if (prop) + props.set(escapedName, prop); } } } @@ -29915,7 +31047,8 @@ var ts; function getConstraintOfType(type) { return type.flags & 32768 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : type.flags & 1048576 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : - getBaseConstraintOfType(type); + type.flags & 2097152 /* Conditional */ ? getConstraintOfConditionalType(type) : + getBaseConstraintOfType(type); } function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; @@ -29934,17 +31067,48 @@ var ts; } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } - function getBaseConstraintOfType(type) { - if (type.flags & (1081344 /* TypeVariable */ | 393216 /* UnionOrIntersection */)) { + function getDefaultConstraintOfConditionalType(type) { + return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]); + } + function getConstraintOfDistributiveConditionalType(type) { + // Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained + // type parameter. If so, create an instantiation of the conditional type where T is replaced + // with its constraint. We do this because if the constraint is a union type it will be distributed + // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' + // removes 'undefined' from T. + if (type.root.isDistributive) { + var constraint = getConstraintOfType(type.checkType); + if (constraint) { + var mapper = createTypeMapper([type.root.checkType], [constraint]); + return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + } + } + return undefined; + } + function getConstraintOfConditionalType(type) { + return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); + } + function getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type) { + if (type.flags & (7372800 /* InstantiableNonPrimitive */ | 393216 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; } } - else if (type.flags & 524288 /* Index */) { + } + function getBaseConstraintOfType(type) { + var constraint = getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type); + if (!constraint && type.flags & 524288 /* Index */) { return stringType; } - return undefined; + return constraint; + } + /** + * This is similar to `getBaseConstraintOfType` except it returns the input type if there's no base constraint, instead of `undefined` + * It also doesn't map indexes to `string`, as where this is used this would be unneeded (and likely undesirable) + */ + function getBaseConstraintOrType(type) { + return getBaseConstraintOfType(type) || type; } function hasNonCircularBaseConstraint(type) { return getResolvedBaseConstraint(type) !== circularConstraintType; @@ -30007,6 +31171,13 @@ var ts; var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (t.flags & 2097152 /* Conditional */) { + var constraint = getConstraintOfConditionalType(t); + return constraint && getBaseConstraint(constraint); + } + if (t.flags & 4194304 /* Substitution */) { + return getBaseConstraint(t.substitute); + } if (isGenericMappedType(t)) { return emptyObjectType; } @@ -30065,13 +31236,13 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 1081344 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + var t = type.flags & 7897088 /* Instantiable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; return t.flags & 262144 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 524322 /* StringLike */ ? globalStringType : t.flags & 84 /* NumberLike */ ? globalNumberType : t.flags & 136 /* BooleanLike */ ? globalBooleanType : t.flags & 1536 /* ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : - t.flags & 33554432 /* NonPrimitive */ ? emptyObjectType : + t.flags & 134217728 /* NonPrimitive */ ? emptyObjectType : t; } function createUnionOrIntersectionProperty(containingType, name) { @@ -30113,7 +31284,7 @@ var ts; } var propTypes = []; var declarations = []; - var commonType = undefined; + var commonType; for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { var prop = props_1[_b]; if (prop.declarations) { @@ -30254,7 +31425,7 @@ var ts; } function isJSDocOptionalParameter(node) { if (ts.isInJavaScriptFile(node)) { - if (node.type && node.type.kind === 276 /* JSDocOptionalType */) { + if (node.type && node.type.kind === 279 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -30265,7 +31436,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 276 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 279 /* JSDocOptionalType */; } } } @@ -30284,9 +31455,8 @@ var ts; return true; } if (node.initializer) { - var signatureDeclaration = node.parent; - var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = signatureDeclaration.parameters.indexOf(node); + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -30371,7 +31541,7 @@ var ts; var parameters = []; var hasLiteralTypes = false; var minArgumentCount = 0; - var thisParameter = undefined; + var thisParameter = void 0; var hasThisParameter = void 0; var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); @@ -30384,7 +31554,7 @@ var ts; var paramSymbol = param.symbol; // Include parameter symbol instead of property symbol in the signature if (paramSymbol && !!(paramSymbol.flags & 4 /* Property */) && !ts.isBindingPattern(param.name)) { - var resolvedSymbol = resolveName(param, paramSymbol.escapedName, 107455 /* Value */, undefined, undefined, /*isUse*/ false); + var resolvedSymbol = resolveName(param, paramSymbol.escapedName, 67216319 /* Value */, undefined, undefined, /*isUse*/ false); paramSymbol = resolvedSymbol; } if (i === 0 && paramSymbol.escapedName === "this") { @@ -30394,7 +31564,7 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 174 /* LiteralType */) { + if (param.type && param.type.kind === 177 /* LiteralType */) { hasLiteralTypes = true; } // Record a new minimum argument count if this is not an optional parameter @@ -30407,16 +31577,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 154 /* GetAccessor */ || declaration.kind === 155 /* SetAccessor */) && + if ((declaration.kind === 155 /* GetAccessor */ || declaration.kind === 156 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = declaration.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 153 /* Constructor */ ? + var classType = declaration.kind === 154 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -30426,18 +31596,21 @@ var ts; } return links.resolvedSignature; } + /** + * A JS function gets a synthetic rest parameter if it references `arguments` AND: + * 1. It has no parameters but at least one `@param` with a type that starts with `...` + * OR + * 2. It has at least one parameter, and the last parameter has a matching `@param` with a type that starts with `...` + */ function maybeAddJsSyntheticRestParameter(declaration, parameters) { - // JS functions get a free rest parameter if: - // a) The last parameter has `...` preceding its type - // b) It references `arguments` somewhere + if (!containsArgumentsReference(declaration)) { + return false; + } var lastParam = ts.lastOrUndefined(declaration.parameters); - var lastParamTags = lastParam && ts.getJSDocParameterTags(lastParam); + var lastParamTags = lastParam ? ts.getJSDocParameterTags(lastParam) : ts.getJSDocTags(declaration).filter(ts.isJSDocParameterTag); var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); - if (!lastParamVariadicType && !containsArgumentsReference(declaration)) { - return false; - } var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args"); syntheticArgsSymbol.type = lastParamVariadicType ? createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)) : anyArrayType; syntheticArgsSymbol.isRestParameter = true; @@ -30461,8 +31634,8 @@ var ts; } // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 154 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 155 /* SetAccessor */); + if (declaration.kind === 155 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { @@ -30486,11 +31659,11 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return node.name.kind === 145 /* ComputedPropertyName */ + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return node.name.kind === 146 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); @@ -30504,20 +31677,20 @@ var ts; for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -30561,7 +31734,7 @@ var ts; } else { var declaration = signature.declaration; - signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 159 /* TypePredicate */ ? + signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 /* TypePredicate */ ? createTypePredicateFromTypePredicateNode(declaration.type) : noTypePredicate; } @@ -30624,7 +31797,10 @@ var ts; return instantiation; } function createSignatureInstantiation(signature, typeArguments) { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); + return instantiateSignature(signature, createSignatureTypeMapper(signature, typeArguments), /*eraseTypeParameters*/ true); + } + function createSignatureTypeMapper(signature, typeArguments) { + return createTypeMapper(signature.typeParameters, typeArguments); } function getErasedSignature(signature) { return signature.typeParameters ? @@ -30664,7 +31840,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 153 /* Constructor */ || signature.declaration.kind === 157 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 154 /* Constructor */ || signature.declaration.kind === 158 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -30678,7 +31854,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 133 /* NumberKeyword */ : 136 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 134 /* NumberKeyword */ : 137 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -30705,7 +31881,43 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return type.symbol && ts.getDeclarationOfKind(type.symbol, 146 /* TypeParameter */).constraint; + return type.symbol && ts.getDeclarationOfKind(type.symbol, 147 /* TypeParameter */).constraint; + } + function getInferredTypeParameterConstraint(typeParameter) { + var inferences; + if (typeParameter.symbol) { + for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + // When an 'infer T' declaration is immediately contained in a type reference node + // (such as 'Foo'), T's constraint is inferred from the constraint of the + // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are + // present, we form an intersection of the inferred constraint types. + if (declaration.parent.kind === 171 /* InferType */ && declaration.parent.parent.kind === 161 /* TypeReference */) { + var typeReference = declaration.parent.parent; + var typeParameters = getTypeParametersForTypeReference(typeReference); + if (typeParameters) { + var index = typeReference.typeArguments.indexOf(declaration.parent); + if (index < typeParameters.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); + if (declaredConstraint) { + // Type parameter constraints can reference other type parameters so + // constraints need to be instantiated. If instantiation produces the + // type parameter itself, we discard that inference. For example, in + // type Foo = [T, U]; + // type Bar = T extends Foo ? Foo : T; + // the instantiated constraint for U is X, so we discard that inference. + var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters)); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts.append(inferences, constraint); + } + } + } + } + } + } + } + return inferences && getIntersectionType(inferences); } function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { @@ -30715,13 +31927,14 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : + getInferredTypeParameterConstraint(typeParameter) || noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 146 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; @@ -30758,7 +31971,7 @@ var ts; result |= type.flags; } } - return result & 29360128 /* PropagatingFlags */; + return result & 117440512 /* PropagatingFlags */; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); @@ -30795,7 +32008,7 @@ var ts; var isJs = ts.isInJavaScriptFile(node); var isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - var missingAugmentsTag = isJs && node.parent.kind !== 282 /* JSDocAugmentsTag */; + var missingAugmentsTag = isJs && node.parent.kind !== 285 /* JSDocAugmentsTag */; var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag @@ -30816,11 +32029,7 @@ var ts; var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs)); return createTypeReference(type, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); @@ -30852,23 +32061,20 @@ var ts; } return getTypeAliasInstantiation(symbol, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeReferenceName(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; } + // fall through; } return undefined; } @@ -30889,28 +32095,25 @@ var ts; } // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); - if (res !== undefined) { - if (typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return res; + if (res) { + return checkNoTypeArguments(node, symbol) ? + res.flags & 32768 /* TypeParameter */ ? getConstrainedTypeVariable(res, node) : res : + unknownType; } - if (!(symbol.flags & 107455 /* Value */ && isJSDocTypeReference(node))) { + if (!(symbol.flags & 67216319 /* Value */ && isJSDocTypeReference(node))) { return unknownType; } // A jsdoc TypeReference may have resolved to a value (as opposed to a type). If // the symbol is a constructor function, return the inferred class type; otherwise, // the type of this reference is just the type of the value we resolved to. + var assignedType = getAssignedClassType(symbol); var valueType = getTypeOfSymbol(symbol); - if (valueType.symbol && !isInferredClassType(valueType)) { - var referenceType = getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments); - if (referenceType) { - return referenceType; - } + var referenceType = valueType.symbol && !isInferredClassType(valueType) && getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments); + if (referenceType || assignedType) { + return referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType; } // Resolve the type reference as a Type for the purpose of reporting errors. - resolveTypeReferenceName(getTypeReferenceName(node), 793064 /* Type */); + resolveTypeReferenceName(getTypeReferenceName(node), 67901928 /* Type */); return valueType; } function getTypeReferenceTypeWorker(node, symbol, typeArguments) { @@ -30926,42 +32129,88 @@ var ts; return getInferredClassType(symbol); } } + function getSubstitutionType(typeVariable, substitute) { + var result = createType(4194304 /* Substitution */); + result.typeVariable = typeVariable; + result.substitute = substitute; + return result; + } + function isUnaryTupleTypeNode(node) { + return node.kind === 167 /* TupleType */ && node.elementTypes.length === 1; + } + function getImpliedConstraint(typeVariable, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + undefined; + } + function getConstrainedTypeVariable(typeVariable, node) { + var constraints; + while (ts.isPartOfTypeNode(node)) { + var parent = node.parent; + if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) { + var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (constraint) { + constraints = ts.append(constraints, constraint); + } + } + node = parent; + } + return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + } function isJSDocTypeReference(node) { - return node.flags & 1048576 /* JSDoc */ && node.kind === 160 /* TypeReference */; + return node.flags & 1048576 /* JSDoc */ && node.kind === 161 /* TypeReference */; + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : ts.declarationNameToString(node.typeName)); + return false; + } + return true; } function getIntendedTypeFromJSDocTypeReference(node) { if (ts.isIdentifier(node.typeName)) { - if (node.typeName.escapedText === "Object") { - if (ts.isJSDocIndexSignature(node)) { - var indexed = getTypeFromTypeNode(node.typeArguments[0]); - var target = getTypeFromTypeNode(node.typeArguments[1]); - var index = createIndexInfo(target, /*isReadonly*/ false); - return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); - } - return anyType; - } + var typeArgs = node.typeArguments; switch (node.typeName.escapedText) { case "String": + checkNoTypeArguments(node); return stringType; case "Number": + checkNoTypeArguments(node); return numberType; case "Boolean": + checkNoTypeArguments(node); return booleanType; case "Void": + checkNoTypeArguments(node); return voidType; case "Undefined": + checkNoTypeArguments(node); return undefinedType; case "Null": + checkNoTypeArguments(node); return nullType; case "Function": case "function": + checkNoTypeArguments(node); return globalFunctionType; case "Array": case "array": - return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined; + return !typeArgs || !typeArgs.length ? anyArrayType : undefined; case "Promise": case "promise": - return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + return !typeArgs || !typeArgs.length ? createPromiseType(anyType) : undefined; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var index = createIndexInfo(target, /*isReadonly*/ false); + return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); + } + return anyType; + } + checkNoTypeArguments(node); + return anyType; } } } @@ -30974,17 +32223,17 @@ var ts; if (!links.resolvedType) { var symbol = void 0; var type = void 0; - var meaning = 793064 /* Type */; + var meaning = 67901928 /* Type */; if (isJSDocTypeReference(node)) { type = getIntendedTypeFromJSDocTypeReference(node); - meaning |= 107455 /* Value */; + meaning |= 67216319 /* Value */; } if (!type) { symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning); type = getTypeReferenceType(node, symbol); } // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the - // type reference in checkTypeReferenceOrExpressionWithTypeArguments. + // type reference in checkTypeReferenceNode. links.resolvedSymbol = symbol; links.resolvedType = type; } @@ -31010,9 +32259,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: return declaration; } } @@ -31032,10 +32281,10 @@ var ts; return type; } function getGlobalValueSymbol(name, reportErrors) { - return getGlobalSymbol(name, 107455 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); + return getGlobalSymbol(name, 67216319 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } function getGlobalTypeSymbol(name, reportErrors) { - return getGlobalSymbol(name, 793064 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); + return getGlobalSymbol(name, 67901928 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { // Don't track references for global symbols anyway, so value if `isReference` is arbitrary @@ -31086,18 +32335,9 @@ var ts; } function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - var symbol = getGlobalSymbol(name, 793064 /* Type */, /*diagnostic*/ undefined); + var symbol = getGlobalSymbol(name, 67901928 /* Type */, /*diagnostic*/ undefined); return symbol && getTypeOfGlobalSymbol(symbol, arity); } - /** - * Returns a type that is inside a namespace at the global scope, e.g. - * getExportedTypeFromNamespace('JSX', 'Element') returns the JSX.Element type - */ - function getExportedTypeFromNamespace(namespace, name) { - var namespaceSymbol = getGlobalSymbol(namespace, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); - var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064 /* Type */); - return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); - } /** * Instantiates a global type that is generic with some element type, and returns that instantiation. */ @@ -31196,27 +32436,29 @@ var ts; return true; } combined |= t.flags; - if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 33554432 /* NonPrimitive */)) { + if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 134217728 /* NonPrimitive */)) { return true; } } return false; } - function addTypeToUnion(typeSet, type) { + function addTypeToUnion(typeSet, includes, type) { var flags = type.flags; if (flags & 131072 /* Union */) { - addTypesToUnion(typeSet, type.types); + includes = addTypesToUnion(typeSet, includes, type.types); } else if (flags & 1 /* Any */) { - typeSet.containsAny = true; + includes |= 1 /* Any */; + if (type === wildcardType) + includes |= 4096 /* Wildcard */; } else if (!strictNullChecks && flags & 12288 /* Nullable */) { if (flags & 4096 /* Undefined */) - typeSet.containsUndefined = true; + includes |= 2 /* Undefined */; if (flags & 8192 /* Null */) - typeSet.containsNull = true; - if (!(flags & 4194304 /* ContainsWideningType */)) - typeSet.containsNonWideningType = true; + includes |= 4 /* Null */; + if (!(flags & 16777216 /* ContainsWideningType */)) + includes |= 16 /* NonWideningType */; } else if (!(flags & 16384 /* Never */ || flags & 262144 /* Intersection */ && isEmptyIntersectionType(type))) { // We ignore 'never' types in unions. Likewise, we ignore intersections of unit types as they are @@ -31224,13 +32466,13 @@ var ts; // intersections of unit types into 'never' upon construction, but deferring the reduction makes it // easier to reason about their origin. if (flags & 2 /* String */) - typeSet.containsString = true; + includes |= 32 /* String */; if (flags & 4 /* Number */) - typeSet.containsNumber = true; + includes |= 64 /* Number */; if (flags & 512 /* ESSymbol */) - typeSet.containsESSymbol = true; + includes |= 128 /* ESSymbol */; if (flags & 1120 /* StringOrNumberLiteralOrUnique */) - typeSet.containsLiteralOrUniqueESSymbol = true; + includes |= 256 /* LiteralOrUniqueESSymbol */; var len = typeSet.length; var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues); if (index < 0) { @@ -31240,14 +32482,16 @@ var ts; } } } + return includes; } // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. - function addTypesToUnion(typeSet, types) { + function addTypesToUnion(typeSet, includes, types) { for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { var type = types_6[_i]; - addTypeToUnion(typeSet, type); + includes = addTypeToUnion(typeSet, includes, type); } + return includes; } function containsIdenticalType(types, type) { for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { @@ -31295,15 +32539,15 @@ var ts; } } } - function removeRedundantLiteralTypes(types) { + function removeRedundantLiteralTypes(types, includes) { var i = types.length; while (i > 0) { i--; var t = types[i]; - var remove = t.flags & 32 /* StringLiteral */ && types.containsString || - t.flags & 64 /* NumberLiteral */ && types.containsNumber || - t.flags & 1024 /* UniqueESSymbol */ && types.containsESSymbol || - t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 2097152 /* FreshLiteral */ && containsType(types, t.regularType); + var remove = t.flags & 32 /* StringLiteral */ && includes & 32 /* String */ || + t.flags & 64 /* NumberLiteral */ && includes & 64 /* Number */ || + t.flags & 1024 /* UniqueESSymbol */ && includes & 128 /* ESSymbol */ || + t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 8388608 /* FreshLiteral */ && containsType(types, t.regularType); if (remove) { ts.orderedRemoveItemAt(types, i); } @@ -31325,14 +32569,14 @@ var ts; return types[0]; } var typeSet = []; - addTypesToUnion(typeSet, types); - if (typeSet.containsAny) { - return anyType; + var includes = addTypesToUnion(typeSet, 0, types); + if (includes & 1 /* Any */) { + return includes & 4096 /* Wildcard */ ? wildcardType : anyType; } switch (unionReduction) { case 1 /* Literal */: - if (typeSet.containsLiteralOrUniqueESSymbol) { - removeRedundantLiteralTypes(typeSet); + if (includes & 256 /* LiteralOrUniqueESSymbol */) { + removeRedundantLiteralTypes(typeSet, includes); } break; case 2 /* Subtype */: @@ -31340,8 +32584,8 @@ var ts; break; } if (typeSet.length === 0) { - return typeSet.containsNull ? typeSet.containsNonWideningType ? nullType : nullWideningType : - typeSet.containsUndefined ? typeSet.containsNonWideningType ? undefinedType : undefinedWideningType : + return includes & 4 /* Null */ ? includes & 16 /* NonWideningType */ ? nullType : nullWideningType : + includes & 2 /* Undefined */ ? includes & 16 /* NonWideningType */ ? undefinedType : undefinedWideningType : neverType; } return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments); @@ -31413,39 +32657,44 @@ var ts; } return links.resolvedType; } - function addTypeToIntersection(typeSet, type) { - if (type.flags & 262144 /* Intersection */) { - addTypesToIntersection(typeSet, type.types); + function addTypeToIntersection(typeSet, includes, type) { + var flags = type.flags; + if (flags & 262144 /* Intersection */) { + includes = addTypesToIntersection(typeSet, includes, type.types); } - else if (type.flags & 1 /* Any */) { - typeSet.containsAny = true; + else if (flags & 1 /* Any */) { + includes |= 1 /* Any */; + if (type === wildcardType) + includes |= 4096 /* Wildcard */; } - else if (type.flags & 16384 /* Never */) { - typeSet.containsNever = true; + else if (flags & 16384 /* Never */) { + includes |= 8 /* Never */; } else if (ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { - typeSet.containsEmptyObject = true; + includes |= 1024 /* EmptyObject */; } - else if ((strictNullChecks || !(type.flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { - if (type.flags & 65536 /* Object */) { - typeSet.containsObjectType = true; + else if ((strictNullChecks || !(flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { + if (flags & 65536 /* Object */) { + includes |= 512 /* ObjectType */; } - if (type.flags & 131072 /* Union */ && typeSet.unionIndex === undefined) { - typeSet.unionIndex = typeSet.length; + if (flags & 131072 /* Union */) { + includes |= 2048 /* Union */; } - if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + if (!(flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { typeSet.push(type); } } + return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. - function addTypesToIntersection(typeSet, types) { + function addTypesToIntersection(typeSet, includes, types) { for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { var type = types_8[_i]; - addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type)); + includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } + return includes; } // We normalize combinations of intersection and union types based on the distributive property of the '&' // operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection @@ -31462,25 +32711,25 @@ var ts; return emptyObjectType; } var typeSet = []; - addTypesToIntersection(typeSet, types); - if (typeSet.containsNever) { + var includes = addTypesToIntersection(typeSet, 0, types); + if (includes & 8 /* Never */) { return neverType; } - if (typeSet.containsAny) { - return anyType; + if (includes & 1 /* Any */) { + return includes & 4096 /* Wildcard */ ? wildcardType : anyType; } - if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + if (includes & 1024 /* EmptyObject */ && !(includes & 512 /* ObjectType */)) { typeSet.push(emptyObjectType); } if (typeSet.length === 1) { return typeSet[0]; } - var unionIndex = typeSet.unionIndex; - if (unionIndex !== undefined) { + if (includes & 2048 /* Union */) { // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. - var unionType = typeSet[unionIndex]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); + var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072 /* Union */) !== 0; }); + var unionType = typeSet[unionIndex_1]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); var type = intersectionTypes.get(id); @@ -31509,18 +32758,30 @@ var ts; return type.resolvedIndexType; } function getLiteralTypeFromPropertyName(prop) { - return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.isKnownSymbol(prop) ? - neverType : - getLiteralType(ts.symbolName(prop)); + var links = getSymbolLinks(getLateBoundSymbol(prop)); + if (!links.nameType) { + if (links.target && links.target !== unknownSymbol && links.target !== resolvingSymbol) { + ts.Debug.assert(links.target.escapedName === prop.escapedName || links.target.escapedName === "__computed" /* Computed */, "Target symbol and symbol do not have the same name"); + links.nameType = getLiteralTypeFromPropertyName(links.target); + } + else { + links.nameType = ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.isKnownSymbol(prop) ? + neverType : + getLiteralType(ts.symbolName(prop)); + } + } + return links.nameType; } function getLiteralTypeFromPropertyNames(type) { return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return maybeTypeOfKind(type, 1081344 /* TypeVariable */) ? getIndexTypeForGenericType(type) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : - type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : - getLiteralTypeFromPropertyNames(type); + return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t); })) : + maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : + type === wildcardType ? wildcardType : + type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : + getLiteralTypeFromPropertyNames(type); } function getIndexTypeOrString(type) { var indexType = getIndexType(type); @@ -31530,11 +32791,11 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 127 /* KeyOfKeyword */: + case 128 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 140 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 137 /* SymbolKeyword */ + case 141 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 138 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : unknownType; break; @@ -31549,7 +32810,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode : undefined; var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : @@ -31572,7 +32833,7 @@ var ts; } if (!(indexType.flags & 12288 /* Nullable */) && isTypeAssignableToKind(indexType, 524322 /* StringLike */ | 84 /* NumberLike */ | 1536 /* ESSymbolLike */)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } var indexInfo = isTypeAssignableToKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || getIndexInfoOfType(objectType, 0 /* String */) || @@ -31596,7 +32857,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } @@ -31611,15 +32872,10 @@ var ts; return anyType; } function isGenericObjectType(type) { - return type.flags & 1081344 /* TypeVariable */ ? true : - ts.getObjectFlags(type) & 32 /* Mapped */ ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericObjectType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 536870912 /* GenericMappedType */); } function isGenericIndexType(type) { - return type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) ? true : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericIndexType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 524288 /* Index */); } // Return true if the given type is a non-generic object type with a string index signature and no // other members. @@ -31686,17 +32942,19 @@ var ts; } function substituteIndexedMappedType(objectType, type) { var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var objectTypeMapper = objectType.mapper; - var templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; + var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } function getIndexedAccessType(objectType, indexType, accessNode) { + if (objectType === wildcardType || indexType === wildcardType) { + return wildcardType; + } // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 181 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 184 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } @@ -31729,7 +32987,13 @@ var ts; function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getIndexedAccessType(getTypeFromTypeNode(node.objectType), getTypeFromTypeNode(node.indexType), node); + var objectType = getTypeFromTypeNode(node.objectType); + var indexType = getTypeFromTypeNode(node.indexType); + var resolved = getIndexedAccessType(objectType, indexType, node); + links.resolvedType = resolved.flags & 1048576 /* IndexedAccess */ && + resolved.objectType === objectType && + resolved.indexType === indexType ? + getConstrainedTypeVariable(resolved, node) : resolved; } return links.resolvedType; } @@ -31747,6 +33011,112 @@ var ts; } return links.resolvedType; } + function getActualTypeVariable(type) { + return type.flags & 4194304 /* Substitution */ ? type.typeVariable : type; + } + function getConditionalType(root, mapper) { + var checkType = instantiateType(root.checkType, mapper); + var extendsType = instantiateType(root.extendsType, mapper); + if (checkType === wildcardType || extendsType === wildcardType) { + return wildcardType; + } + // If this is a distributive conditional type and the check type is generic we need to defer + // resolution of the conditional type such that a later instantiation will properly distribute + // over union types. + if (!root.isDistributive || !maybeTypeOfKind(checkType, 7897088 /* Instantiable */)) { + var combinedMapper = void 0; + if (root.inferTypeParameters) { + var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */); + // We don't want inferences from constraints as they may cause us to eagerly resolve the + // conditional type instead of deferring resolution. Also, we always want strict function + // types rules (i.e. proper contravariance) for inferences. + inferTypes(context.inferences, checkType, extendsType, 32 /* NoConstraints */ | 64 /* AlwaysStrict */); + combinedMapper = combineTypeMappers(mapper, context); + } + // Return union of trueType and falseType for 'any' since it matches anything + if (checkType.flags & 1 /* Any */) { + return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); + } + // Instantiate the extends type including inferences for 'infer T' type parameters + var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; + // Return falseType for a definitely false extends check. We check an instantations of the two + // types with type parameters mapped to the wildcard type, the most permissive instantiations + // possible (the wildcard type is assignable to and from all types). If those are not related, + // then no instatiations will be and we can just return the false branch type. + if (!isTypeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(inferredExtendsType))) { + return instantiateType(root.falseType, mapper); + } + // Return trueType for a definitely true extends check. The definitely assignable relation excludes + // type variable constraints from consideration. Without the definitely assignable relation, the type + // type Foo = T extends { x: string } ? string : number + // would immediately resolve to 'string' instead of being deferred. + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + return instantiateType(root.trueType, combinedMapper || mapper); + } + } + // Return a deferred type for a check that is neither definitely true nor definitely false + var erasedCheckType = getActualTypeVariable(checkType); + var result = createType(2097152 /* Conditional */); + result.root = root; + result.checkType = erasedCheckType; + result.extendsType = extendsType; + result.mapper = mapper; + result.aliasSymbol = root.aliasSymbol; + result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper); + return result; + } + function getTrueTypeFromConditionalType(type) { + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); + } + function getFalseTypeFromConditionalType(type) { + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); + } + function getInferTypeParameters(node) { + var result; + if (node.locals) { + node.locals.forEach(function (symbol) { + if (symbol.flags & 262144 /* TypeParameter */) { + result = ts.append(result, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result; + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var checkType = getTypeFromTypeNode(node.checkType); + var aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node); + var allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true); + var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); }); + var root = { + node: node, + checkType: checkType, + extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), + isDistributive: !!(checkType.flags & 32768 /* TypeParameter */), + inferTypeParameters: getInferTypeParameters(node), + outerTypeParameters: outerTypeParameters, + instantiations: undefined, + aliasSymbol: getAliasSymbolForTypeNode(node), + aliasTypeArguments: aliasTypeArguments + }; + links.resolvedType = getConditionalType(root, /*mapper*/ undefined); + if (outerTypeParameters) { + root.instantiations = ts.createMap(); + root.instantiations.set(getTypeListId(outerTypeParameters), links.resolvedType); + } + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -31768,7 +33138,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 232 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 235 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -31779,7 +33149,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, propagatedFlags) { + function getSpreadType(left, right, symbol, typeFlags, objectFlags) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -31790,12 +33160,12 @@ var ts; return left; } if (left.flags & 131072 /* Union */) { - return mapType(left, function (t) { return getSpreadType(t, right, symbol, propagatedFlags); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); }); } if (right.flags & 131072 /* Union */) { - return mapType(right, function (t) { return getSpreadType(left, t, symbol, propagatedFlags); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); }); } - if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */ | 33554432 /* NonPrimitive */)) { + if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */ | 134217728 /* NonPrimitive */)) { return left; } var members = ts.createSymbolTable(); @@ -31848,8 +33218,8 @@ var ts; } } var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo)); - spread.flags |= propagatedFlags | 8388608 /* ContainsObjectLiteral */; - spread.objectFlags |= (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); + spread.flags |= typeFlags | 33554432 /* ContainsObjectLiteral */; + spread.objectFlags |= objectFlags | (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); return spread; } function getNonReadonlySymbol(prop) { @@ -31879,9 +33249,9 @@ var ts; return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 2097152 /* FreshLiteral */)) { + if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 8388608 /* FreshLiteral */)) { if (!type.freshType) { - var freshType = createLiteralType(type.flags | 2097152 /* FreshLiteral */, type.value, type.symbol); + var freshType = createLiteralType(type.flags | 8388608 /* FreshLiteral */, type.value, type.symbol); freshType.regularType = type; type.freshType = freshType; } @@ -31890,7 +33260,7 @@ var ts; return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? type.regularType : type; + return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? type.regularType : type; } function getLiteralType(value, enumId, symbol) { // We store all literal types in a single map with keys of the form '#NNN' and '@SSS', @@ -31929,9 +33299,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 231 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 234 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && - (container.kind !== 153 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 154 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -31948,73 +33318,78 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return anyType; - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return stringType; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return numberType; case 122 /* BooleanKeyword */: return booleanType; - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return esSymbolType; case 105 /* VoidKeyword */: return voidType; - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: return undefinedType; case 95 /* NullKeyword */: return nullType; - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return neverType; - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return node.flags & 65536 /* JavaScriptFile */ ? anyType : nonPrimitiveType; - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getTypeFromTypeReference(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return booleanType; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 169 /* ParenthesizedType */: - case 275 /* JSDocNonNullableType */: - case 276 /* JSDocOptionalType */: - case 271 /* JSDocTypeExpression */: + case 279 /* JSDocOptionalType */: + return addOptionality(getTypeFromTypeNode(node.type)); + case 172 /* ParenthesizedType */: + case 278 /* JSDocNonNullableType */: + case 274 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 280 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return getTypeFromMappedTypeNode(node); + case 170 /* ConditionalType */: + return getTypeFromConditionalTypeNode(node); + case 171 /* InferType */: + return getTypeFromInferTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -32023,12 +33398,18 @@ var ts; } function instantiateList(items, mapper, instantiator) { if (items && items.length) { - var result = []; - for (var _i = 0, items_1 = items; _i < items_1.length; _i++) { - var v = items_1[_i]; - result.push(instantiator(v, mapper)); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result = i === 0 ? [] : items.slice(0, i); + result.push(mapped); + for (i++; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } } - return result; } return items; } @@ -32071,19 +33452,26 @@ var ts; return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; }; } function isInferenceContext(mapper) { - return !!mapper.signature; + return !!mapper.typeParameters; } function cloneTypeMapper(mapper) { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.compareTypes, mapper.inferences) : + createInferenceContext(mapper.typeParameters, mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.compareTypes, mapper.inferences) : mapper; } function combineTypeMappers(mapper1, mapper2) { + if (!mapper1) + return mapper2; + if (!mapper2) + return mapper1; return function (t) { return instantiateType(mapper1(t), mapper2); }; } function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } + function wildcardMapper(type) { + return type.flags & 32768 /* TypeParameter */ ? wildcardType : type; + } function cloneTypeParameter(typeParameter) { var result = createType(32768 /* TypeParameter */); result.symbol = typeParameter.symbol; @@ -32130,8 +33518,13 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !maybeTypeOfKind(links.type, 65536 /* Object */ | 7897088 /* Instantiable */)) { + // If the type of the symbol is already resolved, and if that type could not possibly + // be affected by instantiation, simply return the symbol itself. + return symbol; + } if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var links = getSymbolLinks(symbol); // If symbol being instantiated is itself a instantiation, fetch the original target and combine the // type mappers. This ensures that original type identities are properly preserved and that aliases // always reference a non-aliases. @@ -32157,7 +33550,7 @@ var ts; var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var symbol = target.symbol; var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; + var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type // parameters that are in scope (and therefore potentially referenced). For type literals that @@ -32168,7 +33561,7 @@ var ts; typeParameters = symbol.flags & 2048 /* TypeLiteral */ && !target.aliasTypeArguments ? ts.filter(outerTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration_1); }) : outerTypeParameters; - links.typeParameters = typeParameters; + links.outerTypeParameters = typeParameters; if (typeParameters.length) { links.instantiations = ts.createMap(); links.instantiations.set(getTypeListId(typeParameters), target); @@ -32196,19 +33589,19 @@ var ts; // between the node and the type parameter declaration, if the node contains actual references to the // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced. if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { - var container_1 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 208 /* Block */ ? "quit" : n === container_1; })) { + var container_2 = tp.symbol.declarations[0].parent; + if (ts.findAncestor(node, function (n) { return n.kind === 211 /* Block */ ? "quit" : n === container_2; })) { return ts.forEachChild(node, containsReference); } } return true; function containsReference(node) { switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: return tp.isThisType; case 71 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return true; } return ts.forEachChild(node, containsReference); @@ -32238,7 +33631,7 @@ var ts; return instantiateAnonymousType(type, mapper); } function isMappableType(type) { - return type.flags & (1 /* Any */ | 32768 /* TypeParameter */ | 65536 /* Object */ | 262144 /* Intersection */ | 1048576 /* IndexedAccess */); + return type.flags & (1 /* Any */ | 7372800 /* InstantiableNonPrimitive */ | 65536 /* Object */ | 262144 /* Intersection */); } function instantiateAnonymousType(type, mapper) { var result = createObjectType(type.objectFlags | 64 /* Instantiated */, type.symbol); @@ -32251,8 +33644,39 @@ var ts; result.aliasTypeArguments = instantiateTypes(type.aliasTypeArguments, mapper); return result; } + function getConditionalTypeInstantiation(type, mapper) { + var root = type.root; + if (root.outerTypeParameters) { + // We are instantiating a conditional type that has one or more type parameters in scope. Apply the + // mapper to the type parameters to produce the effective list of type arguments, and compute the + // instantiation cache key from the type IDs of the type arguments. + var typeArguments = ts.map(root.outerTypeParameters, mapper); + var id = getTypeListId(typeArguments); + var result = root.instantiations.get(id); + if (!result) { + var newMapper = createTypeMapper(root.outerTypeParameters, typeArguments); + result = instantiateConditionalType(root, newMapper); + root.instantiations.set(id, result); + } + return result; + } + return type; + } + function instantiateConditionalType(root, mapper) { + // Check if we have a conditional type where the check type is a naked type parameter. If so, + // the conditional type is distributive over union types and when T is instantiated to a union + // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). + if (root.isDistributive) { + var checkType_1 = root.checkType; + var instantiatedType = mapper(checkType_1); + if (checkType_1 !== instantiatedType && instantiatedType.flags & (131072 /* Union */ | 16384 /* Never */)) { + return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + } + } + return getConditionalType(root, mapper); + } function instantiateType(type, mapper) { - if (type && mapper !== identityMapper) { + if (type && mapper && mapper !== identityMapper) { if (type.flags & 32768 /* TypeParameter */) { return mapper(type); } @@ -32268,14 +33692,20 @@ var ts; return getAnonymousTypeInstantiation(type, mapper); } if (type.objectFlags & 4 /* Reference */) { - return createTypeReference(type.target, instantiateTypes(type.typeArguments, mapper)); + var typeArguments = type.typeArguments; + var newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type; } } if (type.flags & 131072 /* Union */ && !(type.flags & 16382 /* Primitive */)) { - return getUnionType(instantiateTypes(type.types, mapper), 1 /* Literal */, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, 1 /* Literal */, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(instantiateTypes(type.types, mapper), type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 524288 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); @@ -32283,41 +33713,51 @@ var ts; if (type.flags & 1048576 /* IndexedAccess */) { return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper)); } + if (type.flags & 2097152 /* Conditional */) { + return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); + } + if (type.flags & 4194304 /* Substitution */) { + return instantiateType(type.typeVariable, mapper); + } } return type; } + function getWildcardInstantiation(type) { + return type.flags & (16382 /* Primitive */ | 1 /* Any */ | 16384 /* Never */) ? type : + type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return node.operatorToken.kind === 54 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.forEach(node.properties, isContextSensitive); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. return node.initializer && isContextSensitive(node.initializer); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: // It is possible to that node.expression is undefined (e.g
) return node.expression && isContextSensitive(node.expression); } @@ -32332,7 +33772,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 188 /* ArrowFunction */) { + if (node.kind !== 191 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -32341,7 +33781,7 @@ var ts; } } // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return node.body.kind === 208 /* Block */ ? false : isContextSensitive(node.body); + return node.body.kind === 211 /* Block */ ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -32390,7 +33830,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 131072 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 131072 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 1081344 /* TypeVariable */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & 7372800 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); } @@ -32440,8 +33880,8 @@ var ts; source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes); } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 152 /* MethodDeclaration */ && - kind !== 151 /* MethodSignature */ && kind !== 153 /* Constructor */; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 /* MethodDeclaration */ && + kind !== 152 /* MethodSignature */ && kind !== 154 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -32529,13 +33969,12 @@ var ts; return 0 /* False */; } if (source.kind === 1 /* Identifier */) { - var sourcePredicate = source; var targetPredicate = target; - var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0 /* False */; @@ -32593,7 +34032,7 @@ var ts; } function isEmptyObjectType(type) { return type.flags & 65536 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : - type.flags & 33554432 /* NonPrimitive */ ? true : + type.flags & 134217728 /* NonPrimitive */ ? true : type.flags & 131072 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : type.flags & 262144 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : false; @@ -32631,7 +34070,7 @@ var ts; function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { var s = source.flags; var t = target.flags; - if (t & 1 /* Any */ || s & 16384 /* Never */) + if (t & 1 /* Any */ || s & 16384 /* Never */ || source === wildcardType) return true; if (t & 16384 /* Never */) return false; @@ -32665,11 +34104,11 @@ var ts; return true; if (s & 8192 /* Null */ && (!strictNullChecks || t & 8192 /* Null */)) return true; - if (s & 65536 /* Object */ && t & 33554432 /* NonPrimitive */) + if (s & 65536 /* Object */ && t & 134217728 /* NonPrimitive */) return true; if (s & 1024 /* UniqueESSymbol */ || t & 1024 /* UniqueESSymbol */) return false; - if (relation === assignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { if (s & 1 /* Any */) return true; // Type number or any numeric literal type is assignable to any numeric enum type or any @@ -32681,10 +34120,10 @@ var ts; return false; } function isTypeRelatedTo(source, target, relation) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } if (source === target || @@ -32698,13 +34137,13 @@ var ts; return related === 1 /* Succeeded */; } } - if (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */) { + if (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { - return source.flags & 67108864 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). @@ -32812,12 +34251,18 @@ var ts; * * Ternary.False if they are not related. */ function isRelatedTo(source, target, reportErrors, headMessage) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } + if (source.flags & 4194304 /* Substitution */) { + source = relation === definitelyAssignableRelation ? source.typeVariable : source.substitute; + } + if (target.flags & 4194304 /* Substitution */) { + target = target.typeVariable; + } // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return -1 /* True */; @@ -32827,8 +34272,9 @@ var ts; if (relation === comparableRelation && !(target.flags & 16384 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1 /* True */; - if (isObjectLiteralType(source) && source.flags & 2097152 /* FreshLiteral */) { - if (hasExcessProperties(source, target, reportErrors)) { + if (isObjectLiteralType(source) && source.flags & 8388608 /* FreshLiteral */) { + var discriminantType = target.flags & 131072 /* Union */ ? findMatchingDiscriminantType(source, target) : undefined; + if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { reportRelationError(headMessage, source, target); } @@ -32838,7 +34284,7 @@ var ts; // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { source = getRegularTypeOfObjectLiteral(source); } } @@ -32899,7 +34345,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false); } - if (!result && (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */)) { + if (!result && (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; } @@ -32919,32 +34365,55 @@ var ts; } function isIdenticalTo(source, target) { var result; - if (source.flags & 65536 /* Object */ && target.flags & 65536 /* Object */) { + var flags = source.flags & target.flags; + if (flags & 65536 /* Object */) { return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } - if (source.flags & 131072 /* Union */ && target.flags & 131072 /* Union */ || - source.flags & 262144 /* Intersection */ && target.flags & 262144 /* Intersection */) { + if (flags & (131072 /* Union */ | 262144 /* Intersection */)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & 524288 /* Index */) { + return isRelatedTo(source.type, target.type, /*reportErrors*/ false); + } + if (flags & 1048576 /* IndexedAccess */) { + if (result = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { + return result; + } + } + } + if (flags & 2097152 /* Conditional */) { + if (source.root.isDistributive === target.root.isDistributive) { + if (result = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { + if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { + return result; + } + } + } + } + } + } + if (flags & 4194304 /* Substitution */) { + return isRelatedTo(source.substitute, target.substitute, /*reportErrors*/ false); + } return 0 /* False */; } - function hasExcessProperties(source, target, reportErrors) { + function hasExcessProperties(source, target, discriminant, reportErrors) { if (maybeTypeOfKind(target, 65536 /* Object */) && !(ts.getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); - if ((relation === assignableRelation || relation === comparableRelation) && + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); + if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } - if (target.flags & 131072 /* Union */) { - var discriminantType = findMatchingDiscriminantType(source, target); - if (discriminantType) { - // check excess properties against discriminant type only, not the entire union - return hasExcessProperties(source, discriminantType, reportErrors); - } + if (discriminant) { + // check excess properties against discriminant type only, not the entire union + return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } var _loop_4 = function (prop) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -33208,6 +34677,9 @@ var ts; } return result; } + function getConstraintForRelation(type) { + return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); + } function structuredTypeRelatedTo(source, target, reportErrors) { var result; var originalErrorInfo; @@ -33215,7 +34687,7 @@ var ts; if (target.flags & 32768 /* TypeParameter */) { // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. if (ts.getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -33233,7 +34705,7 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // constraint of T. - var constraint = getConstraintOfType(target.type); + var constraint = getConstraintForRelation(target.type); if (constraint) { if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { return result; @@ -33242,8 +34714,8 @@ var ts; } else if (target.flags & 1048576 /* IndexedAccess */) { // A type S is related to a type T[K] if S is related to A[K], where K is string-like and - // A is the constraint of T. - var constraint = getConstraintOfIndexedAccess(target); + // A is the apparent type of T. + var constraint = getConstraintForRelation(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { errorInfo = saveErrorInfo; @@ -33251,19 +34723,30 @@ var ts; } } } - else if (isGenericMappedType(target) && !isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (isGenericMappedType(target)) { + // A source type T is related to a target type { [P in X]: T[P] } + var template = getTemplateTypeFromMappedType(target); + var modifiers = getMappedTypeModifiers(target); + if (!(modifiers & 8 /* ExcludeOptional */)) { + if (template.flags & 1048576 /* IndexedAccess */ && template.objectType === source && + template.indexType === getTypeParameterFromMappedType(target)) { + return -1 /* True */; + } + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } if (source.flags & 32768 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(source); + var constraint = getConstraintForRelation(source); // A type parameter with no constraint is not related to the non-primitive object type. - if (constraint || !(target.flags & 33554432 /* NonPrimitive */)) { + if (constraint || !(target.flags & 134217728 /* NonPrimitive */)) { if (!constraint || constraint.flags & 1 /* Any */) { constraint = emptyObjectType; } @@ -33277,8 +34760,8 @@ var ts; } else if (source.flags & 1048576 /* IndexedAccess */) { // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and - // A is the constraint of S. - var constraint = getConstraintOfIndexedAccess(source); + // A is the apparent type of S. + var constraint = getConstraintForRelation(source); if (constraint) { if (result = isRelatedTo(constraint, target, reportErrors)) { errorInfo = saveErrorInfo; @@ -33295,9 +34778,39 @@ var ts; } } } + else if (source.flags & 2097152 /* Conditional */) { + if (target.flags & 2097152 /* Conditional */) { + if (isTypeIdenticalTo(source.checkType, target.checkType) && + isTypeIdenticalTo(source.extendsType, target.extendsType)) { + if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) { + result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (relation !== definitelyAssignableRelation) { + var distributiveConstraint = getConstraintOfDistributiveConditionalType(source); + if (distributiveConstraint) { + if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + var defaultConstraint = getDefaultConstraintOfConditionalType(source); + if (defaultConstraint) { + if (result = isRelatedTo(defaultConstraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } else { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && - !(source.flags & 134217728 /* MarkerType */ || target.flags & 134217728 /* MarkerType */)) { + !(ts.getObjectFlags(source) & 8192 /* MarkerType */ || ts.getObjectFlags(target) & 8192 /* MarkerType */)) { // We have type references to the same generic type, and the type references are not marker // type references (which are intended by be compared structurally). Obtain the variance // information for the type parameters and relate the type arguments accordingly. @@ -33379,8 +34892,7 @@ var ts; // that S and T are contra-variant whereas X and Y are co-variant. function mappedTypeRelatedTo(source, target, reportErrors) { var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & 2 /* Optional */) || - getCombinedMappedTypeModifiers(target) & 2 /* Optional */); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { var result_1; if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -33506,7 +35018,7 @@ var ts; return false; } function hasCommonProperties(source, target) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -33639,6 +35151,11 @@ var ts; if (isIgnoredJsxProperty(source, prop, /*targetMemberType*/ undefined)) { continue; } + // Skip over symbol-named members + var nameType = getLiteralTypeFromPropertyName(prop); + if (nameType !== undefined && !(isRelatedTo(nameType, stringType) || isRelatedTo(nameType, numberType))) { + continue; + } if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) { var related = isRelatedTo(getTypeOfSymbol(prop), target, reportErrors); if (!related) { @@ -33735,7 +35252,7 @@ var ts; // type, and flag the result as a marker type reference. function getMarkerTypeReference(type, source, target) { var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; })); - result.flags |= 134217728 /* MarkerType */; + result.objectFlags |= 8192 /* MarkerType */; return result; } // Return an array containing the variance of each type parameter. The variance is effectively @@ -34083,8 +35600,8 @@ var ts; } function getWidenedLiteralType(type) { return type.flags & 256 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : - type.flags & 32 /* StringLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? stringType : - type.flags & 64 /* NumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? numberType : + type.flags & 32 /* StringLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? stringType : + type.flags & 64 /* NumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? numberType : type.flags & 128 /* BooleanLiteral */ ? booleanType : type.flags & 131072 /* Union */ ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) : type; @@ -34158,8 +35675,18 @@ var ts; ts.Debug.assert(strictNullChecks); return type.flags & 4096 /* Undefined */ ? type : getUnionType([type, undefinedType]); } + function getGlobalNonNullableTypeInstantiation(type) { + if (!deferredGlobalNonNullableTypeAlias) { + deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288 /* TypeAlias */, /*diagnostic*/ undefined) || unknownSymbol; + } + // Use NonNullable global type alias if available to improve quick info/declaration emit + if (deferredGlobalNonNullableTypeAlias !== unknownSymbol) { + return getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]); + } + return getTypeWithFacts(type, 524288 /* NEUndefinedOrNull */); // Type alias unavailable, fall back to non-higherorder behavior + } function getNonNullableType(type) { - return strictNullChecks ? getTypeWithFacts(type, 524288 /* NEUndefinedOrNull */) : type; + return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type; } /** * Return true if type was inferred from an object literal, written as an object type literal, or is the shape of a module @@ -34196,7 +35723,7 @@ var ts; * Leave signatures alone since they are not subject to the check. */ function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType(type) && type.flags & 2097152 /* FreshLiteral */)) { + if (!(isObjectLiteralType(type) && type.flags & 8388608 /* FreshLiteral */)) { return type; } var regularType = type.regularType; @@ -34206,7 +35733,7 @@ var ts; var resolved = type; var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo); - regularNew.flags = resolved.flags & ~2097152 /* FreshLiteral */; + regularNew.flags = resolved.flags & ~8388608 /* FreshLiteral */; regularNew.objectFlags |= 128 /* ObjectLiteral */; type.regularType = regularNew; return regularNew; @@ -34261,6 +35788,10 @@ var ts; } var result = createSymbol(4 /* Property */ | 16777216 /* Optional */, name); result.type = undefinedType; + var associatedKeyType = getLiteralType(ts.unescapeLeadingUnderscores(name)); + if (associatedKeyType.flags & 32 /* StringLiteral */) { + result.nameType = associatedKeyType; + } undefinedProperties.set(name, result); return result; } @@ -34288,7 +35819,7 @@ var ts; return getWidenedTypeWithContext(type, /*context*/ undefined); } function getWidenedTypeWithContext(type, context) { - if (type.flags & 12582912 /* RequiresWidening */) { + if (type.flags & 50331648 /* RequiresWidening */) { if (type.flags & 12288 /* Nullable */) { return anyType; } @@ -34322,7 +35853,7 @@ var ts; */ function reportWideningErrorsInType(type) { var errorReported = false; - if (type.flags & 4194304 /* ContainsWideningType */) { + if (type.flags & 16777216 /* ContainsWideningType */) { if (type.flags & 131072 /* Union */) { if (ts.some(type.types, isEmptyObjectType)) { errorReported = true; @@ -34348,9 +35879,9 @@ var ts; for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); - if (t.flags & 4194304 /* ContainsWideningType */) { + if (t.flags & 16777216 /* ContainsWideningType */) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, ts.symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -34363,32 +35894,32 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 147 /* Parameter */: + case 148 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 173 /* MappedType */: + case 176 /* MappedType */: error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); return; default: @@ -34397,7 +35928,7 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && noImplicitAny && type.flags & 4194304 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 16777216 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -34424,9 +35955,10 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, flags, compareTypes, baseInferences) { - var inferences = baseInferences ? ts.map(baseInferences, cloneInferenceInfo) : ts.map(signature.typeParameters, createInferenceInfo); + function createInferenceContext(typeParameters, signature, flags, compareTypes, baseInferences) { + var inferences = baseInferences ? baseInferences.map(cloneInferenceInfo) : typeParameters.map(createInferenceInfo); var context = mapper; + context.typeParameters = typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; @@ -34469,7 +36001,7 @@ var ts; // results for union and intersection types for performance reasons. function couldContainTypeVariables(type) { var objectFlags = ts.getObjectFlags(type); - return !!(type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) || + return !!(type.flags & 7897088 /* Instantiable */ || objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || objectFlags & 32 /* Mapped */ || @@ -34528,7 +36060,7 @@ var ts; // is incomplete and we can't infer a meaningful input type. for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { var prop = properties_4[_i]; - if (getTypeOfSymbol(prop).flags & 16777216 /* ContainsAnyFunctionType */) { + if (getTypeOfSymbol(prop).flags & 67108864 /* ContainsAnyFunctionType */) { return undefined; } } @@ -34545,9 +36077,7 @@ var ts; var templateType = getTemplateTypeFromMappedType(target); var inference = createInferenceInfo(typeParameter); inferTypes([inference], sourceType, templateType); - return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : - inference.contraCandidates ? getCommonSubtype(inference.contraCandidates) : - emptyObjectType; + return getTypeFromInference(inference); } function getUnmatchedProperty(source, target, requireOptionalProperties) { var properties = target.flags & 262144 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); @@ -34562,16 +36092,32 @@ var ts; } return undefined; } + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : + inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : + emptyObjectType; + } function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; var visited; var contravariant = false; + var propagationType; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { return; } + if (source === wildcardType) { + // We are inferring from an 'any' type. We want to infer this type for every type parameter + // referenced in the target type, so we record it as the propagation type and infer from the + // target to itself. Then, as we find candidates we substitute the propagation type. + var savePropagationType = propagationType; + propagationType = source; + inferFromTypes(target, target); + propagationType = savePropagationType; + return; + } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { // Source and target are types originating in the same generic type alias declaration. // Simply infer from source type arguments to target type arguments. @@ -34629,7 +36175,7 @@ var ts; // not contain anyFunctionType when we come back to this argument for its second round // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard // when constructing types from type parameters that had no inference candidates). - if (source.flags & 16777216 /* ContainsAnyFunctionType */ || source === silentNeverType) { + if (source.flags & 67108864 /* ContainsAnyFunctionType */ || source === silentNeverType) { return; } var inference = getInferenceInfoForType(target); @@ -34641,14 +36187,15 @@ var ts; inference.priority = priority; } if (priority === inference.priority) { + var candidate = propagationType || source; if (contravariant) { - inference.contraCandidates = ts.append(inference.contraCandidates, source); + inference.contraCandidates = ts.append(inference.contraCandidates, candidate); } else { - inference.candidates = ts.append(inference.candidates, source); + inference.candidates = ts.append(inference.candidates, candidate); } } - if (!(priority & 4 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 8 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; } } @@ -34678,13 +36225,22 @@ var ts; else if ((isLiteralType(source) || source.flags & 2 /* String */) && target.flags & 524288 /* Index */) { var empty = createEmptyObjectTypeFromStringLiteral(source); contravariant = !contravariant; + var savePriority = priority; + priority |= 16 /* LiteralKeyof */; inferFromTypes(empty, target.type); + priority = savePriority; contravariant = !contravariant; } else if (source.flags & 1048576 /* IndexedAccess */ && target.flags & 1048576 /* IndexedAccess */) { inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } + else if (source.flags & 2097152 /* Conditional */ && target.flags & 2097152 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + } else if (target.flags & 393216 /* UnionOrIntersection */) { var targetTypes = target.types; var typeVariableCount = 0; @@ -34719,7 +36275,9 @@ var ts; } } else { - source = getApparentType(source); + if (!(priority & 32 /* NoConstraints */ && source.flags & (262144 /* Intersection */ | 7897088 /* Instantiable */))) { + source = getApparentType(source); + } if (source.flags & (65536 /* Object */ | 262144 /* Intersection */)) { var key = source.id + "," + target.id; if (visited && visited.get(key)) { @@ -34748,7 +36306,7 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes) { + if (strictFunctionTypes || priority & 64 /* AlwaysStrict */) { contravariant = !contravariant; inferFromTypes(source, target); contravariant = !contravariant; @@ -34787,7 +36345,7 @@ var ts; var inferredType = inferTypeForHomomorphicMappedType(source, target); if (inferredType) { var savePriority = priority; - priority |= 2 /* MappedType */; + priority |= 2 /* HomomorphicMappedType */; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -34797,7 +36355,10 @@ var ts; if (constraintType.flags & 32768 /* TypeParameter */) { // We're inferring from some source type S to a mapped type { [P in T]: X }, where T is a type // parameter. Infer from 'keyof S' to T and infer from a union of each property type in S to X. + var savePriority = priority; + priority |= 4 /* MappedTypeConstraint */; inferFromTypes(getIndexType(source), constraintType); + priority = savePriority; inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target)); return; } @@ -34902,62 +36463,73 @@ var ts; } return candidates; } + function getContravariantInference(inference) { + return inference.priority & 28 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates); + } + function getCovariantInference(inference, context, signature) { + // Extract all object literal types and replace them with a single widened and normalized type. + var candidates = widenObjectLiteralCandidates(inference.candidates); + // We widen inferred literal types if + // all inferences were made to top-level occurrences of the type parameter, and + // the type parameter has no constraint or its constraint includes no primitive or literal types, and + // the type parameter was fixed during inference or does not occur at top-level in the return type. + var widenLiteralTypes = inference.topLevel && + !hasPrimitiveConstraint(inference.typeParameter) && + (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates; + // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if + // union types were requested or if all inferences were made from the return type position, infer a + // union type. Otherwise, infer a common supertype. + var unwidenedType = context.flags & 1 /* InferUnionTypes */ || inference.priority & 28 /* PriorityImpliesCombination */ ? + getUnionType(baseCandidates, 2 /* Subtype */) : + getCommonSupertype(baseCandidates); + return getWidenedType(unwidenedType); + } function getInferredType(context, index) { var inference = context.inferences[index]; var inferredType = inference.inferredType; if (!inferredType) { - if (inference.candidates) { - // Extract all object literal types and replace them with a single widened and normalized type. - var candidates = widenObjectLiteralCandidates(inference.candidates); - // We widen inferred literal types if - // all inferences were made to top-level ocurrences of the type parameter, and - // the type parameter has no constraint or its constraint includes no primitive or literal types, and - // the type parameter was fixed during inference or does not occur at top-level in the return type. - var signature = context.signature; - var widenLiteralTypes = inference.topLevel && - !hasPrimitiveConstraint(inference.typeParameter) && - (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); - var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates; - // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if - // union types were requested or if all inferences were made from the return type position, infer a - // union type. Otherwise, infer a common supertype. - var unwidenedType = context.flags & 1 /* InferUnionTypes */ || inference.priority & 4 /* ReturnType */ ? - getUnionType(baseCandidates, 2 /* Subtype */) : - getCommonSupertype(baseCandidates); - inferredType = getWidenedType(unwidenedType); - // If we have inferred 'never' but have contravariant candidates. To get a more specific type we - // infer from the contravariant candidates instead. - if (inferredType.flags & 16384 /* Never */ && inference.contraCandidates) { - inferredType = getCommonSubtype(inference.contraCandidates); + var signature = context.signature; + if (signature) { + if (inference.candidates) { + inferredType = getCovariantInference(inference, context, signature); + // If we have inferred 'never' but have contravariant candidates. To get a more specific type we + // infer from the contravariant candidates instead. + if (inferredType.flags & 16384 /* Never */ && inference.contraCandidates) { + inferredType = getContravariantInference(inference); + } } - } - else if (inference.contraCandidates) { - // We only have contravariant inferences, infer the best common subtype of those - inferredType = getCommonSubtype(inference.contraCandidates); - } - else if (context.flags & 2 /* NoDefault */) { - // We use silentNeverType as the wildcard that signals no inferences. - inferredType = silentNeverType; - } - else { - // Infer either the default or the empty object type when no inferences were - // made. It is important to remember that in this case, inference still - // succeeds, meaning there is no error for not having inference candidates. An - // inference error only occurs when there are *conflicting* candidates, i.e. - // candidates with no common supertype. - var defaultType = getDefaultFromTypeParameter(inference.typeParameter); - if (defaultType) { - // Instantiate the default type. Any forward reference to a type - // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), context)); + else if (inference.contraCandidates) { + // We only have contravariant inferences, infer the best common subtype of those + inferredType = getContravariantInference(inference); + } + else if (context.flags & 2 /* NoDefault */) { + // We use silentNeverType as the wildcard that signals no inferences. + inferredType = silentNeverType; } else { - inferredType = getDefaultTypeArgumentType(!!(context.flags & 4 /* AnyDefault */)); + // Infer either the default or the empty object type when no inferences were + // made. It is important to remember that in this case, inference still + // succeeds, meaning there is no error for not having inference candidates. An + // inference error only occurs when there are *conflicting* candidates, i.e. + // candidates with no common supertype. + var defaultType = getDefaultFromTypeParameter(inference.typeParameter); + if (defaultType) { + // Instantiate the default type. Any forward reference to a type + // parameter should be instantiated to the empty object type. + inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), context)); + } + else { + inferredType = getDefaultTypeArgumentType(!!(context.flags & 4 /* AnyDefault */)); + } } } + else { + inferredType = getTypeFromInference(inference); + } inferredType = getWidenedUniqueESSymbolType(inferredType); inference.inferredType = inferredType; - var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); + var constraint = getConstraintOfTypeParameter(inference.typeParameter); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context); if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { @@ -34982,7 +36554,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), + resolveName(node, node.escapedText, 67216319 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; @@ -34991,7 +36563,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 163 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 144 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 164 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 145 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -35002,18 +36574,18 @@ var ts; function getFlowCacheKey(node) { if (node.kind === 71 /* Identifier */) { var symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? (isApparentTypePosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; + return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; } if (node.kind === 99 /* ThisKeyword */) { return "0"; } - if (node.kind === 180 /* PropertyAccessExpression */) { + if (node.kind === 183 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + ts.idText(node.name); } - if (node.kind === 177 /* BindingElement */) { + if (node.kind === 180 /* BindingElement */) { var container = node.parent.parent; - var key = container.kind === 177 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); + var key = container.kind === 180 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); var text = getBindingElementNameText(node); var result = key && text && (key + "." + text); return result; @@ -35021,12 +36593,12 @@ var ts; return undefined; } function getBindingElementNameText(element) { - if (element.parent.kind === 175 /* ObjectBindingPattern */) { + if (element.parent.kind === 178 /* ObjectBindingPattern */) { var name = element.propertyName || element.name; switch (name.kind) { case 71 /* Identifier */: return ts.idText(name); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -35044,26 +36616,26 @@ var ts; switch (source.kind) { case 71 /* Identifier */: return target.kind === 71 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 227 /* VariableDeclaration */ || target.kind === 177 /* BindingElement */) && + (target.kind === 230 /* VariableDeclaration */ || target.kind === 180 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 99 /* ThisKeyword */: return target.kind === 99 /* ThisKeyword */; case 97 /* SuperKeyword */: return target.kind === 97 /* SuperKeyword */; - case 180 /* PropertyAccessExpression */: - return target.kind === 180 /* PropertyAccessExpression */ && + case 183 /* PropertyAccessExpression */: + return target.kind === 183 /* PropertyAccessExpression */ && source.name.escapedText === target.name.escapedText && isMatchingReference(source.expression, target.expression); - case 177 /* BindingElement */: - if (target.kind !== 180 /* PropertyAccessExpression */) + case 180 /* BindingElement */: + if (target.kind !== 183 /* PropertyAccessExpression */) return false; var t = target; if (t.name.escapedText !== getBindingElementNameText(source)) return false; - if (source.parent.parent.kind === 177 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { + if (source.parent.parent.kind === 180 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { return true; } - if (source.parent.parent.kind === 227 /* VariableDeclaration */) { + if (source.parent.parent.kind === 230 /* VariableDeclaration */) { var maybeId = source.parent.parent.initializer; return maybeId && isMatchingReference(maybeId, t.expression); } @@ -35071,7 +36643,7 @@ var ts; return false; } function containsMatchingReference(source, target) { - while (source.kind === 180 /* PropertyAccessExpression */) { + while (source.kind === 183 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -35084,7 +36656,7 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 180 /* PropertyAccessExpression */ && + return target.kind === 183 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); } @@ -35092,7 +36664,7 @@ var ts; if (expr.kind === 71 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.escapedText); } @@ -35136,7 +36708,7 @@ var ts; } } } - if (callExpression.expression.kind === 180 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 183 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -35221,8 +36793,8 @@ var ts; } if (flags & 65536 /* Object */) { return isFunctionObjectType(type) ? - strictNullChecks ? 6164448 /* FunctionStrictFacts */ : 8376288 /* FunctionFacts */ : - strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; + strictNullChecks ? 1970144 /* FunctionStrictFacts */ : 4181984 /* FunctionFacts */ : + strictNullChecks ? 1972176 /* ObjectStrictFacts */ : 4184016 /* ObjectFacts */; } if (flags & (2048 /* Void */ | 4096 /* Undefined */)) { return 2457472 /* UndefinedFacts */; @@ -35233,16 +36805,16 @@ var ts; if (flags & 1536 /* ESSymbolLike */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 33554432 /* NonPrimitive */) { - return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; + if (flags & 134217728 /* NonPrimitive */) { + return strictNullChecks ? 1972176 /* ObjectStrictFacts */ : 4184016 /* ObjectFacts */; } - if (flags & 1081344 /* TypeVariable */) { + if (flags & 7897088 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 393216 /* UnionOrIntersection */) { return getTypeFactsOfTypes(type.types); } - return 8388607 /* All */; + return 4194303 /* All */; } function getTypeWithFacts(type, include) { return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; }); @@ -35270,15 +36842,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 178 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 181 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 268 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 195 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 217 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 220 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -35295,21 +36867,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return stringType; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return undefinedType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -35317,7 +36889,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 175 /* ObjectBindingPattern */ ? + var type = pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -35335,35 +36907,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 216 /* ForInStatement */) { + if (node.parent.parent.kind === 219 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.parent.kind === 220 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 227 /* VariableDeclaration */ ? + return node.kind === 230 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */ ? + return node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 227 /* VariableDeclaration */ && node.initializer && + return node.kind === 230 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 177 /* BindingElement */ && node.parent.kind === 195 /* BinaryExpression */ && + node.kind !== 180 /* BindingElement */ && node.parent.kind === 198 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (node.operatorToken.kind) { case 58 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -35375,13 +36947,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 186 /* ParenthesizedExpression */ || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? + return parent.kind === 189 /* ParenthesizedExpression */ || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 261 /* CaseClause */) { + if (clause.kind === 264 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -35440,6 +37012,9 @@ var ts; // is a union type, the mapping function is applied to each constituent type and a union // of the resulting types is returned. function mapType(type, mapper, noReductions) { + if (type.flags & 16384 /* Never */) { + return type; + } if (!(type.flags & 131072 /* Union */)) { return mapper(type); } @@ -35551,11 +37126,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 180 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || - parent.parent.kind === 182 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 181 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 183 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || + parent.parent.kind === 185 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 184 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 195 /* BinaryExpression */ && + parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -35592,7 +37167,7 @@ var ts; if (flowAnalysisDisabled) { return unknownType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 35620607 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359 /* Narrowable */)) { return declaredType; } var sharedFlowStart = sharedFlowCount; @@ -35603,7 +37178,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent && reference.parent.kind === 204 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { + if (reference.parent && reference.parent.kind === 207 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { return declaredType; } return resultType; @@ -35674,7 +37249,7 @@ var ts; else if (flags & 2 /* Start */) { // Check if we should continue with the control flow of the containing function. var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 180 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { + if (container && container !== flowContainer && reference.kind !== 183 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -35730,7 +37305,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 182 /* CallExpression */ ? + var expr = node.kind === 185 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -35738,7 +37313,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -35903,7 +37478,7 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - return expr.kind === 180 /* PropertyAccessExpression */ && + return expr.kind === 183 /* PropertyAccessExpression */ && computedType.flags & 131072 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, expr.name.escapedText); @@ -35954,10 +37529,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 190 /* TypeOfExpression */ && (right_1.kind === 9 /* StringLiteral */ || right_1.kind === 13 /* NoSubstitutionTemplateLiteral */)) { + if (left_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 190 /* TypeOfExpression */ && (left_1.kind === 9 /* StringLiteral */ || left_1.kind === 13 /* NoSubstitutionTemplateLiteral */)) { + if (right_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -35980,7 +37555,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); case 92 /* InKeyword */: var target = getReferenceCandidate(expr.right); - if ((expr.left.kind === 9 /* StringLiteral */ || expr.left.kind === 13 /* NoSubstitutionTemplateLiteral */) && isMatchingReference(reference, target)) { + if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { return narrowByInKeyword(type, expr.left, assumeTrue); } break; @@ -36009,7 +37584,7 @@ var ts; assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33620481 /* NotUnionOrUnit */) { + if (type.flags & 134283777 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -36045,7 +37620,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 1081344 /* TypeVariable */) { + if (type.flags & 7897088 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -36169,7 +37744,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 181 /* ElementAccessExpression */ || invokedExpression.kind === 180 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 184 /* ElementAccessExpression */ || invokedExpression.kind === 183 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -36189,15 +37764,15 @@ var ts; case 71 /* Identifier */: case 99 /* ThisKeyword */: case 97 /* SuperKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (expr.operator === 51 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -36233,9 +37808,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 235 /* ModuleBlock */ || - node.kind === 269 /* SourceFile */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 238 /* ModuleBlock */ || + node.kind === 272 /* SourceFile */ || + node.kind === 151 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -36257,7 +37832,7 @@ var ts; if (node.kind === 71 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 147 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148 /* Parameter */) { symbol.isAssigned = true; } } @@ -36272,35 +37847,34 @@ var ts; /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 147 /* Parameter */ && + declaration.kind === 148 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 4096 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096 /* Undefined */); return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072 /* NEUndefined */) : declaredType; } - function isApparentTypePosition(node) { + function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 180 /* PropertyAccessExpression */ || - parent.kind === 182 /* CallExpression */ && parent.expression === node || - parent.kind === 181 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 204 /* NonNullExpression */ || - parent.kind === 177 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 183 /* PropertyAccessExpression */ || + parent.kind === 185 /* CallExpression */ && parent.expression === node || + parent.kind === 184 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 180 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 1081344 /* TypeVariable */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); + return type.flags & 7372800 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); } - function getApparentTypeForLocation(type, node) { + function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, // and the type of the node includes type variables with constraints that are nullable, we fetch the // apparent type of the node *before* performing control flow analysis such that narrowings apply to // the constraint type. - if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { - return mapType(getWidenedType(type), getApparentType); + if (isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) { + return mapType(getWidenedType(type), getBaseConstraintOrType); } return type; } function markAliasReferenced(symbol, location) { - if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + if (isNonLocalAlias(symbol, /*excludes*/ 67216319 /* Value */) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { markAliasSymbolAsReferenced(symbol); } } @@ -36318,7 +37892,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -36339,7 +37913,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 230 /* ClassDeclaration */ + if (declaration.kind === 233 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -36351,14 +37925,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 200 /* ClassExpression */) { + else if (declaration.kind === 203 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); while (container !== undefined) { if (container.parent === declaration) { - if (container.kind === 150 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 151 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -36372,7 +37946,7 @@ var ts; checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - var type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); + var type = getConstraintForLocation(getTypeOfSymbol(localOrExportSymbol), node); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { if (!(localOrExportSymbol.flags & 3 /* Variable */)) { @@ -36404,7 +37978,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 147 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 148 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -36412,8 +37986,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 187 /* FunctionExpression */ || - flowContainer.kind === 188 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 190 /* FunctionExpression */ || + flowContainer.kind === 191 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -36422,11 +37996,11 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || - isInTypeQuery(node) || node.parent.kind === 247 /* ExportSpecifier */) || - node.parent.kind === 204 /* NonNullExpression */ || - declaration.kind === 227 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 250 /* ExportSpecifier */) || + node.parent.kind === 207 /* NonNullExpression */ || + declaration.kind === 230 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 2097152 /* Ambient */; - var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); @@ -36455,7 +38029,7 @@ var ts; function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 264 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 267 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -36480,8 +38054,8 @@ var ts; } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. - if (container.kind === 215 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 228 /* VariableDeclarationList */).parent === container && + if (container.kind === 218 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 231 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -36495,7 +38069,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 186 /* ParenthesizedExpression */) { + while (current.parent.kind === 189 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -36503,7 +38077,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 193 /* PrefixUnaryExpression */ || current.parent.kind === 194 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 196 /* PrefixUnaryExpression */ || current.parent.kind === 197 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; } @@ -36516,7 +38090,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 150 /* PropertyDeclaration */ || container.kind === 153 /* Constructor */) { + if (container.kind === 151 /* PropertyDeclaration */ || container.kind === 154 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -36584,38 +38158,38 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 153 /* Constructor */) { + if (container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES2015 */); } switch (container.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 153 /* Constructor */: + case 154 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -36636,8 +38210,8 @@ var ts; // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (container.kind === 187 /* FunctionExpression */ && - container.parent.kind === 195 /* BinaryExpression */ && + if (container.kind === 190 /* FunctionExpression */ && + container.parent.kind === 198 /* BinaryExpression */ && ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.prototype.y = f @@ -36646,12 +38220,12 @@ var ts; .expression; // x var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { - return getInferredClassType(classSymbol); + return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { - return thisType; + return getFlowTypeOfReference(node, thisType); } } if (ts.isClassLike(container.parent)) { @@ -36662,13 +38236,13 @@ var ts; if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); if (type && type !== unknownType) { - return type; + return getFlowTypeOfReference(node, type); } } } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 277 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 280 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -36678,15 +38252,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 147 /* Parameter */; }); + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 182 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 185 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 188 /* ArrowFunction */) { + while (container && container.kind === 191 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -36699,14 +38273,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 145 /* ComputedPropertyName */; }); - if (current && current.kind === 145 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146 /* ComputedPropertyName */; }); + if (current && current.kind === 146 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -36714,7 +38288,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 153 /* Constructor */) { + if (!isCallExpression && container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -36780,7 +38354,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 152 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 153 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -36794,7 +38368,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (container.parent.kind === 182 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -36815,7 +38389,7 @@ var ts; if (!baseClassType) { return unknownType; } - if (container.kind === 153 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 154 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -36830,7 +38404,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 153 /* Constructor */; + return container.kind === 154 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -36838,21 +38412,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */; } else { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */ || - container.kind === 150 /* PropertyDeclaration */ || - container.kind === 149 /* PropertySignature */ || - container.kind === 153 /* Constructor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */ || + container.kind === 151 /* PropertyDeclaration */ || + container.kind === 150 /* PropertySignature */ || + container.kind === 154 /* Constructor */; } } } @@ -36860,10 +38434,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 152 /* MethodDeclaration */ || - func.kind === 154 /* GetAccessor */ || - func.kind === 155 /* SetAccessor */) && func.parent.kind === 179 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 187 /* FunctionExpression */ && func.parent.kind === 265 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 153 /* MethodDeclaration */ || + func.kind === 155 /* GetAccessor */ || + func.kind === 156 /* SetAccessor */) && func.parent.kind === 182 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 190 /* FunctionExpression */ && func.parent.kind === 268 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -36875,7 +38449,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 188 /* ArrowFunction */) { + if (func.kind === 191 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -36902,7 +38476,7 @@ var ts; if (thisType) { return instantiateType(thisType, getContextualMapper(containingLiteral)); } - if (literal.parent.kind !== 265 /* PropertyAssignment */) { + if (literal.parent.kind !== 268 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -36916,9 +38490,9 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = func.parent; - if (parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { + if (parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { var target = parent.left; - if (target.kind === 180 /* PropertyAccessExpression */ || target.kind === 181 /* ElementAccessExpression */) { + if (target.kind === 183 /* PropertyAccessExpression */ || target.kind === 184 /* ElementAccessExpression */) { var expression = target.expression; // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }` if (inJs && ts.isIdentifier(expression)) { @@ -36993,7 +38567,7 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -37005,7 +38579,7 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 177 /* BindingElement */) { + if (parentDeclaration.kind !== 180 /* BindingElement */) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !ts.isBindingPattern(name)) { var text = ts.getTextOfPropertyName(name); @@ -37022,7 +38596,7 @@ var ts; var func = ts.getContainingFunction(node); if (func) { var functionFlags = ts.getFunctionFlags(func); - if (functionFlags & 1 /* Generator */) { + if (functionFlags & 1 /* Generator */) { // AsyncGenerator function or Generator function return undefined; } var contextualReturnType = getContextualReturnType(func); @@ -37061,7 +38635,7 @@ var ts; function getContextualReturnType(functionDecl) { // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed - if (functionDecl.kind === 153 /* Constructor */ || + if (functionDecl.kind === 154 /* Constructor */ || ts.getEffectiveReturnTypeNode(functionDecl) || isGetAccessorWithAnnotatedSetAccessor(functionDecl)) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); @@ -37077,17 +38651,17 @@ var ts; // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); - var argIndex = args.indexOf(arg); - if (argIndex >= 0) { - // If we're already in the process of resolving the given signature, don't resolve again as - // that could cause infinite recursion. Instead, return anySignature. - var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + // If we're already in the process of resolving the given signature, don't resolve again as + // that could cause infinite recursion. Instead, return anySignature. + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 184 /* TaggedTemplateExpression */) { + if (template.parent.kind === 187 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -37100,9 +38674,11 @@ var ts; return node === right && isContextSensitiveAssignment(binaryExpression) ? getTypeOfExpression(left) : undefined; case 54 /* BarBarToken */: // When an || expression has a contextual type, the operands are contextually typed by that type. When an || - // expression has no contextual type, the right operand is contextually typed by the type of the left operand. + // expression has no contextual type, the right operand is contextually typed by the type of the left operand, + // except for the special case of Javascript declarations of the form `namespace.prop = namespace.prop || {}` var type = getContextualType(binaryExpression); - return !type && node === right ? getTypeOfExpression(left, /*cache*/ true) : type; + return !type && node === right && !ts.getDeclaredJavascriptInitializer(binaryExpression.parent) && !ts.getAssignedJavascriptInitializer(binaryExpression) ? + getTypeOfExpression(left, /*cache*/ true) : type; case 53 /* AmpersandAmpersandToken */: case 26 /* CommaToken */: return node === right ? getContextualType(binaryExpression) : undefined; @@ -37125,6 +38701,7 @@ var ts; case 2 /* ModuleExports */: case 3 /* PrototypeProperty */: case 4 /* ThisProperty */: + case 6 /* Prototype */: return false; default: ts.Debug.assertNever(kind); @@ -37190,7 +38767,7 @@ var ts; function getContextualTypeForChildJsxExpression(node) { var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) - var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; } function getContextualTypeForJsxExpression(node) { @@ -37230,7 +38807,7 @@ var ts; var prop = _a[_i]; if (!prop.symbol) continue; - if (prop.kind !== 265 /* PropertyAssignment */) + if (prop.kind !== 268 /* PropertyAssignment */) continue; if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) { var discriminatingType = getTypeOfNode(prop.initializer); @@ -37278,52 +38855,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 180 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 188 /* ArrowFunction */: - case 220 /* ReturnStatement */: + case 191 /* ArrowFunction */: + case 223 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent); - case 178 /* ArrayLiteralExpression */: { + case 181 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 206 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 197 /* TemplateExpression */); + case 209 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 200 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent); } - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent); } return undefined; @@ -37342,15 +38919,9 @@ var ts; return anyType; } var isJs = ts.isInJavaScriptFile(node); - return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + return mapType(valueType, function (t) { return getJsxSignaturesParameterTypes(t, isJs, node); }); } - function getJsxSignaturesParameterTypes(valueType) { - return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ false); - } - function getJsxSignaturesParameterTypesJs(valueType) { - return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ true); - } - function getJsxSignaturesParameterTypesInternal(valueType, isJs) { + function getJsxSignaturesParameterTypes(valueType, isJs, context) { // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type if (valueType.flags & 2 /* String */) { return anyType; @@ -37360,7 +38931,7 @@ var ts; // For example: // var CustomTag: "h1" = "h1"; // Hello World - var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, context); if (intrinsicElementsType !== unknownType) { var stringLiteralTypeName = valueType.value; var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); @@ -37386,21 +38957,21 @@ var ts; return unknownType; } } - return getUnionType(ts.map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), 0 /* None */); + return getUnionType(ts.map(signatures, ctor ? function (t) { return getJsxPropsTypeFromConstructSignature(t, isJs, context); } : function (t) { return getJsxPropsTypeFromCallSignature(t, context); }), 0 /* None */); } - function getJsxPropsTypeFromCallSignature(sig) { + function getJsxPropsTypeFromCallSignature(sig, context) { var propsType = getTypeOfFirstParameterOfSignature(sig); - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== unknownType) { propsType = intersectTypes(intrinsicAttribs, propsType); } return propsType; } - function getJsxPropsTypeFromClassType(hostClassType, isJs) { + function getJsxPropsTypeFromClassType(hostClassType, isJs, context) { if (isTypeAny(hostClassType)) { return hostClassType; } - var propsName = getJsxElementPropertiesName(); + var propsName = getJsxElementPropertiesName(getJsxNamespaceAt(context)); if (propsName === undefined) { // There is no type ElementAttributesProperty, return 'any' return anyType; @@ -37422,14 +38993,14 @@ var ts; else { // Normal case -- add in IntrinsicClassElements and IntrinsicElements var apparentAttributesType = attributesType; - var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context); if (intrinsicClassAttribs !== unknownType) { var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); apparentAttributesType = intersectTypes(typeParams ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs)) : intrinsicClassAttribs, apparentAttributesType); } - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== unknownType) { apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); } @@ -37437,18 +39008,12 @@ var ts; } } } - function getJsxPropsTypeFromConstructSignatureJs(sig) { - return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ true); - } - function getJsxPropsTypeFromConstructSignature(sig) { - return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ false); - } - function getJsxPropsTypeFromConstructSignatureInternal(sig, isJs) { + function getJsxPropsTypeFromConstructSignature(sig, isJs, context) { var hostClassType = getReturnTypeOfSignature(sig); if (hostClassType) { - return getJsxPropsTypeFromClassType(hostClassType, isJs); + return getJsxPropsTypeFromClassType(hostClassType, isJs, context); } - return getJsxPropsTypeFromCallSignature(sig); + return getJsxPropsTypeFromCallSignature(sig, context); } // If the given type is an object or union type with a single signature, and if that signature has at // least as many parameters as the given function, return the signature. Otherwise return undefined. @@ -37477,7 +39042,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 187 /* FunctionExpression */ || node.kind === 188 /* ArrowFunction */; + return node.kind === 190 /* FunctionExpression */ || node.kind === 191 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -37496,7 +39061,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -37540,8 +39105,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); } function hasDefaultValue(node) { - return (node.kind === 177 /* BindingElement */ && !!node.initializer) || - (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); + return (node.kind === 180 /* BindingElement */ && !!node.initializer) || + (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); } function checkArrayLiteral(node, checkMode) { var elements = node.elements; @@ -37551,7 +39116,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); for (var index = 0; index < elements.length; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 199 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 202 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -37576,7 +39141,7 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 199 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 202 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -37590,7 +39155,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 176 /* ArrayBindingPattern */ || pattern.kind === 178 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 179 /* ArrayBindingPattern */ || pattern.kind === 181 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -37598,7 +39163,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 201 /* OmittedExpression */) { + if (patternElement.kind !== 204 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); @@ -37616,7 +39181,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return isNumericComputedName(name); case 71 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -37690,34 +39255,44 @@ var ts; var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); - var propertiesTable = ts.createSymbolTable(); + var propertiesTable; var propertiesArray = []; var spread = emptyObjectType; - var propagatedFlags = 2097152 /* FreshLiteral */; + var propagatedFlags = 8388608 /* FreshLiteral */; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 175 /* ObjectBindingPattern */ || contextualType.pattern.kind === 179 /* ObjectLiteralExpression */); - var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); + (contextualType.pattern.kind === 178 /* ObjectBindingPattern */ || contextualType.pattern.kind === 182 /* ObjectLiteralExpression */); + var isInJSFile = ts.isInJavaScriptFile(node); + var isJSObjectLiteral = !contextualType && isInJSFile; var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; var hasComputedNumberProperty = false; - var isInJSFile = ts.isInJavaScriptFile(node); + if (isInJSFile && node.properties.length === 0) { + // an empty JS object literal that nonetheless has members is a JS namespace + var symbol = getSymbolOfNode(node); + if (symbol.exports) { + propertiesTable = symbol.exports; + symbol.exports.forEach(function (symbol) { return propertiesArray.push(getMergedSymbol(symbol)); }); + return createObjectLiteralType(); + } + } + propertiesTable = ts.createSymbolTable(); var offset = 0; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); var literalName = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */ || - memberDecl.kind === 266 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 268 /* PropertyAssignment */ || + memberDecl.kind === 269 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var jsdocType = void 0; if (isInJSFile) { jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl); } var type = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */) { - if (memberDecl.name.kind === 145 /* ComputedPropertyName */) { + if (memberDecl.kind === 268 /* PropertyAssignment */) { + if (memberDecl.name.kind === 146 /* ComputedPropertyName */) { var t = checkComputedPropertyName(memberDecl.name); if (t.flags & 224 /* Literal */) { literalName = ts.escapeLeadingUnderscores("" + t.value); @@ -37725,11 +39300,11 @@ var ts; } type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 152 /* MethodDeclaration */) { + else if (memberDecl.kind === 153 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 266 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 269 /* ShorthandPropertyAssignment */); type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -37738,14 +39313,18 @@ var ts; } typeFlags |= type.flags; var nameType = hasLateBindableName(memberDecl) ? checkComputedPropertyName(memberDecl.name) : undefined; - var prop = nameType && isTypeUsableAsLateBoundName(nameType) + var hasLateBoundName = nameType && isTypeUsableAsLateBoundName(nameType); + var prop = hasLateBoundName ? createSymbol(4 /* Property */ | member.flags, getLateBoundNameFromType(nameType), 1024 /* Late */) : createSymbol(4 /* Property */ | member.flags, literalName || member.escapedName); + if (hasLateBoundName) { + prop.nameType = nameType; + } if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 265 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 266 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 268 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 269 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -37773,12 +39352,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 267 /* SpreadAssignment */) { + else if (memberDecl.kind === 270 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); propertiesArray = []; propertiesTable = ts.createSymbolTable(); hasComputedStringProperty = false; @@ -37790,7 +39369,7 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, node.symbol, propagatedFlags); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags, /*objectFlags*/ 0); offset = i + 1; continue; } @@ -37800,7 +39379,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 154 /* GetAccessor */ || memberDecl.kind === 155 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 155 /* GetAccessor */ || memberDecl.kind === 156 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (!literalName && hasNonBindableDynamicName(memberDecl)) { @@ -37832,7 +39411,7 @@ var ts; } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); } return spread; } @@ -37841,8 +39420,8 @@ var ts; var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 2097152 /* FreshLiteral */; - result.flags |= 8388608 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 29360128 /* PropagatingFlags */); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608 /* FreshLiteral */; + result.flags |= 33554432 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 117440512 /* PropagatingFlags */); result.objectFlags |= 128 /* ObjectLiteral */; if (patternWithComputedProperties) { result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; @@ -37851,20 +39430,20 @@ var ts; result.pattern = node; } if (!(result.flags & 12288 /* Nullable */)) { - propagatedFlags |= (result.flags & 29360128 /* PropagatingFlags */); + propagatedFlags |= (result.flags & 117440512 /* PropagatingFlags */); } return result; } } function isValidSpreadType(type) { - return !!(type.flags & (1 /* Any */ | 33554432 /* NonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 134217728 /* NonPrimitive */) || getFalsyFlags(type) & 14560 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 65536 /* Object */ && !isGenericMappedType(type) || type.flags & 393216 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } function checkJsxSelfClosingElement(node, checkMode) { checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } function checkJsxElement(node, checkMode) { // Check attributes @@ -37876,14 +39455,16 @@ var ts; else { checkExpression(node.closingElement.tagName); } - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } function checkJsxFragment(node, checkMode) { checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); - if (compilerOptions.jsx === 2 /* React */ && compilerOptions.jsxFactory) { - error(node, ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); + if (compilerOptions.jsx === 2 /* React */ && (compilerOptions.jsxFactory || ts.getSourceFileOfNode(node).pragmas.has("jsx"))) { + error(node, compilerOptions.jsxFactory + ? ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory + : ts.Diagnostics.JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma); } - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } /** * Returns true iff the JSX element name would be a valid JS identifier, ignoring restrictions about keywords not being identifiers @@ -37898,7 +39479,7 @@ var ts; function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment switch (tagName.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: return false; case 71 /* Identifier */: @@ -37928,7 +39509,7 @@ var ts; var hasSpreadAnyType = false; var typeToIntersect; var explicitlySpecifyChildrenAttribute = false; - var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement)); for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { var attributeDecl = _a[_i]; var member = attributeDecl.symbol; @@ -37948,9 +39529,9 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 259 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 262 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { - spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); attributesTable = ts.createSymbolTable(); } var exprType = checkExpressionCached(attributeDecl.expression, checkMode); @@ -37958,7 +39539,7 @@ var ts; hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType, openingLikeElement.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -37967,11 +39548,11 @@ var ts; } if (!hasSpreadAnyType) { if (attributesTable.size > 0) { - spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 250 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 253 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -37989,7 +39570,7 @@ var ts; createArrayType(getUnionType(childrenTypes)); var childPropMap = ts.createSymbolTable(); childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); - spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } if (hasSpreadAnyType) { @@ -38003,8 +39584,8 @@ var ts; */ function createJsxAttributesType() { var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); - result.flags |= 67108864 /* JsxAttributes */ | 8388608 /* ContainsObjectLiteral */; - result.objectFlags |= 128 /* ObjectLiteral */; + result.flags |= 33554432 /* ContainsObjectLiteral */; + result.objectFlags |= 128 /* ObjectLiteral */ | 4096 /* JsxAttributes */; return result; } } @@ -38033,12 +39614,11 @@ var ts; function checkJsxAttributes(node, checkMode) { return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } - function getJsxType(name) { - var jsxType = jsxTypes.get(name); - if (jsxType === undefined) { - jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); - } - return jsxType; + function getJsxType(name, location) { + var namespace = getJsxNamespaceAt(location); + var exports = namespace && getExportsOfSymbol(namespace); + var typeSymbol = exports && getSymbol(exports, name, 67901928 /* Type */); + return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : unknownType; } /** * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic @@ -38049,11 +39629,11 @@ var ts; function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node); if (intrinsicElementsType !== unknownType) { // Property case if (!ts.isIdentifier(node.tagName)) - throw ts.Debug.fail(); + return ts.Debug.fail(); var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText); if (intrinsicProp) { links.jsxFlags |= 1 /* IntrinsicNamedElement */; @@ -38106,7 +39686,7 @@ var ts; var signature = signatures_3[_i]; if (signature.typeParameters) { var isJavascript = ts.isInJavaScriptFile(node); - var inferenceContext = createInferenceContext(signature, /*flags*/ isJavascript ? 4 /* AnyDefault */ : 0 /* None */); + var inferenceContext = createInferenceContext(signature.typeParameters, signature, /*flags*/ isJavascript ? 4 /* AnyDefault */ : 0 /* None */); var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } @@ -38116,6 +39696,18 @@ var ts; } return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } + function getJsxNamespaceAt(location) { + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + if (resolvedNamespace) { + var candidate = getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */); + if (candidate) { + return candidate; + } + } + // JSX global fallback + return getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); + } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. * Get a single property from that container if existed. Report an error if there are more than one property. @@ -38123,11 +39715,9 @@ var ts; * @param nameOfAttribPropContainer a string of value JsxNames.ElementAttributesPropertyNameContainer or JsxNames.ElementChildrenAttributeNameContainer * if other string is given or the container doesn't exist, return undefined. */ - function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer) { - // JSX - var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); + function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer, jsxNamespace) { // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [symbol] - var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, 793064 /* Type */); + var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, 67901928 /* Type */); // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [type] var jsxElementAttribPropInterfaceType = jsxElementAttribPropInterfaceSym && getDeclaredTypeOfSymbol(jsxElementAttribPropInterfaceSym); // The properties of JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute @@ -38137,6 +39727,8 @@ var ts; if (propertiesOfJsxElementAttribPropInterface.length === 0) { return ""; } + // Element Attributes has one property, so the element attributes type will be the type of the corresponding + // property of the class instance type else if (propertiesOfJsxElementAttribPropInterface.length === 1) { return propertiesOfJsxElementAttribPropInterface[0].escapedName; } @@ -38152,19 +39744,11 @@ var ts; /// non-intrinsic elements' attributes type is 'any'), /// or '' if it has 0 properties (which means every /// non-intrinsic elements' attributes type is the element instance type) - function getJsxElementPropertiesName() { - if (!_hasComputedJsxElementPropertiesName) { - _hasComputedJsxElementPropertiesName = true; - _jsxElementPropertiesName = getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer); - } - return _jsxElementPropertiesName; + function getJsxElementPropertiesName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace); } - function getJsxElementChildrenPropertyName() { - if (!_hasComputedJsxElementChildrenPropertyName) { - _hasComputedJsxElementChildrenPropertyName = true; - _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); - } - return _jsxElementChildrenPropertyName; + function getJsxElementChildrenPropertyName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } function getApparentTypeOfJsxPropsType(propsType) { if (!propsType) { @@ -38193,7 +39777,7 @@ var ts; function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { ts.Debug.assert(!(elementType.flags & 131072 /* Union */)); if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { - var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement); if (jsxStatelessElementType) { // We don't call getResolvedSignature here because we have already resolve the type of JSX Element. var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined); @@ -38203,7 +39787,7 @@ var ts; paramType = getApparentTypeOfJsxPropsType(paramType); if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement); if (intrinsicAttributes !== unknownType) { paramType = intersectTypes(intrinsicAttributes, paramType); } @@ -38228,7 +39812,7 @@ var ts; ts.Debug.assert(!(elementType.flags & 131072 /* Union */)); if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type - var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement); if (jsxStatelessElementType) { // We don't call getResolvedSignature because here we have already resolve the type of JSX Element. var candidatesOutArray = []; @@ -38262,7 +39846,7 @@ var ts; result = allMatchingAttributesType; } // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement); if (intrinsicAttributes !== unknownType) { result = intersectTypes(intrinsicAttributes, result); } @@ -38305,7 +39889,7 @@ var ts; // For example: // var CustomTag: "h1" = "h1"; // Hello World - var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, openingLikeElement); if (intrinsicElementsType !== unknownType) { var stringLiteralTypeName = elementType.value; var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); @@ -38335,7 +39919,7 @@ var ts; if (elementClassType) { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement)); + return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement), openingLikeElement); } /** * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. @@ -38366,7 +39950,7 @@ var ts; * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component */ function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { - return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxElementClassTypeAt(node)); } /** * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. @@ -38406,32 +39990,26 @@ var ts; var prop = getPropertyOfType(attributesType, attrib.name.escapedText); return prop || unknownSymbol; } - function getJsxGlobalElementClassType() { - if (!deferredJsxElementClassType) { - deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); - } - return deferredJsxElementClassType; + function getJsxElementClassTypeAt(location) { + var type = getJsxType(JsxNames.ElementClass, location); + if (type === unknownType) + return undefined; + return type; } - function getJsxGlobalElementType() { - if (!deferredJsxElementType) { - deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); - } - return deferredJsxElementType; + function getJsxElementTypeAt(location) { + return getJsxType(JsxNames.Element, location); } - function getJsxGlobalStatelessElementType() { - if (!deferredJsxStatelessElementType) { - var jsxElementType = getJsxGlobalElementType(); - if (jsxElementType) { - deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); - } + function getJsxStatelessElementTypeAt(location) { + var jsxElementType = getJsxElementTypeAt(location); + if (jsxElementType) { + return getUnionType([jsxElementType, nullType]); } - return deferredJsxStatelessElementType; } /** * Returns all the properties of the Jsx.IntrinsicElements interface */ - function getJsxIntrinsicTagNames() { - var intrinsics = getJsxType(JsxNames.IntrinsicElements); + function getJsxIntrinsicTagNamesAt(location) { + var intrinsics = getJsxType(JsxNames.IntrinsicElements, location); return intrinsics ? getPropertiesOfType(intrinsics) : ts.emptyArray; } function checkJsxPreconditions(errorNode) { @@ -38439,7 +40017,7 @@ var ts; if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (getJsxGlobalElementType() === undefined) { + if (getJsxElementTypeAt(errorNode) === undefined) { if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } @@ -38454,13 +40032,13 @@ var ts; // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. var reactRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var reactNamespace = getJsxNamespace(); + var reactNamespace = getJsxNamespace(node); var reactLocation = isNodeOpeningLikeElement ? node.tagName : node; - var reactSym = resolveName(reactLocation, reactNamespace, 107455 /* Value */, reactRefErr, reactNamespace, /*isUse*/ true); + var reactSym = resolveName(reactLocation, reactNamespace, 67216319 /* Value */, reactRefErr, reactNamespace, /*isUse*/ true); if (reactSym) { // Mark local symbol as referenced here because it might not have been marked // if jsx emit was not react as there wont be error being emitted - reactSym.isReferenced = true; + reactSym.isReferenced = 67108863 /* All */; // If react symbol is alias, mark it as refereced if (reactSym.flags & 2097152 /* Alias */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { markAliasSymbolAsReferenced(reactSym); @@ -38529,8 +40107,8 @@ var ts; var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode); // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. - if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { - error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName())); + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { + error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName(getJsxNamespaceAt(openingLikeElement)))); } else { // Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties @@ -38569,7 +40147,7 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 150 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 151 /* PropertyDeclaration */; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; @@ -38587,7 +40165,7 @@ var ts; */ function checkPropertyAccessibility(node, left, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 180 /* PropertyAccessExpression */ || node.kind === 227 /* VariableDeclaration */ ? + var errorNode = node.kind === 183 /* PropertyAccessExpression */ || node.kind === 230 /* VariableDeclaration */ ? node.name : node.right; if (ts.getCheckFlags(prop) & 256 /* ContainsPrivate */) { @@ -38673,7 +40251,7 @@ var ts; function symbolHasNonMethodDeclaration(symbol) { return forEachProperty(symbol, function (prop) { var propKind = getDeclarationKindFromSymbol(prop); - return propKind !== 152 /* MethodDeclaration */ && propKind !== 151 /* MethodSignature */; + return propKind !== 153 /* MethodDeclaration */ && propKind !== 152 /* MethodSignature */; }); } function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { @@ -38737,12 +40315,12 @@ var ts; return unknownType; } } - propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); + propType = getConstraintForLocation(getTypeOfSymbol(prop), node); } // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 180 /* PropertyAccessExpression */ || + if (node.kind !== 183 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 131072 /* Union */)) { return propType; @@ -38756,7 +40334,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 153 /* Constructor */ && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 154 /* Constructor */ && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -38779,8 +40357,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right)); } - else if (valueDeclaration.kind === 230 /* ClassDeclaration */ && - node.parent.kind !== 160 /* TypeReference */ && + else if (valueDeclaration.kind === 233 /* ClassDeclaration */ && + node.parent.kind !== 161 /* TypeReference */ && !(valueDeclaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right)); @@ -38789,9 +40367,9 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return true; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // We might be in `a = { b: this.b }`, so keep looking. See `tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts`. return false; default: @@ -38848,7 +40426,7 @@ var ts; diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(propNode, errorInfo)); } function getSuggestionForNonexistentProperty(node, containingType) { - var suggestion = getSpellingSuggestionForName(ts.idText(node), getPropertiesOfType(containingType), 107455 /* Value */); + var suggestion = getSpellingSuggestionForName(ts.idText(node), getPropertiesOfType(containingType), 67216319 /* Value */); return suggestion && ts.symbolName(suggestion); } function getSuggestionForNonexistentSymbol(location, outerName, meaning) { @@ -38863,6 +40441,10 @@ var ts; }); return result && ts.symbolName(result); } + function getSuggestionForNonexistentModule(name, targetModule) { + var suggestion = targetModule.exports && getSpellingSuggestionForName(ts.idText(name), getExportsOfModuleAsArray(targetModule), 2623475 /* ModuleMember */); + return suggestion && ts.symbolName(suggestion); + } /** * Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough. * Names less than length 3 only check for case-insensitive equality, not levenshtein distance. @@ -38971,55 +40553,48 @@ var ts; return; } } - if (ts.getCheckFlags(prop) & 1 /* Instantiated */) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; - } + (ts.getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 180 /* PropertyAccessExpression */ ? node.expression : node.left; + var left = node.kind === 183 /* PropertyAccessExpression */ ? node.expression : node.left; return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left))); } function isValidPropertyAccessForCompletions(node, type, property) { return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); } - function isValidMethodAccess(method, type) { + function isValidMethodAccess(method, actualThisType) { var propType = getTypeOfFuncClassEnumModule(method); var signatures = getSignaturesOfType(getNonNullableType(propType), 0 /* Call */); ts.Debug.assert(signatures.length !== 0); return signatures.some(function (sig) { - var thisType = getThisTypeOfSignature(sig); - return !thisType || isTypeAssignableTo(type, thisType); + var signatureThisType = getThisTypeOfSignature(sig); + return !signatureThisType || isTypeAssignableTo(actualThisType, getInstantiatedSignatureThisType(sig, signatureThisType, actualThisType)); }); } - function isValidPropertyAccessWithType(node, left, propertyName, type) { - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(type, propertyName); - if (prop) { - return checkPropertyAccessibility(node, left, type, prop); - } - // In js files properties of unions are allowed in completion - if (ts.isInJavaScriptFile(left) && (type.flags & 131072 /* Union */)) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var elementType = _a[_i]; - if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) { - return true; - } - } - } - return false; + function getInstantiatedSignatureThisType(sig, signatureThisType, actualThisType) { + if (!sig.typeParameters) { + return signatureThisType; } - return true; + var context = createInferenceContext(sig.typeParameters, sig, 0 /* None */); + inferTypes(context.inferences, actualThisType, signatureThisType); + return instantiateType(signatureThisType, createSignatureTypeMapper(sig, getInferredTypes(context))); + } + function isValidPropertyAccessWithType(node, left, propertyName, type) { + if (type === unknownType || isTypeAny(type)) { + return true; + } + var prop = getPropertyOfType(type, propertyName); + return prop ? checkPropertyAccessibility(node, left, type, prop) + // In js files properties of unions are allowed in completion + : ts.isInJavaScriptFile(node) && (type.flags & 131072 /* Union */) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); }); } /** * Return the symbol of the for-in variable declared or referenced by the given for-in statement. */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer.kind === 231 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -39048,7 +40623,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 216 /* ForInStatement */ && + if (node.kind === 219 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -39066,7 +40641,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 183 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 186 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -39133,10 +40708,10 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 148 /* Decorator */) { + else if (node.kind !== 149 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -39202,7 +40777,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 199 /* SpreadElement */) { + if (arg && arg.kind === 202 /* SpreadElement */) { return i; } } @@ -39218,17 +40793,15 @@ var ts; // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". return true; } - if (node.kind === 184 /* TaggedTemplateExpression */) { - var tagExpression = node; + if (node.kind === 187 /* TaggedTemplateExpression */) { // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 197 /* TemplateExpression */) { + if (node.template.kind === 200 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + var lastSpan = ts.lastOrUndefined(node.template.templateSpans); ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -39236,26 +40809,25 @@ var ts; // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, // then this might actually turn out to be a TemplateHead in the future; // so we consider the call to be incomplete. - var templateLiteral = tagExpression.template; + var templateLiteral = node.template; ts.Debug.assert(templateLiteral.kind === 13 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); } else { - var callExpression = node; - if (!callExpression.arguments) { + if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 183 /* NewExpression */); + ts.Debug.assert(node.kind === 186 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; // If we are missing the close parenthesis, the call is incomplete. - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; + callIsIncomplete = node.arguments.end === node.end; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match @@ -39293,13 +40865,13 @@ var ts; } // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) { - var context = createInferenceContext(signature, 1 /* InferUnionTypes */, compareTypes); + var context = createInferenceContext(signature.typeParameters, signature, 1 /* InferUnionTypes */, compareTypes); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); if (!contextualMapper) { - inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 4 /* ReturnType */); + inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8 /* ReturnType */); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJavaScriptFile(contextualSignature.declaration)); } @@ -39330,7 +40902,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 148 /* Decorator */) { + if (node.kind !== 149 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the contextual mapper to avoid disturbing a resolution in progress for an @@ -39350,7 +40922,7 @@ var ts; instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); // Inferences made from return types have lower priority than all other inferences. - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 4 /* ReturnType */); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8 /* ReturnType */); } } var thisType = getThisTypeOfSignature(signature); @@ -39365,7 +40937,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -39455,7 +41027,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 183 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 186 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -39472,7 +41044,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); // If the effective argument type is undefined, there is no synthetic type for the argument. @@ -39496,12 +41068,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 180 /* PropertyAccessExpression */) { + if (callee.kind === 183 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 181 /* ElementAccessExpression */) { + else if (callee.kind === 184 /* ElementAccessExpression */) { return callee.expression; } } @@ -39516,17 +41088,17 @@ var ts; * will be supplied from calls to `getEffectiveArgumentCount` and `getEffectiveArgumentType`. */ function getEffectiveCallArguments(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { var template = node.template; var args_4 = [undefined]; - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_4.push(span.expression); }); } return args_4; } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. @@ -39553,19 +41125,19 @@ var ts; * Otherwise, the argument count is the length of the 'args' array. */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -39575,7 +41147,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 147 /* Parameter */: + case 148 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -39599,25 +41171,25 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -39644,23 +41216,23 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } // For a non-constructor parameter decorator, the `propertyKey` will be either // a string or a symbol, based on the name of the parameter's containing method. } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -39672,7 +41244,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralType(element.name.text); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeAssignableToKind(nameType, 1536 /* ESSymbolLike */)) { return nameType; @@ -39698,21 +41270,21 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a parameter decorator - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 150 /* PropertyDeclaration */) { + if (node.kind === 151 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -39744,10 +41316,10 @@ var ts; // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -39759,8 +41331,8 @@ var ts; */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 148 /* Decorator */ || - (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */)) { + if (node.kind === 149 /* Decorator */ || + (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -39769,11 +41341,11 @@ var ts; * Gets the error node to use when reporting errors for an effective argument. */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -39782,8 +41354,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, fallbackError) { - var isTaggedTemplate = node.kind === 184 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 148 /* Decorator */; + var isTaggedTemplate = node.kind === 187 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 149 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { @@ -39857,7 +41429,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 182 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 185 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -39905,7 +41477,7 @@ var ts; max = Math.max(max, ts.length(sig.typeParameters)); } var paramCount = min < max ? min + "-" + max : min; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); + diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); } else if (args) { var min = Number.POSITIVE_INFINITY; @@ -39983,7 +41555,7 @@ var ts; } var candidate = void 0; var inferenceContext = originalCandidate.typeParameters ? - createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0 /* None */) : + createInferenceContext(originalCandidate.typeParameters, originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0 /* None */) : undefined; while (true) { candidate = originalCandidate; @@ -40252,16 +41824,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -40349,16 +41921,16 @@ var ts; } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 148 /* Decorator */: + case 149 /* Decorator */: return resolveDecorator(node, candidatesOutArray); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: // This code-path is called by language service return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } @@ -40407,19 +41979,50 @@ var ts; return false; } function getJavaScriptClassType(symbol) { - if (ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = getSymbolOfNode(symbol.valueDeclaration.initializer); + var initializer = ts.getDeclaredJavascriptInitializer(symbol.valueDeclaration); + if (initializer) { + symbol = getSymbolOfNode(initializer); } + var inferred; if (isJavaScriptConstructor(symbol.valueDeclaration)) { - return getInferredClassType(symbol); + inferred = getInferredClassType(symbol); } - if (symbol.flags & 3 /* Variable */) { - var valueType = getTypeOfSymbol(symbol); - if (valueType.symbol && !isInferredClassType(valueType) && isJavaScriptConstructor(valueType.symbol.valueDeclaration)) { - return getInferredClassType(valueType.symbol); + var assigned = getAssignedClassType(symbol); + var valueType = getTypeOfSymbol(symbol); + if (valueType.symbol && !isInferredClassType(valueType) && isJavaScriptConstructor(valueType.symbol.valueDeclaration)) { + inferred = getInferredClassType(valueType.symbol); + } + return assigned && inferred ? + getIntersectionType([inferred, assigned]) : + assigned || inferred; + } + function getAssignedClassType(symbol) { + var decl = symbol.valueDeclaration; + var assignmentSymbol = decl && decl.parent && + (ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + if (assignmentSymbol) { + var prototype = ts.forEach(assignmentSymbol.declarations, getAssignedJavascriptPrototype); + if (prototype) { + return checkExpression(prototype); } } } + function getAssignedJavascriptPrototype(node) { + if (!node.parent) { + return false; + } + var parent = node.parent; + while (parent && parent.kind === 183 /* PropertyAccessExpression */) { + parent = parent.parent; + } + return parent && ts.isBinaryExpression(parent) && + ts.isPropertyAccessExpression(parent.left) && + parent.left.name.escapedText === "prototype" && + parent.operatorToken.kind === 58 /* EqualsToken */ && + ts.isObjectLiteralExpression(parent.right) && + parent.right; + } function getInferredClassType(symbol) { var links = getSymbolLinks(symbol); if (!links.inferredClassType) { @@ -40444,12 +42047,12 @@ var ts; if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; } - if (node.kind === 183 /* NewExpression */) { + if (node.kind === 186 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 153 /* Constructor */ && - declaration.kind !== 157 /* ConstructSignature */ && - declaration.kind !== 162 /* ConstructorType */ && + declaration.kind !== 154 /* Constructor */ && + declaration.kind !== 158 /* ConstructSignature */ && + declaration.kind !== 163 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -40497,7 +42100,7 @@ var ts; if (!globalESSymbol) { return false; } - return globalESSymbol === resolveName(left, "Symbol", 107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); + return globalESSymbol === resolveName(left, "Symbol", 67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); } function checkImportCallExpression(node) { // Check grammar of dynamic import @@ -40539,7 +42142,7 @@ var ts; var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); anonymousSymbol.type = defaultContainingObject; - synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*propegatedFlags*/ 0) : defaultContainingObject; + synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*typeFLags*/ 0, /*objectFlags*/ 0) : defaultContainingObject; } else { synthType.syntheticType = type; @@ -40555,8 +42158,8 @@ var ts; } // Make sure require is not a local function if (!ts.isIdentifier(node.expression)) - throw ts.Debug.fail(); - var resolvedRequire = resolveName(node.expression, node.expression.escapedText, 107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); + return ts.Debug.fail(); + var resolvedRequire = resolveName(node.expression, node.expression.escapedText, 67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); if (!resolvedRequire) { // project does not contain symbol named 'require' - assume commonjs require return true; @@ -40566,9 +42169,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 229 /* FunctionDeclaration */ + ? 232 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 227 /* VariableDeclaration */ + ? 230 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -40608,7 +42211,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return unknownType; } - else if (container.kind === 153 /* Constructor */) { + else if (container.kind === 154 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -40735,7 +42338,7 @@ var ts; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 208 /* Block */) { + if (func.body.kind !== 211 /* Block */) { type = checkExpressionCached(func.body, checkMode); if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any @@ -40747,7 +42350,7 @@ var ts; } else { var types = checkAndAggregateReturnExpressionTypes(func, checkMode); - if (functionFlags & 1 /* Generator */) { + if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); if (!types || types.length === 0) { var iterableIteratorAny = functionFlags & 2 /* Async */ @@ -40816,25 +42419,21 @@ var ts; } function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; - var functionFlags = ts.getFunctionFlags(func); + var isAsync = (ts.getFunctionFlags(func) & 2 /* Async */) !== 0; ts.forEachYieldExpression(func.body, function (yieldExpression) { - var expr = yieldExpression.expression; - if (expr) { - var type = checkExpressionCached(expr, checkMode); - if (yieldExpression.asteriskToken) { - // A yield* expression effectively yields everything that its operand yields - type = checkIteratedTypeOrElementType(type, yieldExpression.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); - } - if (functionFlags & 2 /* Async */) { - type = checkAwaitedType(type, expr, yieldExpression.asteriskToken - ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member - : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - } - ts.pushIfUnique(aggregatedTypes, type); - } + ts.pushIfUnique(aggregatedTypes, getYieldedTypeOfYieldExpression(yieldExpression, isAsync, checkMode)); }); return aggregatedTypes; } + function getYieldedTypeOfYieldExpression(node, isAsync, checkMode) { + var errorNode = node.expression || node; + var expressionType = node.expression ? checkExpressionCached(node.expression, checkMode) : undefinedWideningType; + // A `yield*` expression effectively yields everything that its operand yields + var yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(expressionType, errorNode, /*allowStringInput*/ false, isAsync) : expressionType; + return !isAsync ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken + ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + } function isExhaustiveSwitchStatement(node) { if (!node.possiblyExhaustive) { return false; @@ -40853,7 +42452,7 @@ var ts; if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 222 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 225 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { return false; } return true; @@ -40894,11 +42493,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; - case 152 /* MethodDeclaration */: - return func.parent.kind === 179 /* ObjectLiteralExpression */; + case 153 /* MethodDeclaration */: + return func.parent.kind === 182 /* ObjectLiteralExpression */; default: return false; } @@ -40922,7 +42521,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 208 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 152 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 211 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -40955,7 +42554,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); @@ -40963,7 +42562,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 187 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 190 /* FunctionExpression */) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -40998,7 +42597,7 @@ var ts; checkNodeDeferred(node); } } - if (produceDiagnostics && node.kind !== 152 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 153 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithCapturedNewTargetVariable(node, node.name); @@ -41006,14 +42605,14 @@ var ts; return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); var returnOrPromisedType = returnTypeNode && ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ ? checkAsyncFunctionReturnType(node) : // Async function getTypeFromTypeNode(returnTypeNode)); // AsyncGenerator function, Generator function, or normal function - if ((functionFlags & 1 /* Generator */) === 0) { + if ((functionFlags & 1 /* Generator */) === 0) { // Async function or normal function // return is not necessary in the body of generators checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } @@ -41026,7 +42625,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 208 /* Block */) { + if (node.body.kind === 211 /* Block */) { checkSourceElement(node.body); } else { @@ -41037,11 +42636,11 @@ var ts; // its return type annotation. var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) { + if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) { // Async function var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } - else { + else { // Normal function checkTypeAssignableTo(exprType, returnOrPromisedType, node.body); } } @@ -41073,11 +42672,11 @@ var ts; if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) && + (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) && expr.expression.kind === 99 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 153 /* Constructor */)) { + if (!(func && func.kind === 154 /* Constructor */)) { return true; } // If func.parent is a class and symbol is a (readonly) property of that class, or @@ -41090,13 +42689,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); if (node.kind === 71 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 241 /* NamespaceImport */; + return declaration && declaration.kind === 244 /* NamespaceImport */; } } } @@ -41105,7 +42704,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); - if (node.kind !== 71 /* Identifier */ && node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 71 /* Identifier */ && node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -41114,7 +42713,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 180 /* PropertyAccessExpression */ && expr.kind !== 181 /* ElementAccessExpression */) { + if (expr.kind !== 183 /* PropertyAccessExpression */ && expr.kind !== 184 /* ElementAccessExpression */) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -41199,7 +42798,7 @@ var ts; // Return true if type might be of the given kind. A union or intersection type might be of a given // kind if at least one constituent type is of the given kind. function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { + if (type.flags & kind || kind & 536870912 /* GenericMappedType */ && isGenericMappedType(type)) { return true; } if (type.flags & 393216 /* UnionOrIntersection */) { @@ -41228,7 +42827,7 @@ var ts; (kind & 8192 /* Null */ && isTypeAssignableTo(source, nullType)) || (kind & 4096 /* Undefined */ && isTypeAssignableTo(source, undefinedType)) || (kind & 512 /* ESSymbol */ && isTypeAssignableTo(source, esSymbolType)) || - (kind & 33554432 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); + (kind & 134217728 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); } function allTypesAssignableToKind(source, kind, strict) { return source.flags & 131072 /* Union */ ? @@ -41273,7 +42872,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 /* NumberLike */ | 1536 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -41291,9 +42890,9 @@ var ts; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 265 /* PropertyAssignment */ || property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */ || property.kind === 269 /* ShorthandPropertyAssignment */) { var name = property.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { @@ -41306,7 +42905,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 269 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -41318,7 +42917,7 @@ var ts; error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 267 /* SpreadAssignment */) { + else if (property.kind === 270 /* SpreadAssignment */) { if (languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(property, 4 /* Rest */); } @@ -41352,8 +42951,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 201 /* OmittedExpression */) { - if (element.kind !== 199 /* SpreadElement */) { + if (element.kind !== 204 /* OmittedExpression */) { + if (element.kind !== 202 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -41381,7 +42980,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 195 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { + if (restExpression.kind === 198 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -41394,7 +42993,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 266 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 269 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -41410,21 +43009,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 195 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { + if (target.kind === 198 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 179 /* ObjectLiteralExpression */) { + if (target.kind === 182 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 178 /* ArrayLiteralExpression */) { + if (target.kind === 181 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 267 /* SpreadAssignment */ ? + var error = target.parent.kind === 270 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -41446,35 +43045,35 @@ var ts; case 71 /* Identifier */: case 9 /* StringLiteral */: case 12 /* RegularExpressionLiteral */: - case 184 /* TaggedTemplateExpression */: - case 197 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: - case 139 /* UndefinedKeyword */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 190 /* TypeOfExpression */: - case 204 /* NonNullExpression */: - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: + case 140 /* UndefinedKeyword */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 193 /* TypeOfExpression */: + case 207 /* NonNullExpression */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: return true; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -41486,9 +43085,9 @@ var ts; } return false; // Some forms listed here for clarity - case 191 /* VoidExpression */: // Explicit opt-out - case 185 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 203 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 194 /* VoidExpression */: // Explicit opt-out + case 188 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 206 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -41497,11 +43096,14 @@ var ts; return (target.flags & 12288 /* Nullable */) !== 0 || isTypeComparableTo(source, target); } function checkBinaryExpression(node, checkMode) { + if (ts.isInJavaScriptFile(node) && ts.getAssignedJavascriptInitializer(node)) { + return checkExpression(node.right, checkMode); + } return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 58 /* EqualsToken */ && (left.kind === 179 /* ObjectLiteralExpression */ || left.kind === 178 /* ArrayLiteralExpression */)) { + if (operator === 58 /* EqualsToken */ && (left.kind === 182 /* ObjectLiteralExpression */ || left.kind === 181 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } var leftType = checkExpression(left, checkMode); @@ -41706,52 +43308,35 @@ var ts; error(node, ts.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer); } } - if (node.expression) { - var func = ts.getContainingFunction(node); - // If the user's code is syntactically correct, the func should always have a star. After all, - // we are in a yield context. - var functionFlags = func && ts.getFunctionFlags(func); - if (node.asteriskToken) { - // Async generator functions prior to ESNext require the __await, __asyncDelegator, - // and __asyncValues helpers - if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && - languageVersion < 6 /* ESNext */) { - checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */); - } - // Generator functions prior to ES2015 require the __values helper - if ((functionFlags & 3 /* AsyncGenerator */) === 1 /* Generator */ && - languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { - checkExternalEmitHelpers(node, 256 /* Values */); - } + var func = ts.getContainingFunction(node); + var functionFlags = func ? ts.getFunctionFlags(func) : 0 /* Normal */; + if (!(functionFlags & 1 /* Generator */)) { + // If the user's code is syntactically correct, the func should always have a star. After all, we are in a yield context. + return anyType; + } + if (node.asteriskToken) { + // Async generator functions prior to ESNext require the __await, __asyncDelegator, + // and __asyncValues helpers + if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && + languageVersion < 6 /* ESNext */) { + checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */); } - if (functionFlags & 1 /* Generator */) { - var expressionType = checkExpressionCached(node.expression); - var expressionElementType = void 0; - var nodeIsYieldStar = !!node.asteriskToken; - if (nodeIsYieldStar) { - expressionElementType = checkIteratedTypeOrElementType(expressionType, node.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); - } - // There is no point in doing an assignability check if the function - // has no explicit return type because the return type is directly computed - // from the yield expressions. - var returnType = ts.getEffectiveReturnTypeNode(func); - if (returnType) { - var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(returnType), (functionFlags & 2 /* Async */) !== 0) || anyType; - if (nodeIsYieldStar) { - checkTypeAssignableTo(functionFlags & 2 /* Async */ - ? getAwaitedType(expressionElementType, node.expression, ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) - : expressionElementType, signatureElementType, node.expression, - /*headMessage*/ undefined); - } - else { - checkTypeAssignableTo(functionFlags & 2 /* Async */ - ? getAwaitedType(expressionType, node.expression, ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) - : expressionType, signatureElementType, node.expression, - /*headMessage*/ undefined); - } - } + // Generator functions prior to ES2015 require the __values helper + if ((functionFlags & 3 /* AsyncGenerator */) === 1 /* Generator */ && + languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256 /* Values */); } } + var isAsync = (functionFlags & 2 /* Async */) !== 0; + var yieldedType = getYieldedTypeOfYieldExpression(node, isAsync); + // There is no point in doing an assignability check if the function + // has no explicit return type because the return type is directly computed + // from the yield expressions. + var returnType = ts.getEffectiveReturnTypeNode(func); + if (returnType) { + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(returnType), isAsync) || anyType; + checkTypeAssignableTo(yieldedType, signatureElementType, node.expression || node, /*headMessage*/ undefined); + } // Both yield and yield* expressions have type 'any' return anyType; } @@ -41773,7 +43358,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 258 /* JsxAttributes */) { + if (node.kind === 261 /* JsxAttributes */) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -41809,13 +43394,14 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 185 /* TypeAssertionExpression */ || node.kind === 203 /* AsExpression */; + return node.kind === 188 /* TypeAssertionExpression */ || node.kind === 206 /* AsExpression */; } function checkDeclarationInitializer(declaration) { - var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); + var initializer = ts.isInJavaScriptFile(declaration) && ts.getDeclaredJavascriptInitializer(declaration) || declaration.initializer; + var type = getTypeOfExpression(initializer, /*cache*/ true); return ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || (ts.getCombinedModifierFlags(declaration) & 64 /* Readonly */ && !ts.isParameterPropertyDeclaration(declaration)) || - isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); + isTypeAssertion(initializer) ? type : getWidenedLiteralType(type); } function isLiteralOfContextualType(candidateType, contextualType) { if (contextualType) { @@ -41823,7 +43409,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 1081344 /* TypeVariable */) { + if (contextualType.flags & 7372800 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -41855,7 +43441,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -41866,7 +43452,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -41896,7 +43482,7 @@ var ts; function getTypeOfExpression(node, cache) { // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (node.kind === 182 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { + if (node.kind === 185 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -41931,7 +43517,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpression(node, checkMode) { var type; - if (node.kind === 144 /* QualifiedName */) { + if (node.kind === 145 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -41943,10 +43529,10 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 181 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 163 /* TypeQuery */ && node.parent.exprName === node)); + var ok = (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 164 /* TypeQuery */ && node.parent.exprName === node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -41980,74 +43566,74 @@ var ts; return trueType; case 86 /* FalseKeyword */: return falseType; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return checkTemplateExpression(node); case 12 /* RegularExpressionLiteral */: return globalRegExpType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (node.expression.kind === 91 /* ImportKeyword */) { return checkImportCallExpression(node); } /* falls through */ - case 183 /* NewExpression */: + case 186 /* NewExpression */: return checkCallExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return checkClassExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return checkAssertion(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return checkNonNullAssertion(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return checkMetaProperty(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkDeleteExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return checkVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return checkAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return undefinedWideningType; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return checkYieldExpression(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return checkJsxElement(node, checkMode); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return checkJsxFragment(node, checkMode); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -42085,7 +43671,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 153 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 154 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -42096,7 +43682,7 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 153 /* Constructor */ || func.kind === 157 /* ConstructSignature */ || func.kind === 162 /* ConstructorType */) { + if (func.kind === 154 /* Constructor */ || func.kind === 158 /* ConstructSignature */ || func.kind === 163 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -42162,13 +43748,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 188 /* ArrowFunction */: - case 156 /* CallSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 161 /* FunctionType */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 191 /* ArrowFunction */: + case 157 /* CallSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 162 /* FunctionType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -42186,7 +43772,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 176 /* ArrayBindingPattern */ || name.kind === 175 /* ObjectBindingPattern */) { + else if (name.kind === 179 /* ArrayBindingPattern */ || name.kind === 178 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -42195,12 +43781,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 161 /* FunctionType */ || node.kind === 229 /* FunctionDeclaration */ || node.kind === 162 /* ConstructorType */ || - node.kind === 156 /* CallSignature */ || node.kind === 153 /* Constructor */ || - node.kind === 157 /* ConstructSignature */) { + // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled + else if (node.kind === 162 /* FunctionType */ || node.kind === 232 /* FunctionDeclaration */ || node.kind === 163 /* ConstructorType */ || + node.kind === 157 /* CallSignature */ || node.kind === 154 /* Constructor */ || + node.kind === 158 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -42230,10 +43817,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -42280,7 +43867,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -42294,16 +43881,16 @@ var ts; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: addName(names, member.name, memberName, 4 /* Method */); break; } @@ -42366,7 +43953,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* PropertySignature */) { + if (member.kind === 150 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: @@ -42390,7 +43977,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 231 /* InterfaceDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -42410,7 +43997,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -42418,7 +44005,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -42445,7 +44032,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 153 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -42471,7 +44058,7 @@ var ts; return; } function isInstancePropertyWithInitializer(n) { - return n.kind === 150 /* PropertyDeclaration */ && + return n.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -42501,7 +44088,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -42526,7 +44113,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { if (!(node.flags & 2097152 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -42536,13 +44123,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = node.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -42560,7 +44147,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -42577,8 +44164,10 @@ var ts; function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { - var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJavaScriptFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { var typeArguments; var mapper; var result = true; @@ -42586,18 +44175,28 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, ts.isInJavaScriptFile(typeArgumentNodes[i])); + typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(typeArgument, instantiateType(constraint, mapper), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; } + function getTypeParametersForTypeReference(node) { + var type = getTypeFromTypeReference(node); + if (type !== unknownType) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || + (ts.getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : undefined); + } + } + return undefined; + } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 160 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 161 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); @@ -42606,22 +44205,10 @@ var ts; // Do type argument local checks only if referenced type is successfully resolved ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (!symbol) { - // There is no resolved symbol cached if the type resolved to a builtin - // via JSDoc type reference resolution (eg, Boolean became boolean), none - // of which are generic when they have no associated symbol - // (additionally, JSDoc's index signature syntax, Object actually uses generic syntax without being generic) - if (!ts.isJSDocIndexSignature(node)) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - } - return; + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); } - var typeParameters = symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters; - if (!typeParameters && ts.getObjectFlags(type) & 4 /* Reference */) { - typeParameters = type.target.localTypeParameters; - } - checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } if (type.flags & 16 /* Enum */ && getNodeLinks(node).resolvedSymbol.flags & 8 /* EnumMember */) { @@ -42629,6 +44216,14 @@ var ts; } } } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType); + if (!typeReferenceNode) + return undefined; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } function checkTypeQuery(node) { getTypeFromTypeQueryNode(node); } @@ -42663,8 +44258,8 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { - if (accessNode.kind === 181 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && - ts.getObjectFlags(objectType) & 32 /* Mapped */ && objectType.declaration.readonlyToken) { + if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -42696,6 +44291,15 @@ var ts; checkGrammarTypeOperatorNode(node); checkSourceElement(node.type); } + function checkConditionalType(node) { + ts.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 /* ConditionalType */ && n.parent.extendsType === n; })) { + grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + } function isPrivateWithinAmbient(node) { return ts.hasModifier(node, 8 /* Private */) && !!(node.flags & 2097152 /* Ambient */); } @@ -42703,9 +44307,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 231 /* InterfaceDeclaration */ && - n.parent.kind !== 230 /* ClassDeclaration */ && - n.parent.kind !== 200 /* ClassExpression */ && + if (n.parent.kind !== 234 /* InterfaceDeclaration */ && + n.parent.kind !== 233 /* ClassDeclaration */ && + n.parent.kind !== 203 /* ClassExpression */ && n.flags & 2097152 /* Ambient */) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -42796,7 +44400,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */) && + var reportError = (node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -42835,7 +44439,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 2097152 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 231 /* InterfaceDeclaration */ || node.parent.kind === 164 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 234 /* InterfaceDeclaration */ || node.parent.kind === 165 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -42846,7 +44450,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 229 /* FunctionDeclaration */ || node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */ || node.kind === 153 /* Constructor */) { + if (node.kind === 232 /* FunctionDeclaration */ || node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */ || node.kind === 154 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -42974,33 +44578,35 @@ var ts; })(DeclarationSpaces || (DeclarationSpaces = {})); function getDeclarationSpaces(d) { switch (d.kind) { - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: // A jsdoc typedef is, by definition, a type alias - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return 2 /* ExportType */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: return 2 /* ExportType */ | 1 /* ExportValue */; + case 272 /* SourceFile */: + return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; // The below options all declare an Alias, which is allowed to merge with other values within the importing module - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: var result_2 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); }); return result_2; - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 229 /* FunctionDeclaration */: - case 243 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 232 /* FunctionDeclaration */: + case 246 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 return 1 /* ExportValue */; default: - ts.Debug.fail(ts.SyntaxKind[d.kind]); + ts.Debug.fail(ts.Debug.showSyntaxKind(d)); } } } @@ -43224,7 +44830,7 @@ var ts; error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, typeToString(returnType)); return unknownType; } - var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455 /* Value */, /*ignoreErrors*/ true); + var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 67216319 /* Value */, /*ignoreErrors*/ true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { if (promiseConstructorName.kind === 71 /* Identifier */ && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) { @@ -43247,7 +44853,7 @@ var ts; } // Verify there is no local declaration that could collide with the promise constructor. var rootName = promiseConstructorName && getFirstIdentifier(promiseConstructorName); - var collidingSymbol = getSymbol(node.locals, rootName.escapedText, 107455 /* Value */); + var collidingSymbol = getSymbol(node.locals, rootName.escapedText, 67216319 /* Value */); if (collidingSymbol) { error(collidingSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, ts.idText(rootName), ts.entityNameToString(promiseConstructorName)); return unknownType; @@ -43267,22 +44873,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 147 /* Parameter */: + case 148 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -43301,7 +44907,7 @@ var ts; if (!typeName) return; var rootName = getFirstIdentifier(typeName); - var meaning = (typeName.kind === 71 /* Identifier */ ? 793064 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */; + var meaning = (typeName.kind === 71 /* Identifier */ ? 67901928 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */; var rootSymbol = resolveName(rootName, rootName.escapedText, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isRefernce*/ true); if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */ @@ -43326,18 +44932,18 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: var commonEntityName = void 0; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -43363,9 +44969,9 @@ var ts; } } return commonEntityName; - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; } } @@ -43389,14 +44995,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -43405,19 +45011,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 147 /* Parameter */: + case 148 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -43449,7 +45055,20 @@ var ts; function checkJSDocParameterTag(node) { checkSourceElement(node.typeExpression); if (!ts.getParameterSymbolFromJSDoc(node)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 144 /* QualifiedName */ ? node.name.right : node.name)); + var decl = ts.getHostSignatureFromJSDoc(node); + // don't issue an error for invalid hosts -- just functions -- + // and give a better error message when the host function mentions `arguments` + // but the tag doesn't have an array type + if (decl) { + if (!containsArgumentsReference(decl)) { + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 /* QualifiedName */ ? node.name.right : node.name)); + } + else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && + node.typeExpression && node.typeExpression.type && + !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 145 /* QualifiedName */ ? node.name.right : node.name)); + } + } } } function checkJSDocAugmentsTag(node) { @@ -43458,7 +45077,7 @@ var ts; error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName)); return; } - var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 282 /* JSDocAugmentsTag */); + var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 285 /* JSDocAugmentsTag */); ts.Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); @@ -43476,7 +45095,7 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -43489,7 +45108,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -43518,9 +45137,10 @@ var ts; } } } - checkSourceElement(node.body); + var body = node.kind === 152 /* MethodSignature */ ? undefined : node.body; + checkSourceElement(body); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); - if ((functionFlags & 1 /* Generator */) === 0) { + if ((functionFlags & 1 /* Generator */) === 0) { // Async function or normal function var returnOrPromisedType = returnTypeNode && (functionFlags & 2 /* Async */ ? checkAsyncFunctionReturnType(node) // Async function : getTypeFromTypeNode(returnTypeNode)); // normal function @@ -43529,10 +45149,10 @@ var ts; if (produceDiagnostics && !returnTypeNode) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -43551,43 +45171,43 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 269 /* SourceFile */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 237 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 232 /* TypeAliasDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 235 /* TypeAliasDeclaration */: checkUnusedTypeParameters(node); break; default: @@ -43599,8 +45219,10 @@ var ts; function checkUnusedLocalsAndParameters(node) { if (noUnusedIdentifiers && !(node.flags & 2097152 /* Ambient */)) { node.locals.forEach(function (local) { - if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 147 /* Parameter */) { + // If it's purely a type parameter, ignore, will be checked in `checkUnusedTypeParameters`. + // If it's a type parameter merged with a parameter, check if the parameter-side is used. + if (local.flags & 262144 /* TypeParameter */ ? (local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : !local.isReferenced) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 148 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && @@ -43628,31 +45250,31 @@ var ts; var node = ts.getNameOfDeclaration(declaration) || declaration; if (isIdentifierThatStartsWithUnderScore(node)) { var declaration_2 = ts.getRootDeclaration(node.parent); - if ((declaration_2.kind === 227 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || - declaration_2.kind === 146 /* TypeParameter */) { + if ((declaration_2.kind === 230 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || + declaration_2.kind === 147 /* TypeParameter */) { return; } } if (!isRemovedPropertyFromObjectSpread(node.kind === 71 /* Identifier */ ? node.parent : node)) { - error(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name); + diagnostics.add(ts.createDiagnosticForNodeSpan(ts.getSourceFileOfNode(declaration), declaration, node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } function parameterNameStartsWithUnderscore(parameterName) { return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); } function isIdentifierThatStartsWithUnderScore(node) { - return node.kind === 71 /* Identifier */ && ts.idText(node).charCodeAt(0) === 95 /* _ */; + return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 152 /* MethodDeclaration */: - case 150 /* PropertyDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - if (member.kind === 155 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 153 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + if (member.kind === 156 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -43661,7 +45283,7 @@ var ts; error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)); } break; - case 153 /* Constructor */: + case 154 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -43669,8 +45291,8 @@ var ts; } } break; - case 158 /* IndexSignature */: - case 207 /* SemicolonClassElement */: + case 159 /* IndexSignature */: + case 210 /* SemicolonClassElement */: // Can't be private break; default: @@ -43680,7 +45302,7 @@ var ts; } } function checkUnusedTypeParameters(node) { - if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { + if (compilerOptions.noUnusedParameters && !(node.flags & 2097152 /* Ambient */)) { if (node.typeParameters) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. @@ -43691,7 +45313,7 @@ var ts; } for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) { var typeParameter = _a[_i]; - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & 262144 /* TypeParameter */) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(typeParameter.symbol)); } } @@ -43700,21 +45322,63 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { + // Ideally we could use the ImportClause directly as a key, but must wait until we have full ES6 maps. So must store key along with value. + var unusedImports_1 = ts.createMap(); node.locals.forEach(function (local) { - if (!local.isReferenced && !local.exportSymbol) { - for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (!ts.isAmbientModule(declaration)) { - errorUnusedLocal(declaration, ts.symbolName(local)); + if (local.isReferenced || local.exportSymbol) + return; + for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.isAmbientModule(declaration)) + continue; + if (isImportedDeclaration(declaration)) { + var importClause = importClauseFromImported(declaration); + var key = String(getNodeId(importClause)); + var group_1 = unusedImports_1.get(key); + if (group_1) { + group_1[1].push(declaration); + } + else { + unusedImports_1.set(key, [importClause, [declaration]]); } } + else { + errorUnusedLocal(declaration, ts.symbolName(local)); + } + } + }); + unusedImports_1.forEach(function (_a) { + var importClause = _a[0], unuseds = _a[1]; + var importDecl = importClause.parent; + if (forEachImportedDeclaration(importClause, function (d) { return !ts.contains(unuseds, d); })) { + for (var _i = 0, unuseds_1 = unuseds; _i < unuseds_1.length; _i++) { + var unused = unuseds_1[_i]; + errorUnusedLocal(unused, ts.idText(unused.name)); + } + } + else if (unuseds.length === 1) { + error(importDecl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.first(unuseds).name)); + } + else { + error(importDecl, ts.Diagnostics.All_imports_in_import_declaration_are_unused, ts.showModuleSpecifier(importDecl)); } }); } } + function isImportedDeclaration(node) { + return node.kind === 243 /* ImportClause */ || node.kind === 246 /* ImportSpecifier */ || node.kind === 244 /* NamespaceImport */; + } + function importClauseFromImported(decl) { + return decl.kind === 243 /* ImportClause */ ? decl : decl.kind === 244 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + } + function forEachImportedDeclaration(importClause, cb) { + var defaultName = importClause.name, namedBindings = importClause.namedBindings; + return (defaultName && cb(importClause)) || + namedBindings && (namedBindings.kind === 244 /* NamespaceImport */ ? cb(namedBindings) : ts.forEach(namedBindings.elements, cb)); + } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 208 /* Block */) { + if (node.kind === 211 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -43744,12 +45408,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 151 /* MethodSignature */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 152 /* MethodSignature */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -43758,7 +45422,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 147 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 148 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -43837,7 +45501,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43852,7 +45516,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43887,29 +45551,29 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 227 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 230 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); if (symbol.flags & 1 /* FunctionScopedVariable */) { if (!ts.isIdentifier(node.name)) - throw ts.Debug.fail(); + return ts.Debug.fail(); var localDeclarationSymbol = resolveName(node, node.name.escapedText, 3 /* Variable */, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 228 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 209 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 231 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 212 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 208 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 235 /* ModuleBlock */ || - container.kind === 234 /* ModuleDeclaration */ || - container.kind === 269 /* SourceFile */); + (container.kind === 211 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 238 /* ModuleBlock */ || + container.kind === 237 /* ModuleDeclaration */ || + container.kind === 272 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -43924,7 +45588,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 147 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 148 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -43935,14 +45599,14 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 180 /* PropertyAccessExpression */) { + if (n.kind === 183 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } else if (n.kind === 71 /* Identifier */) { // check FunctionLikeDeclaration.locals (stores parameters\function local variable) // if it contains entry with a specified name - var symbol = resolveName(n, n.escapedText, 107455 /* Value */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); + var symbol = resolveName(n, n.escapedText, 67216319 /* Value */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); if (!symbol || symbol === unknownSymbol || !symbol.valueDeclaration) { return; } @@ -43954,8 +45618,8 @@ var ts; // so we need to do a bit of extra work to check if reference is legal var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 147 /* Parameter */ || - symbol.valueDeclaration.kind === 177 /* BindingElement */) { + if (symbol.valueDeclaration.kind === 148 /* Parameter */ || + symbol.valueDeclaration.kind === 180 /* BindingElement */) { // it is ok to reference parameter in initializer if either // - parameter is located strictly on the left of current parameter declaration if (symbol.valueDeclaration.pos < node.pos) { @@ -43969,7 +45633,7 @@ var ts; return ts.isFunctionLike(current.parent) || // computed property names/initializers in instance property declaration of class like entities // are executed in constructor and thus deferred - (current.parent.kind === 150 /* PropertyDeclaration */ && + (current.parent.kind === 151 /* PropertyDeclaration */ && !(ts.hasModifier(current.parent, 32 /* Static */)) && ts.isClassLike(current.parent.parent)); })) { @@ -44002,46 +45666,48 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 177 /* BindingElement */) { - if (node.parent.kind === 175 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { + if (node.kind === 180 /* BindingElement */) { + if (node.parent.kind === 178 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 145 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (!ts.isBindingPattern(name)) { + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 176 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 179 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 147 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 148 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { var initializerType = checkExpressionCached(node.initializer); if (strictNullChecks && node.name.elements.length === 0) { checkNonNullType(initializerType, node); @@ -44058,8 +45724,9 @@ var ts; if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { + var initializer = ts.isInJavaScriptFile(node) && ts.getDeclaredJavascriptInitializer(node) || node.initializer; + checkTypeAssignableTo(checkExpressionCached(initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } } @@ -44080,10 +45747,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */) { + if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */) { + if (node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -44095,14 +45762,14 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 150 /* PropertyDeclaration */ || nextDeclaration.kind === 149 /* PropertySignature */ + var message = nextDeclaration.kind === 151 /* PropertyDeclaration */ || nextDeclaration.kind === 150 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 147 /* Parameter */ && right.kind === 227 /* VariableDeclaration */) || - (left.kind === 227 /* VariableDeclaration */ && right.kind === 147 /* Parameter */)) { + if ((left.kind === 148 /* Parameter */ && right.kind === 230 /* VariableDeclaration */) || + (left.kind === 230 /* VariableDeclaration */ && right.kind === 148 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -44131,19 +45798,6 @@ var ts; checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (ts.getFunctionFlags(node) & 2 /* Async */) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } function checkExpressionStatement(node) { // Grammar checking checkGrammarStatementInAmbientContext(node); @@ -44154,7 +45808,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 210 /* EmptyStatement */) { + if (node.thenStatement.kind === 213 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -44174,12 +45828,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 231 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -44197,7 +45851,7 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 6 /* ESNext */) { @@ -44215,14 +45869,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -44254,7 +45908,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -44268,7 +45922,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -44281,7 +45935,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -44582,8 +46236,8 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return node.kind === 154 /* GetAccessor */ - && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 155 /* SetAccessor */)) !== undefined; + return node.kind === 155 /* GetAccessor */ + && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156 /* SetAccessor */)) !== undefined; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncGenerator */) === 2 /* Async */ @@ -44607,25 +46261,25 @@ var ts; var isGenerator = functionFlags & 1 /* Generator */; if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (isGenerator) { + if (isGenerator) { // AsyncGenerator function or Generator function // A generator does not need its return expressions checked against its return type. // Instead, the yield expressions are checked against the element type. // TODO: Check return types of generators when return type tracking is added // for generators. return; } - else if (func.kind === 155 /* SetAccessor */) { + else if (func.kind === 156 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 153 /* Constructor */) { + else if (func.kind === 154 /* Constructor */) { if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (functionFlags & 2 /* Async */) { + if (functionFlags & 2 /* Async */) { // Async function var promisedType = getPromisedTypeOfPromise(returnType); var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); if (promisedType) { @@ -44640,7 +46294,7 @@ var ts; } } } - else if (func.kind !== 153 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + else if (func.kind !== 154 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -44669,7 +46323,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 262 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 265 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -44681,12 +46335,11 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 261 /* CaseClause */) { - var caseClause = clause; + if (produceDiagnostics && clause.kind === 264 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. - var caseType = checkExpression(caseClause.expression); + var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -44695,7 +46348,7 @@ var ts; } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { // expressionType is not comparable to caseType, try the reversed check and report errors if it fails - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, /*headMessage*/ undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, /*headMessage*/ undefined); } } ts.forEach(clause.statements, checkSourceElement); @@ -44711,9 +46364,8 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 223 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { - var sourceFile = ts.getSourceFileOfNode(node); - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); + if (current.kind === 226 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } }); @@ -44817,8 +46469,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && - (propDeclaration.kind === 195 /* BinaryExpression */ || - ts.getNameOfDeclaration(propDeclaration).kind === 145 /* ComputedPropertyName */ || + (propDeclaration.kind === 198 /* BinaryExpression */ || + ts.getNameOfDeclaration(propDeclaration).kind === 146 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -44996,7 +46648,7 @@ var ts; ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; - if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { break; } } @@ -45068,7 +46720,7 @@ var ts; var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); if (prop && baseProp) { var rootChain = function () { return ts.chainDiagnosticMessages( - /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, ts.unescapeLeadingUnderscores(declaredProp.escapedName), typeToString(typeWithThis), typeToString(baseWithThis)); }; + /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, symbolToString(declaredProp), typeToString(typeWithThis), typeToString(baseWithThis)); }; if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, /*message*/ undefined, rootChain)) { issuedMemberError = true; } @@ -45103,7 +46755,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 230 /* ClassDeclaration */ || d.kind === 231 /* InterfaceDeclaration */; + return d.kind === 233 /* ClassDeclaration */ || d.kind === 234 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -45142,7 +46794,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { - if (derivedClassDecl.kind === 200 /* ClassExpression */) { + if (derivedClassDecl.kind === 203 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -45234,7 +46886,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 150 /* PropertyDeclaration */ && + return node.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -45256,7 +46908,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -45361,17 +47013,17 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 193 /* PrefixUnaryExpression */: - var value_1 = evaluate(expr.operand); - if (typeof value_1 === "number") { + case 196 /* PrefixUnaryExpression */: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { switch (expr.operator) { - case 37 /* PlusToken */: return value_1; - case 38 /* MinusToken */: return -value_1; - case 52 /* TildeToken */: return ~value_1; + case 37 /* PlusToken */: return value_2; + case 38 /* MinusToken */: return -value_2; + case 52 /* TildeToken */: return ~value_2; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -45396,18 +47048,18 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return evaluate(expr.expression); case 71 /* Identifier */: return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText); - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 180 /* PropertyAccessExpression */) { + if (ex.kind === 183 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -45439,8 +47091,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 181 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 183 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 184 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 9 /* StringLiteral */; } function checkEnumDeclaration(node) { @@ -45480,7 +47132,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 233 /* EnumDeclaration */) { + if (declaration.kind !== 236 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -45503,8 +47155,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { var declaration = declarations_7[_i]; - if ((declaration.kind === 230 /* ClassDeclaration */ || - (declaration.kind === 229 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 233 /* ClassDeclaration */ || + (declaration.kind === 232 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 2097152 /* Ambient */)) { return declaration; } @@ -45568,7 +47220,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 230 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 233 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -45583,7 +47235,6 @@ var ts; // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module). var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432 /* Transient */); if (checkBody && node.body) { - // body of ambient external module is always a module block for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { var statement = _a[_i]; checkModuleAugmentationElement(statement, isGlobalAugmentation); @@ -45619,23 +47270,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -45646,12 +47297,12 @@ var ts; break; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 229 /* FunctionDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -45674,12 +47325,12 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: do { node = node.left; } while (node.kind !== 71 /* Identifier */); return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 71 /* Identifier */); @@ -45688,18 +47339,22 @@ var ts; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 9 /* StringLiteral */) { + if (ts.nodeIsMissing(moduleName)) { + // Should be a parse error. + return false; + } + if (!ts.isStringLiteral(moduleName)) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 245 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 248 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } - if (inAmbientExternalModule && ts.isExternalModuleNameRelative(ts.getTextOfIdentifierOrLiteral(moduleName))) { + if (inAmbientExternalModule && ts.isExternalModuleNameRelative(moduleName.text)) { // we have already reported errors on top level imports\exports in external module augmentations in checkModuleDeclaration // no need to do this again. if (!isTopLevelInExternalModuleAugmentation(node)) { @@ -45723,19 +47378,19 @@ var ts; // Based on symbol.flags we can compute a set of excluded meanings (meaning that resolved alias should not have, // otherwise it will conflict with some local declaration). Note that in addition to normal flags we include matching SymbolFlags.Export* // in order to prevent collisions with declarations that were exported from the current module (they still contribute to local names). - var excludedMeanings = (symbol.flags & (107455 /* Value */ | 1048576 /* ExportValue */) ? 107455 /* Value */ : 0) | - (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | + var excludedMeanings = (symbol.flags & (67216319 /* Value */ | 1048576 /* ExportValue */) ? 67216319 /* Value */ : 0) | + (symbol.flags & 67901928 /* Type */ ? 67901928 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 247 /* ExportSpecifier */ ? + var message = node.kind === 250 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 247 /* ExportSpecifier */ - && !(target.flags & 107455 /* Value */) + && node.kind === 250 /* ExportSpecifier */ + && !(target.flags & 67216319 /* Value */) && !(node.flags & 2097152 /* Ambient */)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); } @@ -45762,7 +47417,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -45783,17 +47438,17 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 252 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { - if (target.flags & 107455 /* Value */) { + if (target.flags & 67216319 /* Value */) { // Target is a value symbol, check that it is not hidden by a local declaration with the same name var moduleName = getFirstIdentifier(node.moduleReference); - if (!(resolveEntityName(moduleName, 107455 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) { + if (!(resolveEntityName(moduleName, 67216319 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } - if (target.flags & 793064 /* Type */) { + if (target.flags & 67901928 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } @@ -45819,10 +47474,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 235 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 238 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 2097152 /* Ambient */; - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -45839,7 +47494,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 269 /* SourceFile */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 234 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 272 /* SourceFile */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 237 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -45853,7 +47508,7 @@ var ts; if (!node.parent.parent.moduleSpecifier) { var exportedName = node.propertyName || node.name; // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases) - var symbol = resolveName(exportedName, exportedName.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, + var symbol = resolveName(exportedName, exportedName.escapedText, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); if (symbol && (symbol === undefinedSymbol || isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { error(exportedName, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, ts.idText(exportedName)); @@ -45868,8 +47523,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -45957,7 +47612,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 229 /* FunctionDeclaration */ && declaration.kind !== 152 /* MethodDeclaration */) || + return (declaration.kind !== 232 /* FunctionDeclaration */ && declaration.kind !== 153 /* MethodDeclaration */) || !!declaration.body; } function checkSourceElement(node) { @@ -45975,145 +47630,149 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return checkTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return checkParameter(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return checkPropertyDeclaration(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return checkSignatureDeclaration(node); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return checkMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return checkConstructorDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return checkAccessorDeclaration(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return checkTypeReferenceNode(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return checkTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return checkTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return checkArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return checkTupleType(node); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return checkSourceElement(node.type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return checkTypeOperator(node); - case 282 /* JSDocAugmentsTag */: + case 170 /* ConditionalType */: + return checkConditionalType(node); + case 171 /* InferType */: + return checkInferType(node); + case 285 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return checkJSDocTypedefTag(node); - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: checkSignatureDeclaration(node); // falls through - case 275 /* JSDocNonNullableType */: - case 274 /* JSDocNullableType */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 278 /* JSDocNonNullableType */: + case 277 /* JSDocNullableType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return checkMappedType(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return checkBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return checkVariableStatement(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return checkExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return checkIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return checkDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return checkWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return checkForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return checkForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkForOfStatement(node); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return checkReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return checkSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return checkLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return checkThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return checkTryStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return checkBindingElement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return checkClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return checkImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return checkExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return checkExportAssignment(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -46151,18 +47810,19 @@ var ts; var paramTag = parent.parent; if (ts.isJSDocTypeExpression(parent) && ts.isJSDocParameterTag(paramTag)) { // Else we will add a diagnostic, see `checkJSDocVariadicType`. - var param = ts.getParameterSymbolFromJSDoc(paramTag); - if (param) { - var host_1 = ts.getHostSignatureFromJSDoc(paramTag); + var host_1 = ts.getHostSignatureFromJSDoc(paramTag); + if (host_1) { /* - Only return an array type if the corresponding parameter is marked as a rest parameter. + Only return an array type if the corresponding parameter is marked as a rest parameter, or if there are no parameters. So in the following situation we will not create an array type: /** @param {...number} a * / function f(a) {} Because `a` will just be of type `number | undefined`. A synthetic `...args` will also be added, which *will* get an array type. */ - var lastParamDeclaration = host_1 && ts.last(host_1.parameters); - if (lastParamDeclaration.symbol === param && ts.isRestParameter(lastParamDeclaration)) { + var lastParamDeclaration = ts.lastOrUndefined(host_1.parameters); + var symbol = ts.getParameterSymbolFromJSDoc(paramTag); + if (!lastParamDeclaration || + symbol && lastParamDeclaration.symbol === symbol && ts.isRestParameter(lastParamDeclaration)) { return createArrayType(type); } } @@ -46187,17 +47847,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -46316,13 +47976,13 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -46330,17 +47990,17 @@ var ts; // falls through // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. // Note: that the memberFlags come from previous iteration. if (!isStatic) { - copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 793064 /* Type */); + copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 67901928 /* Type */); } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -46388,28 +48048,28 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 146 /* TypeParameter */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 147 /* TypeParameter */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 144 /* QualifiedName */) { + while (node.parent && node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 160 /* TypeReference */; + return node.parent && node.parent.kind === 161 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 180 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 183 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 202 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 205 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -46437,13 +48097,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 144 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 145 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 238 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 241 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 244 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 247 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -46468,7 +48128,7 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJavaScriptFile(entityName) && - entityName.parent.kind === 180 /* PropertyAccessExpression */ && + entityName.parent.kind === 183 /* PropertyAccessExpression */ && entityName.parent === entityName.parent.parent.left) { // Check if this is a special property assignment var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); @@ -46476,13 +48136,13 @@ var ts; return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 244 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 247 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, - /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); + /*all meanings*/ 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } - if (entityName.kind !== 180 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 183 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 238 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 241 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -46492,26 +48152,26 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 202 /* ExpressionWithTypeArguments */) { - meaning = 793064 /* Type */; + if (entityName.parent.kind === 205 /* ExpressionWithTypeArguments */) { + meaning = 67901928 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { - meaning |= 107455 /* Value */; + meaning |= 67216319 /* Value */; } } else { meaning = 1920 /* Namespace */; } meaning |= 2097152 /* Alias */; - var entityNameSymbol = resolveEntityName(entityName, meaning); + var entityNameSymbol = ts.isEntityNameExpression(entityName) ? resolveEntityName(entityName, meaning) : undefined; if (entityNameSymbol) { return entityNameSymbol; } } - if (entityName.parent.kind === 284 /* JSDocParameterTag */) { + if (entityName.parent.kind === 287 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 146 /* TypeParameter */ && entityName.parent.parent.kind === 287 /* JSDocTemplateTag */) { + if (entityName.parent.kind === 147 /* TypeParameter */ && entityName.parent.parent.kind === 290 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJavaScriptFile(entityName)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -46523,16 +48183,17 @@ var ts; } if (entityName.kind === 71 /* Identifier */) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { - return getIntrinsicTagSymbol(entityName.parent); + var symbol = getIntrinsicTagSymbol(entityName.parent); + return symbol === unknownSymbol ? undefined : symbol; } - return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); + return resolveEntityName(entityName, 67216319 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 180 /* PropertyAccessExpression */ || entityName.kind === 144 /* QualifiedName */) { + else if (entityName.kind === 183 /* PropertyAccessExpression */ || entityName.kind === 145 /* QualifiedName */) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 180 /* PropertyAccessExpression */) { + if (entityName.kind === 183 /* PropertyAccessExpression */) { checkPropertyAccessExpression(entityName); } else { @@ -46542,20 +48203,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 160 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = entityName.parent.kind === 161 /* TypeReference */ ? 67901928 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 257 /* JsxAttribute */) { + else if (entityName.parent.kind === 260 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 159 /* TypePredicate */) { + if (entityName.parent.kind === 160 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (node.flags & 4194304 /* InWithStatement */) { @@ -46573,8 +48234,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 177 /* BindingElement */ && - node.parent.parent.kind === 175 /* ObjectBindingPattern */ && + else if (node.parent.kind === 180 /* BindingElement */ && + node.parent.parent.kind === 178 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText); @@ -46585,8 +48246,8 @@ var ts; } switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 99 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -46600,14 +48261,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 170 /* ThisType */: + case 173 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 97 /* SuperKeyword */: return checkExpression(node).symbol; case 123 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 153 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 154 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -46617,7 +48278,7 @@ var ts; // 2). External module name in an import declaration // 3). Dynamic import call or require in javascript if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 242 /* ImportDeclaration */ || node.parent.kind === 248 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || ts.isImportCall(node.parent))) { return resolveExternalModuleName(node, node); } @@ -46642,8 +48303,8 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 266 /* ShorthandPropertyAssignment */) { - return resolveEntityName(location.name, 107455 /* Value */ | 2097152 /* Alias */); + if (location && location.kind === 269 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location.name, 67216319 /* Value */ | 2097152 /* Alias */); } return undefined; } @@ -46651,7 +48312,7 @@ var ts; function getExportSpecifierLocalTargetSymbol(node) { return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); + resolveEntityName(node.propertyName || node.name, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } function getTypeOfNode(node) { if (node.flags & 4194304 /* InWithStatement */) { @@ -46701,8 +48362,10 @@ var ts; } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolAtLocation(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + } } return unknownType; } @@ -46713,28 +48376,28 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 179 /* ObjectLiteralExpression */ || expr.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 182 /* ObjectLiteralExpression */ || expr.kind === 181 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 217 /* ForOfStatement */) { + if (expr.parent.kind === 220 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 195 /* BinaryExpression */) { + if (expr.parent.kind === 198 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 265 /* PropertyAssignment */) { + if (expr.parent.kind === 268 /* PropertyAssignment */) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 181 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType; @@ -46813,7 +48476,7 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -46834,13 +48497,13 @@ var ts; // for export assignments - check if resolved symbol for RHS is itself a value // otherwise - check if at least one export is value symbolLinks.exportsSomeValue = hasExportAssignment - ? !!(moduleSymbol.flags & 107455 /* Value */) + ? !!(moduleSymbol.flags & 67216319 /* Value */) : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { s = resolveSymbol(s); - return s && !!(s.flags & 107455 /* Value */); + return s && !!(s.flags & 67216319 /* Value */); } } function isNameOfModuleOrEnumDeclaration(node) { @@ -46870,7 +48533,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 269 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 272 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -46890,7 +48553,7 @@ var ts; var symbol = getReferencedValueSymbol(node); // We should only get the declaration of an alias if there isn't a local value // declaration for the symbol - if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */)) { + if (isNonLocalAlias(symbol, /*excludes*/ 67216319 /* Value */)) { return getDeclarationOfAliasSymbol(symbol); } } @@ -46903,7 +48566,7 @@ var ts; var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (ts.isStatementWithLocals(container)) { var nodeLinks_1 = getNodeLinks(symbol.valueDeclaration); - if (resolveName(container.parent, symbol.escapedName, 107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)) { + if (resolveName(container.parent, symbol.escapedName, 67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)) { // redeclaration - always should be renamed links.isDeclarationWithCollidingName = true; } @@ -46925,7 +48588,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 262144 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 208 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 211 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -46966,16 +48629,16 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return node.expression && node.expression.kind === 71 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -46985,7 +48648,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 269 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 272 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -46999,7 +48662,7 @@ var ts; } // const enums and modules that contain only const enums are not considered values from the emit perspective // unless 'preserveConstEnums' option is set to true - return target.flags & 107455 /* Value */ && + return target.flags & 67216319 /* Value */ && (compilerOptions.preserveConstEnums || !isConstEnumOrConstEnumOnlyModule(target)); } function isConstEnumOrConstEnumOnlyModule(s) { @@ -47012,7 +48675,7 @@ var ts; return true; } var target = getSymbolLinks(symbol).target; - if (target && ts.getModifierFlags(node) & 1 /* Export */ && target.flags & 107455 /* Value */) { + if (target && ts.getModifierFlags(node) & 1 /* Export */ && target.flags & 67216319 /* Value */) { // An `export import ... =` of a value symbol is always considered referenced return true; } @@ -47063,15 +48726,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 268 /* EnumMember */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 271 /* EnumMember */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 268 /* EnumMember */) { + if (node.kind === 271 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -47097,9 +48760,9 @@ var ts; return ts.TypeReferenceSerializationKind.Unknown; } // Resolve the symbol as a value to ensure the type can be reached at runtime during emit. - var valueSymbol = resolveEntityName(typeName, 107455 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); + var valueSymbol = resolveEntityName(typeName, 67216319 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); // Resolve the symbol as a type so that we can provide a more useful hint for the type serializer. - var typeSymbol = resolveEntityName(typeName, 793064 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); + var typeSymbol = resolveEntityName(typeName, 67901928 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); if (valueSymbol && valueSymbol === typeSymbol) { var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { @@ -47189,7 +48852,7 @@ var ts; location = getDeclarationContainer(parent); } } - return resolveName(location, reference.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); + return resolveName(location, reference.escapedText, 67216319 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); } function getReferencedValueDeclaration(reference) { if (!ts.isGeneratedIdentifier(reference)) { @@ -47206,7 +48869,7 @@ var ts; function isLiteralConstDeclaration(node) { if (ts.isConst(node)) { var type = getTypeOfSymbol(getSymbolOfNode(node)); - return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */); + return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */); } return false; } @@ -47280,7 +48943,7 @@ var ts; return !!(symbol && ts.getCheckFlags(symbol) & 1024 /* Late */); }, writeLiteralConstValue: writeLiteralConstValue, - getJsxFactoryEntity: function () { return _jsxFactoryEntity; } + getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; } }; // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -47291,9 +48954,9 @@ var ts; // property access can only be used as values // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries - var meaning = (node.kind === 180 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) - ? 107455 /* Value */ | 1048576 /* ExportValue */ - : 793064 /* Type */ | 1920 /* Namespace */; + var meaning = (node.kind === 183 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) + ? 67216319 /* Value */ | 1048576 /* ExportValue */ + : 67901928 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); return symbol && symbol !== unknownSymbol ? getTypeReferenceDirectivesForSymbol(symbol, meaning) : undefined; } @@ -47342,7 +49005,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 269 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 272 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -47362,7 +49025,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 269 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 272 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -47458,7 +49121,7 @@ var ts; for (var helper = 1 /* FirstEmitHelper */; helper <= 65536 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { var name = getHelperName(helper); - var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 107455 /* Value */); + var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 67216319 /* Value */); if (!symbol) { error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); } @@ -47506,14 +49169,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 152 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 153 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */) { + else if (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -47530,17 +49193,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 131 /* ReadonlyKeyword */) { - if (node.kind === 149 /* PropertySignature */ || node.kind === 151 /* MethodSignature */) { + if (modifier.kind !== 132 /* ReadonlyKeyword */) { + if (node.kind === 150 /* PropertySignature */ || node.kind === 152 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 76 /* ConstKeyword */: - if (node.kind !== 233 /* EnumDeclaration */ && node.parent.kind === 230 /* ClassDeclaration */) { + if (node.kind !== 236 /* EnumDeclaration */ && node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76 /* ConstKeyword */)); } break; @@ -47560,7 +49223,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -47583,10 +49246,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -47595,11 +49258,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */ && node.kind !== 158 /* IndexSignature */ && node.kind !== 147 /* Parameter */) { + else if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */ && node.kind !== 159 /* IndexSignature */ && node.kind !== 148 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -47619,17 +49282,17 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 79 /* DefaultKeyword */: - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -47641,13 +49304,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 235 /* ModuleBlock */) { + else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 238 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -47657,14 +49320,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 230 /* ClassDeclaration */) { - if (node.kind !== 152 /* MethodDeclaration */ && - node.kind !== 150 /* PropertyDeclaration */ && - node.kind !== 154 /* GetAccessor */ && - node.kind !== 155 /* SetAccessor */) { + if (node.kind !== 233 /* ClassDeclaration */) { + if (node.kind !== 153 /* MethodDeclaration */ && + node.kind !== 151 /* PropertyDeclaration */ && + node.kind !== 155 /* GetAccessor */ && + node.kind !== 156 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 230 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 233 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -47683,7 +49346,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -47691,7 +49354,7 @@ var ts; break; } } - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -47706,13 +49369,13 @@ var ts; } return; } - else if ((node.kind === 239 /* ImportDeclaration */ || node.kind === 238 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 242 /* ImportDeclaration */ || node.kind === 241 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -47732,37 +49395,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 234 /* ModuleDeclaration */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 147 /* Parameter */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 237 /* ModuleDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 148 /* Parameter */: return false; default: - if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return false; } switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 120 /* AsyncKeyword */); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 117 /* AbstractKeyword */); - case 231 /* InterfaceDeclaration */: - case 209 /* VariableStatement */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 212 /* VariableStatement */: + case 235 /* TypeAliasDeclaration */: return true; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 76 /* ConstKeyword */); default: ts.Debug.fail(); @@ -47775,10 +49438,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -47838,15 +49501,13 @@ var ts; return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 188 /* ArrowFunction */) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } + if (!ts.isArrowFunction(node)) { + return false; } - return false; + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -47873,7 +49534,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 136 /* StringKeyword */ && parameter.type.kind !== 133 /* NumberKeyword */) { + if (parameter.type.kind !== 137 /* StringKeyword */ && parameter.type.kind !== 134 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 2 /* String */ || type.flags & 4 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type))); @@ -47907,7 +49568,7 @@ var ts; if (args) { for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; - if (arg.kind === 201 /* OmittedExpression */) { + if (arg.kind === 204 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -47983,19 +49644,19 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 145 /* ComputedPropertyName */) { + if (node.kind !== 146 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 195 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { + if (computedPropertyName.expression.kind === 198 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 229 /* FunctionDeclaration */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 152 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 232 /* FunctionDeclaration */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 153 /* MethodDeclaration */); if (node.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -48020,15 +49681,15 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */) { + if (prop.kind === 270 /* SpreadAssignment */) { continue; } var name = prop.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 266 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 269 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -48037,7 +49698,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 152 /* MethodDeclaration */) { + if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 153 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -48052,21 +49713,21 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { checkGrammarNumericLiteral(name); } // falls through - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: currentKind = 1 /* Property */; break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: currentKind = 2 /* GetAccessor */; break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: currentKind = 4 /* SetAccessor */; break; default: @@ -48102,20 +49763,18 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 259 /* JsxSpreadAttribute */) { + if (attr.kind === 262 /* JsxSpreadAttribute */) { continue; } - var jsxAttr = attr; - var name = jsxAttr.name; + var name = attr.name, initializer = attr.initializer; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 260 /* JsxExpression */ && !initializer.expression) { - return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === 263 /* JsxExpression */ && !initializer.expression) { + return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -48123,12 +49782,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 217 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 220 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); } } - if (forInOrOfStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 231 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -48143,20 +49802,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -48183,11 +49842,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 154 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 155 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 155 /* SetAccessor */) { + else if (kind === 156 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -48210,21 +49869,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 140 /* UniqueKeyword */) { - if (node.type.kind !== 137 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(137 /* SymbolKeyword */)); + if (node.operator === 141 /* UniqueKeyword */) { + if (node.type.kind !== 138 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 71 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -48236,13 +49895,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -48258,17 +49917,24 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === 153 /* MethodDeclaration */) { + if (node.parent.kind === 182 /* ObjectLiteralExpression */) { + // We only disallow modifier on a method declaration if it is a property of object-literal-expression + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120 /* AsyncKeyword */)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } if (ts.isClassLike(node.parent)) { @@ -48280,14 +49946,14 @@ var ts; if (node.flags & 2097152 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === 153 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -48298,11 +49964,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 218 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 221 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -48310,8 +49976,8 @@ var ts; return false; } break; - case 222 /* SwitchStatement */: - if (node.kind === 219 /* BreakStatement */ && !node.label) { + case 225 /* SwitchStatement */: + if (node.kind === 222 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -48326,13 +49992,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -48344,7 +50010,7 @@ var ts; if (node !== ts.last(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 176 /* ArrayBindingPattern */ || node.name.kind === 175 /* ObjectBindingPattern */) { + if (node.name.kind === 179 /* ArrayBindingPattern */ || node.name.kind === 178 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.propertyName) { @@ -48358,11 +50024,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 193 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && + expr.kind === 196 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 216 /* ForInStatement */ && node.parent.parent.kind !== 217 /* ForOfStatement */) { + if (node.parent.parent.kind !== 219 /* ForInStatement */ && node.parent.parent.kind !== 220 /* ForOfStatement */) { if (node.flags & 2097152 /* Ambient */) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -48391,7 +50057,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 209 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 212 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && @@ -48450,15 +50116,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return false; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -48524,7 +50190,7 @@ var ts; return true; } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48532,7 +50198,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48561,13 +50227,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 231 /* InterfaceDeclaration */ || - node.kind === 232 /* TypeAliasDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 245 /* ExportDeclaration */ || - node.kind === 244 /* ExportAssignment */ || - node.kind === 237 /* NamespaceExportDeclaration */ || + if (node.kind === 234 /* InterfaceDeclaration */ || + node.kind === 235 /* TypeAliasDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 248 /* ExportDeclaration */ || + node.kind === 247 /* ExportAssignment */ || + node.kind === 240 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -48576,7 +50242,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 209 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 212 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -48602,7 +50268,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 208 /* Block */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 211 /* Block */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -48623,10 +50289,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 174 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 177 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 268 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 271 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -48678,23 +50344,23 @@ var ts; /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: - return true; + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: + return ts.isIdentifier(name); default: return ts.isDeclarationName(name); } } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 240 /* ImportClause */: // For default import - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */:// For rename import `x as y` + case 243 /* ImportClause */: // For default import + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: // For rename import `x as y` return true; case 71 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 243 /* ImportSpecifier */; + return decl.parent.kind === 246 /* ImportSpecifier */; default: return false; } @@ -48895,7 +50561,7 @@ var ts; ts.createFalse = createFalse; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(144 /* QualifiedName */); + var node = createSynthesizedNode(145 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -48908,9 +50574,15 @@ var ts; : node; } ts.updateQualifiedName = updateQualifiedName; + function parenthesizeForComputedName(expression) { + return (ts.isBinaryExpression(expression) && expression.operatorToken.kind === 26 /* CommaToken */) || + expression.kind === 296 /* CommaListExpression */ ? + createParen(expression) : + expression; + } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(145 /* ComputedPropertyName */); - node.expression = expression; + var node = createSynthesizedNode(146 /* ComputedPropertyName */); + node.expression = parenthesizeForComputedName(expression); return node; } ts.createComputedPropertyName = createComputedPropertyName; @@ -48922,7 +50594,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(146 /* TypeParameter */); + var node = createSynthesizedNode(147 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -48938,7 +50610,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(147 /* Parameter */); + var node = createSynthesizedNode(148 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -48962,7 +50634,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(148 /* Decorator */); + var node = createSynthesizedNode(149 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -48975,7 +50647,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(149 /* PropertySignature */); + var node = createSynthesizedNode(150 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -48994,30 +50666,32 @@ var ts; : node; } ts.updatePropertySignature = updatePropertySignature; - function createProperty(decorators, modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(150 /* PropertyDeclaration */); + function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { + var node = createSynthesizedNode(151 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.questionToken = questionToken; + node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined; + node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined; node.type = type; node.initializer = initializer; return node; } ts.createProperty = createProperty; - function updateProperty(node, decorators, modifiers, name, questionToken, type, initializer) { + function updateProperty(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { return node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name - || node.questionToken !== questionToken + || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined) + || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined) || node.type !== type || node.initializer !== initializer - ? updateNode(createProperty(decorators, modifiers, name, questionToken, type, initializer), node) + ? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(151 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(152 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -49034,7 +50708,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(152 /* MethodDeclaration */); + var node = createSynthesizedNode(153 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -49062,7 +50736,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(153 /* Constructor */); + var node = createSynthesizedNode(154 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -49082,7 +50756,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(154 /* GetAccessor */); + var node = createSynthesizedNode(155 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49105,7 +50779,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(155 /* SetAccessor */); + var node = createSynthesizedNode(156 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49126,7 +50800,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(156 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(157 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -49134,7 +50808,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(157 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(158 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -49142,7 +50816,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(158 /* IndexSignature */); + var node = createSynthesizedNode(159 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -49182,7 +50856,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(159 /* TypePredicate */); + var node = createSynthesizedNode(160 /* TypePredicate */); node.parameterName = asName(parameterName); node.type = type; return node; @@ -49196,7 +50870,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(160 /* TypeReference */); + var node = createSynthesizedNode(161 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -49210,7 +50884,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(161 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(162 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -49218,7 +50892,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(162 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(163 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -49226,7 +50900,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(163 /* TypeQuery */); + var node = createSynthesizedNode(164 /* TypeQuery */); node.exprName = exprName; return node; } @@ -49238,7 +50912,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(164 /* TypeLiteral */); + var node = createSynthesizedNode(165 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -49250,7 +50924,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(165 /* ArrayType */); + var node = createSynthesizedNode(166 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -49262,7 +50936,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(166 /* TupleType */); + var node = createSynthesizedNode(167 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -49274,7 +50948,7 @@ var ts; } ts.updateTypleTypeNode = updateTypleTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(167 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(168 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -49282,7 +50956,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(168 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(169 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -49300,8 +50974,38 @@ var ts; ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) : node; } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createSynthesizedNode(170 /* ConditionalType */); + node.checkType = ts.parenthesizeConditionalTypeMember(checkType); + node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); + node.trueType = trueType; + node.falseType = falseType; + return node; + } + ts.createConditionalTypeNode = createConditionalTypeNode; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType + || node.extendsType !== extendsType + || node.trueType !== trueType + || node.falseType !== falseType + ? updateNode(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) + : node; + } + ts.updateConditionalTypeNode = updateConditionalTypeNode; + function createInferTypeNode(typeParameter) { + var node = createSynthesizedNode(171 /* InferType */); + node.typeParameter = typeParameter; + return node; + } + ts.createInferTypeNode = createInferTypeNode; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter + ? updateNode(createInferTypeNode(typeParameter), node) + : node; + } + ts.updateInferTypeNode = updateInferTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(169 /* ParenthesizedType */); + var node = createSynthesizedNode(172 /* ParenthesizedType */); node.type = type; return node; } @@ -49313,12 +51017,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(170 /* ThisType */); + return createSynthesizedNode(173 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(171 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 127 /* KeyOfKeyword */; + var node = createSynthesizedNode(174 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 128 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -49328,7 +51032,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(172 /* IndexedAccessType */); + var node = createSynthesizedNode(175 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -49342,7 +51046,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(173 /* MappedType */); + var node = createSynthesizedNode(176 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -49360,7 +51064,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(174 /* LiteralType */); + var node = createSynthesizedNode(177 /* LiteralType */); node.literal = literal; return node; } @@ -49373,7 +51077,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(175 /* ObjectBindingPattern */); + var node = createSynthesizedNode(178 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -49385,7 +51089,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(176 /* ArrayBindingPattern */); + var node = createSynthesizedNode(179 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -49397,7 +51101,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(177 /* BindingElement */); + var node = createSynthesizedNode(180 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -49416,7 +51120,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(178 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(181 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -49430,7 +51134,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(179 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(182 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -49444,7 +51148,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(180 /* PropertyAccessExpression */); + var node = createSynthesizedNode(183 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -49461,7 +51165,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(181 /* ElementAccessExpression */); + var node = createSynthesizedNode(184 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -49475,7 +51179,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(182 /* CallExpression */); + var node = createSynthesizedNode(185 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -49491,7 +51195,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(183 /* NewExpression */); + var node = createSynthesizedNode(186 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -49507,7 +51211,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, template) { - var node = createSynthesizedNode(184 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(187 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; @@ -49521,7 +51225,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(185 /* TypeAssertionExpression */); + var node = createSynthesizedNode(188 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -49535,7 +51239,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(186 /* ParenthesizedExpression */); + var node = createSynthesizedNode(189 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -49547,7 +51251,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(187 /* FunctionExpression */); + var node = createSynthesizedNode(190 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -49571,7 +51275,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(188 /* ArrowFunction */); + var node = createSynthesizedNode(191 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -49605,7 +51309,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(189 /* DeleteExpression */); + var node = createSynthesizedNode(192 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49617,7 +51321,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(190 /* TypeOfExpression */); + var node = createSynthesizedNode(193 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49629,7 +51333,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(191 /* VoidExpression */); + var node = createSynthesizedNode(194 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49641,7 +51345,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(192 /* AwaitExpression */); + var node = createSynthesizedNode(195 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49653,7 +51357,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(193 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(196 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -49666,7 +51370,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(194 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(197 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -49679,7 +51383,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(195 /* BinaryExpression */); + var node = createSynthesizedNode(198 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -49696,7 +51400,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(196 /* ConditionalExpression */); + var node = createSynthesizedNode(199 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -49726,7 +51430,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(197 /* TemplateExpression */); + var node = createSynthesizedNode(200 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -49764,7 +51468,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(198 /* YieldExpression */); + var node = createSynthesizedNode(201 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -49778,7 +51482,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(199 /* SpreadElement */); + var node = createSynthesizedNode(202 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -49790,7 +51494,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(200 /* ClassExpression */); + var node = createSynthesizedNode(203 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49811,11 +51515,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(201 /* OmittedExpression */); + return createSynthesizedNode(204 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(202 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(205 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -49829,7 +51533,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(203 /* AsExpression */); + var node = createSynthesizedNode(206 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -49843,7 +51547,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(204 /* NonNullExpression */); + var node = createSynthesizedNode(207 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -49855,7 +51559,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(205 /* MetaProperty */); + var node = createSynthesizedNode(208 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -49869,7 +51573,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(206 /* TemplateSpan */); + var node = createSynthesizedNode(209 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -49883,12 +51587,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(207 /* SemicolonClassElement */); + return createSynthesizedNode(210 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(208 /* Block */); + var block = createSynthesizedNode(211 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -49902,7 +51606,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(209 /* VariableStatement */); + var node = createSynthesizedNode(212 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -49917,11 +51621,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(210 /* EmptyStatement */); + return createSynthesizedNode(213 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createStatement(expression) { - var node = createSynthesizedNode(211 /* ExpressionStatement */); + var node = createSynthesizedNode(214 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -49933,7 +51637,7 @@ var ts; } ts.updateStatement = updateStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(212 /* IfStatement */); + var node = createSynthesizedNode(215 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -49949,7 +51653,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(213 /* DoStatement */); + var node = createSynthesizedNode(216 /* DoStatement */); node.statement = statement; node.expression = expression; return node; @@ -49963,7 +51667,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(214 /* WhileStatement */); + var node = createSynthesizedNode(217 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; @@ -49977,7 +51681,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(215 /* ForStatement */); + var node = createSynthesizedNode(218 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -49995,7 +51699,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(216 /* ForInStatement */); + var node = createSynthesizedNode(219 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -50011,7 +51715,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(217 /* ForOfStatement */); + var node = createSynthesizedNode(220 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -50029,7 +51733,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(218 /* ContinueStatement */); + var node = createSynthesizedNode(221 /* ContinueStatement */); node.label = asName(label); return node; } @@ -50041,7 +51745,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(219 /* BreakStatement */); + var node = createSynthesizedNode(222 /* BreakStatement */); node.label = asName(label); return node; } @@ -50053,7 +51757,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(220 /* ReturnStatement */); + var node = createSynthesizedNode(223 /* ReturnStatement */); node.expression = expression; return node; } @@ -50065,7 +51769,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(221 /* WithStatement */); + var node = createSynthesizedNode(224 /* WithStatement */); node.expression = expression; node.statement = statement; return node; @@ -50079,7 +51783,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(222 /* SwitchStatement */); + var node = createSynthesizedNode(225 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -50093,7 +51797,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(223 /* LabeledStatement */); + var node = createSynthesizedNode(226 /* LabeledStatement */); node.label = asName(label); node.statement = statement; return node; @@ -50107,7 +51811,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(224 /* ThrowStatement */); + var node = createSynthesizedNode(227 /* ThrowStatement */); node.expression = expression; return node; } @@ -50119,7 +51823,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(225 /* TryStatement */); + var node = createSynthesizedNode(228 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -50135,11 +51839,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(226 /* DebuggerStatement */); + return createSynthesizedNode(229 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(227 /* VariableDeclaration */); + var node = createSynthesizedNode(230 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -50155,7 +51859,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { - var node = createSynthesizedNode(228 /* VariableDeclarationList */); + var node = createSynthesizedNode(231 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -50168,7 +51872,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(229 /* FunctionDeclaration */); + var node = createSynthesizedNode(232 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -50194,7 +51898,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(230 /* ClassDeclaration */); + var node = createSynthesizedNode(233 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50216,7 +51920,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(231 /* InterfaceDeclaration */); + var node = createSynthesizedNode(234 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50238,7 +51942,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(232 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(235 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50258,7 +51962,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(233 /* EnumDeclaration */); + var node = createSynthesizedNode(236 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50276,7 +51980,7 @@ var ts; } ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { - var node = createSynthesizedNode(234 /* ModuleDeclaration */); + var node = createSynthesizedNode(237 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 512 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -50295,7 +51999,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(235 /* ModuleBlock */); + var node = createSynthesizedNode(238 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -50307,7 +52011,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(236 /* CaseBlock */); + var node = createSynthesizedNode(239 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -50319,7 +52023,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(237 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(240 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -50331,7 +52035,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(238 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(241 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50349,7 +52053,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(239 /* ImportDeclaration */); + var node = createSynthesizedNode(242 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -50367,7 +52071,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(240 /* ImportClause */); + var node = createSynthesizedNode(243 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; @@ -50381,7 +52085,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(241 /* NamespaceImport */); + var node = createSynthesizedNode(244 /* NamespaceImport */); node.name = name; return node; } @@ -50393,7 +52097,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(242 /* NamedImports */); + var node = createSynthesizedNode(245 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -50405,7 +52109,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(243 /* ImportSpecifier */); + var node = createSynthesizedNode(246 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -50419,7 +52123,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(244 /* ExportAssignment */); + var node = createSynthesizedNode(247 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -50436,7 +52140,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(245 /* ExportDeclaration */); + var node = createSynthesizedNode(248 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -50454,7 +52158,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(246 /* NamedExports */); + var node = createSynthesizedNode(249 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -50466,7 +52170,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(247 /* ExportSpecifier */); + var node = createSynthesizedNode(250 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -50481,7 +52185,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(249 /* ExternalModuleReference */); + var node = createSynthesizedNode(252 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -50494,7 +52198,7 @@ var ts; ts.updateExternalModuleReference = updateExternalModuleReference; // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(250 /* JsxElement */); + var node = createSynthesizedNode(253 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -50510,7 +52214,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, attributes) { - var node = createSynthesizedNode(251 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(254 /* JsxSelfClosingElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50524,7 +52228,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, attributes) { - var node = createSynthesizedNode(252 /* JsxOpeningElement */); + var node = createSynthesizedNode(255 /* JsxOpeningElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50538,7 +52242,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(253 /* JsxClosingElement */); + var node = createSynthesizedNode(256 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -50550,7 +52254,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(254 /* JsxFragment */); + var node = createSynthesizedNode(257 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -50566,7 +52270,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(257 /* JsxAttribute */); + var node = createSynthesizedNode(260 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -50580,7 +52284,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(258 /* JsxAttributes */); + var node = createSynthesizedNode(261 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -50592,7 +52296,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(259 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(262 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -50604,7 +52308,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(260 /* JsxExpression */); + var node = createSynthesizedNode(263 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -50618,7 +52322,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(261 /* CaseClause */); + var node = createSynthesizedNode(264 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -50632,7 +52336,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(262 /* DefaultClause */); + var node = createSynthesizedNode(265 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -50644,7 +52348,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(263 /* HeritageClause */); + var node = createSynthesizedNode(266 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -50657,7 +52361,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(264 /* CatchClause */); + var node = createSynthesizedNode(267 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -50672,10 +52376,10 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(265 /* PropertyAssignment */); + var node = createSynthesizedNode(268 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; + node.initializer = ts.parenthesizeExpressionForList(initializer); return node; } ts.createPropertyAssignment = createPropertyAssignment; @@ -50687,7 +52391,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(266 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(269 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -50701,7 +52405,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(267 /* SpreadAssignment */); + var node = createSynthesizedNode(270 /* SpreadAssignment */); node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; return node; } @@ -50714,7 +52418,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(268 /* EnumMember */); + var node = createSynthesizedNode(271 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -50730,7 +52434,7 @@ var ts; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createSynthesizedNode(269 /* SourceFile */); + var updated = createSynthesizedNode(272 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -50785,6 +52489,12 @@ var ts; updated.imports = node.imports; if (node.moduleAugmentations !== undefined) updated.moduleAugmentations = node.moduleAugmentations; + if (node.pragmas !== undefined) + updated.pragmas = node.pragmas; + if (node.localJsxFactory !== undefined) + updated.localJsxFactory = node.localJsxFactory; + if (node.localJsxNamespace !== undefined) + updated.localJsxNamespace = node.localJsxNamespace; return updateNode(updated, node); } return node; @@ -50809,7 +52519,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(291 /* NotEmittedStatement */); + var node = createSynthesizedNode(294 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -50821,7 +52531,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(295 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(298 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50833,7 +52543,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(294 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(297 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50848,7 +52558,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(292 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(295 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -50864,7 +52574,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 293 /* CommaListExpression */) { + if (node.kind === 296 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26 /* CommaToken */) { @@ -50874,7 +52584,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(293 /* CommaListExpression */); + var node = createSynthesizedNode(296 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -50886,7 +52596,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createBundle(sourceFiles) { - var node = ts.createNode(270 /* Bundle */); + var node = ts.createNode(273 /* Bundle */); node.sourceFiles = sourceFiles; return node; } @@ -51022,7 +52732,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -51523,7 +53233,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 223 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 226 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -51533,7 +53243,7 @@ var ts; } ts.restoreEnclosingLabel = restoreEnclosingLabel; function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { - var target = skipParentheses(node); + var target = ts.skipParentheses(node); switch (target.kind) { case 71 /* Identifier */: return cacheIdentifiers; @@ -51541,13 +53251,13 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return false; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -51573,7 +53283,7 @@ var ts; } else { switch (callee.kind) { - case 180 /* PropertyAccessExpression */: { + case 183 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51586,7 +53296,7 @@ var ts; } break; } - case 181 /* ElementAccessExpression */: { + case 184 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51643,14 +53353,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -51974,7 +53684,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 186 /* ParenthesizedExpression */) { + if (skipped.kind === 189 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -52008,8 +53718,8 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(195 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(198 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { @@ -52018,7 +53728,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 198 /* YieldExpression */) { + && operand.kind === 201 /* YieldExpression */) { return false; } return true; @@ -52106,7 +53816,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -52121,7 +53831,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(196 /* ConditionalExpression */, 55 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(199 /* ConditionalExpression */, 55 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { @@ -52135,8 +53845,8 @@ var ts; // so in case when comma expression is introduced as a part of previous transformations // if should be wrapped in parens since comma operator has the lowest precedence var emittedExpression = ts.skipPartiallyEmittedExpressions(e); - return emittedExpression.kind === 195 /* BinaryExpression */ && emittedExpression.operatorToken.kind === 26 /* CommaToken */ || - emittedExpression.kind === 293 /* CommaListExpression */ + return emittedExpression.kind === 198 /* BinaryExpression */ && emittedExpression.operatorToken.kind === 26 /* CommaToken */ || + emittedExpression.kind === 296 /* CommaListExpression */ ? ts.createParen(e) : e; } @@ -52154,9 +53864,9 @@ var ts; */ function parenthesizeDefaultExpression(e) { var check = ts.skipPartiallyEmittedExpressions(e); - return (check.kind === 200 /* ClassExpression */ || - check.kind === 187 /* FunctionExpression */ || - check.kind === 293 /* CommaListExpression */ || + return (check.kind === 203 /* ClassExpression */ || + check.kind === 190 /* FunctionExpression */ || + check.kind === 296 /* CommaListExpression */ || ts.isBinaryExpression(check) && check.operatorToken.kind === 26 /* CommaToken */) ? ts.createParen(e) : e; @@ -52171,9 +53881,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.createParen(expression); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -52196,7 +53906,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 183 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 186 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -52234,7 +53944,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, 26 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, 26 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -52245,34 +53955,38 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 187 /* FunctionExpression */ || kind === 188 /* ArrowFunction */) { + if (kind === 190 /* FunctionExpression */ || kind === 191 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 179 /* ObjectLiteralExpression */ || leftmostExpressionKind === 187 /* FunctionExpression */) { + if (leftmostExpressionKind === 182 /* ObjectLiteralExpression */ || leftmostExpressionKind === 190 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function parenthesizeConditionalTypeMember(member) { + return member.kind === 170 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + } + ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createParenthesizedType(member); } - return member; + return parenthesizeConditionalTypeMember(member); } ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -52298,25 +54012,25 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: node = node.operand; continue; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: node = node.left; continue; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: node = node.condition; continue; - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: node = node.expression; continue; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -52324,7 +54038,7 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 179 /* ObjectLiteralExpression */) { + if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 182 /* ObjectLiteralExpression */) { return ts.setTextRange(ts.createParen(body), body); } return body; @@ -52340,13 +54054,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 207 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -52358,7 +54072,7 @@ var ts; do { previousNode = node; if (kinds & 1 /* Parentheses */) { - node = skipParentheses(node); + node = ts.skipParentheses(node); } if (kinds & 2 /* Assertions */) { node = skipAssertions(node); @@ -52370,15 +54084,8 @@ var ts; return node; } ts.skipOuterExpressions = skipOuterExpressions; - function skipParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; - } - ts.skipParentheses = skipParentheses; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 204 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 207 /* NonNullExpression */) { node = node.expression; } return node; @@ -52386,11 +54093,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 186 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 185 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 203 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 204 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 292 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 189 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 206 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -52408,7 +54115,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 186 /* ParenthesizedExpression */ + return node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -52473,10 +54180,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 239 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 242 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 245 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 248 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -52594,7 +54301,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -52606,11 +54313,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -52642,12 +54349,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 148 /* Parameter */: + case 180 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 199 /* SpreadElement */: - case 267 /* SpreadAssignment */: + case 202 /* SpreadElement */: + case 270 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -52659,7 +54366,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -52671,7 +54378,7 @@ var ts; : propertyName; } break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -52683,7 +54390,7 @@ var ts; : propertyName; } break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -52701,13 +54408,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -52747,11 +54454,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -52915,266 +54622,270 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */) || kind === 170 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */) || kind === 173 /* ThisType */) { return node; } switch (kind) { // Names case 71 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 148 /* Decorator */: + case 149 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 166 /* TupleType */: + case 167 /* TupleType */: return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 167 /* UnionType */: + case 168 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); + case 171 /* InferType */: + return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); + case 172 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 173 /* MappedType */: + case 176 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 208 /* Block */: + case 211 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -53216,58 +54927,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 159 /* TypePredicate */ && kind <= 174 /* LiteralType */)) { + if ((kind >= 160 /* TypePredicate */ && kind <= 177 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 207 /* SemicolonClassElement */: - case 210 /* EmptyStatement */: - case 201 /* OmittedExpression */: - case 226 /* DebuggerStatement */: - case 291 /* NotEmittedStatement */: + case 210 /* SemicolonClassElement */: + case 213 /* EmptyStatement */: + case 204 /* OmittedExpression */: + case 229 /* DebuggerStatement */: + case 294 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 147 /* Parameter */: + case 148 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 148 /* Decorator */: + case 149 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53276,12 +54987,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 153 /* Constructor */: + case 154 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53289,7 +55000,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53297,49 +55008,49 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 183 /* NewExpression */: + case 186 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -53347,123 +55058,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 186 /* ParenthesizedExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: - case 204 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 203 /* AsExpression */: + case 206 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 208 /* Block */: + case 211 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 214 /* WhileStatement */: - case 221 /* WithStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53472,7 +55183,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53480,139 +55191,139 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 264 /* CatchClause */: + case 267 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -53685,7 +55396,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 202 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 205 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -53706,7 +55417,7 @@ var ts; var isDebugInfoEnabled = false; Debug.failBadSyntaxKind = Debug.shouldAssert(1 /* Normal */) ? function (node, message) { return Debug.fail((message || "Unexpected node.") + "\r\nNode " + ts.formatSyntaxKind(node.kind) + " was unexpected.", Debug.failBadSyntaxKind); } - : ts.noop; + : ts.noop; // TODO: GH#22091 Debug.assertEachNode = Debug.shouldAssert(1 /* Normal */) ? function (nodes, test, message) { return Debug.assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + Debug.getFunctionName(test) + "'."; }, Debug.assertEachNode); } : ts.noop; @@ -53811,13 +55522,13 @@ var ts; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; - var exportEquals = undefined; + var exportEquals; var hasExportStarsToExportValues = false; var hasImportStarOrImportDefault = false; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -53825,13 +55536,13 @@ var ts; externalImports.push(node); hasImportStarOrImportDefault = getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 238 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + case 241 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -53861,13 +55572,13 @@ var ts; } } break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -53875,7 +55586,7 @@ var ts; } } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -53895,7 +55606,7 @@ var ts; } } break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -53963,9 +55674,8 @@ var ts; * - this is mostly subjective beyond the requirement that the expression not be sideeffecting */ function isSimpleCopiableExpression(expression) { - return expression.kind === 9 /* StringLiteral */ || + return ts.isStringLiteralLike(expression) || expression.kind === 8 /* NumericLiteral */ || - expression.kind === 13 /* NoSubstitutionTemplateLiteral */ || ts.isKeyword(expression.kind) || ts.isIdentifier(expression); } @@ -54496,8 +56206,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -54566,15 +56276,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 235 /* ModuleBlock */: - case 208 /* Block */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 238 /* ModuleBlock */: + case 211 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 230 /* ClassDeclaration */: - case 229 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -54586,7 +56296,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 230 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 233 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } break; } @@ -54630,10 +56340,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -54654,13 +56364,13 @@ var ts; return node; } switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -54680,11 +56390,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 245 /* ExportDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 240 /* ImportClause */ || - (node.kind === 238 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 249 /* ExternalModuleReference */)) { + if (node.kind === 248 /* ExportDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 243 /* ImportClause */ || + (node.kind === 241 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 252 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -54714,19 +56424,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 150 /* PropertyDeclaration */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -54764,53 +56474,54 @@ var ts; case 117 /* AbstractKeyword */: case 76 /* ConstKeyword */: case 124 /* DeclareKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 164 /* TypeLiteral */: - case 159 /* TypePredicate */: - case 146 /* TypeParameter */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 165 /* TypeLiteral */: + case 160 /* TypePredicate */: + case 147 /* TypeParameter */: case 119 /* AnyKeyword */: case 122 /* BooleanKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: case 105 /* VoidKeyword */: - case 137 /* SymbolKeyword */: - case 162 /* ConstructorType */: - case 161 /* FunctionType */: - case 163 /* TypeQuery */: - case 160 /* TypeReference */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: + case 138 /* SymbolKeyword */: + case 163 /* ConstructorType */: + case 162 /* FunctionType */: + case 164 /* TypeQuery */: + case 161 /* TypeReference */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 172 /* ParenthesizedType */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: // TypeScript type nodes are elided. - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // TypeScript index signatures are elided. - case 148 /* Decorator */: + case 149 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructor(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54821,7 +56532,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54832,35 +56543,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -54870,33 +56581,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -55378,7 +57089,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -55415,7 +57126,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536 /* NoComments */); - return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setEmitFlags(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1)), 1536 /* NoComments */)); } /** * Gets all property declarations with initializers on either the static or instance side of a class. @@ -55449,7 +57160,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 150 /* PropertyDeclaration */ + return member.kind === 151 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -55587,12 +57298,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -55745,7 +57456,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 150 /* PropertyDeclaration */ + ? member.kind === 151 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -55868,10 +57579,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 150 /* PropertyDeclaration */; + return kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 151 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -55881,7 +57592,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -55892,12 +57603,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; } return false; @@ -55909,15 +57620,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: - case 154 /* GetAccessor */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 155 /* GetAccessor */: return serializeTypeNode(node.type); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 153 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -55954,7 +57665,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 154 /* GetAccessor */) { + if (container && node.kind === 155 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -56000,26 +57711,26 @@ var ts; } switch (node.kind) { case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return ts.createVoidZero(); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createIdentifier("Function"); - case 165 /* ArrayType */: - case 166 /* TupleType */: + case 166 /* ArrayType */: + case 167 /* TupleType */: return ts.createIdentifier("Array"); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: case 122 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return ts.createIdentifier("String"); - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 174 /* LiteralType */: + case 177 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); @@ -56033,24 +57744,24 @@ var ts; break; } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return serializeTypeReferenceNode(node); - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: return serializeUnionOrIntersectionType(node); - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 164 /* TypeLiteral */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 165 /* TypeLiteral */: case 119 /* AnyKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -56064,13 +57775,13 @@ var ts; var serializedUnion; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -56078,6 +57789,8 @@ var ts; // One of the individual is global object, return immediately return serializedIndividual; } + // If there exists union that is not void 0 expression, check if the the common type is identifier. + // anything more complex and we will just default to Object else if (serializedUnion) { // Different types if (!ts.isIdentifier(serializedUnion) || @@ -56151,7 +57864,7 @@ var ts; return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } return name; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -56241,7 +57954,7 @@ var ts; function visitPropertyNameOfClassElement(member) { var name = member.name; var expr = getPropertyNameExpressionIfNeeded(name, ts.some(member.decorators), /*omitSimple*/ false); - if (expr) { + if (expr) { // expr only exists if `name` is a computed property name // Inline any pending expressions from previous elided or relocated computed property name expressions in order to preserve execution order if (ts.some(pendingExpressions)) { expr = ts.inlineExpressions(pendingExpressions.concat([expr])); @@ -56726,12 +58439,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentScope.kind === 269 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentScope.kind === 272 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 233 /* EnumDeclaration */) { + if (node.kind === 236 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -56850,7 +58563,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 235 /* ModuleBlock */) { + if (body.kind === 238 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -56896,13 +58609,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 235 /* ModuleBlock */) { + if (body.kind !== 238 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -56943,7 +58656,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 241 /* NamespaceImport */) { + if (node.kind === 244 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -57175,16 +58888,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(71 /* Identifier */); - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(234 /* ModuleDeclaration */); + context.enableEmitNotification(237 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 234 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 237 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 233 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 236 /* EnumDeclaration */; } /** * Hook for node emit. @@ -57245,9 +58958,9 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -57285,9 +58998,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 269 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 234 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 233 /* EnumDeclaration */); + if (container && container.kind !== 272 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 237 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 236 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -57322,9 +59035,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } ts.transformTypeScript = transformTypeScript; @@ -57426,15 +59137,15 @@ var ts; case 120 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); default: return ts.visitEachChild(node, visitor, context); @@ -57443,27 +59154,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 208 /* Block */: - case 222 /* SwitchStatement */: - case 236 /* CaseBlock */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 225 /* TryStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 212 /* IfStatement */: - case 221 /* WithStatement */: - case 223 /* LabeledStatement */: + case 211 /* Block */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 224 /* WithStatement */: + case 226 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -57663,7 +59374,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 188 /* ArrowFunction */; + var isArrowFunction = node.kind === 191 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -57736,15 +59447,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -57784,11 +59495,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -57820,11 +59531,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -57922,45 +59633,45 @@ var ts; return node; } switch (node.kind) { - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitVoidExpression(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructorDeclaration(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -57983,7 +59694,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 217 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 220 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -57995,7 +59706,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 267 /* SpreadAssignment */) { + if (e.kind === 270 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -58004,16 +59715,9 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === 265 /* PropertyAssignment */) { - var p = e; - chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); - } - else { - chunkObject.push(ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); - } + chunkObject = ts.append(chunkObject, e.kind === 268 /* PropertyAssignment */ + ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) + : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } } if (chunkObject) { @@ -58029,7 +59733,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 179 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 182 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -58337,15 +60041,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -58385,11 +60089,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -58421,11 +60125,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -58537,13 +60241,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -58553,13 +60257,13 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -58601,14 +60305,14 @@ var ts; objectProperties = ts.createAssignHelper(context, segments); } } - var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); + var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } function visitJsxOpeningFragment(node, children, isChild, location) { - var element = ts.createExpressionForJsxFragment(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, ts.mapDefined(children, transformJsxChildToExpression), node, location); + var element = ts.createExpressionForJsxFragment(context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } @@ -58633,7 +60337,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 260 /* JsxExpression */) { + else if (node.kind === 263 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -58727,7 +60431,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 250 /* JsxElement */) { + if (node.kind === 253 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -59035,7 +60739,7 @@ var ts; return node; } switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -59271,13 +60975,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ - && node.kind === 220 /* ReturnStatement */ + && node.kind === 223 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 208 /* Block */))) + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 211 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -59305,63 +61009,63 @@ var ts; switch (node.kind) { case 115 /* StaticKeyword */: return undefined; // elide static keyword - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return visitClassExpression(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); case 71 /* Identifier */: return visitIdentifier(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 13 /* NoSubstitutionTemplateLiteral */: case 14 /* TemplateHead */: @@ -59372,28 +61076,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitSpreadElement(node); case 97 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 99 /* ThisKeyword */: return visitThisKeyword(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitMetaProperty(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -59480,13 +61184,13 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 219 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 222 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -59497,7 +61201,7 @@ var ts; } } else { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { labelMarker = "break-" + node.label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(node.label), labelMarker); } @@ -59797,17 +61501,19 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 220 /* ReturnStatement */) { + if (statement.kind === 223 /* ReturnStatement */) { return true; } - else if (statement.kind === 212 /* IfStatement */) { + // An if-statement with two covered branches is covered. + else if (statement.kind === 215 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 208 /* Block */) { + // A block is covered if it has a last statement which is covered. + else if (statement.kind === 211 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -59865,7 +61571,7 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + if (firstStatement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } @@ -59875,8 +61581,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 195 /* BinaryExpression */ - || superCallExpression.left.kind !== 182 /* CallExpression */) { + if (superCallExpression.kind !== 198 /* BinaryExpression */ + || superCallExpression.left.kind !== 185 /* CallExpression */) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } // Shift comments from the original super call to the return statement. @@ -60005,11 +61711,11 @@ var ts; function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { initializer = ts.visitNode(initializer, visitor, ts.isExpression); var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.setTextRange(ts.createBlock([ - ts.createStatement(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer))), parameter)) - ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */)); + ts.createStatement(ts.setEmitFlags(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer) | 1536 /* NoComments */)), parameter), 1536 /* NoComments */)) + ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */)); ts.startOnNewLine(statement); ts.setTextRange(statement, parameter); - ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1048576 /* CustomPrologue */); + ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1048576 /* CustomPrologue */ | 1536 /* NoComments */); statements.push(statement); } /** @@ -60073,7 +61779,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 188 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 191 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -60093,22 +61799,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return statements; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 93 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -60140,20 +61846,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -60345,7 +62051,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 229 /* FunctionDeclaration */ || node.kind === 187 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 232 /* FunctionDeclaration */ || node.kind === 190 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); @@ -60393,7 +62099,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 188 /* ArrowFunction */); + ts.Debug.assert(node.kind === 191 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -60460,9 +62166,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -60481,9 +62187,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -60685,14 +62391,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -60880,7 +62586,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 145 /* ComputedPropertyName */) { + if (property.name.kind === 146 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -60952,11 +62658,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 231 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -61236,20 +62942,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -61359,7 +63065,7 @@ var ts; if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */) { var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -61639,7 +63345,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 178 /* ArrayLiteralExpression */ + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 181 /* ArrayLiteralExpression */ ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -61902,13 +63608,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(99 /* ThisKeyword */); - context.enableEmitNotification(153 /* Constructor */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(188 /* ArrowFunction */); - context.enableEmitNotification(187 /* FunctionExpression */); - context.enableEmitNotification(229 /* FunctionDeclaration */); + context.enableEmitNotification(154 /* Constructor */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(191 /* ArrowFunction */); + context.enableEmitNotification(190 /* FunctionExpression */); + context.enableEmitNotification(232 /* FunctionDeclaration */); } } /** @@ -61950,10 +63656,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 230 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -62035,11 +63741,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 211 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 214 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 182 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 185 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -62047,7 +63753,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 199 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 202 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -62102,15 +63808,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(252 /* JsxOpeningElement */); - context.enableEmitNotification(253 /* JsxClosingElement */); - context.enableEmitNotification(251 /* JsxSelfClosingElement */); + context.enableEmitNotification(255 /* JsxOpeningElement */); + context.enableEmitNotification(256 /* JsxClosingElement */); + context.enableEmitNotification(254 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(265 /* PropertyAssignment */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(268 /* PropertyAssignment */); return transformSourceFile; /** * Transforms an ES5 source file to ES3. @@ -62129,9 +63835,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -62464,13 +64170,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -62483,24 +64189,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return visitBreakStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return visitContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -62521,21 +64227,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitConditionalExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -62548,9 +64254,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -62778,7 +64484,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -62790,7 +64496,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -63166,35 +64872,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 208 /* Block */: + case 211 /* Block */: return transformAndEmitBlock(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return transformAndEmitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return transformAndEmitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return transformAndEmitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return transformAndEmitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -63624,7 +65330,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 262 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 265 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -63637,13 +65343,12 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 261 /* CaseClause */) { - var caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (clause.kind === 264 /* CaseClause */) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } - pendingClauses.push(ts.createCaseClause(ts.visitNode(caseClause.expression, visitor, ts.isExpression), [ - createInlineBreak(clauseLabels[i], /*location*/ caseClause.expression) + pendingClauses.push(ts.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [ + createInlineBreak(clauseLabels[i], /*location*/ clause.expression) ])); } else { @@ -64599,6 +66304,7 @@ var ts; withBlockStack.pop(); } break; + // default: do nothing } } } @@ -64868,11 +66574,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -65194,23 +66900,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, importCallExpressionVisitor, context); @@ -65659,7 +67365,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -65714,10 +67420,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -65916,7 +67622,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -65980,10 +67686,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -66004,7 +67710,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -66079,7 +67785,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 /* PlusPlusToken */ ? 59 /* PlusEqualsToken */ : 60 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -66133,13 +67839,13 @@ var ts; var importStarHelper = { name: "typescript:commonjsimportstar", scoped: false, - text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n}" + text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};" }; // emit helper for `import Name from "foo"` var importDefaultHelper = { name: "typescript:commonjsimportdefault", scoped: false, - text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n}" + text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};" }; })(ts || (ts = {})); /// @@ -66158,11 +67864,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -66383,7 +68089,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 245 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 248 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -66408,15 +68114,14 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 245 /* ExportDeclaration */) { + if (externalImport.kind !== 248 /* ExportDeclaration */) { continue; } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { // export * from ... continue; } - for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { + for (var _f = 0, _g = externalImport.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; // write name of indirectly exported entry, i.e. 'export {x} from ...' exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(ts.idText(element.name || element.propertyName)), ts.createTrue())); @@ -66478,28 +68183,28 @@ var ts; function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { - var group = dependencyGroups_1[_i]; + var group_2 = dependencyGroups_1[_i]; // derive a unique name for parameter from the first named entry in the group - var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); + var localName = ts.forEach(group_2.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName(""); var statements = []; - for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) { + for (var _a = 0, _b = group_2.externalImports; _a < _b.length; _a++) { var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -66549,15 +68254,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -66733,7 +68438,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 269 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 272 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -66797,7 +68502,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -66853,10 +68558,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -67036,43 +68741,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitDefaultClause(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitTryStatement(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -67258,7 +68963,7 @@ var ts; */ function destructuringAndImportCallVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 195 /* BinaryExpression */) { + && node.kind === 198 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (ts.isImportCall(node)) { @@ -67323,7 +69028,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 269 /* SourceFile */; + return container !== undefined && container.kind === 272 /* SourceFile */; } else { return false; @@ -67356,7 +69061,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -67404,7 +69109,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -67440,10 +69145,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -67536,14 +69241,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 194 /* PostfixUnaryExpression */) { + if (node.kind === 197 /* PostfixUnaryExpression */) { expression = node.operator === 43 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -67565,7 +69270,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -67606,7 +69311,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(269 /* SourceFile */); + context.enableEmitNotification(272 /* SourceFile */); context.enableSubstitution(71 /* Identifier */); var currentSourceFile; return transformSourceFile; @@ -67635,10 +69340,10 @@ var ts; } function visitor(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); } return node; @@ -67778,7 +69483,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(296 /* Count */); + var enabledSyntaxKindFeatures = new Array(299 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -68118,7 +69823,7 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (sourceFileOrBundle.kind === 269 /* SourceFile */) { + if (sourceFileOrBundle.kind === 272 /* SourceFile */) { // emitting single module file // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); @@ -68263,7 +69968,7 @@ var ts; source = undefined; if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(skipSourceTrivia(pos)); @@ -68280,7 +69985,7 @@ var ts; } if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -68457,7 +70162,7 @@ var ts; if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 291 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 294 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 10 /* JsxText */; @@ -68478,7 +70183,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -68782,8 +70487,8 @@ var ts; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -68857,7 +70562,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 239 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 242 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -68934,10 +70639,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 227 /* VariableDeclaration */) { + if (declaration.kind === 230 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 242 /* NamedImports */ || declaration.kind === 243 /* ImportSpecifier */ || declaration.kind === 240 /* ImportClause */) { + else if (declaration.kind === 245 /* NamedImports */ || declaration.kind === 246 /* ImportSpecifier */ || declaration.kind === 243 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -68955,7 +70660,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 239 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 242 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -68965,12 +70670,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -68987,8 +70692,8 @@ var ts; if (!usedTypeDirectiveReferences) { usedTypeDirectiveReferences = ts.createMap(); } - for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { - var directive = typeReferenceDirectives_1[_i]; + for (var _i = 0, typeReferenceDirectives_2 = typeReferenceDirectives; _i < typeReferenceDirectives_2.length; _i++) { + var directive = typeReferenceDirectives_2[_i]; if (!usedTypeDirectiveReferences.has(directive)) { usedTypeDirectiveReferences.set(directive, directive); } @@ -69044,7 +70749,7 @@ var ts; // for optional parameter properties // and also for non-optional initialized parameters that aren't a parameter property // these types may need to add `undefined`. - var shouldUseResolverType = declaration.kind === 147 /* Parameter */ && + var shouldUseResolverType = declaration.kind === 148 /* Parameter */ && (resolver.isRequiredInitializedParameter(declaration) || resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { @@ -69110,50 +70815,54 @@ var ts; function emitType(type) { switch (type.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 134 /* ObjectKeyword */: - case 137 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 170 /* ThisType */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 173 /* ThisType */: + case 177 /* LiteralType */: return writeTextOfNode(currentText, type); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(type); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(type); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(type); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(type); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(type); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(type); + case 171 /* InferType */: + return emitInferType(type); + case 172 /* ParenthesizedType */: return emitParenType(type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(type); case 71 /* Identifier */: return emitEntityName(type); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitEntityName(type); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -69161,8 +70870,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 144 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 144 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 145 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 145 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -69171,14 +70880,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 238 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 241 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -69219,6 +70928,22 @@ var ts; function emitIntersectionType(type) { emitSeparatedList(type.types, " & ", emitType); } + function emitConditionalType(node) { + emitType(node.checkType); + write(" extends "); + emitType(node.extendsType); + write(" ? "); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node.trueType; + emitType(node.trueType); + enclosingDeclaration = prevEnclosingDeclaration; + write(" : "); + emitType(node.falseType); + } + function emitInferType(node) { + write("infer "); + writeTextOfNode(currentText, node.typeParameter.name); + } function emitParenType(type) { write("("); emitType(type.type); @@ -69242,7 +70967,9 @@ var ts; writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === 37 /* PlusToken */ ? "+readonly " : + node.readonlyToken.kind === 38 /* MinusToken */ ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -69250,10 +70977,17 @@ var ts; emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === 37 /* PlusToken */ ? "+?" : + node.questionToken.kind === 38 /* MinusToken */ ? "-?" : + "?"); } write(": "); - emitType(node.type); + if (node.type) { + emitType(node.type); + } + else { + write("any"); + } write(";"); writeLine(); decreaseIndent(); @@ -69344,10 +71078,11 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 238 /* ImportEqualsDeclaration */ || - (node.parent.kind === 269 /* SourceFile */ && isCurrentFileExternalModule)) { + // Import equals declaration in internal module can become visible as part of any emit so lets make sure we add these irrespective + else if (node.kind === 241 /* ImportEqualsDeclaration */ || + (node.parent.kind === 272 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 269 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 272 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -69357,7 +71092,7 @@ var ts; }); } else { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -69375,23 +71110,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return writeVariableStatement(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return writeClassDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -69399,7 +71134,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 272 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { @@ -69409,7 +71144,7 @@ var ts; if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 231 /* InterfaceDeclaration */ && needsDeclare) { + else if (node.kind !== 234 /* InterfaceDeclaration */ && needsDeclare) { write("declare "); } } @@ -69461,11 +71196,11 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); + return namedBindings.elements.some(function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } } } @@ -69485,7 +71220,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 244 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -69506,19 +71241,9 @@ var ts; // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 234 /* ModuleDeclaration */; - var moduleSpecifier; - if (parent.kind === 238 /* ImportEqualsDeclaration */) { - var node = parent; - moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === 234 /* ModuleDeclaration */) { - moduleSpecifier = parent.name; - } - else { - var node = parent; - moduleSpecifier = node.moduleSpecifier; - } + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 237 /* ModuleDeclaration */; + var moduleSpecifier = parent.kind === 241 /* ImportEqualsDeclaration */ ? ts.getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === 237 /* ModuleDeclaration */ ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === 9 /* StringLiteral */ && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -69583,7 +71308,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 235 /* ModuleBlock */) { + while (node.body && node.body.kind !== 238 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -69653,7 +71378,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 152 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 153 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -69664,15 +71389,15 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.constraint); } else { @@ -69681,15 +71406,15 @@ var ts; } if (node.default && !isPrivateMethodTypeParameter(node)) { write(" = "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.default); } else { @@ -69700,34 +71425,34 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -69761,7 +71486,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + if (node.parent.parent.kind === 233 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -69800,7 +71525,7 @@ var ts; diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: baseTypeNode, typeName: node.name - }, !ts.findAncestor(node, function (n) { return n.kind === 234 /* ModuleDeclaration */; })); + }, !ts.findAncestor(node, function (n) { return n.kind === 237 /* ModuleDeclaration */; })); } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -69875,7 +71600,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 227 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { + if (node.kind !== 230 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -69883,11 +71608,11 @@ var ts; writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */) && node.parent.kind === 164 /* TypeLiteral */) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */) && node.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -69900,15 +71625,17 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit + // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. + else if (node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -69917,7 +71644,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */ || node.kind === 147 /* Parameter */) { + else if (node.parent.kind === 233 /* ClassDeclaration */ || node.kind === 148 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69949,7 +71676,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 201 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { + if (element.kind !== 204 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { elements.push(element); } } @@ -70023,7 +71750,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 154 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 155 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -70036,7 +71763,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 154 /* GetAccessor */ + return accessor.kind === 155 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -70059,7 +71786,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70074,7 +71801,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 155 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 156 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(accessorWithTypeAnnotation, 32 /* Static */)) { @@ -70119,17 +71846,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 152 /* MethodDeclaration */ || node.kind === 153 /* Constructor */) { + else if (node.kind === 153 /* MethodDeclaration */ || node.kind === 154 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 153 /* Constructor */) { + else if (node.kind === 154 /* Constructor */) { write("constructor"); } else { @@ -70156,7 +71883,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70200,22 +71927,22 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 153 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { + if (node.kind === 154 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { write("();"); writeLine(); return; } // Construct signature or constructor type write new Signature - if (node.kind === 157 /* ConstructSignature */ || node.kind === 162 /* ConstructorType */) { + if (node.kind === 158 /* ConstructSignature */ || node.kind === 163 /* ConstructorType */) { write("new "); } - else if (node.kind === 161 /* FunctionType */) { + else if (node.kind === 162 /* FunctionType */) { var currentOutput = writer.getText(); // Do not generate incorrect type when function type with type parameters is type argument // This could happen if user used space between two '<' making it error free @@ -70230,22 +71957,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 161 /* FunctionType */ || node.kind === 162 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 164 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 162 /* FunctionType */ || node.kind === 163 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 165 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 153 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 154 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -70259,26 +71986,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -70286,7 +72013,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -70300,7 +72027,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -70335,9 +72062,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.parent.kind === 164 /* TypeLiteral */) { + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -70353,29 +72080,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -70383,7 +72110,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70396,7 +72123,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70408,12 +72135,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 178 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 179 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -70424,7 +72151,7 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 201 /* OmittedExpression */) { + if (bindingElement.kind === 204 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -70434,7 +72161,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 177 /* BindingElement */) { + else if (bindingElement.kind === 180 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -70473,40 +72200,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return writeFunctionDeclaration(node); - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return emitPropertyDeclaration(node); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return emitSourceFile(node); } } @@ -70534,7 +72261,7 @@ var ts; return addedBundledEmitReference; function getDeclFileName(emitFileNames, sourceFileOrBundle) { // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -70549,7 +72276,7 @@ var ts; var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped || emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -70639,7 +72366,7 @@ var ts; return ".js" /* Js */; } function getOriginalSourceFileOrBundle(sourceFileOrBundle) { - if (sourceFileOrBundle.kind === 270 /* Bundle */) { + if (sourceFileOrBundle.kind === 273 /* Bundle */) { return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, ts.getOriginalSourceFile)); } return ts.getOriginalSourceFile(sourceFileOrBundle); @@ -70716,8 +72443,8 @@ var ts; } } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { - var bundle = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 269 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 272 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); if (bundle) { @@ -70757,7 +72484,7 @@ var ts; } function emitHelpers(node, writeLines) { var helpersEmitted = false; - var bundle = node.kind === 270 /* Bundle */ ? node : undefined; + var bundle = node.kind === 273 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -70851,8 +72578,8 @@ var ts; break; } switch (node.kind) { - case 269 /* SourceFile */: return printFile(node); - case 270 /* Bundle */: return printBundle(node); + case 272 /* SourceFile */: return printFile(node); + case 273 /* Bundle */: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -71028,223 +72755,229 @@ var ts; return emitIdentifier(node); // Parse tree nodes // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitQualifiedName(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return emitTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return emitParameter(node); - case 148 /* Decorator */: + case 149 /* Decorator */: return emitDecorator(node); // Type members - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return emitPropertySignature(node); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return emitMethodSignature(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return emitConstructor(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return emitCallSignature(node); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return emitConstructSignature(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return emitIndexSignature(node); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(node); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return emitFunctionType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return emitConstructorType(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(node); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(node); + case 171 /* InferType */: + return emitInferType(node); + case 172 /* ParenthesizedType */: return emitParenthesizedType(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return emitThisType(); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return emitLiteralType(node); - case 272 /* JSDocAllType */: + case 275 /* JSDocAllType */: write("*"); return; - case 273 /* JSDocUnknownType */: + case 276 /* JSDocUnknownType */: write("?"); return; - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return emitJSDocVariadicType(node); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return emitBindingElement(node); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return emitTemplateSpan(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 208 /* Block */: + case 211 /* Block */: return emitBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitVariableStatement(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: return emitEmptyStatement(); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return emitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return emitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return emitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return emitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return emitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return emitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return emitForOfStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return emitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return emitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return emitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return emitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return emitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return emitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return emitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return emitTryStatement(node); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return emitClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return emitModuleBlock(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return emitCaseBlock(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return emitImportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return emitImportClause(node); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return emitNamespaceImport(node); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return emitNamedImports(node); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return emitImportSpecifier(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return emitNamedExports(node); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return emitExportSpecifier(node); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 252 /* JsxOpeningElement */: - case 255 /* JsxOpeningFragment */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 253 /* JsxClosingElement */: - case 256 /* JsxClosingFragment */: + case 256 /* JsxClosingElement */: + case 259 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return emitJsxAttribute(node); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return emitJsxAttributes(node); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return emitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return emitDefaultClause(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return emitHeritageClause(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMember(node); + // JSDoc nodes (ignored) + // Transformation nodes (ignored) } // If the node is an expression, try to emit it as an expression with // substitution. @@ -71279,71 +73012,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return emitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return emitNewExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return emitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return emitArrowFunction(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return emitDeleteExpression(node); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return emitVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return emitAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return emitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return emitConditionalExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return emitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return emitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return emitSpreadExpression(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return emitClassExpression(node); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: return emitAsExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return emitNonNullExpression(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return emitJsxElement(node); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return emitCommaList(node); } } @@ -71434,13 +73167,14 @@ var ts; emitNodeWithWriter(node.name, writeParameter); } emitIfPresent(node.questionToken); - if (node.parent && node.parent.kind === 277 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 280 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { emitTypeAnnotation(node.type); } - emitInitializer(node.initializer); + // The comment position has to fallback to any present node within the parameterdeclaration because as it turns out, the parser can make parameter declarations with _just_ an initializer. + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.decorators ? node.decorators.end : node.pos, node); } function emitDecorator(decorator) { writePunctuation("@"); @@ -71462,8 +73196,9 @@ var ts; emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); + emitIfPresent(node.exclamationToken); emitTypeAnnotation(node.type); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); writeSemicolon(); } function emitMethodSignature(node) { @@ -71492,7 +73227,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 154 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 155 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -71606,6 +73341,26 @@ var ts; function emitIntersectionType(node) { emitList(node, node.types, 264 /* IntersectionTypeConstituents */); } + function emitConditionalType(node) { + emit(node.checkType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } function emitParenthesizedType(node) { writePunctuation("("); emit(node.type); @@ -71637,12 +73392,20 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + writeKeyword("readonly"); + } writeSpace(); } writePunctuation("["); pipelineEmitWithNotification(3 /* MappedTypeParameter */, node.typeParameter); writePunctuation("]"); - emitIfPresent(node.questionToken); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + writePunctuation("?"); + } + } writePunctuation(":"); writeSpace(); emit(node.type); @@ -71680,7 +73443,7 @@ var ts; writeSpace(); } emit(node.name); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.name.end, node); } // // Expressions @@ -71717,7 +73480,10 @@ var ts; emitExpression(node.expression); increaseIndentIf(indentBeforeDot); var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - writePunctuation(shouldEmitDotDot ? ".." : "."); + if (shouldEmitDotDot) { + writePunctuation("."); + } + emitTokenWithComment(23 /* DotToken */, node.expression.end, writePunctuation, node); increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -71743,9 +73509,9 @@ var ts; } function emitElementAccessExpression(node) { emitExpression(node.expression); - writePunctuation("["); + var openPos = emitTokenWithComment(21 /* OpenBracketToken */, node.expression.end, writePunctuation, node); emitExpression(node.argumentExpression); - writePunctuation("]"); + emitTokenWithComment(22 /* CloseBracketToken */, node.argumentExpression ? node.argumentExpression.end : openPos, writePunctuation, node); } function emitCallExpression(node) { emitExpression(node.expression); @@ -71753,7 +73519,7 @@ var ts; emitExpressionList(node, node.arguments, 1296 /* CallExpressionArguments */); } function emitNewExpression(node) { - writeKeyword("new"); + emitTokenWithComment(94 /* NewKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); @@ -71771,9 +73537,9 @@ var ts; emitExpression(node.expression); } function emitParenthesizedExpression(node) { - writePunctuation("("); + var openParenPos = emitTokenWithComment(19 /* OpenParenToken */, node.pos, writePunctuation, node); emitExpression(node.expression); - writePunctuation(")"); + emitTokenWithComment(20 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node); } function emitFunctionExpression(node) { emitFunctionDeclarationOrExpression(node); @@ -71791,22 +73557,22 @@ var ts; emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - writeKeyword("delete"); + emitTokenWithComment(80 /* DeleteKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - writeKeyword("typeof"); + emitTokenWithComment(103 /* TypeOfKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - writeKeyword("void"); + emitTokenWithComment(105 /* VoidKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - writeKeyword("await"); + emitTokenWithComment(121 /* AwaitKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } @@ -71831,7 +73597,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 193 /* PrefixUnaryExpression */ + return operand.kind === 196 /* PrefixUnaryExpression */ && ((node.operator === 37 /* PlusToken */ && (operand.operator === 37 /* PlusToken */ || operand.operator === 43 /* PlusPlusToken */)) || (node.operator === 38 /* MinusToken */ && (operand.operator === 38 /* MinusToken */ || operand.operator === 44 /* MinusMinusToken */))); } @@ -71874,7 +73640,7 @@ var ts; emitList(node, node.templateSpans, 131072 /* TemplateExpressionSpans */); } function emitYieldExpression(node) { - writeKeyword("yield"); + emitTokenWithComment(116 /* YieldKeyword */, node.pos, writeKeyword, node); emit(node.asteriskToken); emitExpressionWithLeadingSpace(node.expression); } @@ -71918,17 +73684,13 @@ var ts; // Statements // function emitBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node); emitBlockStatements(node, /*forceSingleLine*/ !node.multiLine && isEmptyBlock(node)); - // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted - increaseIndent(); - emitLeadingCommentsOfPosition(node.statements.end); - decreaseIndent(); - writeToken(18 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node); } function emitBlockStatements(node, forceSingleLine) { + emitTokenWithComment(17 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node); var format = forceSingleLine || ts.getEmitFlags(node) & 1 /* SingleLine */ ? 384 /* SingleLineBlockStatements */ : 65 /* MultiLineBlockStatements */; emitList(node, node.statements, format); + emitTokenWithComment(18 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node, /*indentLeading*/ !!(format & 1 /* MultiLine */)); } function emitVariableStatement(node) { emitModifiers(node, node.modifiers); @@ -71943,16 +73705,16 @@ var ts; writeSemicolon(); } function emitIfStatement(node) { - var openParenPos = writeToken(90 /* IfKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(90 /* IfKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(82 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 212 /* IfStatement */) { + emitTokenWithComment(82 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 215 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -71961,8 +73723,15 @@ var ts; } } } + function emitWhileClause(node, startPos) { + var openParenPos = emitTokenWithComment(106 /* WhileKeyword */, startPos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); + } function emitDoStatement(node) { - writeKeyword("do"); + emitTokenWithComment(81 /* DoKeyword */, node.pos, writeKeyword, node); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { writeSpace(); @@ -71970,60 +73739,53 @@ var ts; else { writeLineOrSpace(node); } - writeKeyword("while"); - writeSpace(); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(");"); + emitWhileClause(node, node.statement.end); + writePunctuation(";"); } function emitWhileStatement(node) { - writeKeyword("while"); - writeSpace(); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(")"); + emitWhileClause(node, node.pos); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(88 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); + var pos = emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); emitForBinding(node.initializer); - writeSemicolon(); + pos = emitTokenWithComment(25 /* SemicolonToken */, node.initializer ? node.initializer.end : pos, writeSemicolon, node); emitExpressionWithLeadingSpace(node.condition); - writeSemicolon(); + pos = emitTokenWithComment(25 /* SemicolonToken */, node.condition ? node.condition.end : pos, writeSemicolon, node); emitExpressionWithLeadingSpace(node.incrementor); - writePunctuation(")"); + emitTokenWithComment(20 /* CloseParenToken */, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(88 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - writeKeyword("in"); + emitTokenWithComment(92 /* InKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(88 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); emitWithTrailingSpace(node.awaitModifier); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - writeKeyword("of"); + emitTokenWithComment(144 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { emit(node); } else { @@ -72032,22 +73794,34 @@ var ts; } } function emitContinueStatement(node) { - writeToken(77 /* ContinueKeyword */, node.pos, writeKeyword); + emitTokenWithComment(77 /* ContinueKeyword */, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeSemicolon(); } function emitBreakStatement(node) { - writeToken(72 /* BreakKeyword */, node.pos, writeKeyword); + emitTokenWithComment(72 /* BreakKeyword */, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeSemicolon(); } - function emitTokenWithComment(token, pos, writer, contextNode) { + function emitTokenWithComment(token, pos, writer, contextNode, indentLeading) { var node = contextNode && ts.getParseTreeNode(contextNode); - if (node && node.kind === contextNode.kind) { + var isSimilarNode = node && node.kind === contextNode.kind; + var startPos = pos; + if (isSimilarNode) { pos = ts.skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, writer, /*contextNode*/ contextNode); - if (node && node.kind === contextNode.kind) { + if (emitLeadingCommentsOfPosition && isSimilarNode) { + var needsIndent = indentLeading && !ts.positionsAreOnSameLine(startPos, pos, currentSourceFile); + if (needsIndent) { + increaseIndent(); + } + emitLeadingCommentsOfPosition(startPos); + if (needsIndent) { + decreaseIndent(); + } + } + pos = writeTokenText(token, writer, pos); + if (emitTrailingCommentsOfPosition && isSimilarNode) { emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); } return pos; @@ -72058,35 +73832,35 @@ var ts; writeSemicolon(); } function emitWithStatement(node) { - writeKeyword("with"); + var openParenPos = emitTokenWithComment(107 /* WithKeyword */, node.pos, writeKeyword, node); writeSpace(); - writePunctuation("("); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writePunctuation(")"); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(98 /* SwitchKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node) { emit(node.label); - writePunctuation(":"); + emitTokenWithComment(56 /* ColonToken */, node.label.end, writePunctuation, node); writeSpace(); emit(node.statement); } function emitThrowStatement(node) { - writeKeyword("throw"); + emitTokenWithComment(100 /* ThrowKeyword */, node.pos, writeKeyword, node); emitExpressionWithLeadingSpace(node.expression); writeSemicolon(); } function emitTryStatement(node) { - writeKeyword("try"); + emitTokenWithComment(102 /* TryKeyword */, node.pos, writeKeyword, node); writeSpace(); emit(node.tryBlock); if (node.catchClause) { @@ -72095,7 +73869,7 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - writeKeyword("finally"); + emitTokenWithComment(87 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); writeSpace(); emit(node.finallyBlock); } @@ -72110,7 +73884,7 @@ var ts; function emitVariableDeclaration(node) { emit(node.name); emitTypeAnnotation(node.type); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node); } function emitVariableDeclarationList(node) { writeKeyword(ts.isLet(node) ? "let" : ts.isConst(node) ? "const" : "var"); @@ -72301,7 +74075,7 @@ var ts; } emit(node.name); var body = node.body; - while (body.kind === 234 /* ModuleDeclaration */) { + while (body.kind === 237 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -72311,23 +74085,21 @@ var ts; } function emitModuleBlock(node) { pushNameGenerationScope(node); - writePunctuation("{"); emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node)); - writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation); + emitTokenWithComment(17 /* OpenBraceToken */, node.pos, writePunctuation, node); emitList(node, node.clauses, 65 /* CaseBlockClauses */); - writeToken(18 /* CloseBraceToken */, node.clauses.end, writePunctuation); + emitTokenWithComment(18 /* CloseBraceToken */, node.clauses.end, writePunctuation, node, /*indentLeading*/ true); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - writeKeyword("import"); + emitTokenWithComment(91 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); emit(node.name); writeSpace(); - writePunctuation("="); + emitTokenWithComment(58 /* EqualsToken */, node.name.end, writePunctuation, node); writeSpace(); emitModuleReference(node.moduleReference); writeSemicolon(); @@ -72342,12 +74114,12 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - writeKeyword("import"); + emitTokenWithComment(91 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { emit(node.importClause); writeSpace(); - writeKeyword("from"); + emitTokenWithComment(142 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -72356,15 +74128,15 @@ var ts; function emitImportClause(node) { emit(node.name); if (node.name && node.namedBindings) { - writePunctuation(","); + emitTokenWithComment(26 /* CommaToken */, node.name.end, writePunctuation, node); writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node) { - writePunctuation("*"); + var asPos = emitTokenWithComment(39 /* AsteriskToken */, node.pos, writePunctuation, node); writeSpace(); - writeKeyword("as"); + emitTokenWithComment(118 /* AsKeyword */, asPos, writeKeyword, node); writeSpace(); emit(node.name); } @@ -72375,41 +74147,42 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - writeKeyword("export"); + var nextPos = emitTokenWithComment(84 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isExportEquals) { - writeOperator("="); + emitTokenWithComment(58 /* EqualsToken */, nextPos, writeOperator, node); } else { - writeKeyword("default"); + emitTokenWithComment(79 /* DefaultKeyword */, nextPos, writeKeyword, node); } writeSpace(); emitExpression(node.expression); writeSemicolon(); } function emitExportDeclaration(node) { - writeKeyword("export"); + var nextPos = emitTokenWithComment(84 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - writePunctuation("*"); + nextPos = emitTokenWithComment(39 /* AsteriskToken */, nextPos, writePunctuation, node); } if (node.moduleSpecifier) { writeSpace(); - writeKeyword("from"); + var fromPos = node.exportClause ? node.exportClause.end : nextPos; + emitTokenWithComment(142 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } writeSemicolon(); } function emitNamespaceExportDeclaration(node) { - writeKeyword("export"); + var nextPos = emitTokenWithComment(84 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeKeyword("as"); + nextPos = emitTokenWithComment(118 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - writeKeyword("namespace"); + nextPos = emitTokenWithComment(130 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeSemicolon(); @@ -72429,7 +74202,7 @@ var ts; if (node.propertyName) { emit(node.propertyName); writeSpace(); - writeKeyword("as"); + emitTokenWithComment(118 /* AsKeyword */, node.propertyName.end, writeKeyword, node); writeSpace(); } emit(node.name); @@ -72521,44 +74294,31 @@ var ts; // Clauses // function emitCaseClause(node) { - writeKeyword("case"); + emitTokenWithComment(73 /* CaseKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writePunctuation(":"); - emitCaseOrDefaultClauseStatements(node, node.statements); + emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); } function emitDefaultClause(node) { - writeKeyword("default"); - writePunctuation(":"); - emitCaseOrDefaultClauseStatements(node, node.statements); + var pos = emitTokenWithComment(79 /* DefaultKeyword */, node.pos, writeKeyword, node); + emitCaseOrDefaultClauseRest(node, node.statements, pos); } - function emitCaseOrDefaultClauseStatements(parentNode, statements) { + function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { var emitAsSingleStatement = statements.length === 1 && ( // treat synthesized nodes as located on the same line for emit purposes ts.nodeIsSynthesized(parentNode) || ts.nodeIsSynthesized(statements[0]) || ts.rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); - // e.g: - // case 0: // Zero - // case 1: // One - // case 2: // two - // return "hi"; - // If there is no statements, emitNodeWithComments of the parentNode which is caseClause will take care of trailing comment. - // So in example above, comment "// Zero" and "// One" will be emit in emitTrailingComments in emitNodeWithComments. - // However, for "case 2", because parentNode which is caseClause has an "end" property to be end of the statements (in this case return statement) - // comment "// two" will not be emitted in emitNodeWithComments. - // Therefore, we have to do the check here to emit such comment. - if (statements.length > 0) { - // We use emitTrailingCommentsOfPosition instead of emitLeadingCommentsOfPosition because leading comments is defined as comments before the node after newline character separating it from previous line - // Note: we can't use parentNode.end as such position includes statements. - emitTrailingCommentsOfPosition(statements.pos); - } var format = 81985 /* CaseOrDefaultClauseStatements */; if (emitAsSingleStatement) { + writeToken(56 /* ColonToken */, colonPos, writePunctuation, parentNode); writeSpace(); format &= ~(1 /* MultiLine */ | 64 /* Indented */); } + else { + emitTokenWithComment(56 /* ColonToken */, colonPos, writePunctuation, parentNode); + } emitList(parentNode, statements, format); } function emitHeritageClause(node) { @@ -72568,12 +74328,12 @@ var ts; emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - var openParenPos = writeToken(74 /* CatchKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(74 /* CatchKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.variableDeclaration) { - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emit(node.variableDeclaration); - writeToken(20 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation, node); writeSpace(); } emit(node.block); @@ -72619,7 +74379,7 @@ var ts; // function emitEnumMember(node) { emit(node.name); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.name.end, node); } // // Top-level nodes @@ -72736,10 +74496,10 @@ var ts; emit(node); } } - function emitInitializer(node) { + function emitInitializer(node, equalCommentStartPos, container) { if (node) { writeSpace(); - writeOperator("="); + emitTokenWithComment(58 /* EqualsToken */, equalCommentStartPos, writeOperator, container); writeSpace(); emitExpression(node); } @@ -72787,7 +74547,7 @@ var ts; emitList(parentNode, typeArguments, 26896 /* TypeArguments */); } function emitTypeParameters(parentNode, typeParameters) { - if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { + if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { // Quick info uses type arguments in place of type parameters on instantiated signatures return emitTypeArguments(parentNode, parentNode.typeArguments); } emitList(parentNode, typeParameters, 26896 /* TypeParameters */); @@ -72864,6 +74624,9 @@ var ts; } if (format & 7680 /* BracketsMask */) { writePunctuation(getOpeningBracket(format)); + if (isEmpty) { + emitTrailingCommentsOfPosition(children.pos, /*prefixSpace*/ true); // Emit comments within empty bracketed lists + } } if (onBeforeEmitNodeArray) { onBeforeEmitNodeArray(children); @@ -72971,6 +74734,9 @@ var ts; onAfterEmitNodeArray(children); } if (format & 7680 /* BracketsMask */) { + if (isEmpty) { + emitLeadingCommentsOfPosition(children.end); // Emit leading comments within empty lists + } writePunctuation(getClosingBracket(format)); } } @@ -73207,7 +74973,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -73316,7 +75082,7 @@ var ts; if (node.locals) { var local = node.locals.get(ts.escapeLeadingUnderscores(name)); // We conservatively include alias symbols to cover cases where they're emitted as locals - if (local && local.flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { + if (local && local.flags & (67216319 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { return false; } } @@ -73419,21 +75185,21 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - case 244 /* ExportAssignment */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 247 /* ExportAssignment */: return generateNameForExportDefault(); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return generateNameForClassExpression(); - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); @@ -73551,7 +75317,7 @@ var ts; if (failed) { return ""; } - if (!commonPathComponents) { + if (!commonPathComponents) { // Can happen when all input files are .d.ts files return currentDirectory; } return ts.getNormalizedPathFromPathComponents(commonPathComponents); @@ -73683,8 +75449,7 @@ var ts; } ts.formatDiagnostics = formatDiagnostics; function formatDiagnostic(diagnostic, host) { - var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - var errorMessage = category + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine(); + var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine(); if (diagnostic.file) { var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; var fileName = diagnostic.file.fileName; @@ -73709,8 +75474,9 @@ var ts; var ellipsis = "..."; function getCategoryFormat(category) { switch (category) { - case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case ts.DiagnosticCategory.Suggestion: return ts.Debug.fail("Should never get an Info diagnostic on the command line."); case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } @@ -73741,8 +75507,8 @@ var ts; if (hasMoreThanFiveLines) { gutterWidth = Math.max(ellipsis.length, gutterWidth); } - context += host.getNewLine(); for (var i = firstLine; i <= lastLine; i++) { + context += host.getNewLine(); // If the error spans over 5 lines, we'll only show the first 2 and last 2 lines, // so we'll skip ahead to the second-to-last line. if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { @@ -73783,9 +75549,7 @@ var ts; output += formatColorAndReset("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); output += " - "; } - var categoryColor = getCategoryFormat(diagnostic.category); - var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category)); output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey); output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); if (diagnostic.file) { @@ -73844,7 +75608,7 @@ var ts; */ /* @internal */ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames) { - // If we haven't create a program yet or has changed automatic type directives, then it is not up-to-date + // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date if (!program || hasChangedAutomaticTypeDirectiveNames) { return false; } @@ -73878,10 +75642,10 @@ var ts; } ts.isProgramUptoDate = isProgramUptoDate; /** - * Determined if source file needs to be re-created even if its text hasnt changed + * Determined if source file needs to be re-created even if its text hasn't changed */ function shouldProgramCreateNewSourceFiles(program, newOptions) { - // If any of these options change, we cant reuse old source file even if version match + // If any of these options change, we can't reuse old source file even if version match // The change in options like these could result in change in syntax tree change var oldOptions = program && program.getCompilerOptions(); return oldOptions && (oldOptions.target !== newOptions.target || @@ -74638,22 +76402,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } // falls through - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 227 /* VariableDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 230 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -74661,41 +76425,41 @@ var ts; } } switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 108 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } var prevParent = parent; @@ -74708,28 +76472,28 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 233 /* ClassDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } // falls through - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 209 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 212 /* VariableStatement */); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -74741,16 +76505,16 @@ var ts; return; } break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -74776,7 +76540,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 124 /* DeclareKeyword */: case 117 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); @@ -74884,9 +76648,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || !ts.isStringLiteral(moduleNameExpr)) { break; @@ -74901,7 +76665,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) { var moduleName = node.name; var nameText = ts.getTextOfIdentifierOrLiteral(moduleName); @@ -74938,6 +76702,7 @@ var ts; if (ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { (imports || (imports = [])).push(node.arguments[0]); } + // we have to check the argument list has length of 1. We will still have to process these even though we have parsing error. else if (ts.isImportCall(node) && node.arguments.length === 1 && node.arguments[0].kind === 9 /* StringLiteral */) { (imports || (imports = [])).push(node.arguments[0]); } @@ -75038,6 +76803,7 @@ var ts; modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } + // See if we need to reprocess the imports due to prior skipped imports else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { modulesWithElidedImports.set(file_1.path, false); @@ -75376,7 +77142,7 @@ var ts; // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted if (options.outDir || // there is --outDir specified options.sourceRoot || // there is --sourceRoot specified - options.mapRoot) { + options.mapRoot) { // there is --mapRoot specified // Precalculate and cache the common source directory var dir = getCommonSourceDirectory(); // If we failed to find a good common directory, but outDir is specified and at least one of our files is on a windows drive/URL/other resource, add a failure @@ -75392,7 +77158,7 @@ var ts; } if (options.emitDeclarationOnly) { if (!options.declaration) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations"); + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declaration"); } if (options.noEmit) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); @@ -75603,7 +77369,6 @@ var ts; if (aug.kind === 9 /* StringLiteral */) { res.push(aug.text); } - // Do nothing if it's an Identifier; we don't need to do module resolution for `declare global`. } return res; } @@ -75920,14 +77685,8 @@ var ts; var ts; (function (ts) { function hasSameKeys(map1, map2) { - if (map1 === undefined) { - return map2 === undefined; - } - if (map2 === undefined) { - return map1 === undefined; - } // Has same size and every key is present in both maps - return map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); }); + return map1 === map2 || map1 && map2 && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); }); } /** * Create the state so that we can iterate on changedFiles/affected files @@ -76485,7 +78244,7 @@ var ts; createNewValue: createMissingFileWatch, // Files that are no longer missing (e.g. because they are no longer required) // should no longer be watched. - onDeleteValue: closeFileWatcher + onDeleteValue: ts.closeFileWatcher }); } ts.updateMissingFilePathsWatch = updateMissingFilePathsWatch; @@ -76528,75 +78287,74 @@ var ts; return program.isEmittedFile(file); } ts.isEmittedFileOfProgram = isEmittedFileOfProgram; - function addFileWatcher(host, file, cb) { - return host.watchFile(file, cb); + var WatchLogLevel; + (function (WatchLogLevel) { + WatchLogLevel[WatchLogLevel["None"] = 0] = "None"; + WatchLogLevel[WatchLogLevel["TriggerOnly"] = 1] = "TriggerOnly"; + WatchLogLevel[WatchLogLevel["Verbose"] = 2] = "Verbose"; + })(WatchLogLevel = ts.WatchLogLevel || (ts.WatchLogLevel = {})); + function getWatchFactory(watchLogLevel, log, getDetailWatchInfo) { + return getWatchFactoryWith(watchLogLevel, log, getDetailWatchInfo, watchFile, watchDirectory); } - ts.addFileWatcher = addFileWatcher; - function addFileWatcherWithLogging(host, file, cb, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb); - } - ts.addFileWatcherWithLogging = addFileWatcherWithLogging; - function addFileWatcherWithOnlyTriggerLogging(host, file, cb, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb); - } - ts.addFileWatcherWithOnlyTriggerLogging = addFileWatcherWithOnlyTriggerLogging; - function addFilePathWatcher(host, file, cb, path) { - return host.watchFile(file, function (fileName, eventKind) { return cb(fileName, eventKind, path); }); - } - ts.addFilePathWatcher = addFilePathWatcher; - function addFilePathWatcherWithLogging(host, file, cb, path, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb, path); - } - ts.addFilePathWatcherWithLogging = addFilePathWatcherWithLogging; - function addFilePathWatcherWithOnlyTriggerLogging(host, file, cb, path, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb, path); - } - ts.addFilePathWatcherWithOnlyTriggerLogging = addFilePathWatcherWithOnlyTriggerLogging; - function addDirectoryWatcher(host, directory, cb, flags) { - var recursive = (flags & 1 /* Recursive */) !== 0; - return host.watchDirectory(directory, cb, recursive); - } - ts.addDirectoryWatcher = addDirectoryWatcher; - function addDirectoryWatcherWithLogging(host, directory, cb, flags, log) { - var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; - return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, directory, cb, flags); - } - ts.addDirectoryWatcherWithLogging = addDirectoryWatcherWithLogging; - function addDirectoryWatcherWithOnlyTriggerLogging(host, directory, cb, flags, log) { - var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; - return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, directory, cb, flags); - } - ts.addDirectoryWatcherWithOnlyTriggerLogging = addDirectoryWatcherWithOnlyTriggerLogging; - function createWatcherWithLogging(addWatch, watcherCaption, log, logOnlyTrigger, host, file, cb, optional) { - var info = "PathInfo: " + file; - if (!logOnlyTrigger) { - log(watcherCaption + "Added: " + info); + ts.getWatchFactory = getWatchFactory; + function getWatchFactoryWith(watchLogLevel, log, getDetailWatchInfo, watchFile, watchDirectory) { + var createFileWatcher = getCreateFileWatcher(watchLogLevel, watchFile); + var createFilePathWatcher = watchLogLevel === WatchLogLevel.None ? watchFilePath : createFileWatcher; + var createDirectoryWatcher = getCreateFileWatcher(watchLogLevel, watchDirectory); + return { + watchFile: function (host, file, callback, pollingInterval, detailInfo1, detailInfo2) { + return createFileWatcher(host, file, callback, pollingInterval, /*passThrough*/ undefined, detailInfo1, detailInfo2, watchFile, log, "FileWatcher", getDetailWatchInfo); + }, + watchFilePath: function (host, file, callback, pollingInterval, path, detailInfo1, detailInfo2) { + return createFilePathWatcher(host, file, callback, pollingInterval, path, detailInfo1, detailInfo2, watchFile, log, "FileWatcher", getDetailWatchInfo); + }, + watchDirectory: function (host, directory, callback, flags, detailInfo1, detailInfo2) { + return createDirectoryWatcher(host, directory, callback, flags, /*passThrough*/ undefined, detailInfo1, detailInfo2, watchDirectory, log, "DirectoryWatcher", getDetailWatchInfo); + } + }; + function watchFilePath(host, file, callback, pollingInterval, path) { + return watchFile(host, file, function (fileName, eventKind) { return callback(fileName, eventKind, path); }, pollingInterval); } - var watcher = addWatch(host, file, function (fileName, cbOptional1) { - var optionalInfo = cbOptional1 !== undefined ? " " + cbOptional1 : ""; - log(watcherCaption + "Trigger: " + fileName + optionalInfo + " " + info); - var start = ts.timestamp(); - cb(fileName, cbOptional1, optional); - var elapsed = ts.timestamp() - start; - log(watcherCaption + "Elapsed: " + elapsed + "ms Trigger: " + fileName + optionalInfo + " " + info); - }, optional); + } + function watchFile(host, file, callback, pollingInterval) { + return host.watchFile(file, callback, pollingInterval); + } + function watchDirectory(host, directory, callback, flags) { + return host.watchDirectory(directory, callback, (flags & 1 /* Recursive */) !== 0); + } + function getCreateFileWatcher(watchLogLevel, addWatch) { + switch (watchLogLevel) { + case WatchLogLevel.None: + return addWatch; + case WatchLogLevel.TriggerOnly: + return createFileWatcherWithTriggerLogging; + case WatchLogLevel.Verbose: + return createFileWatcherWithLogging; + } + } + function createFileWatcherWithLogging(host, file, cb, flags, passThrough, detailInfo1, detailInfo2, addWatch, log, watchCaption, getDetailWatchInfo) { + log(watchCaption + ":: Added:: " + getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo)); + var watcher = createFileWatcherWithTriggerLogging(host, file, cb, flags, passThrough, detailInfo1, detailInfo2, addWatch, log, watchCaption, getDetailWatchInfo); return { close: function () { - if (!logOnlyTrigger) { - log(watcherCaption + "Close: " + info); - } + log(watchCaption + ":: Close:: " + getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo)); watcher.close(); } }; } - function closeFileWatcher(watcher) { - watcher.close(); + function createFileWatcherWithTriggerLogging(host, file, cb, flags, passThrough, detailInfo1, detailInfo2, addWatch, log, watchCaption, getDetailWatchInfo) { + return addWatch(host, file, function (fileName, cbOptional) { + var triggerredInfo = watchCaption + ":: Triggered with " + fileName + (cbOptional !== undefined ? cbOptional : "") + ":: " + getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo); + log(triggerredInfo); + var start = ts.timestamp(); + cb(fileName, cbOptional, passThrough); + var elapsed = ts.timestamp() - start; + log("Elapsed:: " + elapsed + "ms " + triggerredInfo); + }, flags); + } + function getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo) { + return "WatchInfo: " + file + " " + flags + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : ""); } - ts.closeFileWatcher = closeFileWatcher; function closeFileWatcherOf(objWithWatcher) { objWithWatcher.watcher.close(); } @@ -76613,15 +78371,17 @@ var ts; var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var allFilesHaveInvalidatedResolution = false; + var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. // The key in the map is source file's path. // The values are Map of resolutions with key being name lookedup. var resolvedModuleNames = ts.createMap(); var perDirectoryResolvedModuleNames = ts.createMap(); + var nonRelaticeModuleNameCache = ts.createMap(); + var moduleResolutionCache = ts.createModuleResolutionCacheWithMaps(perDirectoryResolvedModuleNames, nonRelaticeModuleNameCache, getCurrentDirectory(), resolutionHost.getCanonicalFileName); var resolvedTypeReferenceDirectives = ts.createMap(); var perDirectoryResolvedTypeReferenceDirectives = ts.createMap(); - var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); - var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); /** * These are the extensions that failed lookup files will have by default, * any other extension of failed lookup will be store that path in custom failed lookup path @@ -76694,6 +78454,7 @@ var ts; } function clearPerDirectoryResolutions() { perDirectoryResolvedModuleNames.clear(); + nonRelaticeModuleNameCache.clear(); perDirectoryResolvedTypeReferenceDirectives.clear(); } function finishCachingPerDirectoryResolution() { @@ -76707,7 +78468,7 @@ var ts; clearPerDirectoryResolutions(); } function resolveModuleName(moduleName, containingFile, compilerOptions, host) { - var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); + var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { return primaryResult; @@ -76753,15 +78514,8 @@ var ts; perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - if (resolution.failedLookupLocations) { - if (existingResolution && existingResolution.failedLookupLocations) { - watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution); - } - else { - watchFailedLookupLocationOfResolution(resolution, 0); - } - } - else if (existingResolution) { + watchFailedLookupLocationOfResolution(resolution); + if (existingResolution) { stopWatchFailedLookupLocationOfResolution(existingResolution); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { @@ -76841,8 +78595,9 @@ var ts; if (isInDirectoryPath(rootPath, failedLookupLocationPath)) { return { dir: rootDir, dirPath: rootPath }; } - var dir = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())); - var dirPath = ts.getDirectoryPath(failedLookupLocationPath); + return getDirectoryToWatchFromFailedLookupLocationDirectory(ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())), ts.getDirectoryPath(failedLookupLocationPath)); + } + function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath) { // If directory path contains node module, get the most parent node_modules directory for watching while (ts.stringContains(dirPath, "/node_modules/")) { dir = ts.getDirectoryPath(dir); @@ -76868,78 +78623,91 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution) { - var failedLookupLocations = resolution.failedLookupLocations; - var existingFailedLookupLocations = existingResolution.failedLookupLocations; - for (var index = 0; index < failedLookupLocations.length; index++) { - if (index === existingFailedLookupLocations.length) { - // Additional failed lookup locations, watch from this index - watchFailedLookupLocationOfResolution(resolution, index); - return; - } - else if (failedLookupLocations[index] !== existingFailedLookupLocations[index]) { - // Different failed lookup locations, - // Watch new resolution failed lookup locations from this index and - // stop watching existing resolutions from this index - watchFailedLookupLocationOfResolution(resolution, index); - stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, index); - return; - } + function watchFailedLookupLocationOfResolution(resolution) { + // No need to set the resolution refCount + if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { + return; } - // All new failed lookup locations are already watched (and are same), - // Stop watching failed lookup locations of existing resolution after failed lookup locations length - stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, failedLookupLocations.length); - } - function watchFailedLookupLocationOfResolution(_a, startIndex) { - var failedLookupLocations = _a.failedLookupLocations; - for (var i = startIndex; i < failedLookupLocations.length; i++) { - var failedLookupLocation = failedLookupLocations[i]; + if (resolution.refCount !== undefined) { + resolution.refCount++; + return; + } + resolution.refCount = 1; + var failedLookupLocations = resolution.failedLookupLocations; + var setAtRoot = false; + for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { + var failedLookupLocation = failedLookupLocations_1[_i]; var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - // If the failed lookup location path is not one of the supported extensions, - // store it in the custom path - if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { - var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; - customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); - } - var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _b.dir, dirPath = _b.dirPath, ignore = _b.ignore; + var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _a.dir, dirPath = _a.dirPath, ignore = _a.ignore; if (!ignore) { - var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - if (dirWatcher) { - dirWatcher.refCount++; + // If the failed lookup location path is not one of the supported extensions, + // store it in the custom path + if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { + var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; + customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); + } + if (dirPath === rootPath) { + setAtRoot = true; } else { - directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); + setDirectoryWatcher(dir, dirPath); } } } + if (setAtRoot) { + setDirectoryWatcher(rootDir, rootPath); + } + } + function setDirectoryWatcher(dir, dirPath) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + if (dirWatcher) { + dirWatcher.refCount++; + } + else { + directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); + } } function stopWatchFailedLookupLocationOfResolution(resolution) { - if (resolution.failedLookupLocations) { - stopWatchFailedLookupLocationOfResolutionFrom(resolution, 0); + if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { + return; } - } - function stopWatchFailedLookupLocationOfResolutionFrom(_a, startIndex) { - var failedLookupLocations = _a.failedLookupLocations; - for (var i = startIndex; i < failedLookupLocations.length; i++) { - var failedLookupLocation = failedLookupLocations[i]; + resolution.refCount--; + if (resolution.refCount) { + return; + } + var failedLookupLocations = resolution.failedLookupLocations; + var removeAtRoot = false; + for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { + var failedLookupLocation = failedLookupLocations_2[_i]; var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - var refCount = customFailedLookupPaths.get(failedLookupLocationPath); - if (refCount) { - if (refCount === 1) { - customFailedLookupPaths.delete(failedLookupLocationPath); + var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _a.dirPath, ignore = _a.ignore; + if (!ignore) { + var refCount = customFailedLookupPaths.get(failedLookupLocationPath); + if (refCount) { + if (refCount === 1) { + customFailedLookupPaths.delete(failedLookupLocationPath); + } + else { + ts.Debug.assert(refCount > 1); + customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + } + } + if (dirPath === rootPath) { + removeAtRoot = true; } else { - ts.Debug.assert(refCount > 1); - customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + removeDirectoryWatcher(dirPath); } } - var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _b.dirPath, ignore = _b.ignore; - if (!ignore) { - var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - // Do not close the watcher yet since it might be needed by other failed lookup locations. - dirWatcher.refCount--; - } } + if (removeAtRoot) { + removeDirectoryWatcher(rootPath); + } + } + function removeDirectoryWatcher(dirPath) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + // Do not close the watcher yet since it might be needed by other failed lookup locations. + dirWatcher.refCount--; } function createDirectoryWatcher(directory, dirPath) { return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) { @@ -77026,7 +78794,8 @@ var ts; // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { // Invalidate any resolution from this directory isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); @@ -77055,7 +78824,17 @@ var ts; function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } - function createTypeRootsWatch(_typeRootPath, typeRoot) { + function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { + if (allFilesHaveInvalidatedResolution) { + return undefined; + } + if (isInDirectoryPath(rootPath, typeRootPath)) { + return rootPath; + } + var _a = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath), dirPath = _a.dirPath, ignore = _a.ignore; + return !ignore && directoryWatchesOfFailedLookups.has(dirPath) && dirPath; + } + function createTypeRootsWatch(typeRootPath, typeRoot) { // Create new watch and recursive info return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); @@ -77067,6 +78846,12 @@ var ts; // We could potentially store more data here about whether it was/would be really be used or not // and with that determine to trigger compilation but for now this is enough resolutionHost.onChangedAutomaticTypeDirectiveNames(); + // Since directory watchers invoked are flaky, the failed lookup location events might not be triggered + // So handle to failed lookup locations here as well to ensure we are invalidating resolutions + var dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath); + if (dirPath && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + resolutionHost.onInvalidatedResolution(); + } }, 1 /* Recursive */); } /** @@ -77140,6 +78925,7 @@ var ts; ts.createDiagnosticReporter = createDiagnosticReporter; function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { if (system.clearScreen && + !options.preserveWatchOutput && diagnostic.code !== ts.Diagnostics.Compilation_complete_Watching_for_file_changes.code && !options.extendedDiagnostics && !options.diagnostics) { @@ -77342,6 +79128,7 @@ var ts; } } ts.createWatchCompilerHost = createWatchCompilerHost; + var initialVersion = 1; function createWatchProgram(host) { var builderProgram; var reloadLevel; // level to indicate if the program needs to be reloaded from config file/just filenames etc @@ -77377,16 +79164,16 @@ var ts; parseConfigFile(); } var trace = host.trace && (function (s) { host.trace(s + newLine); }); - var loggingEnabled = trace && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); - var writeLog = loggingEnabled ? trace : ts.noop; - var watchFile = compilerOptions.extendedDiagnostics ? ts.addFileWatcherWithLogging : loggingEnabled ? ts.addFileWatcherWithOnlyTriggerLogging : ts.addFileWatcher; - var watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; - var watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; - if (configFileName) { - watchFile(host, configFileName, scheduleProgramReload, writeLog); - } + var watchLogLevel = trace ? compilerOptions.extendedDiagnostics ? ts.WatchLogLevel.Verbose : + compilerOptions.diagnostis ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None; + var writeLog = watchLogLevel !== ts.WatchLogLevel.None ? trace : ts.noop; + var _b = ts.getWatchFactory(watchLogLevel, writeLog), watchFile = _b.watchFile, watchFilePath = _b.watchFilePath, watchDirectoryWorker = _b.watchDirectory; var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); var newLine = updateNewLine(); + writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames); + if (configFileName) { + watchFile(host, configFileName, scheduleProgramReload, ts.PollingInterval.High); + } var compilerHost = { // Members for CompilerHost getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { return getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile); }, @@ -77463,6 +79250,11 @@ var ts; return builderProgram; } // Compile the program + if (watchLogLevel !== ts.WatchLogLevel.None) { + writeLog("CreatingProgramWith::"); + writeLog(" roots: " + JSON.stringify(rootFileNames)); + writeLog(" options: " + JSON.stringify(compilerOptions)); + } var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; hasChangedCompilerOptions = false; resolutionCache.startCachingPerDirectoryResolution(); @@ -77506,49 +79298,58 @@ var ts; function toPath(fileName) { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); } + function isFileMissingOnHost(hostSourceFile) { + return typeof hostSourceFile === "number"; + } + function isFilePresentOnHost(hostSourceFile) { + return !!hostSourceFile.sourceFile; + } function fileExists(fileName) { var path = toPath(fileName); - var hostSourceFileInfo = sourceFilesCache.get(path); - if (hostSourceFileInfo !== undefined) { - return !ts.isString(hostSourceFileInfo); + // If file is missing on host from cache, we can definitely say file doesnt exist + // otherwise we need to ensure from the disk + if (isFileMissingOnHost(sourceFilesCache.get(path))) { + return true; } return directoryStructureHost.fileExists(fileName); } function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) { var hostSourceFile = sourceFilesCache.get(path); // No source file on the host - if (ts.isString(hostSourceFile)) { + if (isFileMissingOnHost(hostSourceFile)) { return undefined; } // Create new source file if requested or the versions dont match - if (!hostSourceFile || shouldCreateNewSourceFile || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { + if (!hostSourceFile || shouldCreateNewSourceFile || !isFilePresentOnHost(hostSourceFile) || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { var sourceFile = getNewSourceFile(); if (hostSourceFile) { if (shouldCreateNewSourceFile) { hostSourceFile.version++; } if (sourceFile) { + // Set the source file and create file watcher now that file was present on the disk hostSourceFile.sourceFile = sourceFile; sourceFile.version = hostSourceFile.version.toString(); if (!hostSourceFile.fileWatcher) { - hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); + hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path); } } else { // There is no source file on host any more, close the watch, missing file paths will track it - hostSourceFile.fileWatcher.close(); - sourceFilesCache.set(path, hostSourceFile.version.toString()); + if (isFilePresentOnHost(hostSourceFile)) { + hostSourceFile.fileWatcher.close(); + } + sourceFilesCache.set(path, hostSourceFile.version); } } else { - var fileWatcher = void 0; if (sourceFile) { - sourceFile.version = "1"; - fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); - sourceFilesCache.set(path, { sourceFile: sourceFile, version: 1, fileWatcher: fileWatcher }); + sourceFile.version = initialVersion.toString(); + var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path); + sourceFilesCache.set(path, { sourceFile: sourceFile, version: initialVersion, fileWatcher: fileWatcher }); } else { - sourceFilesCache.set(path, "0"); + sourceFilesCache.set(path, initialVersion); } } return sourceFile; @@ -77570,19 +79371,21 @@ var ts; return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; } } - function removeSourceFile(path) { + function nextSourceFileVersion(path) { var hostSourceFile = sourceFilesCache.get(path); if (hostSourceFile !== undefined) { - if (!ts.isString(hostSourceFile)) { - hostSourceFile.fileWatcher.close(); - resolutionCache.invalidateResolutionOfFile(path); + if (isFileMissingOnHost(hostSourceFile)) { + // The next version, lets set it as presence unknown file + sourceFilesCache.set(path, { version: Number(hostSourceFile) + 1 }); + } + else { + hostSourceFile.version++; } - sourceFilesCache.delete(path); } } function getSourceVersion(path) { var hostSourceFile = sourceFilesCache.get(path); - return !hostSourceFile || ts.isString(hostSourceFile) ? undefined : hostSourceFile.version.toString(); + return !hostSourceFile || isFileMissingOnHost(hostSourceFile) ? undefined : hostSourceFile.version.toString(); } function onReleaseOldSourceFile(oldSourceFile, _oldOptions) { var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.path); @@ -77592,10 +79395,13 @@ var ts; // there was version update and new source file was created. if (hostSourceFileInfo) { // record the missing file paths so they can be removed later if watchers arent tracking them - if (ts.isString(hostSourceFileInfo)) { + if (isFileMissingOnHost(hostSourceFileInfo)) { (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); } else if (hostSourceFileInfo.sourceFile === oldSourceFile) { + if (hostSourceFileInfo.fileWatcher) { + hostSourceFileInfo.fileWatcher.close(); + } sourceFilesCache.delete(oldSourceFile.path); resolutionCache.removeResolutionsOfFile(oldSourceFile.path); } @@ -77666,27 +79472,11 @@ var ts; } function onSourceFileChange(fileName, eventKind, path) { updateCachedSystemWithFile(fileName, path, eventKind); - var hostSourceFile = sourceFilesCache.get(path); - if (hostSourceFile) { - // Update the cache - if (eventKind === ts.FileWatcherEventKind.Deleted) { - resolutionCache.invalidateResolutionOfFile(path); - if (!ts.isString(hostSourceFile)) { - hostSourceFile.fileWatcher.close(); - sourceFilesCache.set(path, (++hostSourceFile.version).toString()); - } - } - else { - // Deleted file created - if (ts.isString(hostSourceFile)) { - sourceFilesCache.delete(path); - } - else { - // file changed - just update the version - hostSourceFile.version++; - } - } + // Update the source file cache + if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.get(path)) { + resolutionCache.invalidateResolutionOfFile(path); } + nextSourceFileVersion(path); // Update the program scheduleProgramUpdate(); } @@ -77696,10 +79486,10 @@ var ts; } } function watchDirectory(directory, cb, flags) { - return watchDirectoryWorker(host, directory, cb, flags, writeLog); + return watchDirectoryWorker(host, directory, cb, flags); } function watchMissingFilePath(missingFilePath) { - return watchFilePath(host, missingFilePath, onMissingFileChange, missingFilePath, writeLog); + return watchFilePath(host, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, missingFilePath); } function onMissingFileChange(fileName, eventKind, missingFilePath) { updateCachedSystemWithFile(fileName, missingFilePath, eventKind); @@ -77707,7 +79497,7 @@ var ts; missingFilesMap.get(missingFilePath).close(); missingFilesMap.delete(missingFilePath); // Delete the entry in the source files cache so that new source file is created - removeSourceFile(missingFilePath); + nextSourceFileVersion(missingFilePath); // When a missing file is created, we should update the graph. scheduleProgramUpdate(); } @@ -77725,16 +79515,10 @@ var ts; ts.Debug.assert(!!configFileName); var fileOrDirectoryPath = toPath(fileOrDirectory); // Since the file existance changed, update the sourceFiles cache - var result = cachedDirectoryStructureHost && cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); - // Instead of deleting the file, mark it as changed instead - // Many times node calls add/remove/file when watching directories recursively - var hostSourceFile = sourceFilesCache.get(fileOrDirectoryPath); - if (hostSourceFile && !ts.isString(hostSourceFile) && (result ? result.fileExists : directoryStructureHost.fileExists(fileOrDirectory))) { - hostSourceFile.version++; - } - else { - removeSourceFile(fileOrDirectoryPath); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } + nextSourceFileVersion(fileOrDirectoryPath); // If the the added or created file or directory is not supported file name, ignore the file // But when watched directory is added/removed, we need to reload the file list if (fileOrDirectoryPath !== directory && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, compilerOptions)) { @@ -77837,6 +79621,13 @@ var ts; category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, + { + name: "preserveWatchOutput", + type: "boolean", + showInSimplifiedHelpView: false, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen, + }, { name: "watch", shortName: "w", @@ -77918,9 +79709,10 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "es2018.promise": "lib.es2018.promise.d.ts", + "es2018.regexp": "lib.es2018.regexp.d.ts", "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", - "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, @@ -78782,7 +80574,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265 /* PropertyAssignment */) { + if (element.kind !== 268 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -78857,13 +80649,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (valueExpression.operator !== 38 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -78880,7 +80672,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -79385,7 +81177,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -79572,7 +81364,7 @@ var ts; function getFileNamesFromConfigSpecs(spec, basePath, options, host, extraFileExtensions) { if (extraFileExtensions === void 0) { extraFileExtensions = []; } basePath = ts.normalizePath(basePath); - var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper; + var keyMapper = host.useCaseSensitiveFileNames ? ts.identity : ts.toLowerCase; // Literal file names (provided via the "files" array in tsconfig.json) are stored in a // file map with a possibly case insensitive key. We use this map later when when including // wildcard paths. @@ -79762,22 +81554,6 @@ var ts; wildcardFiles.delete(lowerPriorityPath); } } - /** - * Gets a case sensitive key. - * - * @param key The original key. - */ - function caseSensitiveKeyMapper(key) { - return key; - } - /** - * Gets a case insensitive key. - * - * @param key The original key. - */ - function caseInsensitiveKeyMapper(key) { - return key.toLowerCase(); - } /** * Produces a cleaned version of compiler options with personally identifiying info (aka, paths) removed. * Also converts enum values back to strings. @@ -79788,7 +81564,7 @@ var ts; for (var key in opts) { if (opts.hasOwnProperty(key)) { var type = getOptionFromName(key); - if (type !== undefined) { + if (type !== undefined) { // Ignore unknown options out[key] = getOptionValueWithEmptyStrings(opts[key], type); } } @@ -79798,11 +81574,11 @@ var ts; ts.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry; function getOptionValueWithEmptyStrings(value, option) { switch (option.type) { - case "object":// "paths". Can't get any useful information from the value since we blank out strings, so just return "". + case "object": // "paths". Can't get any useful information from the value since we blank out strings, so just return "". return ""; - case "string":// Could be any arbitrary string -- use empty string instead. + case "string": // Could be any arbitrary string -- use empty string instead. return ""; - case "number":// Allow numbers, but be sure to check it's actually a number. + case "number": // Allow numbers, but be sure to check it's actually a number. return typeof value === "number" ? value : ""; case "boolean": return typeof value === "boolean" ? value : ""; @@ -80067,36 +81843,36 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 264 /* CatchClause */: - case 257 /* JsxAttribute */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 267 /* CatchClause */: + case 260 /* JsxAttribute */: return 1 /* Value */; - case 146 /* TypeParameter */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 164 /* TypeLiteral */: + case 147 /* TypeParameter */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 165 /* TypeLiteral */: return 2 /* Type */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 268 /* EnumMember */: - case 230 /* ClassDeclaration */: + case 271 /* EnumMember */: + case 233 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -80106,26 +81882,26 @@ var ts; else { return 4 /* Namespace */; } - case 233 /* EnumDeclaration */: - case 242 /* NamedImports */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 236 /* EnumDeclaration */: + case 245 /* NamedImports */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 269 /* SourceFile */: + case 272 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 244 /* ExportAssignment */) { + else if (node.parent.kind === 247 /* ExportAssignment */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -80150,19 +81926,14 @@ var ts; } ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 71 /* Identifier */); // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 144 /* QualifiedName */ && - node.parent.right === node && - node.parent.parent.kind === 238 /* ImportEqualsDeclaration */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - return 4 /* Namespace */; + var name = node.kind === 145 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 241 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 144 /* QualifiedName */) { + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -80174,27 +81945,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 144 /* QualifiedName */) { - while (root.parent && root.parent.kind === 144 /* QualifiedName */) { + if (root.parent.kind === 145 /* QualifiedName */) { + while (root.parent && root.parent.kind === 145 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 160 /* TypeReference */ && !isLastClause; + return root.parent.kind === 161 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 180 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 180 /* PropertyAccessExpression */) { + if (root.parent.kind === 183 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 183 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 202 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 263 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 205 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 266 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 230 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || - (decl.kind === 231 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); + return (decl.kind === 233 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || + (decl.kind === 234 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); } return false; } @@ -80205,23 +81976,23 @@ var ts; switch (node.kind) { case 99 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return true; } switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 182 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 185 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 183 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 186 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -80234,7 +82005,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 223 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 226 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -80243,30 +82014,27 @@ var ts; } ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { - return node.kind === 71 /* Identifier */ && - (node.parent.kind === 219 /* BreakStatement */ || node.parent.kind === 218 /* ContinueStatement */) && - node.parent.label === node; + return node.kind === 71 /* Identifier */ && ts.isBreakOrContinueStatement(node.parent) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { - return node.kind === 71 /* Identifier */ && - node.parent.kind === 223 /* LabeledStatement */ && - node.parent.label === node; + return node.kind === 71 /* Identifier */ && ts.isLabeledStatement(node.parent) && node.parent.label === node; } + ts.isLabelOfLabeledStatement = isLabelOfLabeledStatement; function isLabelName(node) { return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 234 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 237 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -80276,22 +82044,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 268 /* EnumMember */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 234 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 271 /* EnumMember */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 237 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return true; - case 174 /* LiteralType */: - return node.parent.parent.kind === 172 /* IndexedAccessType */; + case 177 /* LiteralType */: + return node.parent.parent.kind === 175 /* IndexedAccessType */; } } ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess; @@ -80301,7 +82069,7 @@ var ts; } ts.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration; function getContainerNode(node) { - if (node.kind === 288 /* JSDocTypedefTag */) { + if (node.kind === 291 /* JSDocTypedefTag */) { // This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope. // node.parent = the JSDoc comment, node.parent.parent = the node having the comment. // Then we get parent again in the loop. @@ -80313,17 +82081,17 @@ var ts; return undefined; } switch (node.kind) { - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return node; } } @@ -80331,48 +82099,48 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return "class" /* classElement */; - case 231 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 232 /* TypeAliasDeclaration */: return "type" /* typeElement */; - case 233 /* EnumDeclaration */: return "enum" /* enumElement */; - case 227 /* VariableDeclaration */: + case 234 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 235 /* TypeAliasDeclaration */: return "type" /* typeElement */; + case 236 /* EnumDeclaration */: return "enum" /* enumElement */; + case 230 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return "function" /* functionElement */; - case 154 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 155 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 155 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 156 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return "property" /* memberVariableElement */; - case 158 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 157 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 156 /* CallSignature */: return "call" /* callSignatureElement */; - case 153 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 146 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 268 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 147 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 238 /* ImportEqualsDeclaration */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 247 /* ExportSpecifier */: - case 241 /* NamespaceImport */: + case 159 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 158 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 157 /* CallSignature */: return "call" /* callSignatureElement */; + case 154 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 147 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 271 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 148 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 241 /* ImportEqualsDeclaration */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 250 /* ExportSpecifier */: + case 244 /* NamespaceImport */: return "alias" /* alias */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var kind = ts.getSpecialPropertyAssignmentKind(node); var right = node.right; switch (kind) { @@ -80389,6 +82157,8 @@ var ts; case 5 /* Property */: // static method / property return ts.isFunctionExpression(right) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; + case 6 /* Prototype */: + return "local class" /* localClassElement */; default: { ts.assertTypeIsNever(kind); return "" /* unknown */; @@ -80413,7 +82183,7 @@ var ts; return true; case 71 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 147 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 148 /* Parameter */; default: return false; } @@ -80462,42 +82232,42 @@ var ts; return false; } switch (n.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 175 /* ObjectBindingPattern */: - case 164 /* TypeLiteral */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 236 /* CaseBlock */: - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 165 /* TypeLiteral */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 239 /* CaseBlock */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return nodeEndsWith(n, 18 /* CloseBraceToken */, sourceFile); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 183 /* NewExpression */: + case 186 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 182 /* CallExpression */: - case 186 /* ParenthesizedExpression */: - case 169 /* ParenthesizedType */: + case 185 /* CallExpression */: + case 189 /* ParenthesizedExpression */: + case 172 /* ParenthesizedType */: return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 191 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -80507,65 +82277,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 20 /* CloseParenToken */, sourceFile); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 212 /* IfStatement */: + case 215 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 25 /* SemicolonToken */, sourceFile); - case 178 /* ArrayLiteralExpression */: - case 176 /* ArrayBindingPattern */: - case 181 /* ElementAccessExpression */: - case 145 /* ComputedPropertyName */: - case 166 /* TupleType */: + case 181 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 184 /* ElementAccessExpression */: + case 146 /* ComputedPropertyName */: + case 167 /* TupleType */: return nodeEndsWith(n, 22 /* CloseBracketToken */, sourceFile); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 106 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 190 /* TypeOfExpression */: - case 189 /* DeleteExpression */: - case 191 /* VoidExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: + case 193 /* TypeOfExpression */: + case 192 /* DeleteExpression */: + case 194 /* VoidExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -80618,12 +82388,7 @@ var ts; // be parented by the container of the SyntaxList, not the SyntaxList itself. // In order to find the list item index, we first need to locate SyntaxList itself and then search // for the position of the relevant node (or comma). - var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - // find syntax list that covers the span of the node - if (ts.isSyntaxList(c) && c.pos <= node.pos && c.end >= node.end) { - return c; - } - }); + var syntaxList = ts.find(node.parent.getChildren(), function (c) { return ts.isSyntaxList(c) && rangeContainsRange(c, node); }); // Either we didn't find an appropriate list, or the list must contain us. ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); return syntaxList; @@ -80739,19 +82504,11 @@ var ts; var result = find(startNode || sourceFile); ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); return result; - function findRightmostToken(n) { - if (ts.isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } function find(n) { - if (ts.isToken(n)) { + if (isNonWhitespaceToken(n)) { return n; } - var children = n.getChildren(); + var children = n.getChildren(sourceFile); for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). @@ -80767,7 +82524,7 @@ var ts; if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } else { // candidate should be in this node @@ -80775,32 +82532,43 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 269 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 272 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. // Namely we are skipping the check: 'position < node.end' if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } - } - /** - * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. - */ - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - var child = children[i]; - if (isWhiteSpaceOnlyJsxText(child)) { - ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - else if (nodeHasTokens(children[i])) { - return children[i]; - } + return candidate && findRightmostToken(candidate, sourceFile); } } } ts.findPrecedingToken = findPrecedingToken; + function isNonWhitespaceToken(n) { + return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n); + } + function findRightmostToken(n, sourceFile) { + if (isNonWhitespaceToken(n)) { + return n; + } + var children = n.getChildren(sourceFile); + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate, sourceFile); + } + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { + for (var i = exclusiveStartPosition - 1; i >= 0; i--) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } function isInString(sourceFile, position, previousToken) { if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); } if (previousToken && ts.isStringTextContainingNode(previousToken)) { @@ -80836,17 +82604,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
|
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 253 /* JsxClosingElement */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 256 /* JsxClosingElement */) { return true; } return false; @@ -80855,12 +82623,107 @@ var ts; function isWhiteSpaceOnlyJsxText(node) { return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; } - ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); } ts.isInTemplateString = isInTemplateString; + function findPrecedingMatchingToken(token, matchingTokenKind, sourceFile) { + var tokenKind = token.kind; + var remainingMatchingTokens = 0; + while (true) { + token = findPrecedingToken(token.getFullStart(), sourceFile); + if (!token) { + return undefined; + } + if (token.kind === matchingTokenKind) { + if (remainingMatchingTokens === 0) { + return token; + } + remainingMatchingTokens--; + } + else if (token.kind === tokenKind) { + remainingMatchingTokens++; + } + } + } + ts.findPrecedingMatchingToken = findPrecedingMatchingToken; + function isPossiblyTypeArgumentPosition(token, sourceFile) { + // This function determines if the node could be type argument position + // Since during editing, when type argument list is not complete, + // the tree could be of any shape depending on the tokens parsed before current node, + // scanning of the previous identifier followed by "<" before current node would give us better result + // Note that we also balance out the already provided type arguments, arrays, object literals while doing so + var remainingLessThanTokens = 0; + while (token) { + switch (token.kind) { + case 27 /* LessThanToken */: + // Found the beginning of the generic argument expression + token = findPrecedingToken(token.getFullStart(), sourceFile); + var tokenIsIdentifier = token && ts.isIdentifier(token); + if (!remainingLessThanTokens || !tokenIsIdentifier) { + return tokenIsIdentifier; + } + remainingLessThanTokens--; + break; + case 47 /* GreaterThanGreaterThanGreaterThanToken */: + remainingLessThanTokens = +3; + break; + case 46 /* GreaterThanGreaterThanToken */: + remainingLessThanTokens = +2; + break; + case 29 /* GreaterThanToken */: + remainingLessThanTokens++; + break; + case 18 /* CloseBraceToken */: + // This can be object type, skip untill we find the matching open brace token + // Skip untill the matching open brace token + token = findPrecedingMatchingToken(token, 17 /* OpenBraceToken */, sourceFile); + if (!token) + return false; + break; + case 20 /* CloseParenToken */: + // This can be object type, skip untill we find the matching open brace token + // Skip untill the matching open brace token + token = findPrecedingMatchingToken(token, 19 /* OpenParenToken */, sourceFile); + if (!token) + return false; + break; + case 22 /* CloseBracketToken */: + // This can be object type, skip untill we find the matching open brace token + // Skip untill the matching open brace token + token = findPrecedingMatchingToken(token, 21 /* OpenBracketToken */, sourceFile); + if (!token) + return false; + break; + // Valid tokens in a type name. Skip. + case 26 /* CommaToken */: + case 36 /* EqualsGreaterThanToken */: + case 71 /* Identifier */: + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: + case 103 /* TypeOfKeyword */: + case 85 /* ExtendsKeyword */: + case 128 /* KeyOfKeyword */: + case 23 /* DotToken */: + case 49 /* BarToken */: + case 55 /* QuestionToken */: + case 56 /* ColonToken */: + break; + default: + if (ts.isTypeNode(token)) { + break; + } + // Invalid token in type + return false; + } + token = findPrecedingToken(token.getFullStart(), sourceFile); + } + return false; + } + ts.isPossiblyTypeArgumentPosition = isPossiblyTypeArgumentPosition; /** * Returns true if the cursor at position in sourceFile is within a comment. * @@ -80908,10 +82771,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 160 /* TypeReference */ || node.kind === 182 /* CallExpression */) { + if (node.kind === 161 /* TypeReference */ || node.kind === 185 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 230 /* ClassDeclaration */ || node.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 233 /* ClassDeclaration */ || node.kind === 234 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -80963,18 +82826,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 178 /* ArrayLiteralExpression */ || - node.kind === 179 /* ObjectLiteralExpression */) { + if (node.kind === 181 /* ArrayLiteralExpression */ || + node.kind === 182 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 195 /* BinaryExpression */ && + if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 217 /* ForOfStatement */ && + if (node.parent.kind === 220 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -80982,7 +82845,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 265 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 268 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -81016,19 +82879,27 @@ var ts; return ts.createTextSpanFromBounds(range.pos, range.end); } ts.createTextSpanFromRange = createTextSpanFromRange; + function createTextChangeFromStartLength(start, length, newText) { + return createTextChange(ts.createTextSpan(start, length), newText); + } + ts.createTextChangeFromStartLength = createTextChangeFromStartLength; + function createTextChange(span, newText) { + return { span: span, newText: newText }; + } + ts.createTextChange = createTextChange; ts.typeKeywords = [ 119 /* AnyKeyword */, 122 /* BooleanKeyword */, - 127 /* KeyOfKeyword */, - 130 /* NeverKeyword */, + 128 /* KeyOfKeyword */, + 131 /* NeverKeyword */, 95 /* NullKeyword */, - 133 /* NumberKeyword */, - 134 /* ObjectKeyword */, - 136 /* StringKeyword */, - 137 /* SymbolKeyword */, + 134 /* NumberKeyword */, + 135 /* ObjectKeyword */, + 137 /* StringKeyword */, + 138 /* SymbolKeyword */, 105 /* VoidKeyword */, - 139 /* UndefinedKeyword */, - 140 /* UniqueKeyword */, + 140 /* UndefinedKeyword */, + 141 /* UniqueKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); @@ -81076,7 +82947,7 @@ var ts; /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 147 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 148 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -81269,7 +83140,7 @@ var ts; ts.signatureToDisplayParts = signatureToDisplayParts; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 243 /* ImportSpecifier */ || location.parent.kind === 247 /* ExportSpecifier */) && + (location.parent.kind === 246 /* ImportSpecifier */ || location.parent.kind === 250 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -81356,32 +83227,30 @@ var ts; */ /* @internal */ function suppressLeadingAndTrailingTrivia(node) { - ts.Debug.assert(node !== undefined); - suppressLeading(node); - suppressTrailing(node); - function suppressLeading(node) { - ts.addEmitFlags(node, 512 /* NoLeadingComments */); - var firstChild = ts.forEachChild(node, function (child) { return child; }); - if (firstChild) { - suppressLeading(firstChild); - } - } - function suppressTrailing(node) { - ts.addEmitFlags(node, 1024 /* NoTrailingComments */); - var lastChild = undefined; - ts.forEachChild(node, function (child) { return (lastChild = child, undefined); }, function (children) { - // As an optimization, jump straight to the end of the list. - if (children.length) { - lastChild = ts.last(children); - } - return undefined; - }); - if (lastChild) { - suppressTrailing(lastChild); - } + ts.Debug.assertDefined(node); + suppress(node, 512 /* NoLeadingComments */, getFirstChild); + suppress(node, 1024 /* NoTrailingComments */, getLastChild); + function suppress(node, flag, getChild) { + ts.addEmitFlags(node, flag); + var child = getChild(node); + if (child) + suppress(child, flag, getChild); } } ts.suppressLeadingAndTrailingTrivia = suppressLeadingAndTrailingTrivia; + function getFirstChild(node) { + return node.forEachChild(function (child) { return child; }); + } + function getLastChild(node) { + var lastChild; + node.forEachChild(function (child) { lastChild = child; }, function (children) { + // As an optimization, jump straight to the end of the list. + if (children.length) { + lastChild = ts.last(children); + } + }); + return lastChild; + } })(ts || (ts = {})); var ts; (function (ts) { @@ -81483,10 +83352,10 @@ var ts; } break; case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -81595,7 +83464,7 @@ var ts; case 13 /* NoSubstitutionTemplateLiteral */: return 4 /* InTemplateHeadOrNoSubstitutionTemplate */; default: - throw ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); + return ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); } } return lastOnTemplateStack === 14 /* TemplateHead */ ? 6 /* InTemplateSubstitutionPosition */ : undefined; @@ -81672,7 +83541,7 @@ var ts; } switch (keyword2) { case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 123 /* ConstructorKeyword */: case 115 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -81702,7 +83571,7 @@ var ts; case 0 /* None */: return { prefix: "" }; default: - throw ts.Debug.assertNever(lexState); + return ts.Debug.assertNever(lexState); } } function isBinaryExpressionOperatorToken(token) { @@ -81811,10 +83680,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -82025,16 +83894,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -82121,22 +83990,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -82164,17 +84033,17 @@ var ts; if (token) { if (tokenKind === 58 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 227 /* VariableDeclaration */ || - token.parent.kind === 150 /* PropertyDeclaration */ || - token.parent.kind === 147 /* Parameter */ || - token.parent.kind === 257 /* JsxAttribute */) { + if (token.parent.kind === 230 /* VariableDeclaration */ || + token.parent.kind === 151 /* PropertyDeclaration */ || + token.parent.kind === 148 /* Parameter */ || + token.parent.kind === 260 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 195 /* BinaryExpression */ || - token.parent.kind === 193 /* PrefixUnaryExpression */ || - token.parent.kind === 194 /* PostfixUnaryExpression */ || - token.parent.kind === 196 /* ConditionalExpression */) { + if (token.parent.kind === 198 /* BinaryExpression */ || + token.parent.kind === 196 /* PrefixUnaryExpression */ || + token.parent.kind === 197 /* PostfixUnaryExpression */ || + token.parent.kind === 199 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -82184,7 +84053,7 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 257 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 260 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 12 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -82200,32 +84069,32 @@ var ts; else if (tokenKind === 71 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 147 /* Parameter */: + case 148 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -82261,6 +84130,9 @@ var ts; (function (Completions) { var PathCompletions; (function (PathCompletions) { + function createPathCompletion(name, kind, span) { + return { name: name, kind: kind, span: span }; + } function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; @@ -82350,7 +84222,7 @@ var ts; } } ts.forEachKey(foundFiles, function (foundFile) { - result.push(createCompletionEntryForModule(foundFile, "script" /* scriptElement */, span)); + result.push(createPathCompletion(foundFile, "script" /* scriptElement */, span)); }); } // If possible, get folder completion as well @@ -82359,7 +84231,7 @@ var ts; for (var _a = 0, directories_1 = directories; _a < directories_1.length; _a++) { var directory = directories_1[_a]; var directoryName = ts.getBaseFileName(ts.normalizePath(directory)); - result.push(createCompletionEntryForModule(directoryName, "directory" /* directory */, span)); + result.push(createPathCompletion(directoryName, "directory" /* directory */, span)); } } } @@ -82386,7 +84258,7 @@ var ts; var _loop_7 = function (name, kind) { // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. if (!result.some(function (entry) { return entry.name === name; })) { - result.push(createCompletionEntryForModule(name, kind, span)); + result.push(createPathCompletion(name, kind, span)); } }; for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host); _i < _a.length; _i++) { @@ -82407,7 +84279,7 @@ var ts; getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); for (var _c = 0, _d = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _c < _d.length; _c++) { var moduleName = _d[_c]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); } return result; } @@ -82546,7 +84418,7 @@ var ts; try { typeRoots = ts.getEffectiveTypeRoots(options, host); } - catch (_b) { } + catch ( /* Wrap in try catch because getEffectiveTypeRoots touches the filesystem */_b) { /* Wrap in try catch because getEffectiveTypeRoots touches the filesystem */ } if (typeRoots) { for (var _c = 0, typeRoots_2 = typeRoots; _c < typeRoots_2.length; _c++) { var root = typeRoots_2[_c]; @@ -82578,7 +84450,7 @@ var ts; } function pushResult(moduleName) { if (!seen.has(moduleName)) { - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); seen.set(moduleName, true); } } @@ -82640,9 +84512,6 @@ var ts; } } } - function createCompletionEntryForModule(name, kind, replacementSpan) { - return { name: name, kind: kind, kindModifiers: "" /* none */, sortText: name, replacementSpan: replacementSpan }; - } // Replace everything after the last directory seperator that appears function getDirectoryFragmentTextSpan(text, textStart) { var index = text.lastIndexOf(ts.directorySeparator); @@ -82659,7 +84528,7 @@ var ts; return false; } function normalizeAndPreserveTrailingSlash(path) { - if (path === "./" || path === ".\\") { + if (ts.normalizeSlashes(path) === "./") { // normalizePath turns "./" into "". "" + "/" would then be a rooted path instead of a relative one, so avoid this particular case. // There is no problem for adding "/" to a non-empty string -- it's only a problem at the beginning. return ""; @@ -82697,7 +84566,7 @@ var ts; try { return ts.directoryProbablyExists(path, host); } - catch (_a) { } + catch ( /*ignore*/_a) { /*ignore*/ } return undefined; } function tryIOAndConsumeErrors(host, toApply) { @@ -82708,7 +84577,7 @@ var ts; try { return toApply && toApply.apply(host, args); } - catch (_a) { } + catch ( /*ignore*/_a) { /*ignore*/ } return undefined; } })(PathCompletions = Completions.PathCompletions || (Completions.PathCompletions = {})); @@ -82731,13 +84600,13 @@ var ts; function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position, allSourceFiles, options) { if (ts.isInReferenceComment(sourceFile, position)) { var entries = Completions.PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host); - return entries && pathCompletionsInfo(entries); + return entries && convertPathCompletions(entries); } var contextToken = ts.findPrecedingToken(position, sourceFile); if (ts.isInString(sourceFile, position, contextToken)) { - return !contextToken || !ts.isStringLiteral(contextToken) && !ts.isNoSubstitutionTemplateLiteral(contextToken) + return !contextToken || !ts.isStringLiteralLike(contextToken) ? undefined - : getStringLiteralCompletionEntries(sourceFile, contextToken, position, typeChecker, compilerOptions, host, log); + : convertStringLiteralCompletions(getStringLiteralCompletionEntries(sourceFile, contextToken, position, typeChecker, compilerOptions, host), sourceFile, typeChecker, log); } if (contextToken && ts.isBreakOrContinueStatement(contextToken.parent) && (contextToken.kind === 72 /* BreakKeyword */ || contextToken.kind === 77 /* ContinueKeyword */ || contextToken.kind === 71 /* Identifier */)) { @@ -82759,15 +84628,44 @@ var ts; case 3 /* JsDocParameterName */: return jsdocCompletionInfo(ts.JsDoc.getJSDocParameterNameCompletions(completionData.tag)); default: - throw ts.Debug.assertNever(completionData); + return ts.Debug.assertNever(completionData); } } Completions.getCompletionsAtPosition = getCompletionsAtPosition; + function convertStringLiteralCompletions(completion, sourceFile, checker, log) { + if (completion === undefined) { + return undefined; + } + switch (completion.kind) { + case 0 /* Paths */: + return convertPathCompletions(completion.paths); + case 1 /* Properties */: { + var entries = []; + getCompletionEntriesFromSymbols(completion.symbols, entries, sourceFile, sourceFile, checker, 6 /* ESNext */, log, 4 /* String */); // Target will not be used, so arbitrary + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + } + case 2 /* Types */: { + var entries = completion.types.map(function (type) { return ({ name: type.value, kindModifiers: "" /* none */, kind: "var" /* variableElement */, sortText: "0" }); }); + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; + } + default: + return ts.Debug.assertNever(completion); + } + } + function convertPathCompletions(pathCompletions) { + var isGlobalCompletion = false; // We don't want the editor to offer any other completions, such as snippets, inside a comment. + var isNewIdentifierLocation = true; // The user may type in a path that doesn't yet exist, creating a "new identifier" with respect to the collection of identifiers the server is aware of. + var entries = pathCompletions.map(function (_a) { + var name = _a.name, kind = _a.kind, span = _a.span; + return ({ name: name, kind: kind, kindModifiers: "" /* none */, sortText: "0", replacementSpan: span }); + }); + return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: false, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + } function jsdocCompletionInfo(entries) { return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } function completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, includeInsertTextCompletions) { - var symbols = completionData.symbols, completionKind = completionData.completionKind, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer; + var symbols = completionData.symbols, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer; if (sourceFile.languageVariant === 1 /* JSX */ && location && location.parent && ts.isJsxClosingElement(location.parent)) { // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. @@ -82802,7 +84700,7 @@ var ts; if (keywordFilters !== 0 /* None */ || !isMemberCompletion) { ts.addRange(entries, getKeywordCompletions(keywordFilters)); } - return { isGlobalCompletion: completionKind === 1 /* Global */, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + return { isGlobalCompletion: isInSnippetScope, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } function isMemberCompletionKind(kind) { switch (kind) { @@ -82928,141 +84826,6 @@ var ts; return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } } - function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host, log) { - switch (node.parent.kind) { - case 174 /* LiteralType */: - switch (node.parent.parent.kind) { - case 160 /* TypeReference */: - // TODO: GH#21168 - return undefined; - case 172 /* IndexedAccessType */: - // Get all apparent property names - // i.e. interface Foo { - // foo: string; - // bar: string; - // } - // let x: Foo["/*completion position*/"] - var type = typeChecker.getTypeFromTypeNode(node.parent.parent.objectType); - return getStringLiteralCompletionEntriesFromElementAccessOrIndexedAccess(node, sourceFile, type, typeChecker, compilerOptions.target, log); - default: - return undefined; - } - case 265 /* PropertyAssignment */: - if (node.parent.parent.kind === 179 /* ObjectLiteralExpression */ && - node.parent.name === node) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent, sourceFile, typeChecker, compilerOptions.target, log); - } - return fromContextualType(); - case 181 /* ElementAccessExpression */: { - var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression; - if (node === argumentExpression) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - var type = typeChecker.getTypeAtLocation(expression); - return getStringLiteralCompletionEntriesFromElementAccessOrIndexedAccess(node, sourceFile, type, typeChecker, compilerOptions.target, log); - } - break; - } - case 182 /* CallExpression */: - case 183 /* NewExpression */: - if (!ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) && !ts.isImportCall(node.parent)) { - var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return argumentInfo ? getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) : fromContextualType(); - } - // falls through - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: - case 249 /* ExternalModuleReference */: - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // var y = import("/*completion position*/"); - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - // export * from "/*completion position*/"; - return pathCompletionsInfo(Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker)); - default: - return fromContextualType(); - } - function fromContextualType() { - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromType(getContextualTypeFromParent(node, typeChecker), typeChecker); - } - } - function pathCompletionsInfo(entries) { - return { - // We don't want the editor to offer any other completions, such as snippets, inside a comment. - isGlobalCompletion: false, - isMemberCompletion: false, - // The user may type in a path that doesn't yet exist, creating a "new identifier" - // with respect to the collection of identifiers the server is aware of. - isNewIdentifierLocation: true, - entries: entries, - }; - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element, sourceFile, typeChecker, target, log) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, sourceFile, typeChecker, target, log, 4 /* String */); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { - var candidates = []; - var entries = []; - var uniques = ts.createMap(); - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates, argumentInfo.argumentCount); - for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { - var candidate = candidates_1[_i]; - addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker, uniques); - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccessOrIndexedAccess(stringLiteralNode, sourceFile, type, typeChecker, target, log) { - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, stringLiteralNode, sourceFile, typeChecker, target, log, 4 /* String */); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromType(type, typeChecker) { - if (type) { - var entries = []; - addStringLiteralCompletionsFromType(type, entries, typeChecker); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; - } - } - return undefined; - } function getLabelStatementCompletions(node) { var entries = []; var uniques = ts.createMap(); @@ -83087,32 +84850,105 @@ var ts; } return entries; } - function addStringLiteralCompletionsFromType(type, result, typeChecker, uniques) { + var StringLiteralCompletionKind; + (function (StringLiteralCompletionKind) { + StringLiteralCompletionKind[StringLiteralCompletionKind["Paths"] = 0] = "Paths"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Properties"] = 1] = "Properties"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; + })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); + function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { + switch (node.parent.kind) { + case 177 /* LiteralType */: + switch (node.parent.parent.kind) { + case 161 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(node.parent), typeChecker) }; + case 175 /* IndexedAccessType */: + // Get all apparent property names + // i.e. interface Foo { + // foo: string; + // bar: string; + // } + // let x: Foo["/*completion position*/"] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeFromTypeNode(node.parent.parent.objectType).getApparentProperties() }; + default: + return undefined; + } + case 268 /* PropertyAssignment */: + if (ts.isObjectLiteralExpression(node.parent.parent) && node.parent.name === node) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + var type = typeChecker.getContextualType(node.parent.parent); + return { kind: 1 /* Properties */, symbols: type && type.getApparentProperties() }; + } + return fromContextualType(); + case 184 /* ElementAccessExpression */: { + var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeAtLocation(expression).getApparentProperties() }; + } + return undefined; + } + case 185 /* CallExpression */: + case 186 /* NewExpression */: + if (!ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) && !ts.isImportCall(node.parent)) { + var argumentInfo_1 = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + if (argumentInfo_1) { + var candidates = []; + typeChecker.getResolvedSignature(argumentInfo_1.invocation, candidates, argumentInfo_1.argumentCount); + var uniques_1 = ts.createMap(); + return { kind: 2 /* Types */, types: ts.flatMap(candidates, function (candidate) { return getStringLiteralTypes(typeChecker.getParameterType(candidate, argumentInfo_1.argumentIndex), typeChecker, uniques_1); }) }; + } + return fromContextualType(); + } + // falls through (is `require("")` or `import("")`) + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 252 /* ExternalModuleReference */: + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // var y = import("/*completion position*/"); + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + // export * from "/*completion position*/"; + return { kind: 0 /* Paths */, paths: Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; + default: + return fromContextualType(); + } + function fromContextualType() { + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker), typeChecker) }; + } + } + function getStringLiteralTypes(type, typeChecker, uniques) { if (uniques === void 0) { uniques = ts.createMap(); } if (type && type.flags & 32768 /* TypeParameter */) { - type = typeChecker.getBaseConstraintOfType(type); - } - if (!type) { - return; - } - if (type.flags & 131072 /* Union */) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - addStringLiteralCompletionsFromType(t, result, typeChecker, uniques); - } - } - else if (type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */)) { - var name = type.value; - if (!uniques.has(name)) { - uniques.set(name, true); - result.push({ - name: name, - kindModifiers: "" /* none */, - kind: "var" /* variableElement */, - sortText: "0" - }); - } + type = type.getConstraint(); } + return type && type.flags & 131072 /* Union */ + ? ts.flatMap(type.types, function (t) { return getStringLiteralTypes(t, typeChecker, uniques); }) + : type && type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */) && ts.addToSeen(uniques, type.value) + ? [type] + : ts.emptyArray; } function getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, _a, allSourceFiles) { var name = _a.name, source = _a.source; @@ -83193,36 +85029,10 @@ var ts; : { codeActions: undefined, sourceDisplay: undefined }; } function getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { - var moduleSymbol = symbolOriginInfo.moduleSymbol, isDefaultExport = symbolOriginInfo.isDefaultExport; + var moduleSymbol = symbolOriginInfo.moduleSymbol; var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); - var moduleSymbols = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); - ts.Debug.assert(ts.contains(moduleSymbols, moduleSymbol)); - var sourceDisplay = [ts.textPart(ts.first(ts.codefix.getModuleSpecifiersForNewImport(program, sourceFile, moduleSymbols, compilerOptions, getCanonicalFileName, host)))]; - var codeActions = ts.codefix.getCodeActionForImport(moduleSymbols, { - host: host, - program: program, - checker: checker, - compilerOptions: compilerOptions, - sourceFile: sourceFile, - formatContext: formatContext, - symbolName: getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), - getCanonicalFileName: getCanonicalFileName, - symbolToken: ts.tryCast(previousToken, ts.isIdentifier), - kind: isDefaultExport ? 1 /* Default */ : 0 /* Named */, - }).slice(0, 1); // Only take the first code action - return { sourceDisplay: sourceDisplay, codeActions: codeActions }; - } - function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { - var result = []; - ts.codefix.forEachExternalModule(checker, allSourceFiles, function (module) { - for (var _i = 0, _a = checker.getExportsOfModule(module); _i < _a.length; _i++) { - var exported = _a[_i]; - if (ts.skipAlias(exported, checker) === exportedSymbol) { - result.push(module); - } - } - }); - return result; + var _a = ts.codefix.getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, previousToken), moduleSpecifier = _a.moduleSpecifier, codeAction = _a.codeAction; + return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] }; } function getCompletionEntrySymbol(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles) { var completion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); @@ -83239,52 +85049,65 @@ var ts; var CompletionKind; (function (CompletionKind) { CompletionKind[CompletionKind["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; - /** Note that sometimes we access completions from global scope, but use "None" instead of this. See isGlobalCompletionScope. */ CompletionKind[CompletionKind["Global"] = 1] = "Global"; CompletionKind[CompletionKind["PropertyAccess"] = 2] = "PropertyAccess"; CompletionKind[CompletionKind["MemberLike"] = 3] = "MemberLike"; CompletionKind[CompletionKind["String"] = 4] = "String"; CompletionKind[CompletionKind["None"] = 5] = "None"; })(CompletionKind || (CompletionKind = {})); - function getRecommendedCompletion(currentToken, checker) { - var ty = getContextualType(currentToken, checker); + function getRecommendedCompletion(currentToken, position, sourceFile, checker) { + var ty = getContextualType(currentToken, position, sourceFile, checker); var symbol = ty && ty.symbol; // Don't include make a recommended completion for an abstract class return symbol && (symbol.flags & 384 /* Enum */ || symbol.flags & 32 /* Class */ && !ts.isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, currentToken, checker) : undefined; } - function getContextualType(currentToken, checker) { + function getContextualType(currentToken, position, sourceFile, checker) { var parent = currentToken.parent; switch (currentToken.kind) { case 71 /* Identifier */: return getContextualTypeFromParent(currentToken, checker); case 58 /* EqualsToken */: - return ts.isVariableDeclaration(parent) ? checker.getContextualType(parent.initializer) : - ts.isBinaryExpression(parent) ? checker.getTypeAtLocation(parent.left) : undefined; + switch (parent.kind) { + case 230 /* VariableDeclaration */: + return checker.getContextualType(parent.initializer); + case 198 /* BinaryExpression */: + return checker.getTypeAtLocation(parent.left); + case 260 /* JsxAttribute */: + return checker.getContextualTypeForJsxAttribute(parent); + default: + return undefined; + } case 94 /* NewKeyword */: return checker.getContextualType(parent); case 73 /* CaseKeyword */: - return getSwitchedType(ts.cast(currentToken.parent, ts.isCaseClause), checker); + return getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); + case 17 /* OpenBraceToken */: + return ts.isJsxExpression(parent) && parent.parent.kind !== 253 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: - return isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) - // completion at `x ===/**/` should be for the right side - ? checker.getTypeAtLocation(parent.left) - : checker.getContextualType(currentToken); + var argInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(currentToken, position, sourceFile); + return argInfo + // At `,`, treat this as the next argument after the comma. + ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (currentToken.kind === 26 /* CommaToken */ ? 1 : 0)) + : isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) + // completion at `x ===/**/` should be for the right side + ? checker.getTypeAtLocation(parent.left) + : checker.getContextualType(currentToken); } } function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 183 /* NewExpression */: + case 186 /* NewExpression */: return checker.getContextualType(parent); - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 261 /* CaseClause */: + case 264 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -83297,10 +85120,10 @@ var ts; var chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ 67108863 /* All */, /*useOnlyExternalAliasing*/ false); if (chain) return ts.first(chain); - return isModuleSymbol(symbol.parent) ? symbol : symbol.parent && getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 269 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 272 /* SourceFile */; }); } function getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, options, target) { var start = ts.timestamp(); @@ -83312,6 +85135,7 @@ var ts; var insideComment = ts.isInComment(sourceFile, position, currentToken); log("getCompletionData: Is inside comment: " + (ts.timestamp() - start)); var insideJsDocTagTypeExpression = false; + var isInSnippetScope = false; if (insideComment) { if (ts.hasDocComment(sourceFile, position)) { if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { @@ -83350,11 +85174,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 271 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 274 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ true); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 289 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 292 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -83404,11 +85228,11 @@ var ts; if (contextToken.kind === 23 /* DotToken */) { isRightOfDot = true; switch (parent.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; break; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: node = parent.left; break; default: @@ -83421,32 +85245,47 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 180 /* PropertyAccessExpression */) { + if (parent && parent.kind === 183 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } + // Fix location + if (currentToken.parent === location) { + switch (currentToken.kind) { + case 29 /* GreaterThanToken */: + if (currentToken.parent.kind === 253 /* JsxElement */ || currentToken.parent.kind === 255 /* JsxOpeningElement */) { + location = currentToken; + } + break; + case 41 /* SlashToken */: + if (currentToken.parent.kind === 254 /* JsxSelfClosingElement */) { + location = currentToken; + } + break; + } + } switch (parent.kind) { - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (contextToken.kind === 41 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (!(parent.left.flags & 32768 /* ThisNodeHasError */)) { // It has a left-hand side, so we're not in an opening JSX tag. break; } // falls through - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: + case 255 /* JsxOpeningElement */: if (contextToken.kind === 27 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: switch (previousToken.kind) { case 58 /* EqualsToken */: isJsxInitializer = true; @@ -83470,9 +85309,9 @@ var ts; getTypeScriptMemberSymbols(); } else if (isRightOfOpenTag) { - var tagSymbols = typeChecker.getJsxIntrinsicTagNames(); + var tagSymbols = ts.Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNamesAt(location), "getJsxIntrinsicTagNames() should all be defined"); if (tryGetGlobalSymbols()) { - symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & (107455 /* Value */ | 2097152 /* Alias */)); })); + symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & (67216319 /* Value */ | 2097152 /* Alias */)); })); } else { symbols = tagSymbols; @@ -83482,7 +85321,7 @@ var ts; else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; var tagSymbol = typeChecker.getSymbolAtLocation(tagName); - if (!typeChecker.isUnknownSymbol(tagSymbol)) { + if (tagSymbol) { symbols = [tagSymbol]; } completionKind = 3 /* MemberLike */; @@ -83496,15 +85335,15 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - var recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, typeChecker); - return { kind: 0 /* Data */, symbols: symbols, completionKind: completionKind, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer }; + var recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, position, sourceFile, typeChecker); + return { kind: 0 /* Data */, symbols: symbols, completionKind: completionKind, isInSnippetScope: isInSnippetScope, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: - case 285 /* JSDocReturnTag */: - case 286 /* JSDocTypeTag */: - case 288 /* JSDocTypedefTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: + case 288 /* JSDocReturnTag */: + case 289 /* JSDocTypeTag */: + case 291 /* JSDocTypedefTag */: return true; } } @@ -83514,16 +85353,17 @@ var ts; // Since this is qualified name check its a type node location var isTypeLocation = insideJsDocTagTypeExpression || ts.isPartOfTypeNode(node.parent); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); + var allowTypeOrValue = isRhsOfImportDeclaration || (!isTypeLocation && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile)); if (ts.isEntityName(node)) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { symbol = ts.skipAlias(symbol, typeChecker); if (symbol.flags & (1536 /* Module */ | 384 /* Enum */)) { // Extract module or enum members - var exportedSymbols = typeChecker.getExportsOfModule(symbol); + var exportedSymbols = ts.Debug.assertEachDefined(typeChecker.getExportsOfModule(symbol), "getExportsOfModule() should all be defined"); var isValidValueAccess_1 = function (symbol) { return typeChecker.isValidPropertyAccess((node.parent), symbol.name); }; var isValidTypeAccess_1 = function (symbol) { return symbolCanBeReferencedAtTypeLocation(symbol); }; - var isValidAccess = isRhsOfImportDeclaration ? + var isValidAccess = allowTypeOrValue ? // Any kind is allowed when dotting off namespace in internal import equals declaration function (symbol) { return isValidTypeAccess_1(symbol) || isValidValueAccess_1(symbol); } : isTypeLocation ? isValidTypeAccess_1 : isValidValueAccess_1; @@ -83534,7 +85374,7 @@ var ts; } } // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). - if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 269 /* SourceFile */ && d.kind !== 234 /* ModuleDeclaration */ && d.kind !== 233 /* EnumDeclaration */; })) { + if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 272 /* SourceFile */ && d.kind !== 237 /* ModuleDeclaration */ && d.kind !== 236 /* EnumDeclaration */; })) { addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node)); } return; @@ -83585,9 +85425,6 @@ var ts; keywordFilters = 2 /* ConstructorParameterKeywords */; return true; } - if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { - keywordFilters = 3 /* FunctionLikeBodyKeywords */; - } if (classLikeContainer = tryGetClassLikeCompletionContainer(contextToken)) { // cursor inside class declaration getGetClassLikeCompletionSymbols(classLikeContainer); @@ -83595,7 +85432,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 251 /* JsxSelfClosingElement */) || (jsxContainer.kind === 252 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 254 /* JsxSelfClosingElement */) || (jsxContainer.kind === 255 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { @@ -83606,8 +85443,11 @@ var ts; } } } + if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { + keywordFilters = 3 /* FunctionLikeBodyKeywords */; + } // Get all entities in the current scope. - completionKind = 5 /* None */; + completionKind = 1 /* Global */; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); @@ -83641,13 +85481,11 @@ var ts; previousToken.getStart() : position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - if (isGlobalCompletionScope(scopeNode)) { - completionKind = 1 /* Global */; - } - var symbolMeanings = 793064 /* Type */ | 107455 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); + isInSnippetScope = isSnippetScope(scopeNode); + var symbolMeanings = 67901928 /* Type */ | 67216319 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; + symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (options.includeInsertTextCompletions && scopeNode.kind !== 269 /* SourceFile */) { + if (options.includeInsertTextCompletions && scopeNode.kind !== 272 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode); if (thisType) { for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker, /*isForAccess*/ true); _i < _a.length; _i++) { @@ -83663,20 +85501,21 @@ var ts; filterGlobalCompletion(symbols); return true; } - function isGlobalCompletionScope(scopeNode) { + function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 269 /* SourceFile */: - case 197 /* TemplateExpression */: - case 260 /* JsxExpression */: - case 208 /* Block */: + case 272 /* SourceFile */: + case 200 /* TemplateExpression */: + case 263 /* JsxExpression */: + case 211 /* Block */: return true; default: return ts.isStatement(scopeNode); } } function filterGlobalCompletion(symbols) { - var isTypeCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); - if (isTypeCompletion) + var isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + var allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile); + if (isTypeOnlyCompletion) keywordFilters = 4 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { @@ -83689,34 +85528,37 @@ var ts; if (ts.isInRightSideOfInternalImportEqualsDeclaration(location)) { return !!(symbol.flags & 1920 /* Namespace */); } - if (isTypeCompletion) { + if (allowTypes) { // Its a type, but you can reach it by namespace.type as well - return symbolCanBeReferencedAtTypeLocation(symbol); + var symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol); + if (symbolAllowedAsType || isTypeOnlyCompletion) { + return symbolAllowedAsType; + } } } // expressions are value space (which includes the value namespaces) - return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 107455 /* Value */); + return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67216319 /* Value */); }); } function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 103 /* TypeOfKeyword */ && - contextToken.parent.kind === 163 /* TypeQuery */; + (contextToken.parent.kind === 164 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 56 /* ColonToken */: - return parentKind === 150 /* PropertyDeclaration */ || - parentKind === 149 /* PropertySignature */ || - parentKind === 147 /* Parameter */ || - parentKind === 227 /* VariableDeclaration */ || + return parentKind === 151 /* PropertyDeclaration */ || + parentKind === 150 /* PropertySignature */ || + parentKind === 148 /* Parameter */ || + parentKind === 230 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 58 /* EqualsToken */: - return parentKind === 232 /* TypeAliasDeclaration */; + return parentKind === 235 /* TypeAliasDeclaration */; case 118 /* AsKeyword */: - return parentKind === 203 /* AsExpression */; + return parentKind === 206 /* AsExpression */; } } return false; @@ -83725,7 +85567,7 @@ var ts; symbol = symbol.exportSymbol || symbol; // This is an alias, follow what it aliases symbol = ts.skipAlias(symbol, typeChecker); - if (symbol.flags & 793064 /* Type */) { + if (symbol.flags & 67901928 /* Type */) { return true; } if (symbol.flags & 1536 /* Module */) { @@ -83741,6 +85583,9 @@ var ts; for (var _i = 0, _a = typeChecker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { var symbol = _a[_i]; // Don't add a completion for a re-export, only for the original. + // The actual import fix might end up coming from a re-export -- we don't compute that until getting completion details. + // This is just to avoid adding duplicate completion entries. + // // If `symbol.parent !== ...`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. // If `some(...)`, this comes from an `export { foo } from "foo"` re-export, which creates a new symbol (thus isn't caught by the first check). if (typeChecker.getMergedSymbol(symbol.parent) !== typeChecker.resolveExternalModuleSymbol(moduleSymbol) @@ -83805,11 +85650,11 @@ var ts; return true; } if (contextToken.kind === 29 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 252 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 255 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 253 /* JsxClosingElement */ || contextToken.parent.kind === 251 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 250 /* JsxElement */; + if (contextToken.parent.kind === 256 /* JsxClosingElement */ || contextToken.parent.kind === 254 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 253 /* JsxElement */; } } return false; @@ -83819,40 +85664,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 182 /* CallExpression */ // func( a, | - || containingNodeKind === 153 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 183 /* NewExpression */ // new C(a, | - || containingNodeKind === 178 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 195 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 161 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 185 /* CallExpression */ // func( a, | + || containingNodeKind === 154 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 186 /* NewExpression */ // new C(a, | + || containingNodeKind === 181 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 198 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 162 /* FunctionType */; // var x: (s: string, list| case 19 /* OpenParenToken */: - return containingNodeKind === 182 /* CallExpression */ // func( | - || containingNodeKind === 153 /* Constructor */ // constructor( | - || containingNodeKind === 183 /* NewExpression */ // new C(a| - || containingNodeKind === 186 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 169 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 185 /* CallExpression */ // func( | + || containingNodeKind === 154 /* Constructor */ // constructor( | + || containingNodeKind === 186 /* NewExpression */ // new C(a| + || containingNodeKind === 189 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 172 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 21 /* OpenBracketToken */: - return containingNodeKind === 178 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 158 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 145 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 128 /* ModuleKeyword */: // module | - case 129 /* NamespaceKeyword */:// namespace | + return containingNodeKind === 181 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 159 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 146 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 129 /* ModuleKeyword */: // module | + case 130 /* NamespaceKeyword */: // namespace | return true; case 23 /* DotToken */: - return containingNodeKind === 234 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 237 /* ModuleDeclaration */; // module A.| case 17 /* OpenBraceToken */: - return containingNodeKind === 230 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 233 /* ClassDeclaration */; // class A{ | case 58 /* EqualsToken */: - return containingNodeKind === 227 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 195 /* BinaryExpression */; // x = a| + return containingNodeKind === 230 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 198 /* BinaryExpression */; // x = a| case 14 /* TemplateHead */: - return containingNodeKind === 197 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 200 /* TemplateExpression */; // `aa ${| case 15 /* TemplateMiddle */: - return containingNodeKind === 206 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 209 /* TemplateSpan */; // `aa ${10} dd ${| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 151 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -83895,7 +85740,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 179 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 182 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -83906,23 +85751,23 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 175 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 178 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); if (!ts.isVariableLike(rootDeclaration)) - throw ts.Debug.fail("Root declaration is not variable-like."); + return ts.Debug.fail("Root declaration is not variable-like."); // We don't want to complete using the type acquired by the shape // of the binding pattern; we are only interested in types acquired // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 217 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 147 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 220 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 148 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 152 /* MethodDeclaration */ || rootDeclaration.parent.kind === 155 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 153 /* MethodDeclaration */ || rootDeclaration.parent.kind === 156 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -83937,7 +85782,7 @@ var ts; } if (typeMembers && typeMembers.length > 0) { // Add filtered items to the completion list - symbols = filterObjectMembersList(typeMembers, existingMembers); + symbols = filterObjectMembersList(typeMembers, ts.Debug.assertDefined(existingMembers)); } return true; } @@ -83957,9 +85802,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 242 /* NamedImports */ ? - 239 /* ImportDeclaration */ : - 245 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 245 /* NamedImports */ ? + 242 /* ImportDeclaration */ : + 248 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -84031,7 +85876,7 @@ var ts; if (contextToken) { switch (contextToken.kind) { case 17 /* OpenBraceToken */: // const x = { | - case 26 /* CommaToken */:// const x = { a: 0, | + case 26 /* CommaToken */: // const x = { a: 0, | var parent = contextToken.parent; if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) { return parent; @@ -84049,10 +85894,10 @@ var ts; if (contextToken) { switch (contextToken.kind) { case 17 /* OpenBraceToken */: // import { | - case 26 /* CommaToken */:// import { a as 0, | + case 26 /* CommaToken */: // import { a as 0, | switch (contextToken.parent.kind) { - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return contextToken.parent; } } @@ -84077,7 +85922,7 @@ var ts; function tryGetClassLikeCompletionContainer(contextToken) { if (contextToken) { switch (contextToken.kind) { - case 17 /* OpenBraceToken */:// class c { | + case 17 /* OpenBraceToken */: // class c { | if (ts.isClassLike(contextToken.parent)) { return contextToken.parent; } @@ -84110,7 +85955,7 @@ var ts; } } // class c { method() { } | method2() { } } - if (location && location.kind === 290 /* SyntaxList */ && ts.isClassLike(location.parent)) { + if (location && location.kind === 293 /* SyntaxList */ && ts.isClassLike(location.parent)) { return location.parent; } return undefined; @@ -84155,14 +86000,14 @@ var ts; case 28 /* LessThanSlashToken */: case 41 /* SlashToken */: case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 258 /* JsxAttributes */: - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 251 /* JsxSelfClosingElement */ || parent.kind === 252 /* JsxOpeningElement */)) { + case 183 /* PropertyAccessExpression */: + case 261 /* JsxAttributes */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 254 /* JsxSelfClosingElement */ || parent.kind === 255 /* JsxOpeningElement */)) { return parent; } - else if (parent.kind === 257 /* JsxAttribute */) { + else if (parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84174,7 +86019,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent && ((parent.kind === 257 /* JsxAttribute */) || (parent.kind === 259 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 260 /* JsxAttribute */) || (parent.kind === 262 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84184,8 +86029,8 @@ var ts; break; case 18 /* CloseBraceToken */: if (parent && - parent.kind === 260 /* JsxExpression */ && - parent.parent && parent.parent.kind === 257 /* JsxAttribute */) { + parent.kind === 263 /* JsxExpression */ && + parent.parent && parent.parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84193,7 +86038,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 259 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 262 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84212,59 +86057,59 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 227 /* VariableDeclaration */ || - containingNodeKind === 228 /* VariableDeclarationList */ || - containingNodeKind === 209 /* VariableStatement */ || - containingNodeKind === 233 /* EnumDeclaration */ || // enum a { foo, | + return containingNodeKind === 230 /* VariableDeclaration */ || + containingNodeKind === 231 /* VariableDeclarationList */ || + containingNodeKind === 212 /* VariableStatement */ || + containingNodeKind === 236 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 23 /* DotToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [.| case 56 /* ColonToken */: - return containingNodeKind === 177 /* BindingElement */; // var {x :html| + return containingNodeKind === 180 /* BindingElement */; // var {x :html| case 21 /* OpenBracketToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [x| case 19 /* OpenParenToken */: - return containingNodeKind === 264 /* CatchClause */ || + return containingNodeKind === 267 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 17 /* OpenBraceToken */: - return containingNodeKind === 233 /* EnumDeclaration */ || // enum a { | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface a { | - containingNodeKind === 164 /* TypeLiteral */; // const x : { | + return containingNodeKind === 236 /* EnumDeclaration */ || // enum a { | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface a { | + containingNodeKind === 165 /* TypeLiteral */; // const x : { | case 25 /* SemicolonToken */: - return containingNodeKind === 149 /* PropertySignature */ && + return containingNodeKind === 150 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 231 /* InterfaceDeclaration */ || // interface a { f; | - contextToken.parent.parent.kind === 164 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 234 /* InterfaceDeclaration */ || // interface a { f; | + contextToken.parent.parent.kind === 165 /* TypeLiteral */); // const x : { a; | case 27 /* LessThanToken */: - return containingNodeKind === 230 /* ClassDeclaration */ || // class A< | - containingNodeKind === 200 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 232 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 233 /* ClassDeclaration */ || // class A< | + containingNodeKind === 203 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 235 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 115 /* StaticKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); + return containingNodeKind === 151 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); case 24 /* DotDotDotToken */: - return containingNodeKind === 147 /* Parameter */ || + return containingNodeKind === 148 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 176 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 179 /* ArrayBindingPattern */); // var [...z| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 147 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); + return containingNodeKind === 148 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); case 118 /* AsKeyword */: - return containingNodeKind === 243 /* ImportSpecifier */ || - containingNodeKind === 247 /* ExportSpecifier */ || - containingNodeKind === 241 /* NamespaceImport */; + return containingNodeKind === 246 /* ImportSpecifier */ || + containingNodeKind === 250 /* ExportSpecifier */ || + containingNodeKind === 244 /* NamespaceImport */; case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: if (isFromClassElementDeclaration(contextToken)) { return false; } @@ -84278,7 +86123,7 @@ var ts; case 110 /* LetKeyword */: case 76 /* ConstKeyword */: case 116 /* YieldKeyword */: - case 138 /* TypeKeyword */:// type htm| + case 139 /* TypeKeyword */: // type htm| return true; } // If the previous token is keyword correspoding to class member completion keyword @@ -84324,7 +86169,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 153 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 154 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -84353,10 +86198,7 @@ var ts; var name = element.propertyName || element.name; existingImportsOrExports.set(name.escapedText, true); } - if (existingImportsOrExports.size === 0) { - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" /* Default */; }); - } - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" /* Default */ && !existingImportsOrExports.get(e.escapedName); }); + return exportsOfModule.filter(function (e) { return e.escapedName !== "default" /* Default */ && !existingImportsOrExports.get(e.escapedName); }); } /** * Filters out completion suggestions for named imports or exports. @@ -84365,19 +86207,19 @@ var ts; * do not occur at the current position and have not otherwise been typed. */ function filterObjectMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { + if (existingMembers.length === 0) { return contextualMemberSymbols; } var existingMemberNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 265 /* PropertyAssignment */ && - m.kind !== 266 /* ShorthandPropertyAssignment */ && - m.kind !== 177 /* BindingElement */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 268 /* PropertyAssignment */ && + m.kind !== 269 /* ShorthandPropertyAssignment */ && + m.kind !== 180 /* BindingElement */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -84385,7 +86227,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 177 /* BindingElement */ && m.propertyName) { + if (m.kind === 180 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 71 /* Identifier */) { existingName = m.propertyName.escapedText; @@ -84396,11 +86238,11 @@ var ts; // NOTE: if one only performs this step when m.name is an identifier, // things like '__proto__' are not filtered out. var name = ts.getNameOfDeclaration(m); - existingName = ts.getEscapedTextOfIdentifierOrLiteral(name); + existingName = ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.escapedName); }); + return contextualMemberSymbols.filter(function (m) { return !existingMemberNames.get(m.escapedName); }); } /** * Filters out completion suggestions for class elements. @@ -84412,10 +86254,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 150 /* PropertyDeclaration */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 151 /* PropertyDeclaration */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -84470,11 +86312,11 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 257 /* JsxAttribute */) { + if (attr.kind === 260 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } } - return ts.filter(symbols, function (a) { return !seenNames.get(a.escapedName); }); + return symbols.filter(function (a) { return !seenNames.get(a.escapedName); }); } function isCurrentlyEditingNode(node) { return node.getStart() <= position && position <= node.getEnd(); @@ -84500,10 +86342,10 @@ var ts; // TODO: GH#18169 return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; case 2 /* PropertyAccess */: - case 5 /* None */: case 1 /* Global */: // Don't add a completion for a name starting with a space. See https://github.com/Microsoft/TypeScript/pull/20547 return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; + case 5 /* None */: case 4 /* String */: return validIdentiferResult; default: @@ -84514,7 +86356,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 72 /* FirstKeyword */; i <= 143 /* LastKeyword */; i++) { + for (var i = 72 /* FirstKeyword */; i <= 144 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -84530,7 +86372,7 @@ var ts; switch (keywordFilter) { case 0 /* None */: // "undefined" is a global variable, so don't need a keyword completion for it. - return kind !== 139 /* UndefinedKeyword */; + return kind !== 140 /* UndefinedKeyword */; case 1 /* ClassElementKeywords */: return isClassMemberCompletionKeyword(kind); case 2 /* ConstructorParameterKeywords */: @@ -84552,9 +86394,9 @@ var ts; case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: case 123 /* ConstructorKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 120 /* AsyncKeyword */: return true; } @@ -84567,7 +86409,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; } } @@ -84579,13 +86421,13 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 123 /* ConstructorKeyword */: case 115 /* StaticKeyword */: case 117 /* AbstractKeyword */: case 125 /* GetKeyword */: - case 135 /* SetKeyword */: - case 139 /* UndefinedKeyword */: + case 136 /* SetKeyword */: + case 140 /* UndefinedKeyword */: return false; } return true; @@ -84637,14 +86479,14 @@ var ts; */ function getPropertiesForCompletion(type, checker, isForAccess) { if (!(type.flags & 131072 /* Union */)) { - return type.getApparentProperties(); + return ts.Debug.assertEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } var types = type.types; // If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals. var filteredTypes = isForAccess ? types : types.filter(function (memberType) { return !(memberType.flags & 16382 /* Primitive */ || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker)); }); - return checker.getAllPossiblePropertiesOfTypes(filteredTypes); + return ts.Debug.assertEachDefined(checker.getAllPossiblePropertiesOfTypes(filteredTypes), "getAllPossiblePropertiesOfTypes() should all be defined"); } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); @@ -84676,30 +86518,17 @@ var ts; } function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken); - return referenceEntries && convertReferencedSymbols(referenceEntries); - } - function convertReferencedSymbols(referenceEntries) { - var fileNameToDocumentHighlights = ts.createMap(); - for (var _i = 0, referenceEntries_1 = referenceEntries; _i < referenceEntries_1.length; _i++) { - var entry = referenceEntries_1[_i]; - var _a = ts.FindAllReferences.toHighlightSpan(entry), fileName = _a.fileName, span_12 = _a.span; - var highlightSpans = fileNameToDocumentHighlights.get(fileName); - if (!highlightSpans) { - fileNameToDocumentHighlights.set(fileName, highlightSpans = []); - } - highlightSpans.push(span_12); - } - return ts.arrayFrom(fileNameToDocumentHighlights.entries(), function (_a) { + if (!referenceEntries) + return undefined; + var map = ts.arrayToMultiMap(referenceEntries.map(ts.FindAllReferences.toHighlightSpan), function (e) { return e.fileName; }, function (e) { return e.span; }); + return ts.arrayFrom(map.entries(), function (_a) { var fileName = _a[0], highlightSpans = _a[1]; return ({ fileName: fileName, highlightSpans: highlightSpans }); }); } function getSyntacticDocumentHighlights(node, sourceFile) { var highlightSpans = getHighlightSpans(node, sourceFile); - if (!highlightSpans || highlightSpans.length === 0) { - return undefined; - } - return [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; + return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; } function getHighlightSpans(node, sourceFile) { switch (node.kind) { @@ -84728,15 +86557,20 @@ var ts; case 81 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); case 123 /* ConstructorKeyword */: - return useParent(node.parent, ts.isConstructorDeclaration, getConstructorOccurrences); + return getFromAllDeclarations(ts.isConstructorDeclaration, [123 /* ConstructorKeyword */]); case 125 /* GetKeyword */: - case 135 /* SetKeyword */: - return useParent(node.parent, ts.isAccessor, getGetAndSetOccurrences); + case 136 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [125 /* GetKeyword */, 136 /* SetKeyword */]); default: return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : undefined; } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, function (decl) { return ts.mapDefined(decl.symbol.declarations, function (d) { + return nodeTest(d) ? ts.find(d.getChildren(sourceFile), function (c) { return ts.contains(keywords, c.kind); }) : undefined; + }); }); + } function useParent(node, nodeTest, getNodes) { return nodeTest(node) ? highlightSpans(getNodes(node, sourceFile)) : undefined; } @@ -84749,30 +86583,15 @@ var ts; * into function boundaries and try-blocks with catch-clauses. */ function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (ts.isThrowStatement(node)) { - statementAccumulator.push(node); - } - else if (ts.isTryStatement(node)) { - if (node.catchClause) { - aggregate(node.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(node.tryBlock); - } - if (node.finallyBlock) { - aggregate(node.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } + if (ts.isThrowStatement(node)) { + return [node]; } + else if (ts.isTryStatement(node)) { + // Exceptions thrown within a try block lacking a catch clause are "owned" in the current context. + return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), aggregateOwnedThrowStatements(node.finallyBlock)); + } + // Do not cross function boundaries. + return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements); } /** * For lack of a better name, this function takes a throw statement and returns the @@ -84783,33 +86602,30 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 269 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 272 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === 225 /* TryStatement */) { - var tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } + if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) { + return child; } child = parent; } return undefined; } function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */) { - statementAccumulator.push(node); + return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + var result = []; + node.forEachChild(function (child) { + var value = cb(child); + if (value !== undefined) { + result.push.apply(result, ts.toArray(value)); } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } + }); + return result; } function ownsBreakOrContinueStatement(owner, statement) { var actualOwner = getBreakOrContinueOwner(statement); @@ -84818,17 +86634,17 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 222 /* SwitchStatement */: - if (statement.kind === 218 /* ContinueStatement */) { + case 225 /* SwitchStatement */: + if (statement.kind === 221 /* ContinueStatement */) { return false; } // falls through - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - return !statement.label || isLabeledBy(node, statement.label.text); + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. // TODO: GH#20090 @@ -84837,10 +86653,6 @@ var ts; }); } function getModifierOccurrences(modifier, declaration) { - // Make sure we only highlight the keyword when it makes sense to do so. - if (!isLegalModifier(modifier, declaration)) { - return undefined; - } var modifierFlag = ts.modifierToFlag(modifier); return ts.mapDefined(getNodesToSearchForModifier(declaration, modifierFlag), function (node) { if (ts.getModifierFlags(node) & modifierFlag) { @@ -84851,24 +86663,28 @@ var ts; }); } function getNodesToSearchForModifier(declaration, modifierFlag) { + // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 208 /* Block */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 211 /* Block */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration - if (modifierFlag & 128 /* Abstract */) { + if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return declaration.members.concat([declaration]); } else { return container.statements; } - case 153 /* Constructor */: - return container.parameters.concat(container.parent.members); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: { + return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : [])); + } + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -84883,33 +86699,7 @@ var ts; } return nodes; default: - ts.Debug.fail("Invalid container kind."); - } - } - function isLegalModifier(modifier, declaration) { - var container = declaration.parent; - switch (modifier) { - case 112 /* PrivateKeyword */: - case 113 /* ProtectedKeyword */: - case 114 /* PublicKeyword */: - switch (container.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return true; - case 153 /* Constructor */: - return declaration.kind === 147 /* Parameter */; - default: - return false; - } - case 115 /* StaticKeyword */: - return container.kind === 230 /* ClassDeclaration */ || container.kind === 200 /* ClassExpression */; - case 84 /* ExportKeyword */: - case 124 /* DeclareKeyword */: - return container.kind === 235 /* ModuleBlock */ || container.kind === 269 /* SourceFile */; - case 117 /* AbstractKeyword */: - return container.kind === 230 /* ClassDeclaration */ || declaration.kind === 230 /* ClassDeclaration */; - default: - return false; + ts.Debug.assertNever(container, "Invalid container kind."); } } function pushKeywordIf(keywordList, token) { @@ -84923,33 +86713,11 @@ var ts; } return false; } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 154 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 155 /* SetAccessor */); - return keywords; - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 125 /* GetKeyword */, 135 /* SetKeyword */); }); - } - } - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 123 /* ConstructorKeyword */); - }); - }); - return keywords; - } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 88 /* ForKeyword */, 106 /* WhileKeyword */, 81 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 213 /* DoStatement */) { + if (loopNode.kind === 216 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 106 /* WhileKeyword */)) { @@ -84958,8 +86726,7 @@ var ts; } } } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */, 77 /* ContinueKeyword */); } @@ -84970,13 +86737,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -84988,8 +86755,7 @@ var ts; // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 73 /* CaseKeyword */, 79 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */); } @@ -85009,36 +86775,36 @@ var ts; } return keywords; } - function getThrowOccurrences(throwStatement) { + function getThrowOccurrences(throwStatement, sourceFile) { var owner = getThrowStatementOwner(throwStatement); if (!owner) { return undefined; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); // If the "owner" is a function, then we equate 'return' and 'throw' statements in their // ability to "jump out" of the function, and include occurrences for both. if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); } return keywords; } - function getReturnOccurrences(returnStatement) { + function getReturnOccurrences(returnStatement, sourceFile) { var func = ts.getContainingFunction(returnStatement); if (!func) { return undefined; } var keywords = []; ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); // Include 'throw' statements that do not occur within a try block. ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); return keywords; } @@ -85102,12 +86868,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 223 /* LabeledStatement */; owner = owner.parent) { - if (owner.label.escapedText === labelName) { - return true; - } - } - return false; + return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName; }); } })(DocumentHighlights = ts.DocumentHighlights || (ts.DocumentHighlights = {})); })(ts || (ts = {})); @@ -85284,10 +87045,10 @@ var ts; } cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 227 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 230 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 71 /* Identifier */) { directImports.push(name); @@ -85298,24 +87059,26 @@ var ts; addIndirectUser(direct.getSourceFile()); } break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name); } else if (ts.isDefaultImport(direct)) { var sourceFileLike = getSourceFileLikeForImportDeclaration(direct); - addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + if (!isAvailableThroughGlobal) { + addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + } directImports.push(direct); } else { directImports.push(direct); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -85336,7 +87099,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 269 /* SourceFile */ || sourceFileLike.kind === 234 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 272 /* SourceFile */ || sourceFileLike.kind === 237 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -85391,7 +87154,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 238 /* ImportEqualsDeclaration */) { + if (decl.kind === 241 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -85405,7 +87168,7 @@ var ts; if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { return; } - if (decl.kind === 245 /* ExportDeclaration */) { + if (decl.kind === 248 /* ExportDeclaration */) { searchForNamedImport(decl.exportClause); return; } @@ -85414,7 +87177,7 @@ var ts; return; } var namedBindings = importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImportLike(namedBindings.name); return; } @@ -85460,13 +87223,13 @@ var ts; if (propertyName) { // This is `import { foo as bar } from "./a"` or `export { foo as bar } from "./a"`. `foo` isn't a local in the file, so just add it as a single reference. singleReferences.push(propertyName); - if (!isForRename) { + if (!isForRename) { // If renaming `foo`, don't touch `bar`, just `foo`. // Search locally for `bar`. addSearch(name, checker.getSymbolAtLocation(name)); } } else { - var localSymbol = element.kind === 247 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 250 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -85482,7 +87245,7 @@ var ts; function findNamespaceReExports(sourceFileLike, name, checker) { var namespaceImportSymbol = checker.getSymbolAtLocation(name); return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { - if (statement.kind !== 245 /* ExportDeclaration */) + if (statement.kind !== 248 /* ExportDeclaration */) return; var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; if (moduleSpecifier || !exportClause) @@ -85501,7 +87264,7 @@ var ts; for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { var referencingFile = sourceFiles_4[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 269 /* SourceFile */) { + if (searchSourceFile.kind === 272 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -85548,7 +87311,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 269 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 272 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -85563,18 +87326,18 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: { + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { action(decl, decl.moduleSpecifier); } break; } - case 238 /* ImportEqualsDeclaration */: { + case 241 /* ImportEqualsDeclaration */: { var decl = statement; var moduleReference = decl.moduleReference; - if (moduleReference.kind === 249 /* ExternalModuleReference */ && + if (moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */) { action(decl, moduleReference.expression); } @@ -85587,11 +87350,11 @@ var ts; function importerFromModuleSpecifier(moduleSpecifier) { var decl = moduleSpecifier.parent; switch (decl.kind) { - case 182 /* CallExpression */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 185 /* CallExpression */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return decl; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return decl.parent; default: ts.Debug.fail("Unexpected module specifier parent: " + decl.kind); @@ -85609,7 +87372,7 @@ var ts; function getExport() { var parent = node.parent; if (symbol.exportSymbol) { - if (parent.kind === 180 /* PropertyAccessExpression */) { + if (parent.kind === 183 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(parent.parent) @@ -85635,12 +87398,15 @@ var ts; return exportInfo(symbol, getExportKindForDeclaration(exportNode)); } } + // If we are in `export = a;` or `export default a;`, `parent` is the export assignment. else if (ts.isExportAssignment(parent)) { return getExportAssignmentExport(parent); } + // If we are in `export = class A {};` (or `export = class A {};`) at `A`, `parent.parent` is the export assignment. else if (ts.isExportAssignment(parent.parent)) { return getExportAssignmentExport(parent.parent); } + // Similar for `module.exports =` and `exports.A =`. else if (ts.isBinaryExpression(parent)) { return getSpecialPropertyExport(parent, /*useLhsSymbol*/ true); } @@ -85650,8 +87416,7 @@ var ts; } function getExportAssignmentExport(ex) { // Get the symbol for the `export =` node; its parent is the module it's the export of. - var exportingModuleSymbol = ex.symbol.parent; - ts.Debug.assert(!!exportingModuleSymbol); + var exportingModuleSymbol = ts.Debug.assertDefined(ex.symbol.parent, "Expected export symbol to have a parent"); var exportKind = ex.isExportEquals ? 2 /* ExportEquals */ : 1 /* Default */; return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } }; } @@ -85667,7 +87432,11 @@ var ts; default: return undefined; } - var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.cast(node.left, ts.isPropertyAccessExpression).name) : symbol; + // Better detection for GH#20803 + if (sym && !(checker.getMergedSymbol(sym.parent).flags & 1536 /* Module */)) { + ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.showSymbol(sym) + ", parent is " + ts.Debug.showSymbol(sym.parent)); + } return sym && exportInfo(sym, kind); } } @@ -85705,24 +87474,24 @@ var ts; FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; function getExportEqualsLocalSymbol(importedSymbol, checker) { if (importedSymbol.flags & 2097152 /* Alias */) { - return checker.getImmediateAliasedSymbol(importedSymbol); + return ts.Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol)); } var decl = importedSymbol.valueDeclaration; - if (ts.isExportAssignment(decl)) { - return decl.expression.symbol; + if (ts.isExportAssignment(decl)) { // `export = class {}` + return ts.Debug.assertDefined(decl.expression.symbol); } - else if (ts.isBinaryExpression(decl)) { - return decl.right.symbol; + else if (ts.isBinaryExpression(decl)) { // `module.exports = class {}` + return ts.Debug.assertDefined(decl.right.symbol); } - ts.Debug.fail(); + return ts.Debug.fail(); } // If a reference is a class expression, the exported node would be its parent. // If a reference is a variable declaration, the exported node would be the variable statement. function getExportNode(parent, node) { - if (parent.kind === 227 /* VariableDeclaration */) { + if (parent.kind === 230 /* VariableDeclaration */) { var p = parent; return p.name !== node ? undefined : - p.parent.kind === 264 /* CatchClause */ ? undefined : p.parent.parent.kind === 209 /* VariableStatement */ ? p.parent.parent : undefined; + p.parent.kind === 267 /* CatchClause */ ? undefined : p.parent.parent.kind === 212 /* VariableStatement */ ? p.parent.parent : undefined; } else { return parent; @@ -85731,15 +87500,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent) ? { isNamedImport: false } : undefined; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return parent.propertyName ? undefined : { isNamedImport: true }; - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return { isNamedImport: false }; default: @@ -85747,7 +87516,10 @@ var ts; } } function getExportInfo(exportSymbol, exportKind, checker) { - var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + var moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return undefined; // This can happen if an `export` is not at the top-level (which is a compile error). + var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation. // `export` may appear in a namespace. In that case, just rely on global search. return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; } @@ -85778,22 +87550,22 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 269 /* SourceFile */) { + if (parent.kind === 272 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 235 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); - return parent.parent; + ts.Debug.assert(parent.kind === 238 /* ModuleBlock */); + return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + return node.kind === 237 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; } function isExternalModuleImportEquals(_a) { var moduleReference = _a.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + return moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -85808,12 +87580,13 @@ var ts; } FindAllReferences.nodeEntry = nodeEntry; function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { - var referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); + var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + var referencedSymbols = FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, /*options*/ {}); var checker = program.getTypeChecker(); return !referencedSymbols || !referencedSymbols.length ? undefined : ts.mapDefined(referencedSymbols, function (_a) { var definition = _a.definition, references = _a.references; // Only include referenced symbols that have a valid definition. - return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }; + return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker, node), references: references.map(toReferenceEntry) }; }); } FindAllReferences.findReferencedSymbols = findReferencedSymbols; @@ -85826,13 +87599,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var result_4 = []; FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_4.push(nodeEntry(node)); }); return result_4; @@ -85849,8 +87622,8 @@ var ts; } } function findReferencedEntries(program, cancellationToken, sourceFiles, sourceFile, position, options) { - var x = flattenEntries(findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options)); - return ts.map(x, toReferenceEntry); + var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), toReferenceEntry); } FindAllReferences.findReferencedEntries = findReferencedEntries; function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options) { @@ -85858,46 +87631,41 @@ var ts; return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)); } FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; - function findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options) { - var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - return FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); - } function flattenEntries(referenceSymbols) { return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); } - function definitionToReferencedSymbolDefinitionInfo(def, checker) { + function definitionToReferencedSymbolDefinitionInfo(def, checker, originalNode) { var info = (function () { switch (def.type) { case "symbol": { - var symbol = def.symbol, node_3 = def.node; - var _a = getDefinitionKindAndDisplayParts(symbol, node_3, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; + var symbol = def.symbol; + var _a = getDefinitionKindAndDisplayParts(symbol, checker, originalNode), displayParts_1 = _a.displayParts, kind_1 = _a.kind; var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: node_3, name: name_4, kind: kind_1, displayParts: displayParts_1 }; + return { node: symbol.declarations ? ts.getNameOfDeclaration(ts.first(symbol.declarations)) || ts.first(symbol.declarations) : originalNode, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case "label": { - var node_4 = def.node; - return { node: node_4, name: node_4.text, kind: "label" /* label */, displayParts: [ts.displayPart(node_4.text, ts.SymbolDisplayPartKind.text)] }; + var node_3 = def.node; + return { node: node_3, name: node_3.text, kind: "label" /* label */, displayParts: [ts.displayPart(node_3.text, ts.SymbolDisplayPartKind.text)] }; } case "keyword": { - var node_5 = def.node; - var name_5 = ts.tokenToString(node_5.kind); - return { node: node_5, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; + var node_4 = def.node; + var name_5 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; } case "this": { - var node_6 = def.node; - var symbol = checker.getSymbolAtLocation(node_6); - var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_6.getSourceFile(), ts.getContainerNode(node_6), node_6).displayParts; - return { node: node_6, name: "this", kind: "var" /* variableElement */, displayParts: displayParts_2 }; + var node_5 = def.node; + var symbol = checker.getSymbolAtLocation(node_5); + var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_5.getSourceFile(), ts.getContainerNode(node_5), node_5).displayParts; + return { node: node_5, name: "this", kind: "var" /* variableElement */, displayParts: displayParts_2 }; } case "string": { - var node_7 = def.node; - return { node: node_7, name: node_7.text, kind: "var" /* variableElement */, displayParts: [ts.displayPart(ts.getTextOfNode(node_7), ts.SymbolDisplayPartKind.stringLiteral)] }; + var node_6 = def.node; + return { node: node_6, name: node_6.text, kind: "var" /* variableElement */, displayParts: [ts.displayPart(ts.getTextOfNode(node_6), ts.SymbolDisplayPartKind.stringLiteral)] }; } + default: + return ts.Debug.assertNever(def); } })(); - if (!info) { - return undefined; - } var node = info.node, name = info.name, kind = info.kind, displayParts = info.displayParts; var sourceFile = node.getSourceFile(); return { @@ -85910,8 +87678,10 @@ var ts; displayParts: displayParts }; } - function getDefinitionKindAndDisplayParts(symbol, node, checker) { - var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts.getContainerNode(node), node), displayParts = _a.displayParts, symbolKind = _a.symbolKind; + function getDefinitionKindAndDisplayParts(symbol, checker, node) { + var meaning = FindAllReferences.Core.getIntersectingMeaningFromDeclarations(node, symbol); + var enclosingDeclaration = ts.firstOrUndefined(symbol.declarations) || node; + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } function toReferenceEntry(entry) { @@ -85942,15 +87712,15 @@ var ts; function implementationKindDisplayParts(node, checker) { var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node); if (symbol) { - return getDefinitionKindAndDisplayParts(symbol, node, checker); + return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(20 /* CloseParenToken */)] }; } - else if (node.kind === 200 /* ClassExpression */) { + else if (node.kind === 203 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(20 /* CloseParenToken */)] @@ -86025,16 +87795,16 @@ var ts; } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; function isModuleReferenceLocation(node) { - if (node.kind !== 9 /* StringLiteral */ && node.kind !== 13 /* NoSubstitutionTemplateLiteral */) { + if (!ts.isStringLiteralLike(node)) { return false; } switch (node.parent.kind) { - case 234 /* ModuleDeclaration */: - case 249 /* ExternalModuleReference */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 237 /* ModuleDeclaration */: + case 252 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return true; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent); default: return false; @@ -86057,20 +87827,17 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: references.push({ type: "node", node: decl.name }); break; default: ts.Debug.fail("Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); } } - return [{ - definition: { type: "symbol", symbol: symbol, node: symbol.valueDeclaration }, - references: references - }]; + return [{ definition: { type: "symbol", symbol: symbol }, references: references }]; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -86078,17 +87845,15 @@ var ts; return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); } // Labels - if (ts.isLabelName(node)) { - if (ts.isJumpStatementTarget(node)) { - var labelDefinition = ts.getTargetLabel(node.parent, node.text); - // if we have a label definition, look within its statement for references, if not, then - // the label is undefined and we have no results.. - return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); - } - else { - // it is a label definition and not a target, search within the parent labeledStatement - return getLabelReferencesInNode(node.parent, node); - } + if (ts.isJumpStatementTarget(node)) { + var labelDefinition = ts.getTargetLabel(node.parent, node.text); + // if we have a label definition, look within its statement for references, if not, then + // the label is undefined and we have no results.. + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); + } + else if (ts.isLabelOfLabeledStatement(node)) { + // it is a label definition and not a target, search within the parent labeledStatement + return getLabelReferencesInNode(node.parent, node); } if (ts.isThis(node)) { return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); @@ -86100,14 +87865,14 @@ var ts; } /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { - symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker); + symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; // Compute the meaning from the location and the symbol it references - var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); + var searchMeaning = getIntersectingMeaningFromDeclarations(node, symbol); var result = []; var state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result); if (node.kind === 79 /* DefaultKeyword */) { - addReference(node, symbol, node, state); - searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: 1 /* Default */ }, state); + addReference(node, symbol, state); + searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } else { var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); @@ -86154,10 +87919,15 @@ var ts; } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { + if (!decl.parent) { + // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. + ts.Debug.assert(decl.kind === 272 /* SourceFile */); + ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); + } return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) : undefined; - }) || symbol; + }); } var SpecialSearchKind; (function (SpecialSearchKind) { @@ -86205,7 +87975,11 @@ var ts; this.symbolIdToReferences = []; // Source file ID → symbol ID → Whether the symbol has been searched for in the source file. this.sourceFileToSeenSymbols = []; + this.includedSourceFiles = ts.arrayToSet(sourceFiles, function (s) { return s.fileName; }); } + State.prototype.includesSourceFile = function (sourceFile) { + return this.includedSourceFiles.has(sourceFile.fileName); + }; /** Gets every place to look for references of an exported symbols. See `ImportsResult` in `importTracker.ts` for more documentation. */ State.prototype.getImportSearches = function (exportSymbol, exportInfo) { if (!this.importTracker) @@ -86219,11 +87993,11 @@ var ts; // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`. // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form // here appears to be intentional). - var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, allSearchSymbols = searchOptions.allSearchSymbols; var escapedText = ts.escapeLeadingUnderscores(text); var parents = this.options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, this.checker); return { - location: location, symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, + symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, includes: function (referenceSymbol) { return allSearchSymbols ? ts.contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol; }, }; }; @@ -86231,12 +88005,12 @@ var ts; * Callback to add references for a particular searched symbol. * This initializes a reference group, so only call this if you will add at least one reference. */ - State.prototype.referenceAdder = function (searchSymbol, searchLocation) { + State.prototype.referenceAdder = function (searchSymbol) { var symbolId = ts.getSymbolId(searchSymbol); var references = this.symbolIdToReferences[symbolId]; if (!references) { references = this.symbolIdToReferences[symbolId] = []; - this.result.push({ definition: { type: "symbol", symbol: searchSymbol, node: searchLocation }, references: references }); + this.result.push({ definition: { type: "symbol", symbol: searchSymbol }, references: references }); } return function (node) { return references.push(FindAllReferences.nodeEntry(node)); }; }; @@ -86261,7 +88035,7 @@ var ts; var _a = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a.importSearches, singleReferences = _a.singleReferences, indirectUsers = _a.indirectUsers; // For `import { foo as bar }` just add the reference to `foo`, and don't otherwise search in the file. if (singleReferences.length) { - var addRef = state.referenceAdder(exportSymbol, exportLocation); + var addRef = state.referenceAdder(exportSymbol); for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { var singleRef = singleReferences_1[_i]; addRef(singleRef); @@ -86297,7 +88071,10 @@ var ts; function searchForImportedSymbol(symbol, state) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - getReferencesInSourceFile(declaration.getSourceFile(), state.createSearch(declaration, symbol, 0 /* Import */), state); + var exportingFile = declaration.getSourceFile(); + if (state.includesSourceFile(exportingFile)) { + getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state); + } } } /** Search for all occurences of an identifier in a source file (and filter out the ones that match). */ @@ -86311,9 +88088,9 @@ var ts; checker.getPropertySymbolOfDestructuringAssignment(location); } function getObjectBindingElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 177 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 180 /* BindingElement */); if (bindingElement && - bindingElement.parent.kind === 175 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 178 /* ObjectBindingPattern */ && !bindingElement.propertyName) { return bindingElement; } @@ -86343,7 +88120,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 187 /* FunctionExpression */ || valueDeclaration.kind === 200 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 190 /* FunctionExpression */ || valueDeclaration.kind === 203 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -86353,7 +88130,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 230 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 233 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -86382,7 +88159,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -86397,6 +88174,17 @@ var ts; // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.) return exposedByParent ? scope.getSourceFile() : scope; } + /** Used as a quick check for whether a symbol is used at all in a file (besides its definition). */ + function isSymbolReferencedInFile(definition, checker, sourceFile) { + var symbol = checker.getSymbolAtLocation(definition); + if (!symbol) + return true; // Be lenient with invalid code. + return getPossibleSymbolReferencePositions(sourceFile, symbol.name).some(function (position) { + var token = ts.tryCast(ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true), ts.isIdentifier); + return token && token !== definition && token.escapedText === definition.escapedText && checker.getSymbolAtLocation(token) === symbol; + }); + } + Core.isSymbolReferencedInFile = isSymbolReferencedInFile; function getPossibleSymbolReferencePositions(sourceFile, symbolName, container) { if (container === void 0) { container = sourceFile; } var positions = []; @@ -86427,18 +88215,13 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var references = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container); - for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { - var position = possiblePositions_1[_i]; + var references = ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, labelName, container), function (position) { var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); // Only pick labels that are either the target label, or have a target that is the target label - if (node && (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel))) { - references.push(FindAllReferences.nodeEntry(node)); - } - } + return node && (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel)) ? FindAllReferences.nodeEntry(node) : undefined; + }); return [{ definition: { type: "label", node: targetLabel }, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { @@ -86458,24 +88241,15 @@ var ts; } } function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) { - var references = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var sourceFile = sourceFiles_6[_i]; + var references = ts.flatMap(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); - addReferencesForKeywordInFile(sourceFile, keywordKind, ts.tokenToString(keywordKind), references); - } + return ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, ts.tokenToString(keywordKind), sourceFile), function (position) { + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return referenceLocation.kind === keywordKind ? FindAllReferences.nodeEntry(referenceLocation) : undefined; + }); + }); return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references: references }] : undefined; } - function addReferencesForKeywordInFile(sourceFile, kind, searchText, references) { - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile); - for (var _i = 0, possiblePositions_2 = possiblePositions; _i < possiblePositions_2.length; _i++) { - var position = possiblePositions_2[_i]; - var referenceLocation = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (referenceLocation.kind === kind) { - references.push(FindAllReferences.nodeEntry(referenceLocation)); - } - } - } function getReferencesInSourceFile(sourceFile, search, state) { state.cancellationToken.throwIfCancellationRequested(); return getReferencesInContainer(sourceFile, sourceFile, search, state); @@ -86533,7 +88307,7 @@ var ts; } switch (state.specialSearchKind) { case 0 /* None */: - addReference(referenceLocation, relatedSymbol, search.location, state); + addReference(referenceLocation, relatedSymbol, state); break; case 1 /* Constructor */: addConstructorReferences(referenceLocation, sourceFile, search, state); @@ -86563,7 +88337,7 @@ var ts; addRef(); } if (!state.options.isForRename && state.markSeenReExportRHS(name)) { - addReference(name, referenceSymbol, name, state); + addReference(name, referenceSymbol, state); } } else { @@ -86580,14 +88354,16 @@ var ts; } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { - searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); } function addRef() { - addReference(referenceLocation, localSymbol, search.location, state); + addReference(referenceLocation, localSymbol, state); } } function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; } function isExportSpecifierAlias(referenceLocation, exportSpecifier) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; @@ -86628,11 +88404,11 @@ var ts; * position of property accessing, the referenceEntry of such position will be handled in the first case. */ if (!(flags & 33554432 /* Transient */) && search.includes(shorthandValueSymbol)) { - addReference(ts.getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, search.location, state); + addReference(ts.getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, state); } } - function addReference(referenceLocation, relatedSymbol, searchLocation, state) { - var addRef = state.referenceAdder(relatedSymbol, searchLocation); + function addReference(referenceLocation, relatedSymbol, state) { + var addRef = state.referenceAdder(relatedSymbol); if (state.options.implementations) { addImplementationReferences(referenceLocation, addRef, state); } @@ -86643,11 +88419,11 @@ var ts; /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ function addConstructorReferences(referenceLocation, sourceFile, search, state) { if (ts.isNewExpressionTarget(referenceLocation)) { - addReference(referenceLocation, search.symbol, search.location, state); + addReference(referenceLocation, search.symbol, state); } - var pusher = function () { return state.referenceAdder(search.symbol, search.location); }; + var pusher = function () { return state.referenceAdder(search.symbol); }; if (ts.isClassLike(referenceLocation.parent)) { - ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + ts.Debug.assert(referenceLocation.kind === 79 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); // This is the class declaration containing the constructor. findOwnConstructorReferences(search.symbol, sourceFile, pusher()); } @@ -86660,11 +88436,11 @@ var ts; } } function addClassStaticThisReferences(referenceLocation, search, state) { - addReference(referenceLocation, search.symbol, search.location, state); - if (ts.isClassLike(referenceLocation.parent)) { + addReference(referenceLocation, search.symbol, state); + if (!state.options.isForRename && ts.isClassLike(referenceLocation.parent)) { ts.Debug.assert(referenceLocation.parent.name === referenceLocation); // This is the class declaration. - addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location)); + addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol)); } } function addStaticThisReferences(classLike, pusher) { @@ -86694,12 +88470,12 @@ var ts; for (var _i = 0, _a = classSymbol.members.get("__constructor" /* Constructor */).declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 123 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 153 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 154 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 152 /* MethodDeclaration */) { + if (decl && decl.kind === 153 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 99 /* ThisKeyword */, function (thisKeyword) { @@ -86720,7 +88496,7 @@ var ts; } for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 153 /* Constructor */); + ts.Debug.assert(decl.kind === 154 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 97 /* SuperKeyword */, function (node) { @@ -86740,7 +88516,7 @@ var ts; if (refNode.kind !== 71 /* Identifier */) { return; } - if (refNode.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 269 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -86759,7 +88535,7 @@ var ts; } else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { var body = parent.body; - if (body.kind === 208 /* Block */) { + if (body.kind === 211 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { addReference(returnStatement.expression); @@ -86789,7 +88565,7 @@ var ts; return result; } function getContainingTypeReference(node) { - var topLevelTypeReference = undefined; + var topLevelTypeReference; while (node) { if (ts.isTypeNode(node)) { topLevelTypeReference = node; @@ -86800,12 +88576,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ - && node.parent.kind === 263 /* HeritageClause */ + if (node.kind === 205 /* ExpressionWithTypeArguments */ + && node.parent.kind === 266 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 71 /* Identifier */ || node.kind === 180 /* PropertyAccessExpression */) { + else if (node.kind === 71 /* Identifier */ || node.kind === 183 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -86816,13 +88592,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 178 /* ArrayLiteralExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 181 /* ArrayLiteralExpression */: return true; default: return false; @@ -86876,7 +88652,7 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } @@ -86904,64 +88680,59 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; default: return undefined; } - var references = []; var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode); - for (var _i = 0, possiblePositions_3 = possiblePositions; _i < possiblePositions_3.length; _i++) { - var position = possiblePositions_3[_i]; + var references = ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode), function (position) { var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); if (!node || node.kind !== 97 /* SuperKeyword */) { - continue; + return; } var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false); // If we have a 'super' container, we must have an enclosing class. // Now make sure the owning class is the same as the search-space // and has the same static qualifier as the original 'super's owner. - if (container && (32 /* Static */ & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(FindAllReferences.nodeEntry(node)); - } - } - return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references: references }]; + return container && (32 /* Static */ & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol ? FindAllReferences.nodeEntry(node) : undefined; + }); + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol }, references: references }]; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -86969,81 +88740,65 @@ var ts; return undefined; } var references = []; - var possiblePositions; - if (searchSpaceNode.kind === 269 /* SourceFile */) { - ts.forEach(sourceFiles, function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this"); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); - }); - } - else { - var sourceFile = searchSpaceNode.getSourceFile(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); + for (var _i = 0, _a = searchSpaceNode.kind === 272 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()]; _i < _a.length; _i++) { + var sourceFile = _a[_i]; + cancellationToken.throwIfCancellationRequested(); + var positions = getPossibleSymbolReferencePositions(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode); + getThisReferencesInFile(sourceFile, searchSpaceNode.kind === 272 /* SourceFile */ ? sourceFile : searchSpaceNode, positions, staticFlag, references); } return [{ definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (!node || !ts.isThis(node)) { - return; - } - var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); - switch (searchSpaceNode.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - if (searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - // Make sure the container belongs to the same class - // and has the appropriate static modifier from the original container. - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 269 /* SourceFile */: - if (container.kind === 269 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - } - }); - } + } + function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, result) { + ts.forEach(possiblePositions, function (position) { + var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); + if (!node || !ts.isThis(node)) { + return; + } + var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); + switch (searchSpaceNode.kind) { + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + if (searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 272 /* SourceFile */: + if (container.kind === 272 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + } + }); } function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { - var references = []; - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + var references = ts.flatMap(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text); - getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); - } + return ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, node.text), function (position) { + var ref = ts.tryCast(ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false), ts.isStringLiteral); + return ref && ref.text === node.text ? FindAllReferences.nodeEntry(ref, /*isInString*/ true) : undefined; + }); + }); return [{ definition: { type: "string", node: node }, references: references }]; - function getReferencesForStringLiteralInFile(sourceFile, searchText, possiblePositions, references) { - for (var _i = 0, possiblePositions_4 = possiblePositions; _i < possiblePositions_4.length; _i++) { - var position = possiblePositions_4[_i]; - var node_8 = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (node_8 && node_8.kind === 9 /* StringLiteral */ && node_8.text === searchText) { - references.push(FindAllReferences.nodeEntry(node_8, /*isInString*/ true)); - } - } - } } // For certain symbol kinds, we need to include other symbols in the search set. // This is not needed when searching for re-exports. @@ -87055,7 +88810,7 @@ var ts; // If the location is name of property symbol from object literal destructuring pattern // Search the property symbol // for ( { property: p2 } of elems) { } - if (containingObjectLiteralElement.kind !== 266 /* ShorthandPropertyAssignment */) { + if (containingObjectLiteralElement.kind !== 269 /* ShorthandPropertyAssignment */) { var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); if (propertySymbol) { result.push(propertySymbol); @@ -87148,7 +88903,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -87234,7 +88989,7 @@ var ts; } } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -87260,7 +89015,9 @@ var ts; * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) * do not intersect in any of the three spaces. */ - function getIntersectingMeaningFromDeclarations(meaning, declarations) { + function getIntersectingMeaningFromDeclarations(node, symbol) { + var meaning = ts.getMeaningFromLocation(node); + var declarations = symbol.declarations; if (declarations) { var lastIterationMeaning = void 0; do { @@ -87281,6 +89038,7 @@ var ts; } return meaning; } + Core.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; function isImplementation(node) { if (!node) { return false; @@ -87288,7 +89046,7 @@ var ts; else if (ts.isVariableLike(node) && ts.hasInitializer(node)) { return true; } - else if (node.kind === 227 /* VariableDeclaration */) { + else if (node.kind === 230 /* VariableDeclaration */) { var parentStatement = getParentStatementOfVariableDeclaration(node); return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); } @@ -87297,18 +89055,18 @@ var ts; } else { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return true; } } return false; } function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 209 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 228 /* VariableDeclarationList */); + if (node.parent && node.parent.parent && node.parent.parent.kind === 212 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 231 /* VariableDeclarationList */); return node.parent.parent; } } @@ -87384,9 +89142,8 @@ var ts; } // Labels if (ts.isJumpStatementTarget(node)) { - var labelName = node.text; - var label = ts.getTargetLabel(node.parent, labelName); - return label ? [createDefinitionInfoFromName(label, "label" /* label */, labelName, /*containerName*/ undefined)] : undefined; + var label = ts.getTargetLabel(node.parent, node.text); + return label ? [createDefinitionInfoFromName(label, "label" /* label */, node.text, /*containerName*/ undefined)] : undefined; } var typeChecker = program.getTypeChecker(); var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); @@ -87414,7 +89171,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -87504,10 +89261,7 @@ var ts; // Check if position is on triple slash reference. var comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (comment) { - return { - definitions: definitions, - textSpan: ts.createTextSpanFromBounds(comment.pos, comment.end) - }; + return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) }; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); var textSpan = ts.createTextSpan(node.getStart(), node.getWidth()); @@ -87527,11 +89281,11 @@ var ts; return true; } switch (declaration.kind) { - case 240 /* ImportClause */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: return true; - case 243 /* ImportSpecifier */: - return declaration.parent.kind === 242 /* NamedImports */; + case 246 /* ImportSpecifier */: + return declaration.parent.kind === 245 /* NamedImports */; default: return false; } @@ -87542,7 +89296,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (ts.isNewExpressionTarget(node) || node.kind === 123 /* ConstructorKeyword */ && symbol.flags & 32 /* Class */) { + if (symbol.flags & 32 /* Class */ && (ts.isNewExpressionTarget(node) || node.kind === 123 /* ConstructorKeyword */)) { var cls = ts.find(symbol.declarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -87564,10 +89318,11 @@ var ts; } function isSignatureDeclaration(node) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return true; default: return false; @@ -87685,6 +89440,7 @@ var ts; "see", "since", "static", + "template", "throws", "type", "typedef", @@ -87716,9 +89472,9 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 289 /* JSDocPropertyTag */: + case 292 /* JSDocPropertyTag */: return [declaration]; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return [declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -87739,15 +89495,15 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return withNode(tag.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 288 /* JSDocTypedefTag */: - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: + case 291 /* JSDocTypedefTag */: + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -87903,9 +89659,7 @@ var ts; var docParams = ""; for (var i = 0; i < parameters.length; i++) { var currentName = parameters[i].name; - var paramName = currentName.kind === 71 /* Identifier */ ? - currentName.escapedText : - "param" + i; + var paramName = currentName.kind === 71 /* Identifier */ ? currentName.escapedText : "param" + i; if (isJavaScriptFile) { docParams += indentationStr + " * @param {any} " + paramName + newLine; } @@ -87932,20 +89686,20 @@ var ts; function getCommentOwnerInfo(tokenAtPos) { for (var commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 152 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 149 /* PropertySignature */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 232 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 150 /* PropertySignature */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 235 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 209 /* VariableStatement */: { + case 212 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -87953,14 +89707,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 269 /* SourceFile */: + case 272 /* SourceFile */: return undefined; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 234 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 195 /* BinaryExpression */: { + return commentOwner.parent.kind === 237 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 198 /* BinaryExpression */: { var be = commentOwner; if (ts.getSpecialPropertyAssignmentKind(be) === 0 /* None */) { return undefined; @@ -87980,17 +89734,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 186 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 189 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return rightHandSide.parameters; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { return member.parameters; } } @@ -88000,16 +89754,88 @@ var ts; } })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + function stringToInt(str) { + var n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error("Error in parseInt(" + JSON.stringify(str) + ")"); + } + return n; + } + var isPrereleaseRegex = /^(.*)-next.\d+/; + var prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + var semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + var Semver = /** @class */ (function () { + function Semver(major, minor, patch, + /** + * If true, this is `major.minor.0-next.patch`. + * If false, this is `major.minor.patch`. + */ + isPrerelease) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.isPrerelease = isPrerelease; + } + Semver.parse = function (semver) { + var isPrerelease = isPrereleaseRegex.test(semver); + var result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error("Unexpected semver: " + semver + " (isPrerelease: " + isPrerelease + ")"); + } + return result; + }; + Semver.fromRaw = function (_a) { + var major = _a.major, minor = _a.minor, patch = _a.patch, isPrerelease = _a.isPrerelease; + return new Semver(major, minor, patch, isPrerelease); + }; + // This must parse the output of `versionString`. + Semver.tryParse = function (semver, isPrerelease) { + // Per the semver spec : + // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." + var rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; + var match = rgx.exec(semver); + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; + }; + Object.defineProperty(Semver.prototype, "versionString", { + get: function () { + return this.isPrerelease ? this.major + "." + this.minor + ".0-next." + this.patch : this.major + "." + this.minor + "." + this.patch; + }, + enumerable: true, + configurable: true + }); + Semver.prototype.equals = function (sem) { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + }; + Semver.prototype.greaterThan = function (sem) { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); + }; + return Semver; + }()); + ts.Semver = Semver; +})(ts || (ts = {})); // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// /// /// +/// /* @internal */ var ts; (function (ts) { var JsTyping; (function (JsTyping) { + /* @internal */ + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = ts.Semver.parse(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest")); + return !availableVersion.greaterThan(cachedTyping.version); + } + JsTyping.isTypingUpToDate = isTypingUpToDate; /* @internal */ JsTyping.nodeCoreModuleList = [ "buffer", "querystring", "events", "http", "cluster", @@ -88038,11 +89864,11 @@ var ts; * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ - function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; } @@ -88079,9 +89905,9 @@ var ts; addInferredTypings(module, "Inferred typings from unresolved imports"); } // Add the cached typing locations for inferred typings that are already installed - packageNameToTypingLocation.forEach(function (typingLocation, name) { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); + packageNameToTypingLocation.forEach(function (typing, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { + inferredTypings.set(name, typing.typingLocation); } }); // Remove typings that the user has added to the exclude list @@ -88256,7 +90082,7 @@ var ts; case 6 /* NameContainsNonURISafeCharacters */: return "Package name '" + typing + "' contains non URI safe characters"; case 0 /* Ok */: - throw ts.Debug.fail(); // Shouldn't have called this. + return ts.Debug.fail(); // Shouldn't have called this. default: ts.Debug.assertNever(result); } @@ -88282,8 +90108,8 @@ var ts; }); }; // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] - for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) { - var sourceFile = sourceFiles_8[_i]; + for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { + var sourceFile = sourceFiles_6[_i]; _loop_8(sourceFile); } rawItems.sort(compareNavigateToItems); @@ -88321,9 +90147,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 240 /* ImportClause */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -88343,41 +90169,35 @@ var ts; return true; } function tryAddSingleDeclarationName(declaration, containers) { - if (declaration) { - var name = ts.getNameOfDeclaration(declaration); - if (name) { - var text = ts.getTextOfIdentifierOrLiteral(name); - if (text !== undefined) { - containers.unshift(text); - } - else if (name.kind === 145 /* ComputedPropertyName */) { - return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); - } - else { - // Don't know how to add this. - return false; - } - } + var name = ts.getNameOfDeclaration(declaration); + if (name && ts.isPropertyNameLiteral(name)) { + containers.unshift(ts.getTextOfIdentifierOrLiteral(name)); + return true; + } + else if (name && name.kind === 146 /* ComputedPropertyName */) { + return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); + } + else { + // Don't know how to add this. + return false; } - return true; } // Only added the names of computed properties if they're simple dotted expressions, like: // // [X.Y.Z]() { } function tryAddComputedPropertyName(expression, containers, includeLastPortion) { - var text = ts.getTextOfIdentifierOrLiteral(expression); - if (text !== undefined) { + if (ts.isPropertyNameLiteral(expression)) { + var text = ts.getTextOfIdentifierOrLiteral(expression); if (includeLastPortion) { containers.unshift(text); } return true; } - if (expression.kind === 180 /* PropertyAccessExpression */) { - var propertyAccess = expression; + if (ts.isPropertyAccessExpression(expression)) { if (includeLastPortion) { - containers.unshift(propertyAccess.name.text); + containers.unshift(expression.name.text); } - return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion*/ true); + return tryAddComputedPropertyName(expression.expression, containers, /*includeLastPortion*/ true); } return false; } @@ -88386,7 +90206,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -88567,7 +90387,7 @@ var ts; return; } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -88579,21 +90399,21 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 152 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -88605,7 +90425,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -88616,8 +90436,8 @@ var ts; } } break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var _d = node, name = _d.name, initializer = _d.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -88638,12 +90458,12 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: startNode(node); for (var _e = 0, _f = node.members; _e < _f.length; _e++) { var member = _f[_e]; @@ -88653,9 +90473,9 @@ var ts; } endNode(); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: startNode(node); for (var _g = 0, _h = node.members; _g < _h.length; _g++) { var member = _h[_g]; @@ -88663,23 +90483,24 @@ var ts; } endNode(); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 247 /* ExportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 158 /* IndexSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 232 /* TypeAliasDeclaration */: + case 250 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 159 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 235 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var special = ts.getSpecialPropertyAssignmentKind(node); switch (special) { case 1 /* ExportsProperty */: case 2 /* ModuleExports */: case 3 /* PrototypeProperty */: + case 6 /* Prototype */: addNodeWithRecursiveChild(node, node.right); break; case 4 /* ThisProperty */: @@ -88695,7 +90516,7 @@ var ts; if (ts.hasJSDocNodes(node)) { ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -88752,12 +90573,12 @@ var ts; return false; } switch (a.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -88766,7 +90587,7 @@ var ts; // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { - return a.body.kind === b.body.kind && (a.body.kind !== 234 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 237 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -88796,7 +90617,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -88804,18 +90625,18 @@ var ts; return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName)); } switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: return getFunctionOrClassName(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var name = ts.getNameOfDeclaration(node); @@ -88826,16 +90647,16 @@ var ts; } } switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -88843,15 +90664,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return "new()"; - case 156 /* CallSignature */: + case 157 /* CallSignature */: return "()"; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "[]"; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -88863,7 +90684,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 209 /* VariableStatement */) { + if (parentNode && parentNode.kind === 212 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 71 /* Identifier */) { @@ -88892,24 +90713,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 269 /* SourceFile */: - case 232 /* TypeAliasDeclaration */: - case 288 /* JSDocTypedefTag */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 235 /* TypeAliasDeclaration */: + case 291 /* JSDocTypedefTag */: return true; - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 227 /* VariableDeclaration */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 230 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -88919,10 +90740,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -88931,7 +90752,7 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 227 /* VariableDeclaration */ && childKind !== 177 /* BindingElement */; + return childKind !== 230 /* VariableDeclaration */ && childKind !== 180 /* BindingElement */; }); } } @@ -88987,7 +90808,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -88998,18 +90819,16 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 234 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 237 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 145 /* ComputedPropertyName */; + return !member.name || member.name.kind === 146 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 269 /* SourceFile */ - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 272 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 227 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 230 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -89018,16 +90837,20 @@ var ts; if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 227 /* VariableDeclaration */) { + // See if it is a var initializer. If so, use the var name. + else if (node.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 195 /* BinaryExpression */ && + // See if it is of the form " = function(){...}". If so, use the text from the left-hand side. + else if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 265 /* PropertyAssignment */ && node.parent.name) { + // See if it is a property assignment, and if so use the property name + else if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } + // Default exports are named "default" else if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -89037,9 +90860,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: return true; default: return false; @@ -89049,6 +90872,230 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var OrganizeImports; + (function (OrganizeImports) { + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ + function organizeImports(sourceFile, formatContext, host, program) { + var changeTracker = ts.textChanges.ChangeTracker.fromContext({ host: host, formatContext: formatContext }); + // All of the old ImportDeclarations in the file, in syntactic order. + var topLevelImportDecls = sourceFile.statements.filter(ts.isImportDeclaration); + organizeImportsWorker(topLevelImportDecls); + for (var _i = 0, _a = sourceFile.statements.filter(ts.isAmbientModule); _i < _a.length; _i++) { + var ambientModule = _a[_i]; + var ambientModuleBody = getModuleBlock(ambientModule); + var ambientModuleImportDecls = ambientModuleBody.statements.filter(ts.isImportDeclaration); + organizeImportsWorker(ambientModuleImportDecls); + } + return changeTracker.getChanges(); + function organizeImportsWorker(oldImportDecls) { + if (ts.length(oldImportDecls) === 0) { + return; + } + var oldImportGroups = ts.group(oldImportDecls, function (importDecl) { return getExternalModuleName(importDecl.moduleSpecifier); }); + var sortedImportGroups = ts.stableSort(oldImportGroups, function (group1, group2) { return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); }); + var newImportDecls = ts.flatMap(sortedImportGroups, function (importGroup) { + return getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup, sourceFile, program)) + : importGroup; + }); + // Delete or replace the first import. + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: ts.getNewLineOrDefaultFromHost(host, formatContext.options), + }); + } + // Delete any subsequent imports. + for (var i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + } + } + OrganizeImports.organizeImports = organizeImports; + function getModuleBlock(moduleDecl) { + var body = moduleDecl.body; + return body && !ts.isIdentifier(body) && (ts.isModuleBlock(body) ? body : getModuleBlock(body)); + } + function removeUnusedImports(oldImports, sourceFile, program) { + var typeChecker = program.getTypeChecker(); + var jsxNamespace = typeChecker.getJsxNamespace(); + var jsxContext = sourceFile.languageVariant === 1 /* JSX */ && program.getCompilerOptions().jsx; + var usedImports = []; + for (var _i = 0, oldImports_1 = oldImports; _i < oldImports_1.length; _i++) { + var importDecl = oldImports_1[_i]; + var importClause = importDecl.importClause; + if (!importClause) { + // Imports without import clauses are assumed to be included for their side effects and are not removed. + usedImports.push(importDecl); + continue; + } + var name = importClause.name, namedBindings = importClause.namedBindings; + // Default import + if (name && !isDeclarationUsed(name)) { + name = undefined; + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + // Namespace import + if (!isDeclarationUsed(namedBindings.name)) { + namedBindings = undefined; + } + } + else { + // List of named imports + var newElements = namedBindings.elements.filter(function (e) { return isDeclarationUsed(e.propertyName || e.name); }); + if (newElements.length < namedBindings.elements.length) { + namedBindings = newElements.length + ? ts.updateNamedImports(namedBindings, newElements) + : undefined; + } + } + } + if (name || namedBindings) { + usedImports.push(updateImportDeclarationAndClause(importDecl, name, namedBindings)); + } + } + return usedImports; + function isDeclarationUsed(identifier) { + // The JSX factory symbol is always used. + return jsxContext && (identifier.text === jsxNamespace) || ts.FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile); + } + } + function getExternalModuleName(specifier) { + return ts.isStringLiteral(specifier) || ts.isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + /* @internal */ // Internal for testing + /** + * @param importGroup a list of ImportDeclarations, all with the same module name. + */ + function coalesceImports(importGroup) { + if (importGroup.length === 0) { + return importGroup; + } + var _a = getCategorizedImports(importGroup), importWithoutClause = _a.importWithoutClause, defaultImports = _a.defaultImports, namespaceImports = _a.namespaceImports, namedImports = _a.namedImports; + var coalescedImports = []; + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + var defaultImport = defaultImports[0]; + coalescedImports.push(updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)); + return coalescedImports; + } + var sortedNamespaceImports = ts.stableSort(namespaceImports, function (i1, i2) { + return compareIdentifiers(i1.importClause.namedBindings.name, i2.importClause.namedBindings.name); + }); + for (var _i = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _i < sortedNamespaceImports_1.length; _i++) { + var namespaceImport = sortedNamespaceImports_1[_i]; + // Drop the name, if any + coalescedImports.push(updateImportDeclarationAndClause(namespaceImport, /*name*/ undefined, namespaceImport.importClause.namedBindings)); + } + if (defaultImports.length === 0 && namedImports.length === 0) { + return coalescedImports; + } + var newDefaultImport; + var newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0].importClause.name; + } + else { + for (var _b = 0, defaultImports_1 = defaultImports; _b < defaultImports_1.length; _b++) { + var defaultImport = defaultImports_1[_b]; + newImportSpecifiers.push(ts.createImportSpecifier(ts.createIdentifier("default"), defaultImport.importClause.name)); + } + } + newImportSpecifiers.push.apply(newImportSpecifiers, ts.flatMap(namedImports, function (i) { return i.importClause.namedBindings.elements; })); + var sortedImportSpecifiers = ts.stableSort(newImportSpecifiers, function (s1, s2) { + return compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name); + }); + var importDecl = defaultImports.length > 0 + ? defaultImports[0] + : namedImports[0]; + var newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? ts.createNamedImports(sortedImportSpecifiers) + : ts.updateNamedImports(namedImports[0].importClause.namedBindings, sortedImportSpecifiers); + coalescedImports.push(updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)); + return coalescedImports; + /* + * Returns entire import declarations because they may already have been rewritten and + * may lack parent pointers. The desired parts can easily be recovered based on the + * categorization. + * + * NB: There may be overlap between `defaultImports` and `namespaceImports`/`namedImports`. + */ + function getCategorizedImports(importGroup) { + var importWithoutClause; + var defaultImports = []; + var namespaceImports = []; + var namedImports = []; + for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) { + var importDeclaration = importGroup_1[_i]; + if (importDeclaration.importClause === undefined) { + // Only the first such import is interesting - the others are redundant. + // Note: Unfortunately, we will lose trivia that was on this node. + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + var _a = importDeclaration.importClause, name = _a.name, namedBindings = _a.namedBindings; + if (name) { + defaultImports.push(importDeclaration); + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + namespaceImports.push(importDeclaration); + } + else { + namedImports.push(importDeclaration); + } + } + } + return { + importWithoutClause: importWithoutClause, + defaultImports: defaultImports, + namespaceImports: namespaceImports, + namedImports: namedImports, + }; + } + function compareIdentifiers(s1, s2) { + return ts.compareStringsCaseSensitive(s1.text, s2.text); + } + } + OrganizeImports.coalesceImports = coalesceImports; + function updateImportDeclarationAndClause(importDeclaration, name, namedBindings) { + return ts.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.updateImportClause(importDeclaration.importClause, name, namedBindings), importDeclaration.moduleSpecifier); + } + /* internal */ // Exported for testing + function compareModuleSpecifiers(m1, m2) { + var name1 = getExternalModuleName(m1); + var name2 = getExternalModuleName(m2); + return ts.compareBooleans(name1 === undefined, name2 === undefined) || + ts.compareBooleans(ts.isExternalModuleNameRelative(name1), ts.isExternalModuleNameRelative(name2)) || + ts.compareStringsCaseSensitive(name1, name2); + } + OrganizeImports.compareModuleSpecifiers = compareModuleSpecifiers; + })(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { @@ -89088,8 +91135,8 @@ var ts; continue; } if (!result[1]) { - var span_13 = ts.createTextSpanFromBounds(sourceFile.text.indexOf("//", currentLineStart), lineEnd); - regions.push(createOutliningSpan(span_13, span_13, /*autoCollapse*/ false, result[2] || "#region")); + var span_12 = ts.createTextSpanFromBounds(sourceFile.text.indexOf("//", currentLineStart), lineEnd); + regions.push(createOutliningSpan(span_12, span_12, /*autoCollapse*/ false, result[2] || "#region")); } else { var region = regions.pop(); @@ -89143,24 +91190,24 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(n)) { - return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 188 /* ArrowFunction */); + return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 191 /* ArrowFunction */); } // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 213 /* DoStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 264 /* CatchClause */: + case 216 /* DoStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 267 /* CatchClause */: return spanForNode(n.parent); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -89175,16 +91222,16 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile)); } - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanForNode(n.parent); - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 236 /* CaseBlock */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 239 /* CaseBlock */: return spanForNode(n); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 21 /* OpenBracketToken */); } function spanForObjectOrArrayLiteral(node, open) { @@ -89328,10 +91375,10 @@ var ts; // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). var wordSpans = getWordSpans(candidate); for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) { - var span_14 = wordSpans_1[_i]; - if (partStartsWith(candidate, span_14, chunk.text, /*ignoreCase:*/ true)) { + var span_13 = wordSpans_1[_i]; + if (partStartsWith(candidate, span_13, chunk.text, /*ignoreCase:*/ true)) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, - /*isCaseSensitive:*/ partStartsWith(candidate, span_14, chunk.text, /*ignoreCase:*/ false)); + /*isCaseSensitive:*/ partStartsWith(candidate, span_13, chunk.text, /*ignoreCase:*/ false)); } } } @@ -89433,7 +91480,7 @@ var ts; // // Only if all words have some sort of match is the pattern considered matched. var subWordTextChunks = segment.subWordTextChunks; - var matches = undefined; + var matches; for (var _i = 0, subWordTextChunks_1 = subWordTextChunks; _i < subWordTextChunks_1.length; _i++) { var subWordTextChunk = subWordTextChunks_1[_i]; // Try to match the candidate with this word @@ -89481,8 +91528,8 @@ var ts; // and I will both match in UI. var currentCandidate = 0; var currentChunkSpan = 0; - var firstMatch = undefined; - var contiguous = undefined; + var firstMatch; + var contiguous; while (true) { // Let's consider our termination cases if (currentChunkSpan === chunkCharacterSpans.length) { @@ -89782,11 +91829,18 @@ var ts; function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) { if (readImportFiles === void 0) { readImportFiles = true; } if (detectJavaScriptImports === void 0) { detectJavaScriptImports = false; } - var referencedFiles = []; - var typeReferenceDirectives = []; + var pragmaContext = { + languageVersion: 1 /* ES5 */, + pragmas: undefined, + checkJsDirective: undefined, + referencedFiles: [], + typeReferenceDirectives: [], + amdDependencies: [], + hasNoDefaultLib: undefined, + moduleName: undefined + }; var importedFiles = []; var ambientExternalModules; - var isNoDefaultLib = false; var braceNesting = 0; // assume that text represent an external module if it contains at least one top level import/export // ambient modules that are found inside external modules are interpreted as module augmentations @@ -89801,23 +91855,6 @@ var ts; } return token; } - function processTripleSlashDirectives() { - var commentRanges = ts.getLeadingCommentRanges(sourceText, 0); - ts.forEach(commentRanges, function (commentRange) { - var comment = sourceText.substring(commentRange.pos, commentRange.end); - var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, commentRange); - if (referencePathMatchResult) { - isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - var fileReference = referencePathMatchResult.fileReference; - if (fileReference) { - var collection = referencePathMatchResult.isTypeReferenceDirective - ? typeReferenceDirectives - : referencedFiles; - collection.push(fileReference); - } - } - }); - } function getFileReference() { var fileName = ts.scanner.getTokenValue(); var pos = ts.scanner.getTokenPos(); @@ -89846,7 +91883,7 @@ var ts; if (token === 124 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 128 /* ModuleKeyword */) { + if (token === 129 /* ModuleKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { recordAmbientExternalModule(); @@ -89879,7 +91916,7 @@ var ts; else { if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -89910,7 +91947,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -89926,7 +91963,7 @@ var ts; token = nextToken(); if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -89956,7 +91993,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -89968,7 +92005,7 @@ var ts; } else if (token === 39 /* AsteriskToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -89993,7 +92030,7 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 132 /* RequireKeyword */) { + if (token === 133 /* RequireKeyword */) { token = nextToken(); if (token === 19 /* OpenParenToken */) { token = nextToken(); @@ -90078,7 +92115,8 @@ var ts; if (readImportFiles) { processImports(); } - processTripleSlashDirectives(); + ts.processCommentPragmas(pragmaContext, sourceText); + ts.processPragmasIntoFields(pragmaContext, ts.noop); if (externalModule) { // for external modules module all nested ambient modules are augmentations if (ambientExternalModules) { @@ -90088,7 +92126,7 @@ var ts; importedFiles.push(decl.ref); } } - return { referencedFiles: referencedFiles, typeReferenceDirectives: typeReferenceDirectives, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: undefined }; + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: undefined }; } else { // for global scripts ambient modules still can have augmentations - look for ambient modules with depth > 0 @@ -90107,7 +92145,7 @@ var ts; } } } - return { referencedFiles: referencedFiles, typeReferenceDirectives: typeReferenceDirectives, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientModuleNames }; + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames }; } } ts.preProcessFile = preProcessFile; @@ -90138,23 +92176,18 @@ var ts; var symbol = typeChecker.getSymbolAtLocation(node); // Only allow a symbol to be renamed if it actually has at least one declaration. if (symbol) { - var declarations = symbol.getDeclarations(); + var declarations = symbol.declarations; if (declarations && declarations.length > 0) { // Disallow rename for elements that are defined in the standard TypeScript library. - if (ts.some(declarations, isDefinedInLibraryFile)) { + if (declarations.some(isDefinedInLibraryFile)) { return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (node.kind === 71 /* Identifier */ && - node.originalKeywordKind === 79 /* DefaultKeyword */ && - symbol.parent.flags & 1536 /* Module */) { + if (ts.isIdentifier(node) && node.originalKeywordKind === 79 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { return undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (!kind) { - return undefined; - } - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 145 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 146 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -90162,12 +92195,11 @@ var ts; return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile); } } - else if (node.kind === 9 /* StringLiteral */) { + else if (ts.isStringLiteral(node)) { if (isDefinedInLibraryFile(node)) { return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } - var displayName = ts.stripQuotes(node.text); - return getRenameInfoSuccess(displayName, displayName, "var" /* variableElement */, "" /* none */, node, sourceFile); + return getRenameInfoSuccess(node.text, node.text, "var" /* variableElement */, "" /* none */, node, sourceFile); } } function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { @@ -90258,17 +92290,13 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 182 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 185 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. var callExpression = argumentInfo.invocation; var expression = callExpression.expression; - var name = expression.kind === 71 /* Identifier */ - ? expression - : expression.kind === 180 /* PropertyAccessExpression */ - ? expression.name - : undefined; + var name = ts.isIdentifier(expression) ? expression : ts.isPropertyAccessExpression(expression) ? expression.name : undefined; if (!name || !name.escapedText) { return undefined; } @@ -90344,25 +92372,25 @@ var ts; var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } - else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 187 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0, sourceFile); } } - else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 206 /* TemplateSpan */ && node.parent.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 209 /* TemplateSpan */ && node.parent.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 16 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -90403,9 +92431,8 @@ var ts; // that trailing comma in the list, and we'll have generated the appropriate // arg index. var argumentIndex = 0; - var listChildren = argumentsList.getChildren(); - for (var _i = 0, listChildren_1 = listChildren; _i < listChildren_1.length; _i++) { - var child = listChildren_1[_i]; + for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; if (child === node) { break; } @@ -90461,9 +92488,7 @@ var ts; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. - var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = ts.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; if (argumentIndex !== 0) { ts.Debug.assertLessThan(argumentIndex, argumentCount); } @@ -90500,7 +92525,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -90509,7 +92534,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 269 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 272 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -90632,14 +92657,75 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + function computeSuggestionDiagnostics(sourceFile, program) { + program.getSemanticDiagnostics(sourceFile); + var checker = program.getDiagnosticsProducingTypeChecker(); + var diags = []; + if (sourceFile.commonJsModuleIndicator) { + diags.push(ts.createDiagnosticForNode(sourceFile.commonJsModuleIndicator, ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)); + } + var isJsFile = ts.isSourceFileJavaScript(sourceFile); + function check(node) { + switch (node.kind) { + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + if (isJsFile) { + var symbol = node.symbol; + if (symbol.members && (symbol.members.size > 0)) { + diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); + } + } + break; + } + if (!isJsFile && ts.codefix.parameterShouldGetTypeFromJSDoc(node)) { + diags.push(ts.createDiagnosticForNode(node.name || node, ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types)); + } + node.forEachChild(check); + } + check(sourceFile); + if (ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importNode = _a[_i]; + var name = importNameForConvertToDefaultImport(importNode.parent); + if (!name) + continue; + var module = ts.getResolvedModule(sourceFile, importNode.text); + var resolvedFile = module && program.getSourceFile(module.resolvedFileName); + if (resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) { + diags.push(ts.createDiagnosticForNode(name, ts.Diagnostics.Import_may_be_converted_to_a_default_import)); + } + } + } + return diags.concat(checker.getSuggestionDiagnostics(sourceFile)); + } + ts.computeSuggestionDiagnostics = computeSuggestionDiagnostics; + function importNameForConvertToDefaultImport(node) { + if (ts.isExternalModuleReference(node)) { + return node.parent.name; + } + if (ts.isImportDeclaration(node)) { + var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; + return importClause && !importClause.name && importClause.namedBindings.kind === 244 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + ? importClause.namedBindings.name + : undefined; + } + } +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var SymbolDisplay; (function (SymbolDisplay) { // TODO(drosen): use contextual SemanticMeaning. function getSymbolKind(typeChecker, symbol, location) { + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); + if (result !== "" /* unknown */) { + return result; + } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -90650,17 +92736,14 @@ var ts; return "interface" /* interfaceElement */; if (flags & 262144 /* TypeParameter */) return "type parameter" /* typeParameterElement */; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); - if (result === "" /* unknown */) { - if (flags & 262144 /* TypeParameter */) - return "type parameter" /* typeParameterElement */; - if (flags & 8 /* EnumMember */) - return "enum member" /* enumMemberElement */; - if (flags & 2097152 /* Alias */) - return "alias" /* alias */; - if (flags & 1536 /* Module */) - return "module" /* moduleElement */; - } + if (flags & 262144 /* TypeParameter */) + return "type parameter" /* typeParameterElement */; + if (flags & 8 /* EnumMember */) + return "enum member" /* enumMemberElement */; + if (flags & 2097152 /* Alias */) + return "alias" /* alias */; + if (flags & 1536 /* Module */) + return "module" /* moduleElement */; return result; } SymbolDisplay.getSymbolKind = getSymbolKind; @@ -90722,9 +92805,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: return location.kind === 71 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -90763,7 +92848,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 180 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 183 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -90784,7 +92869,7 @@ var ts; if (callExpressionLike) { var candidateSignatures = []; signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - var useConstructSignatures = callExpressionLike.kind === 183 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 186 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -90839,7 +92924,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 153 /* Constructor */)) { + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 154 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -90847,21 +92932,21 @@ var ts; return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 153 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 154 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 153 /* Constructor */) { + if (functionDeclaration_1.kind === 154 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 156 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 157 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -90871,7 +92956,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -90894,7 +92979,7 @@ var ts; } if (symbolFlags & 524288 /* TypeAlias */) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -90915,9 +93000,9 @@ var ts; } if (symbolFlags & 1536 /* Module */) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 234 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 237 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 71 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 129 /* NamespaceKeyword */ : 128 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 130 /* NamespaceKeyword */ : 129 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -90936,28 +93021,28 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 146 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 147 /* TypeParameter */); ts.Debug.assert(decl !== undefined); var declaration = decl.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 157 /* ConstructSignature */) { + if (declaration.kind === 158 /* ConstructSignature */) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 156 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 157 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 232 /* TypeAliasDeclaration */) { + else if (declaration.kind === 235 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -90969,7 +93054,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 268 /* EnumMember */) { + if (declaration.kind === 271 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -90998,12 +93083,12 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(129 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(130 /* NamespaceKeyword */)); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 58 /* EqualsToken */ : 79 /* DefaultKeyword */)); @@ -91014,13 +93099,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 238 /* ImportEqualsDeclaration */) { + if (declaration.kind === 241 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(132 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(133 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -91092,10 +93177,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 269 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 272 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 195 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 198 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -91200,16 +93285,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 187 /* FunctionExpression */) { + if (declaration.kind === 190 /* FunctionExpression */) { return true; } - if (declaration.kind !== 227 /* VariableDeclaration */ && declaration.kind !== 229 /* FunctionDeclaration */) { + if (declaration.kind !== 230 /* VariableDeclaration */ && declaration.kind !== 232 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 269 /* SourceFile */ || parent.kind === 235 /* ModuleBlock */) { + if (parent.kind === 272 /* SourceFile */ || parent.kind === 238 /* ModuleBlock */) { return false; } } @@ -91519,10 +93604,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 257 /* JsxAttribute */: - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 260 /* JsxAttribute */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 71 /* Identifier */; } @@ -91699,7 +93784,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 143 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 144 /* LastToken */; token++) { allTokens.push(token); } function anyTokenExcept() { @@ -91711,9 +93796,9 @@ var ts; } var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */])); - var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 143 /* LastKeyword */); + var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 144 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(27 /* FirstBinaryOperator */, 70 /* LastBinaryOperator */); - var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 143 /* OfKeyword */, 118 /* AsKeyword */, 126 /* IsKeyword */]; + var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 144 /* OfKeyword */, 118 /* AsKeyword */, 127 /* IsKeyword */]; var unaryPrefixOperators = [43 /* PlusPlusToken */, 44 /* MinusMinusToken */, 52 /* TildeToken */, 51 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 71 /* Identifier */, 19 /* OpenParenToken */, 21 /* OpenBracketToken */, @@ -91775,6 +93860,8 @@ var ts; rule("SpaceBetweenCloseBraceAndElse", 18 /* CloseBraceToken */, 82 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("SpaceBetweenCloseBraceAndWhile", 18 /* CloseBraceToken */, 106 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceBetweenEmptyBraceBrackets", 17 /* OpenBraceToken */, 18 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 8 /* Delete */), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule("SpaceAfterConditionalClosingParen", 20 /* CloseParenToken */, 21 /* OpenBracketToken */, [isControlDeclContext], 2 /* Space */), rule("NoSpaceBetweenFunctionKeywordAndStar", 89 /* FunctionKeyword */, 39 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 8 /* Delete */), rule("SpaceAfterStarInGeneratorDeclaration", 39 /* AsteriskToken */, [71 /* Identifier */, 19 /* OpenParenToken */], [isFunctionDeclarationOrFunctionExpressionContext], 2 /* Space */), rule("SpaceAfterFunctionInFuncDecl", 89 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 2 /* Space */), @@ -91784,7 +93871,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 135 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), + rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 136 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), rule("NoSpaceBetweenYieldKeywordAndStar", 116 /* YieldKeyword */, 39 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8 /* Delete */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [116 /* YieldKeyword */, 39 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2 /* Space */), rule("NoSpaceBetweenReturnAndSemicolon", 96 /* ReturnKeyword */, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -91808,7 +93895,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 58 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [128 /* ModuleKeyword */, 132 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterModuleImport", [129 /* ModuleKeyword */, 133 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 117 /* AbstractKeyword */, @@ -91822,19 +93909,20 @@ var ts; 108 /* ImplementsKeyword */, 91 /* ImportKeyword */, 109 /* InterfaceKeyword */, - 128 /* ModuleKeyword */, - 129 /* NamespaceKeyword */, + 129 /* ModuleKeyword */, + 130 /* NamespaceKeyword */, 112 /* PrivateKeyword */, 114 /* PublicKeyword */, 113 /* ProtectedKeyword */, - 131 /* ReadonlyKeyword */, - 135 /* SetKeyword */, + 132 /* ReadonlyKeyword */, + 136 /* SetKeyword */, 115 /* StaticKeyword */, - 138 /* TypeKeyword */, - 141 /* FromKeyword */, - 127 /* KeyOfKeyword */, + 139 /* TypeKeyword */, + 142 /* FromKeyword */, + 128 /* KeyOfKeyword */, + 126 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 141 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 142 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 9 /* StringLiteral */, 17 /* OpenBraceToken */, [isModuleDeclContext], 2 /* Space */), // Lambda expressions @@ -91866,7 +93954,7 @@ var ts; 112 /* PrivateKeyword */, 113 /* ProtectedKeyword */, 125 /* GetKeyword */, - 135 /* SetKeyword */, + 136 /* SetKeyword */, 21 /* OpenBracketToken */, 39 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 2 /* Space */), @@ -91949,6 +94037,8 @@ var ts; rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */, 73 /* CaseKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterCloseBracket", 22 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 8 /* Delete */), rule("SpaceAfterSemicolon", 25 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), + // Remove extra space between for and await + rule("SpaceBetweenForAndAwaitKeyword", 88 /* ForKeyword */, 121 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2 /* Space */), @@ -91997,44 +94087,45 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 215 /* ForStatement */; + return context.contextNode.kind === 218 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 203 /* AsExpression */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 159 /* TypePredicate */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 170 /* ConditionalType */: + case 206 /* AsExpression */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 160 /* TypePredicate */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 177 /* BindingElement */: + case 180 /* BindingElement */: // equals in type X = ... - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: // equal in p = 0; - case 147 /* Parameter */: - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return context.currentTokenSpan.kind === 58 /* EqualsToken */ || context.nextTokenSpan.kind === 58 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return context.currentTokenSpan.kind === 92 /* InKeyword */ || context.nextTokenSpan.kind === 92 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 217 /* ForOfStatement */: - return context.currentTokenSpan.kind === 143 /* OfKeyword */ || context.nextTokenSpan.kind === 143 /* OfKeyword */; + case 220 /* ForOfStatement */: + return context.currentTokenSpan.kind === 144 /* OfKeyword */ || context.nextTokenSpan.kind === 144 /* OfKeyword */; } return false; } @@ -92046,20 +94137,23 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 150 /* PropertyDeclaration */ || - contextKind === 149 /* PropertySignature */ || - contextKind === 147 /* Parameter */ || - contextKind === 227 /* VariableDeclaration */ || + return contextKind === 151 /* PropertyDeclaration */ || + contextKind === 150 /* PropertySignature */ || + contextKind === 148 /* Parameter */ || + contextKind === 230 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 196 /* ConditionalExpression */; + return context.contextNode.kind === 199 /* ConditionalExpression */ || + context.contextNode.kind === 170 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 175 /* ObjectBindingPattern */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 178 /* ObjectBindingPattern */ || + context.contextNode.kind === 176 /* MappedType */ || + isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration function isBeforeMultilineBlockContext(context) { @@ -92084,70 +94178,70 @@ var ts; return true; } switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 179 /* ObjectLiteralExpression */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 182 /* ObjectLiteralExpression */: + case 238 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 156 /* CallSignature */: - case 187 /* FunctionExpression */: - case 153 /* Constructor */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 190 /* FunctionExpression */: + case 154 /* Constructor */: + case 191 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 231 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one + case 234 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 229 /* FunctionDeclaration */ || context.contextNode.kind === 187 /* FunctionExpression */; + return context.contextNode.kind === 232 /* FunctionDeclaration */ || context.contextNode.kind === 190 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 164 /* TypeLiteral */: - case 234 /* ModuleDeclaration */: - case 245 /* ExportDeclaration */: - case 246 /* NamedExports */: - case 239 /* ImportDeclaration */: - case 242 /* NamedImports */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 165 /* TypeLiteral */: + case 237 /* ModuleDeclaration */: + case 248 /* ExportDeclaration */: + case 249 /* NamedExports */: + case 242 /* ImportDeclaration */: + case 245 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 230 /* ClassDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 264 /* CatchClause */: - case 235 /* ModuleBlock */: - case 222 /* SwitchStatement */: + case 233 /* ClassDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 267 /* CatchClause */: + case 238 /* ModuleBlock */: + case 225 /* SwitchStatement */: return true; - case 208 /* Block */: { + case 211 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 188 /* ArrowFunction */ && blockParent.kind !== 187 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 191 /* ArrowFunction */ && blockParent.kind !== 190 /* FunctionExpression */) { return true; } } @@ -92156,31 +94250,31 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 212 /* IfStatement */: - case 222 /* SwitchStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 225 /* TryStatement */: - case 213 /* DoStatement */: - case 221 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 224 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 264 /* CatchClause */: + case 267 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 179 /* ObjectLiteralExpression */; + return context.contextNode.kind === 182 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 182 /* CallExpression */; + return context.contextNode.kind === 185 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 183 /* NewExpression */; + return context.contextNode.kind === 186 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -92192,25 +94286,25 @@ var ts; return context.nextTokenSpan.kind !== 22 /* CloseBracketToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 188 /* ArrowFunction */; + return context.contextNode.kind === 191 /* ArrowFunction */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 250 /* JsxElement */ && context.contextNode.kind !== 254 /* JsxFragment */; + return context.contextNode.kind !== 253 /* JsxElement */ && context.contextNode.kind !== 257 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 260 /* JsxExpression */ || context.contextNode.kind === 259 /* JsxSpreadAttribute */; + return context.contextNode.kind === 263 /* JsxExpression */ || context.contextNode.kind === 262 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 257 /* JsxAttribute */; + return context.nextTokenParent.kind === 260 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 257 /* JsxAttribute */; + return context.contextNode.kind === 260 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 251 /* JsxSelfClosingElement */; + return context.contextNode.kind === 254 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -92225,45 +94319,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 228 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 231 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 234 /* ModuleDeclaration */; + return context.contextNode.kind === 237 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 164 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 165 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 157 /* ConstructSignature */; + return context.contextNode.kind === 158 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 27 /* LessThanToken */ && token.kind !== 29 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 160 /* TypeReference */: - case 185 /* TypeAssertionExpression */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 161 /* TypeReference */: + case 188 /* TypeAssertionExpression */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -92274,16 +94368,16 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 185 /* TypeAssertionExpression */; + return context.contextNode.kind === 188 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 191 /* VoidExpression */; + return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 194 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 198 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 201 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 204 /* NonNullExpression */; + return context.contextNode.kind === 207 /* NonNullExpression */; } })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -92335,12 +94429,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 143 /* LastKeyword */ && column <= 143 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 144 /* LastKeyword */ && column <= 144 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 143 /* LastToken */ + 1; + var mapRowLength = 144 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; @@ -92522,17 +94616,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 235 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 269 /* SourceFile */: - case 208 /* Block */: - case 235 /* ModuleBlock */: + return body && body.kind === 238 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 272 /* SourceFile */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -92755,19 +94849,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 230 /* ClassDeclaration */: return 75 /* ClassKeyword */; - case 231 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; - case 229 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; - case 233 /* EnumDeclaration */: return 233 /* EnumDeclaration */; - case 154 /* GetAccessor */: return 125 /* GetKeyword */; - case 155 /* SetAccessor */: return 135 /* SetKeyword */; - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: return 75 /* ClassKeyword */; + case 234 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; + case 232 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; + case 236 /* EnumDeclaration */: return 236 /* EnumDeclaration */; + case 155 /* GetAccessor */: return 125 /* GetKeyword */; + case 156 /* SetAccessor */: return 136 /* SetKeyword */; + case 153 /* MethodDeclaration */: if (node.asteriskToken) { return 39 /* AsteriskToken */; } // falls through - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: return ts.getNameOfDeclaration(node).kind; } } @@ -92812,15 +94906,15 @@ var ts; case 41 /* SlashToken */: case 29 /* GreaterThanToken */: switch (container.kind) { - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: return false; } break; case 21 /* OpenBracketToken */: case 22 /* CloseBracketToken */: - if (container.kind !== 173 /* MappedType */) { + if (container.kind !== 176 /* MappedType */) { return false; } break; @@ -92912,7 +95006,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 148 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 149 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 10 /* JsxText */) { @@ -92920,7 +95014,7 @@ var ts; indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false); } childContextNode = node; - if (isFirstListItem && parent.kind === 178 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 181 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -93227,17 +95321,14 @@ var ts; var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); } - function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; - } function recordDelete(start, len) { if (len) { - edits.push(newTextChange(start, len, "")); + edits.push(ts.createTextChangeFromStartLength(start, len, "")); } } function recordReplace(start, len, newText) { if (len || newText) { - edits.push(newTextChange(start, len, newText)); + edits.push(ts.createTextChangeFromStartLength(start, len, newText)); } } function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { @@ -93334,12 +95425,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 191 /* ArrowFunction */: if (node.typeParameters === list) { return 27 /* LessThanToken */; } @@ -93347,8 +95438,8 @@ var ts; return 19 /* OpenParenToken */; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -93356,7 +95447,7 @@ var ts; return 19 /* OpenParenToken */; } break; - case 160 /* TypeReference */: + case 161 /* TypeReference */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -93473,7 +95564,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 195 /* BinaryExpression */) { + if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 198 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -93629,7 +95720,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 269 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 272 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -93677,7 +95768,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 212 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 215 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 82 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -93692,37 +95783,37 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.parent.properties; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return node.parent.elements; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 153 /* Constructor */: - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: { + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 154 /* Constructor */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); - case 183 /* NewExpression */: - case 182 /* CallExpression */: { + case 186 /* NewExpression */: + case 185 /* CallExpression */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } @@ -93762,10 +95853,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: node = node.expression; break; default: @@ -93829,52 +95920,52 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 211 /* ExpressionStatement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 178 /* ArrayLiteralExpression */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 173 /* MappedType */: - case 166 /* TupleType */: - case 236 /* CaseBlock */: - case 262 /* DefaultClause */: - case 261 /* CaseClause */: - case 186 /* ParenthesizedExpression */: - case 180 /* PropertyAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 209 /* VariableStatement */: - case 227 /* VariableDeclaration */: - case 244 /* ExportAssignment */: - case 220 /* ReturnStatement */: - case 196 /* ConditionalExpression */: - case 176 /* ArrayBindingPattern */: - case 175 /* ObjectBindingPattern */: - case 252 /* JsxOpeningElement */: - case 255 /* JsxOpeningFragment */: - case 251 /* JsxSelfClosingElement */: - case 260 /* JsxExpression */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 147 /* Parameter */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 169 /* ParenthesizedType */: - case 184 /* TaggedTemplateExpression */: - case 192 /* AwaitExpression */: - case 246 /* NamedExports */: - case 242 /* NamedImports */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: + case 214 /* ExpressionStatement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 181 /* ArrayLiteralExpression */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 176 /* MappedType */: + case 167 /* TupleType */: + case 239 /* CaseBlock */: + case 265 /* DefaultClause */: + case 264 /* CaseClause */: + case 189 /* ParenthesizedExpression */: + case 183 /* PropertyAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 212 /* VariableStatement */: + case 230 /* VariableDeclaration */: + case 247 /* ExportAssignment */: + case 223 /* ReturnStatement */: + case 199 /* ConditionalExpression */: + case 179 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: + case 254 /* JsxSelfClosingElement */: + case 263 /* JsxExpression */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 148 /* Parameter */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 172 /* ParenthesizedType */: + case 187 /* TaggedTemplateExpression */: + case 195 /* AwaitExpression */: + case 249 /* NamedExports */: + case 245 /* NamedImports */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: return true; } return false; @@ -93882,29 +95973,29 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return childKind !== 208 /* Block */; - case 245 /* ExportDeclaration */: - return childKind !== 246 /* NamedExports */; - case 239 /* ImportDeclaration */: - return childKind !== 240 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 242 /* NamedImports */); - case 250 /* JsxElement */: - return childKind !== 253 /* JsxClosingElement */; - case 254 /* JsxFragment */: - return childKind !== 256 /* JsxClosingFragment */; + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return childKind !== 211 /* Block */; + case 248 /* ExportDeclaration */: + return childKind !== 249 /* NamedExports */; + case 242 /* ImportDeclaration */: + return childKind !== 243 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 245 /* NamedImports */); + case 253 /* JsxElement */: + return childKind !== 256 /* JsxClosingElement */; + case 257 /* JsxFragment */: + return childKind !== 259 /* JsxClosingFragment */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -93912,29 +96003,17 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: - switch (parent.kind) { - case 208 /* Block */: - var grandParent = parent.parent; - switch (grandParent && grandParent.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - // We may want to write inner functions after this. - return false; - default: - return true; - } - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: - return true; - default: - throw ts.Debug.fail(); + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: { + if (parent.kind !== 211 /* Block */) { + return true; } - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + var grandParent = parent.parent; + // In a function, we may want to write inner functions after this. + return !(grandParent && grandParent.kind === 190 /* FunctionExpression */ || grandParent.kind === 232 /* FunctionDeclaration */); + } + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return true; default: return false; @@ -93957,7 +96036,7 @@ var ts; var ts; (function (ts) { var textChanges; - (function (textChanges) { + (function (textChanges_1) { /** * Currently for simplicity we store recovered positions on the node itself. * It can be changed to side-table later if we decide that current design is too invasive. @@ -93984,7 +96063,7 @@ var ts; (function (Position) { Position[Position["FullStart"] = 0] = "FullStart"; Position[Position["Start"] = 1] = "Start"; - })(Position = textChanges.Position || (textChanges.Position = {})); + })(Position = textChanges_1.Position || (textChanges_1.Position = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); } @@ -94000,6 +96079,10 @@ var ts; } return false; } + textChanges_1.useNonAdjustedPositions = { + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; var ChangeKind; (function (ChangeKind) { ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; @@ -94009,10 +96092,10 @@ var ts; function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } - textChanges.getSeparatorCharacter = getSeparatorCharacter; + textChanges_1.getSeparatorCharacter = getSeparatorCharacter; function getAdjustedStartPosition(sourceFile, node, options, position) { if (options.useNonAdjustedStartPosition) { - return node.getFullStart(); + return node.getStart(sourceFile); } var fullStart = node.getFullStart(); var start = node.getStart(sourceFile); @@ -94039,7 +96122,7 @@ var ts; adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } - textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + textChanges_1.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); @@ -94050,12 +96133,12 @@ var ts; ? newEnd : end; } - textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + textChanges_1.getAdjustedEndPosition = getAdjustedEndPosition; /** * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 179 /* ObjectLiteralExpression */)); + return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 182 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -94065,18 +96148,17 @@ var ts; return s; } var ChangeTracker = /** @class */ (function () { - function ChangeTracker(newLine, formatContext, validator) { - this.newLine = newLine; + /** Public for tests only. Other callers should use `ChangeTracker.with`. */ + function ChangeTracker(newLineCharacter, formatContext) { + this.newLineCharacter = newLineCharacter; this.formatContext = formatContext; - this.validator = validator; this.changes = []; this.deletedNodesInLists = []; // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. // Map from class id to nodes to insert at the start this.nodesInsertedAtClassStarts = ts.createMap(); - this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); } ChangeTracker.fromContext = function (context) { - return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options) === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.formatContext); + return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); }; ChangeTracker.with = function (context, cb) { var tracker = ChangeTracker.fromContext(context); @@ -94087,6 +96169,7 @@ var ts; this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); return this; }; + /** Warning: This deletes comments too. See `copyComments` in `convertFunctionToEs6Class`. */ ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); @@ -94146,54 +96229,52 @@ var ts; } return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; - ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithSingleNode, - sourceFile: sourceFile, - options: options, - node: newNode, - range: { pos: startPosition, end: endPosition } - }); + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); return this; }; - ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithMultipleNodes, - sourceFile: sourceFile, - options: options, - nodes: newNodes, - range: { pos: startPosition, end: endPosition } - }); - return this; + ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; - ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes) { - this.replaceWithMultiple(sourceFile, oldNode.getStart(sourceFile), oldNode.getEnd(), newNodes, { nodeSeparator: this.newLineCharacter }); - }; - ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes) { - this.replaceWithMultiple(sourceFile, ts.first(oldNodes).getStart(sourceFile), ts.last(oldNodes).getEnd(), newNodes, { nodeSeparator: this.newLineCharacter }); + ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; + ChangeTracker.prototype.insertNodesAt = function (sourceFile, pos, newNodes, options) { + if (options === void 0) { options = {}; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, options: options, nodes: newNodes, range: { pos: pos, end: pos } }); + }; ChangeTracker.prototype.insertNodeAtTopOfFile = function (sourceFile, newNode, blankLineBetween) { var pos = getInsertionPositionAtSourceFileTop(sourceFile); this.insertNodeAt(sourceFile, pos, newNode, { @@ -94203,25 +96284,37 @@ var ts; }; ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { if (blankLineBetween === void 0) { blankLineBetween = false; } - var startPosition = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); - return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); + var pos = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); + return this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); }; ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { var pos = before.getStart(sourceFile); - this.replaceWithSingle(sourceFile, pos, pos, ts.createToken(modifier), { suffix: " " }); + this.replaceRange(sourceFile, { pos: pos, end: pos }, ts.createToken(modifier), { suffix: " " }); }; - ChangeTracker.prototype.changeIdentifierToPropertyAccess = function (sourceFile, prefix, node) { - var startPosition = getAdjustedStartPosition(sourceFile, node, {}, Position.Start); - this.replaceWithSingle(sourceFile, startPosition, startPosition, ts.createPropertyAccess(ts.createIdentifier(prefix), ""), {}); + /** Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node. */ + ChangeTracker.prototype.insertTypeAnnotation = function (sourceFile, node, type) { + var end = (ts.isFunctionLike(node) + // If no `)`, is an arrow function `x => x`, so use the end of the first parameter + ? ts.findChildOfKind(node, 20 /* CloseParenToken */, sourceFile) || ts.first(node.parameters) + : node.kind !== 230 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name).end; + this.insertNodeAt(sourceFile, end, type, { prefix: ": " }); + }; + ChangeTracker.prototype.insertTypeParameters = function (sourceFile, node, typeParameters) { + // If no `(`, is an arrow function `x => x`, so use the pos of the first parameter + var start = (ts.findChildOfKind(node, 19 /* OpenParenToken */, sourceFile) || ts.first(node.parameters)).getStart(sourceFile); + this.insertNodesAt(sourceFile, start, typeParameters, { prefix: "<", suffix: ">" }); }; ChangeTracker.prototype.getOptionsForInsertNodeBefore = function (before, doubleNewlines) { if (ts.isStatement(before) || ts.isClassElement(before)) { return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; } - else if (ts.isVariableDeclaration(before)) { + else if (ts.isVariableDeclaration(before)) { // insert `x = 1, ` into `const x = 1, y = 2; return { suffix: ", " }; } - throw ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it + else if (ts.isParameter(before)) { + return {}; + } + return ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it }; ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) { var firstStatement = ts.firstOrUndefined(ctr.body.statements); @@ -94245,8 +96338,8 @@ var ts; this.replaceNode(sourceFile, ctr.body, ts.createBlock(statements, /*multiLine*/ true), { useNonAdjustedEndPosition: true }); }; ChangeTracker.prototype.insertNodeAtEndOfScope = function (sourceFile, scope, newNode) { - var startPosition = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); - this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, { + var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); + this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, { prefix: ts.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, suffix: this.newLineCharacter }); @@ -94270,9 +96363,9 @@ var ts; }; ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) { if (ts.isStatementButNotDeclaration(after) || - after.kind === 150 /* PropertyDeclaration */ || - after.kind === 149 /* PropertySignature */ || - after.kind === 151 /* MethodSignature */) { + after.kind === 151 /* PropertyDeclaration */ || + after.kind === 150 /* PropertySignature */ || + after.kind === 152 /* MethodSignature */) { // check if previous statement ends with semicolon // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { @@ -94286,7 +96379,7 @@ var ts; } } var endPosition = getAdjustedEndPosition(sourceFile, after, {}); - return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, this.getInsertNodeAfterOptions(after)); + return this.replaceRange(sourceFile, { pos: endPosition, end: endPosition }, newNode, this.getInsertNodeAfterOptions(after)); }; ChangeTracker.prototype.getInsertNodeAfterOptions = function (node) { if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) { @@ -94298,7 +96391,10 @@ var ts; else if (ts.isVariableDeclaration(node)) { return { prefix: ", " }; } - throw ts.Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it + else if (ts.isParameter(node)) { + return {}; + } + return ts.Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it }; /** * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, @@ -94443,114 +96539,89 @@ var ts; var _this = this; this.nodesInsertedAtClassStarts.forEach(function (_a) { var sourceFile = _a.sourceFile, cls = _a.cls, members = _a.members; - var newCls = cls.kind === 230 /* ClassDeclaration */ + var newCls = cls.kind === 233 /* ClassDeclaration */ ? ts.updateClassDeclaration(cls, cls.decorators, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members) : ts.updateClassExpression(cls, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members); _this.replaceNode(sourceFile, cls, newCls, { useNonAdjustedEndPosition: true }); }); }; - ChangeTracker.prototype.getChanges = function () { - var _this = this; + /** + * Note: after calling this, the TextChanges object must be discarded! + * @param validate only for tests + * The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions, + * so we can only call this once and can't get the non-formatted text separately. + */ + ChangeTracker.prototype.getChanges = function (validate) { this.finishInsertNodeAtClassStart(); - var changesPerFile = ts.createMap(); - // group changes per file - for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { - var c = _a[_i]; - var changesInFile = changesPerFile.get(c.sourceFile.path); - if (!changesInFile) { - changesPerFile.set(c.sourceFile.path, changesInFile = []); - } - changesInFile.push(c); - } - // convert changes - var fileChangesList = []; - changesPerFile.forEach(function (changesInFile) { - var sourceFile = changesInFile[0].sourceFile; - var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; - for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { - var c = _a[_i]; - fileTextChanges.textChanges.push({ - span: _this.computeSpan(c, sourceFile), - newText: _this.computeNewText(c, sourceFile) - }); - } - fileChangesList.push(fileTextChanges); - }); - return fileChangesList; - }; - ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { - return ts.createTextSpanFromBounds(change.range.pos, change.range.end); - }; - ChangeTracker.prototype.computeNewText = function (change, sourceFile) { - var _this = this; - if (change.kind === ChangeKind.Remove) { - // deletion case - return ""; - } - var options = change.options || {}; - var text; - var pos = change.range.pos; - var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); - text = parts.join(change.options.nodeSeparator); - } - else { - ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); - text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); - } - // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line - text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); - }; - ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { - var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); - if (this.validator) { - this.validator(nonformattedText); - } - var formatOptions = this.formatContext.options; - var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - var initialIndentation = options.indentation !== undefined - ? options.indentation - : (options.useIndentationFromFile !== false) - ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) - : 0; - var delta = options.delta !== undefined - ? options.delta - : ts.formatting.SmartIndenter.shouldIndentChildNode(node) - ? (formatOptions.indentSize || 0) - : 0; - return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.formatContext); - }; - ChangeTracker.normalize = function (changes) { - // order changes by start position - var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); - // verify that change intervals do not overlap, except possibly at end points. - for (var i = 0; i < normalized.length - 2; i++) { - ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos); - } - return normalized; + return changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate); }; return ChangeTracker; }()); - textChanges.ChangeTracker = ChangeTracker; - function getNonformattedText(node, sourceFile, newLine) { - var options = { newLine: newLine, target: sourceFile && sourceFile.languageVersion }; - var writer = new Writer(ts.getNewLineCharacter(options)); - var printer = ts.createPrinter(options, writer); - printer.writeNode(4 /* Unspecified */, node, sourceFile, writer); - return { text: writer.getText(), node: assignPositionsToNode(node) }; - } - function applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, formatContext) { - var lineMap = ts.computeLineStarts(nonFormattedText.text); - var file = { - text: nonFormattedText.text, - lineMap: lineMap, - getLineAndCharacterOfPosition: function (pos) { return ts.computeLineAndCharacterOfPosition(lineMap, pos); } - }; - var changes = ts.formatting.formatNodeGivenIndentation(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, formatContext); - return applyChanges(nonFormattedText.text, changes); - } + textChanges_1.ChangeTracker = ChangeTracker; + var changesToText; + (function (changesToText) { + function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate) { + return ts.group(changes, function (c) { return c.sourceFile.path; }).map(function (changesInFile) { + var sourceFile = changesInFile[0].sourceFile; + // order changes by start position + var normalized = ts.stableSort(changesInFile, function (a, b) { return a.range.pos - b.range.pos; }); + var _loop_10 = function (i) { + ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () { + return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range); + }); + }; + // verify that change intervals do not overlap, except possibly at end points. + for (var i = 0; i < normalized.length - 2; i++) { + _loop_10(i); + } + var textChanges = normalized.map(function (c) { + return ts.createTextChange(ts.createTextSpanFromRange(c.range), computeNewText(c, sourceFile, newLineCharacter, formatContext, validate)); + }); + return { fileName: sourceFile.fileName, textChanges: textChanges }; + }); + } + changesToText.getTextChangesFromChanges = getTextChangesFromChanges; + function computeNewText(change, sourceFile, newLineCharacter, formatContext, validate) { + if (change.kind === ChangeKind.Remove) { + return ""; + } + var _a = change.options, options = _a === void 0 ? {} : _a, pos = change.range.pos; + var format = function (n) { return getFormattedTextOfNode(n, sourceFile, pos, options, newLineCharacter, formatContext, validate); }; + var text = change.kind === ChangeKind.ReplaceWithMultipleNodes + ? change.nodes.map(function (n) { return ts.removeSuffix(format(n), newLineCharacter); }).join(newLineCharacter) + : format(change.node); + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + var noIndent = (options.preserveLeadingWhitespace || options.indentation !== undefined || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + noIndent + (options.suffix || ""); + } + /** Note: this may mutate `nodeIn`. */ + function getFormattedTextOfNode(nodeIn, sourceFile, pos, options, newLineCharacter, formatContext, validate) { + var _a = getNonformattedText(nodeIn, sourceFile, newLineCharacter), node = _a.node, text = _a.text; + if (validate) + validate(node, text); + var formatOptions = formatContext.options; + var initialIndentation = options.indentation !== undefined + ? options.indentation + : (options.useIndentationFromFile !== false) + ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, options.prefix === newLineCharacter || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) + : 0; + var delta = options.delta !== undefined + ? options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(nodeIn) + ? (formatOptions.indentSize || 0) + : 0; + var file = { text: text, getLineAndCharacterOfPosition: function (pos) { return ts.getLineAndCharacterOfPosition(this, pos); } }; + var changes = ts.formatting.formatNodeGivenIndentation(node, file, sourceFile.languageVariant, initialIndentation, delta, formatContext); + return applyChanges(text, changes); + } + /** Note: output node may be mutated input node. */ + function getNonformattedText(node, sourceFile, newLineCharacter) { + var writer = new Writer(newLineCharacter); + var newLine = newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; + ts.createPrinter({ newLine: newLine }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + })(changesToText || (changesToText = {})); function applyChanges(text, changes) { for (var i = changes.length - 1; i >= 0; i--) { var change = changes[i]; @@ -94558,7 +96629,7 @@ var ts; } return text; } - textChanges.applyChanges = applyChanges; + textChanges_1.applyChanges = applyChanges; function isTrivia(s) { return ts.skipTrivia(s, 0) === s.length; } @@ -94820,16 +96891,9 @@ var ts; return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands); } codefix.codeFixAll = codeFixAll; - function codeFixAllWithTextChanges(context, errorCodes, use) { - var changes = []; - eachDiagnostic(context, errorCodes, function (diag) { return use(changes, diag); }); - changes.sort(function (a, b) { return b.span.start - a.span.start; }); - return createCombinedCodeActions([createFileTextChanges(context.sourceFile.fileName, changes)]); - } - codefix.codeFixAllWithTextChanges = codeFixAllWithTextChanges; function eachDiagnostic(_a, errorCodes, cb) { var program = _a.program, sourceFile = _a.sourceFile; - for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile); _i < _b.length; _i++) { + for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile).concat(ts.computeSuggestionDiagnostics(sourceFile, program)); _i < _b.length; _i++) { var diag = _b[_i]; if (ts.contains(errorCodes, diag.code)) { cb(diag); @@ -94895,6 +96959,806 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "annotateWithTypeFromJSDoc"; + var errorCodes = [ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var decl = getDeclaration(context.sourceFile, context.span.start); + if (!decl) + return; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Annotate_with_type_from_JSDoc); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, decl); }); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var decl = getDeclaration(diag.file, diag.start); + if (decl) + doChange(changes, diag.file, decl); + }); }, + }); + function getDeclaration(file, pos) { + var name = ts.getTokenAtPosition(file, pos, /*includeJsDocComment*/ false); + // For an arrow function with no name, 'name' lands on the first parameter. + return ts.tryCast(ts.isParameter(name.parent) ? name.parent.parent : name.parent, parameterShouldGetTypeFromJSDoc); + } + function parameterShouldGetTypeFromJSDoc(node) { + return isDeclarationWithType(node) && hasUsableJSDoc(node); + } + codefix.parameterShouldGetTypeFromJSDoc = parameterShouldGetTypeFromJSDoc; + function hasUsableJSDoc(decl) { + return ts.isFunctionLikeDeclaration(decl) + ? decl.parameters.some(hasUsableJSDoc) || (!decl.type && !!ts.getJSDocReturnType(decl)) + : !decl.type && !!ts.getJSDocType(decl); + } + function doChange(changes, sourceFile, decl) { + if (ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); }))) { + if (!decl.typeParameters) { + var typeParameters = ts.getJSDocTypeParameterDeclarations(decl); + if (typeParameters) + changes.insertTypeParameters(sourceFile, decl, typeParameters); + } + var needParens = ts.isArrowFunction(decl) && !ts.findChildOfKind(decl, 19 /* OpenParenToken */, sourceFile); + if (needParens) + changes.insertNodeBefore(sourceFile, ts.first(decl.parameters), ts.createToken(19 /* OpenParenToken */)); + for (var _i = 0, _a = decl.parameters; _i < _a.length; _i++) { + var param = _a[_i]; + if (!param.type) { + var paramType = ts.getJSDocType(param); + if (paramType) + changes.insertTypeAnnotation(sourceFile, param, transformJSDocType(paramType)); + } + } + if (needParens) + changes.insertNodeAfter(sourceFile, ts.last(decl.parameters), ts.createToken(20 /* CloseParenToken */)); + if (!decl.type) { + var returnType = ts.getJSDocReturnType(decl); + if (returnType) + changes.insertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType)); + } + } + else { + var jsdocType = ts.Debug.assertDefined(ts.getJSDocType(decl)); // If not defined, shouldn't have been an error to fix + ts.Debug.assert(!decl.type); // If defined, shouldn't have been an error to fix. + changes.insertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType)); + } + } + function isDeclarationWithType(node) { + return ts.isFunctionLikeDeclaration(node) || + node.kind === 230 /* VariableDeclaration */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 151 /* PropertyDeclaration */; + } + function transformJSDocType(node) { + switch (node.kind) { + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: + return ts.createTypeReferenceNode("any", ts.emptyArray); + case 279 /* JSDocOptionalType */: + return transformJSDocOptionalType(node); + case 278 /* JSDocNonNullableType */: + return transformJSDocType(node.type); + case 277 /* JSDocNullableType */: + return transformJSDocNullableType(node); + case 281 /* JSDocVariadicType */: + return transformJSDocVariadicType(node); + case 280 /* JSDocFunctionType */: + return transformJSDocFunctionType(node); + case 161 /* TypeReference */: + return transformJSDocTypeReference(node); + default: + var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); + ts.setEmitFlags(visited, 1 /* SingleLine */); + return visited; + } + } + function transformJSDocOptionalType(node) { + return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("undefined", ts.emptyArray)]); + } + function transformJSDocNullableType(node) { + return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("null", ts.emptyArray)]); + } + function transformJSDocVariadicType(node) { + return ts.createArrayTypeNode(ts.visitNode(node.type, transformJSDocType)); + } + function transformJSDocFunctionType(node) { + return ts.createFunctionTypeNode(ts.emptyArray, node.parameters.map(transformJSDocParameter), node.type); + } + function transformJSDocParameter(node) { + var index = node.parent.parameters.indexOf(node); + var isRest = node.type.kind === 281 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + var name = node.name || (isRest ? "rest" : "arg" + index); + var dotdotdot = isRest ? ts.createToken(24 /* DotDotDotToken */) : node.dotDotDotToken; + return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); + } + function transformJSDocTypeReference(node) { + var name = node.typeName; + var args = node.typeArguments; + if (ts.isIdentifier(node.typeName)) { + if (ts.isJSDocIndexSignature(node)) { + return transformJSDocIndexSignature(node); + } + var text = node.typeName.text; + switch (node.typeName.text) { + case "String": + case "Boolean": + case "Object": + case "Number": + text = text.toLowerCase(); + break; + case "array": + case "date": + case "promise": + text = text[0].toUpperCase() + text.slice(1); + break; + } + name = ts.createIdentifier(text); + if ((text === "Array" || text === "Promise") && !node.typeArguments) { + args = ts.createNodeArray([ts.createTypeReferenceNode("any", ts.emptyArray)]); + } + else { + args = ts.visitNodes(node.typeArguments, transformJSDocType); + } + } + return ts.createTypeReferenceNode(name, args); + } + function transformJSDocIndexSignature(node) { + var index = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "number" : "string", []), + /*initializer*/ undefined); + var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); + ts.setEmitFlags(indexSignature, 1 /* SingleLine */); + return indexSignature; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "convertFunctionToEs6Class"; + var errorCodes = [ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, context.span.start, context.program.getTypeChecker()); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_function_to_an_ES2015_class), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, err) { return doChange(changes, err.file, err.start, context.program.getTypeChecker()); }); }, + }); + function doChange(changes, sourceFile, position, checker) { + var deletedNodes = []; + var deletes = []; + var ctorSymbol = checker.getSymbolAtLocation(ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false)); + if (!ctorSymbol || !(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { + // Bad input + return undefined; + } + var ctorDeclaration = ctorSymbol.valueDeclaration; + var precedingNode; + var newClassDeclaration; + switch (ctorDeclaration.kind) { + case 232 /* FunctionDeclaration */: + precedingNode = ctorDeclaration; + deleteNode(ctorDeclaration); + newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); + break; + case 230 /* VariableDeclaration */: + precedingNode = ctorDeclaration.parent.parent; + if (ctorDeclaration.parent.declarations.length === 1) { + deleteNode(precedingNode); + } + else { + deleteNode(ctorDeclaration, /*inList*/ true); + } + newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + break; + } + if (!newClassDeclaration) { + return undefined; + } + copyComments(ctorDeclaration, newClassDeclaration, sourceFile); + // Because the preceding node could be touched, we need to insert nodes before delete nodes. + changes.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); + for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { + var deleteCallback = deletes_1[_i]; + deleteCallback(); + } + function deleteNode(node, inList) { + if (inList === void 0) { inList = false; } + if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { + // Parent node has already been deleted; do nothing + return; + } + deletedNodes.push(node); + if (inList) { + deletes.push(function () { return changes.deleteNodeInList(sourceFile, node); }); + } + else { + deletes.push(function () { return changes.deleteNode(sourceFile, node); }); + } + } + function createClassElementsFromSymbol(symbol) { + var memberElements = []; + // all instance members are stored in the "member" array of symbol + if (symbol.members) { + symbol.members.forEach(function (member) { + var memberElement = createClassElement(member, /*modifiers*/ undefined); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + // all static members are stored in the "exports" array of symbol + if (symbol.exports) { + symbol.exports.forEach(function (member) { + var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + // Right now the only thing we can convert are function expressions - other values shouldn't get + // transformed. We can update this once ES public class properties are available. + return ts.isFunctionLike(source); + } + function createClassElement(symbol, modifiers) { + // both properties and methods are bound as property symbols + if (!(symbol.flags & 4 /* Property */)) { + return; + } + var memberDeclaration = symbol.valueDeclaration; + var assignmentBinaryExpression = memberDeclaration.parent; + if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { + return; + } + // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 214 /* ExpressionStatement */ + ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + deleteNode(nodeToDelete); + if (!assignmentBinaryExpression.right) { + return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, + /*type*/ undefined, /*initializer*/ undefined); + } + switch (assignmentBinaryExpression.right.kind) { + case 190 /* FunctionExpression */: { + var functionExpression = assignmentBinaryExpression.right; + var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120 /* AsyncKeyword */)); + var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); + copyComments(assignmentBinaryExpression, method, sourceFile); + return method; + } + case 191 /* ArrowFunction */: { + var arrowFunction = assignmentBinaryExpression.right; + var arrowFunctionBody = arrowFunction.body; + var bodyBlock = void 0; + // case 1: () => { return [1,2,3] } + if (arrowFunctionBody.kind === 211 /* Block */) { + bodyBlock = arrowFunctionBody; + } + // case 2: () => [1,2,3] + else { + bodyBlock = ts.createBlock([ts.createReturn(arrowFunctionBody)]); + } + var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120 /* AsyncKeyword */)); + var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); + copyComments(assignmentBinaryExpression, method, sourceFile); + return method; + } + default: { + // Don't try to declare members in JavaScript files + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, + /*type*/ undefined, assignmentBinaryExpression.right); + copyComments(assignmentBinaryExpression.parent, prop, sourceFile); + return prop; + } + } + } + } + function createClassFromVariableDeclaration(node) { + var initializer = node.initializer; + if (!initializer || initializer.kind !== 190 /* FunctionExpression */) { + return undefined; + } + if (node.name.kind !== 71 /* Identifier */) { + return undefined; + } + var memberElements = createClassElementsFromSymbol(initializer.symbol); + if (initializer.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); + } + var modifiers = getModifierKindFromSource(precedingNode, 84 /* ExportKeyword */); + var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } + function createClassFromFunctionDeclaration(node) { + var memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); + } + var modifiers = getModifierKindFromSource(node, 84 /* ExportKeyword */); + var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } + } + function copyComments(sourceNode, targetNode, sourceFile) { + ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { + if (kind === 3 /* MultiLineCommentTrivia */) { + // Remove leading /* + pos += 2; + // Remove trailing */ + end -= 2; + } + else { + // Remove leading // + pos += 2; + } + ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); + }); + } + function getModifierKindFromSource(source, kind) { + return ts.filter(source.modifiers, function (modifier) { return modifier.kind === kind; }); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module.code], + getCodeActions: function (context) { + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); + var sourceFile = context.sourceFile, program = context.program; + var changes = ts.textChanges.ChangeTracker.with(context, function (changes) { + var moduleExportsChangedToDefault = convertFileToEs6Module(sourceFile, program.getTypeChecker(), changes, program.getCompilerOptions().target); + if (moduleExportsChangedToDefault) { + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var importingFile = _a[_i]; + fixImportOfModuleExports(importingFile, sourceFile, changes); + } + } + }); + // No support for fix-all since this applies to the whole file at once anyway. + return [{ description: description, changes: changes, fixId: undefined }]; + }, + }); + function fixImportOfModuleExports(importingFile, exportingFile, changes) { + for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + var parent = moduleSpecifier.parent; + switch (parent.kind) { + case 252 /* ExternalModuleReference */: { + var importEq = parent.parent; + changes.replaceNode(importingFile, importEq, makeImport(importEq.name, /*namedImports*/ undefined, moduleSpecifier.text)); + break; + } + case 185 /* CallExpression */: { + var call = parent; + if (ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ false)) { + changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); + } + break; + } + } + } + } + /** @returns Whether we converted a `module.exports =` to a default export. */ + function convertFileToEs6Module(sourceFile, checker, changes, target) { + var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; + var exports = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports, changes); + var moduleExportsChangedToDefault = false; + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + var res = ts.createMap(); + forEachExportReference(sourceFile, function (node) { + var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; + if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) + || checker.resolveName(node.name.text, node, 67216319 /* Value */, /*excludeGlobals*/ true))) { + // Unconditionally add an underscore in case `text` is a keyword. + res.set(text, makeUniqueName("_" + text, identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports, changes) { + forEachExportReference(sourceFile, function (node, isAssignmentLhs) { + if (isAssignmentLhs) { + return; + } + var text = node.name.text; + changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { + var parent = node.parent; + cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58 /* EqualsToken */); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { + switch (statement.kind) { + case 212 /* VariableStatement */: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); + return false; + case 214 /* ExpressionStatement */: { + var expression = statement.expression; + switch (expression.kind) { + case 185 /* CallExpression */: { + if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteral*/ true)) { + // For side-effecting require() call, just make a side-effecting import. + changes.replaceNode(sourceFile, statement, makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0].text)); + } + return false; + } + case 198 /* BinaryExpression */: { + var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return operatorToken.kind === 58 /* EqualsToken */ && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); + } + } + } + // falls through + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { + var declarationList = statement.declarationList; + var foundImport = false; + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { + var name = decl.name, initializer = decl.initializer; + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + // `const alias = module.exports;` can be removed. + foundImport = true; + return []; + } + if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); + } + else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); + } + else { + // Move it out to its own variable statement. + return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); + } + }); + if (foundImport) { + // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + } + /** Converts `const name = require("moduleSpecifier").propertyName` */ + function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: { + // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` + var tmp = makeUniqueName(propertyName, identifiers); + return [ + makeSingleImport(tmp, propertyName, moduleSpecifier), + makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + // `const a = require("b").c` --> `import { c as a } from "./b"; + return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; + default: + ts.Debug.assertNever(name); + } + } + function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { + if (!ts.isPropertyAccessExpression(left)) { + return false; + } + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { + // `const alias = module.exports;` or `module.exports = alias;` can be removed. + changes.deleteNode(sourceFile, statement); + } + else { + var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; + var changedToDefaultExport = false; + if (!newNodes) { + (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); + } + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + return changedToDefaultExport; + } + } + else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, statement, left.name, right, changes, exports); + } + return false; + var _a; + } + /** + * Convert `module.exports = { ... }` to individual exports.. + * We can't always do this if the module has interesting members -- then it will be a default export instead. + */ + function tryChangeModuleExportsObject(object) { + return ts.mapAllOrFail(object.properties, function (prop) { + switch (prop.kind) { + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. + case 269 /* ShorthandPropertyAssignment */: + case 270 /* SpreadAssignment */: + return undefined; + case 268 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals(prop.name.text, prop.initializer); + case 153 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(84 /* ExportKeyword */)], prop); + default: + ts.Debug.assertNever(prop); + } + }); + } + function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { + // If "originalKeywordKind" was set, this is e.g. `exports. + var text = propertyName.text; + var rename = exports.get(text); + if (rename !== undefined) { + /* + const _class = 0; + export { _class as class }; + */ + var newNodes = [ + makeConst(/*modifiers*/ undefined, rename, right), + makeExportDeclaration([ts.createExportSpecifier(rename, text)]), + ]; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + else { + changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); + } + } + function convertModuleExportsToExportDefault(exported, checker) { + var modifiers = [ts.createToken(84 /* ExportKeyword */), ts.createToken(79 /* DefaultKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: { + // `module.exports = function f() {}` --> `export default function f() {}` + var fn = exported; + return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; + } + case 203 /* ClassExpression */: { + // `module.exports = class C {}` --> `export default class C {}` + var cls = exported; + return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; + } + case 185 /* CallExpression */: + if (ts.isRequireCall(exported, /*checkArgumentIsStringLiteral*/ true)) { + return convertReExportAll(exported.arguments[0], checker); + } + // falls through + default: + // `module.exports = 0;` --> `export default 0;` + return [[ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, exported)], true]; + } + } + function convertReExportAll(reExported, checker) { + // `module.exports = require("x");` ==> `export * from "x"; export { default } from "x";` + var moduleSpecifier = reExported.text; + var moduleSymbol = checker.getSymbolAtLocation(reExported); + var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; + return exports.has("export=") + ? [[reExportDefault(moduleSpecifier)], true] + : !exports.has("default") + ? [[reExportStar(moduleSpecifier)], false] + // If there's some non-default export, must include both `export *` and `export default`. + : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([ts.createExportSpecifier(/*propertyName*/ undefined, "default")], moduleSpecifier); + } + function convertExportsDotXEquals(name, exported) { + var modifiers = [ts.createToken(84 /* ExportKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: { + var expressionName = exported.name; + if (expressionName && expressionName.text !== name) { + // `exports.f = function g() {}` -> `export const f = function g() {}` + return exportConst(); + } + } + // falls through + case 191 /* ArrowFunction */: + // `exports.f = function() {}` --> `export function f() {}` + return functionExpressionToDeclaration(name, modifiers, exported); + case 203 /* ClassExpression */: + // `exports.C = class {}` --> `export class C {}` + return classExpressionToDeclaration(name, modifiers, exported); + default: + return exportConst(); + } + function exportConst() { + // `exports.x = 0;` --> `export const x = 0;` + return makeConst(modifiers, ts.createIdentifier(name), exported); + } + } + /** + * Converts `const <> = require("x");`. + * Returns nodes that will replace the variable declaration for the commonjs import. + * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. + */ + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: { + var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { + return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) + ? undefined + : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); + }); + if (importSpecifiers) { + return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier)]; + } + } + // falls through -- object destructuring has an interesting pattern and must be a variable declaration + case 179 /* ArrayBindingPattern */: { + /* + import x from "x"; + const [a, b, c] = x; + */ + var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); + return [ + makeImport(ts.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), + makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); + default: + ts.Debug.assertNever(name); + } + } + /** + * Convert `import x = require("x").` + * Also converts uses like `x.y()` to `y()` and uses a named import. + */ + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { + var nameSymbol = checker.getSymbolAtLocation(name); + // Maps from module property name to name actually used. (The same if there isn't shadowing.) + var namedBindingsNames = ts.createMap(); + // True if there is some non-property use like `x()` or `f(x)`. + var needDefaultImport = false; + for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { + var use = _a[_i]; + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { + // This was a use of a different symbol with the same name, due to shadowing. Ignore. + continue; + } + var parent = use.parent; + if (ts.isPropertyAccessExpression(parent)) { + var expression = parent.expression, propertyName = parent.name.text; + ts.Debug.assert(expression === use); // Else shouldn't have been in `collectIdentifiers` + var idName = namedBindingsNames.get(propertyName); + if (idName === undefined) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + changes.replaceNode(file, parent, ts.createIdentifier(idName)); + } + else { + needDefaultImport = true; + } + } + var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { + var propertyName = _a[0], idName = _a[1]; + return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); + })); + if (!namedBindings) { + // If it was unused, ensure that we at least import *something*. + needDefaultImport = true; + } + return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; + } + // Identifiers helpers + function makeUniqueName(name, identifiers) { + while (identifiers.original.has(name) || identifiers.additional.has(name)) { + name = "_" + name; + } + identifiers.additional.set(name, true); + return name; + } + function collectFreeIdentifiers(file) { + var map = ts.createMultiMap(); + file.forEachChild(function recur(node) { + if (ts.isIdentifier(node) && isFreeIdentifier(node)) { + map.add(node.text, node); + } + node.forEachChild(recur); + }); + return map; + } + function isFreeIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + return parent.name !== node; + case 180 /* BindingElement */: + return parent.propertyName !== node; + default: + return true; + } + } + // Node helpers + function functionExpressionToDeclaration(name, additionalModifiers, fn) { + return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); + } + function classExpressionToDeclaration(name, additionalModifiers, cls) { + return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); + } + function makeSingleImport(localName, propertyName, moduleSpecifier) { + return propertyName === "default" + ? makeImport(ts.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier) + : makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); + } + function makeImport(name, namedImports, moduleSpecifier) { + return makeImportDeclaration(name, namedImports, ts.createLiteral(moduleSpecifier)); + } + function makeImportDeclaration(name, namedImports, moduleSpecifier) { + var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); + return ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, moduleSpecifier); + } + codefix.makeImportDeclaration = makeImportDeclaration; + function makeImportSpecifier(propertyName, name) { + return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); + } + function makeConst(modifiers, name, init) { + return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, /*type*/ undefined, init)], 2 /* Const */)); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return ts.createExportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -94967,9 +97831,7 @@ var ts; }, }); function getClass(sourceFile, pos) { - var classDeclaration = ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false)); - ts.Debug.assert(!!classDeclaration); - return classDeclaration; + return ts.Debug.assertDefined(ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false))); } function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker) { // Note that this is ultimately derived from a map indexed by symbol names, @@ -95080,7 +97942,7 @@ var ts; else { var leftExpressionType = checker.getTypeAtLocation(parent.expression); var symbol = leftExpressionType.symbol; - if (!(leftExpressionType.flags & 65536 /* Object */ && symbol.flags & 32 /* Class */)) { + if (!(symbol && leftExpressionType.flags & 65536 /* Object */ && symbol.flags & 32 /* Class */)) { return undefined; } var classDeclaration = ts.cast(ts.first(symbol.declarations), ts.isClassLike); @@ -95097,7 +97959,7 @@ var ts; } function addMissingMemberInJs(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { if (makeStatic) { - if (classDeclaration.kind === 200 /* ClassExpression */) { + if (classDeclaration.kind === 203 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -95123,7 +97985,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 195 /* BinaryExpression */) { + if (token.parent.parent.kind === 198 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -95146,7 +98008,7 @@ var ts; } function createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(136 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(137 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -95228,10 +98090,10 @@ var ts; flags |= 1920 /* Namespace */; } if (meaning & 2 /* Type */) { - flags |= 793064 /* Type */; + flags |= 67901928 /* Type */; } if (meaning & 1 /* Value */) { - flags |= 107455 /* Value */; + flags |= 67216319 /* Value */; } return flags; } @@ -95277,7 +98139,6 @@ var ts; commands: [getCommand(fileName, packageName)], }; } - codefix.tryGetCodeActionForInstallPackageTypes = tryGetCodeActionForInstallPackageTypes; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -95300,17 +98161,21 @@ var ts; return changes.length === 0 ? undefined : [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), changes: changes, fixId: fixId }]; }, fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { - addMissingMembers(getClass(diag.file, diag.start), context.sourceFile, context.program.getTypeChecker(), changes); - }); }, + getAllCodeActions: function (context) { + var seenClassDeclarations = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { + addMissingMembers(classDeclaration, context.sourceFile, context.program.getTypeChecker(), changes); + } + }); + }, }); function getClass(sourceFile, pos) { - // This is the identifier in the case of a class declaration + // Token is the identifier in the case of a class declaration // or the class keyword token in the case of a class expression. var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); - var classDeclaration = token.parent; - ts.Debug.assert(ts.isClassLike(classDeclaration)); - return classDeclaration; + return ts.cast(token.parent, ts.isClassLike); } function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker) { var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); @@ -95367,7 +98232,8 @@ var ts; } function getNodes(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); - ts.Debug.assert(token.kind === 99 /* ThisKeyword */); + if (token.kind !== 99 /* ThisKeyword */) + return undefined; var constructor = ts.getContainingFunction(token); var superCall = findSuperCall(constructor.body); // figure out if the `this` access is actually inside the supercall @@ -95446,7 +98312,7 @@ var ts; return extendsToken.kind === 85 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; } function doChanges(changes, sourceFile, extendsToken, heritageClauses) { - changes.replaceRange(sourceFile, { pos: extendsToken.getStart(), end: extendsToken.end }, ts.createToken(108 /* ImplementsKeyword */)); + changes.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */), ts.textChanges.useNonAdjustedPositions); // If there is already an implements clause, replace the implements keyword with a comma. if (heritageClauses.length === 2 && heritageClauses[0].token === 85 /* ExtendsKeyword */ && @@ -95478,6 +98344,9 @@ var ts; getCodeActions: function (context) { var sourceFile = context.sourceFile; var token = getNode(sourceFile, context.span.start); + if (!token) { + return undefined; + } var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, token); }); return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), changes: changes, fixId: fixId }]; }, @@ -95487,10 +98356,16 @@ var ts; }); }, }); function getNode(sourceFile, pos) { - return ts.cast(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), ts.isIdentifier); + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return ts.isIdentifier(node) ? node : undefined; } function doChange(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); + if (!token) { + return; + } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper + ts.suppressLeadingAndTrailingTrivia(token); + changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token), ts.textChanges.useNonAdjustedPositions); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -95504,19 +98379,26 @@ var ts; var errorCodes = [ ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + ts.Diagnostics.All_imports_in_import_declaration_are_unused.code, ]; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = getToken(sourceFile, context.span.start); + var errorCode = context.errorCode, sourceFile = context.sourceFile; + var importDecl = tryGetFullImport(sourceFile, context.span.start); + if (importDecl) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_import_from_0), [ts.showModuleSpecifier(importDecl)]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.deleteNode(sourceFile, importDecl); }); + return [{ description: description, changes: changes, fixId: fixIdDelete }]; + } + var token = getToken(sourceFile, ts.textSpanEnd(context.span)); var result = []; var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token); }); if (deletion.length) { var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), [token.getText()]); result.push({ description: description, changes: deletion, fixId: fixIdDelete }); } - var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, context.errorCode, sourceFile, token); }); + var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, errorCode, sourceFile, token); }); if (prefix.length) { var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), [token.getText()]); result.push({ description: description, changes: prefix, fixId: fixIdPrefix }); @@ -95526,7 +98408,7 @@ var ts; fixIds: [fixIdPrefix, fixIdDelete], getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var sourceFile = context.sourceFile; - var token = getToken(diag.file, diag.start); + var token = ts.findPrecedingToken(ts.textSpanEnd(diag), diag.file); switch (context.fixId) { case fixIdPrefix: if (ts.isIdentifier(token) && canPrefix(token)) { @@ -95534,17 +98416,28 @@ var ts; } break; case fixIdDelete: - tryDeleteDeclaration(changes, sourceFile, token); + var importDecl = tryGetFullImport(diag.file, diag.start); + if (importDecl) { + changes.deleteNode(sourceFile, importDecl); + } + else { + tryDeleteDeclaration(changes, sourceFile, token); + } break; default: ts.Debug.fail(JSON.stringify(context.fixId)); } }); }, }); + // Sometimes the diagnostic span is an entire ImportDeclaration, so we should remove the whole thing. + function tryGetFullImport(sourceFile, pos) { + var startToken = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return startToken.kind === 91 /* ImportKeyword */ ? ts.tryCast(startToken.parent, ts.isImportDeclaration) : undefined; + } function getToken(sourceFile, pos) { - var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var token = ts.findPrecedingToken(pos, sourceFile); // this handles var ["computed"] = 12; - return token.kind === 21 /* OpenBracketToken */ ? ts.getTokenAtPosition(sourceFile, pos + 1, /*includeJsDocComment*/ false) : token; + return token.kind === 22 /* CloseBracketToken */ ? ts.findPrecedingToken(pos - 1, sourceFile) : token; } function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { // Don't offer to prefix a property. @@ -95554,13 +98447,13 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 147 /* Parameter */: + case 148 /* Parameter */: return true; - case 227 /* VariableDeclaration */: { + case 230 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 217 /* ForOfStatement */: - case 216 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 219 /* ForInStatement */: return true; } } @@ -95572,8 +98465,8 @@ var ts; case 71 /* Identifier */: tryDeleteIdentifier(changes, sourceFile, token); break; - case 150 /* PropertyDeclaration */: - case 241 /* NamespaceImport */: + case 151 /* PropertyDeclaration */: + case 244 /* NamespaceImport */: changes.deleteNode(sourceFile, token.parent); break; default: @@ -95591,10 +98484,10 @@ var ts; function tryDeleteIdentifier(changes, sourceFile, identifier) { var parent = identifier.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: tryDeleteVariableDeclaration(changes, sourceFile, parent); break; - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: var typeParameters = parent.parent.typeParameters; if (typeParameters.length === 1) { var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); @@ -95607,7 +98500,7 @@ var ts; changes.deleteNodeInList(sourceFile, parent); } break; - case 147 /* Parameter */: + case 148 /* Parameter */: var oldFunction = parent.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) { // Lambdas with exactly one parameter are special because, after removal, there @@ -95619,18 +98512,18 @@ var ts; // to replace the span (vs the full span) of the old function - the old leading // and trailing trivia will remain. ts.suppressLeadingAndTrailingTrivia(newFunction); - changes.replaceRange(sourceFile, { pos: oldFunction.getStart(), end: oldFunction.end }, newFunction); + changes.replaceNode(sourceFile, oldFunction, newFunction, ts.textChanges.useNonAdjustedPositions); } else { changes.deleteNodeInList(sourceFile, parent); } break; // handle case where 'import a = A;' - case 238 /* ImportEqualsDeclaration */: - var importEquals = ts.getAncestor(identifier, 238 /* ImportEqualsDeclaration */); + case 241 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(identifier, 241 /* ImportEqualsDeclaration */); changes.deleteNode(sourceFile, importEquals); break; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: var namedImports = parent.parent; if (namedImports.elements.length === 1) { tryDeleteNamedImportBinding(changes, sourceFile, namedImports); @@ -95640,10 +98533,10 @@ var ts; changes.deleteNodeInList(sourceFile, parent); } break; - case 240 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' + case 243 /* ImportClause */: // this covers both 'import |d|' and 'import |d,| *' var importClause = parent; - if (!importClause.namedBindings) { - changes.deleteNode(sourceFile, ts.getAncestor(importClause, 239 /* ImportDeclaration */)); + if (!importClause.namedBindings) { // |import d from './file'| + changes.deleteNode(sourceFile, ts.getAncestor(importClause, 242 /* ImportDeclaration */)); } else { // import |d,| * as ns from './file' @@ -95659,7 +98552,7 @@ var ts; } } break; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: tryDeleteNamedImportBinding(changes, sourceFile, parent); break; default: @@ -95681,14 +98574,14 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(namedBindings, 239 /* ImportDeclaration */); + var importDecl = ts.getAncestor(namedBindings, 242 /* ImportDeclaration */); changes.deleteNode(sourceFile, importDecl); } } // token.parent is a variableDeclaration function tryDeleteVariableDeclaration(changes, sourceFile, varDecl) { switch (varDecl.parent.parent.kind) { - case 215 /* ForStatement */: { + case 218 /* ForStatement */: { var forStatement = varDecl.parent.parent; var forInitializer = forStatement.initializer; if (forInitializer.declarations.length === 1) { @@ -95699,14 +98592,14 @@ var ts; } break; } - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: var forOfStatement = varDecl.parent.parent; - ts.Debug.assert(forOfStatement.initializer.kind === 228 /* VariableDeclarationList */); + ts.Debug.assert(forOfStatement.initializer.kind === 231 /* VariableDeclarationList */); var forOfInitializer = forOfStatement.initializer; changes.replaceNode(sourceFile, forOfInitializer.declarations[0], ts.createObjectLiteral()); break; - case 216 /* ForInStatement */: - case 225 /* TryStatement */: + case 219 /* ForInStatement */: + case 228 /* TryStatement */: break; default: var variableStatement = varDecl.parent.parent; @@ -95739,66 +98632,61 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain)]; - if (typeNode.kind === 274 /* JSDocNullableType */) { + if (typeNode.kind === 277 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 4096 /* Undefined */), fixIdNullable)); } return actions; function fix(type, fixId) { - var newText = typeString(type, checker); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]), - changes: [codefix.createFileTextChanges(sourceFile.fileName, [createChange(typeNode, sourceFile, newText)])], - fixId: fixId, - }; + var newText = checker.typeToString(type); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, typeNode, type, checker); }); + return { description: description, changes: changes, fixId: fixId }; } }, fixIds: [fixIdPlain, fixIdNullable], getAllCodeActions: function (context) { var fixId = context.fixId, program = context.program, sourceFile = context.sourceFile; var checker = program.getTypeChecker(); - return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + return codefix.codeFixAll(context, errorCodes, function (changes, err) { var info = getInfo(err.file, err.start, checker); if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 274 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 4096 /* Undefined */) : type; - changes.push(createChange(typeNode, sourceFile, typeString(fixedType, checker))); + var fixedType = typeNode.kind === 277 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 4096 /* Undefined */) : type; + doChange(changes, sourceFile, typeNode, fixedType, checker); }); } }); + function doChange(changes, sourceFile, oldTypeNode, newType, checker) { + changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode(newType, /*enclosingDeclaration*/ oldTypeNode)); + } function getInfo(sourceFile, pos, checker) { var decl = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isTypeContainer); var typeNode = decl && decl.type; return typeNode && { typeNode: typeNode, type: checker.getTypeFromTypeNode(typeNode) }; } - function createChange(declaration, sourceFile, newText) { - return { span: ts.createTextSpanFromBounds(declaration.getStart(sourceFile), declaration.getEnd()), newText: newText }; - } - function typeString(type, checker) { - return checker.typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* NoTruncation */); - } function isTypeContainer(node) { // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 203 /* AsExpression */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 229 /* FunctionDeclaration */: - case 154 /* GetAccessor */: - case 158 /* IndexSignature */: - case 173 /* MappedType */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 155 /* SetAccessor */: - case 232 /* TypeAliasDeclaration */: - case 185 /* TypeAssertionExpression */: - case 227 /* VariableDeclaration */: + case 206 /* AsExpression */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 155 /* GetAccessor */: + case 159 /* IndexSignature */: + case 176 /* MappedType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: + case 188 /* TypeAssertionExpression */: + case 230 /* VariableDeclaration */: return true; default: return false; @@ -95849,14 +98737,14 @@ var ts; var containingFunction = ts.getContainingFunction(token); var insertBefore; switch (containingFunction.kind) { - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 89 /* FunctionKeyword */, sourceFile); break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 19 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -95897,116 +98785,15 @@ var ts; fixIds: [], getAllCodeActions: ts.notImplemented, }); - var ModuleSpecifierComparison; - (function (ModuleSpecifierComparison) { - ModuleSpecifierComparison[ModuleSpecifierComparison["Better"] = 0] = "Better"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; - })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = /** @class */ (function () { - function ImportCodeActionMap() { - this.symbolIdToActionMap = []; - } - ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { - var actions = this.symbolIdToActionMap[symbolId]; - if (!actions) { - this.symbolIdToActionMap[symbolId] = [newAction]; - return; - } - if (newAction.kind === "CodeChange") { - actions.push(newAction); - return; - } - var updatedNewImports = []; - for (var _i = 0, _a = this.symbolIdToActionMap[symbolId]; _i < _a.length; _i++) { - var existingAction = _a[_i]; - if (existingAction.kind === "CodeChange") { - // only import actions should compare - updatedNewImports.push(existingAction); - continue; - } - switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { - case 0 /* Better */: - // the new one is not worth considering if it is a new import. - // However if it is instead a insertion into existing import, the user might want to use - // the module specifier even it is worse by our standards. So keep it. - if (newAction.kind === "NewImport") { - return; - } - // falls through - case 1 /* Equal */: - // the current one is safe. But it is still possible that the new one is worse - // than another existing one. For example, you may have new imports from "./foo/bar" - // and "bar", when the new one is "bar/bar2" and the current one is "./foo/bar". The new - // one and the current one are not comparable (one relative path and one absolute path), - // but the new one is worse than the other one, so should not add to the list. - updatedNewImports.push(existingAction); - break; - case 2 /* Worse */: - // the existing one is worse, remove from the list. - continue; - } - } - // if we reach here, it means the new one is better or equal to all of the existing ones. - updatedNewImports.push(newAction); - this.symbolIdToActionMap[symbolId] = updatedNewImports; - }; - ImportCodeActionMap.prototype.addActions = function (symbolId, newActions) { - for (var _i = 0, newActions_1 = newActions; _i < newActions_1.length; _i++) { - var newAction = newActions_1[_i]; - this.addAction(symbolId, newAction); - } - }; - ImportCodeActionMap.prototype.getAllActions = function () { - var result = []; - for (var key in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[key]); - } - return result; - }; - ImportCodeActionMap.prototype.compareModuleSpecifiers = function (moduleSpecifier1, moduleSpecifier2) { - if (moduleSpecifier1 === moduleSpecifier2) { - return 1 /* Equal */; - } - // if moduleSpecifier1 (ms1) is a substring of ms2, then it is better - if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { - return 0 /* Better */; - } - if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { - return 2 /* Worse */; - } - // if both are relative paths, and ms1 has fewer levels, then it is better - if (ts.isExternalModuleNameRelative(moduleSpecifier1) && ts.isExternalModuleNameRelative(moduleSpecifier2)) { - var regex = new RegExp(ts.directorySeparator, "g"); - var moduleSpecifier1LevelCount = (moduleSpecifier1.match(regex) || []).length; - var moduleSpecifier2LevelCount = (moduleSpecifier2.match(regex) || []).length; - return moduleSpecifier1LevelCount < moduleSpecifier2LevelCount - ? 0 /* Better */ - : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount - ? 1 /* Equal */ - : 2 /* Worse */; - } - // the equal cases include when the two specifiers are not comparable. - return 1 /* Equal */; - }; - return ImportCodeActionMap; - }()); - function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { - return { - description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: changes, - // TODO: GH#20315 - fixId: undefined, - kind: kind, - moduleSpecifier: moduleSpecifier - }; + function createCodeAction(descriptionDiagnostic, diagnosticArgs, changes) { + var description = ts.formatMessage.apply(undefined, [undefined, descriptionDiagnostic].concat(diagnosticArgs)); + // TODO: GH#20315 + return { description: description, changes: changes, fixId: undefined }; } - function convertToImportCodeFixContext(context) { + function convertToImportCodeFixContext(context, symbolToken, symbolName) { var useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; var program = context.program; var checker = program.getTypeChecker(); - // This will always be an Identifier, since the diagnostics we fix only fail on identifiers. - var symbolToken = ts.cast(ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false), ts.isIdentifier); return { host: context.host, formatContext: context.formatContext, @@ -96016,8 +98803,8 @@ var ts; compilerOptions: program.getCompilerOptions(), cachedImportDeclarations: [], getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), - symbolName: symbolToken.getText(), - symbolToken: symbolToken, + symbolName: symbolName, + symbolToken: symbolToken }; } var ImportKind; @@ -96026,58 +98813,77 @@ var ts; ImportKind[ImportKind["Default"] = 1] = "Default"; ImportKind[ImportKind["Namespace"] = 2] = "Namespace"; ImportKind[ImportKind["Equals"] = 3] = "Equals"; - })(ImportKind = codefix.ImportKind || (codefix.ImportKind = {})); - function getCodeActionForImport(moduleSymbols, context) { - moduleSymbols = ts.toArray(moduleSymbols); - var declarations = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getImportDeclarations(moduleSymbol, context.checker, context.sourceFile, context.cachedImportDeclarations); - }); - var actions = []; - if (context.symbolToken) { - // It is possible that multiple import statements with the same specifier exist in the file. - // e.g. - // - // import * as ns from "foo"; - // import { member1, member2 } from "foo"; - // - // member3/**/ <-- cusor here - // - // in this case we should provie 2 actions: - // 1. change "member3" to "ns.member3" - // 2. add "member3" to the second import statement's import list - // and it is up to the user to decide which one fits best. - for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { - var declaration = declarations_13[_i]; - var namespace = getNamespaceImportName(declaration); - if (namespace) { - var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); - if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { - actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken)); - } + })(ImportKind || (ImportKind = {})); + function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, symbolToken) { + var exportInfos = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); + ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol; })); + // We sort the best codefixes first, so taking `first` is best for completions. + var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, exportInfos, compilerOptions, getCanonicalFileName, host)).moduleSpecifier; + var ctx = { host: host, program: program, checker: checker, compilerOptions: compilerOptions, sourceFile: sourceFile, formatContext: formatContext, symbolName: symbolName, getCanonicalFileName: getCanonicalFileName, symbolToken: symbolToken }; + return { moduleSpecifier: moduleSpecifier, codeAction: ts.first(getCodeActionsForImport(exportInfos, ctx)) }; + } + codefix.getImportCompletionAction = getImportCompletionAction; + function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { + var result = []; + forEachExternalModule(checker, allSourceFiles, function (moduleSymbol) { + for (var _i = 0, _a = checker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { + var exported = _a[_i]; + if (ts.skipAlias(exported, checker) === exportedSymbol) { + var isDefaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol) === exported; + result.push({ moduleSymbol: moduleSymbol, importKind: isDefaultExport ? 1 /* Default */ : 0 /* Named */ }); } } - } - return actions.concat(getCodeActionsForAddImport(moduleSymbols, context, declarations)); + }); + return result; + } + function getCodeActionsForImport(exportInfos, context) { + var existingImports = ts.flatMap(exportInfos, function (info) { + return getImportDeclarations(info, context.checker, context.sourceFile, context.cachedImportDeclarations); + }); + // It is possible that multiple import statements with the same specifier exist in the file. + // e.g. + // + // import * as ns from "foo"; + // import { member1, member2 } from "foo"; + // + // member3/**/ <-- cusor here + // + // in this case we should provie 2 actions: + // 1. change "member3" to "ns.member3" + // 2. add "member3" to the second import statement's import list + // and it is up to the user to decide which one fits best. + var useExistingImportActions = !context.symbolToken || !ts.isIdentifier(context.symbolToken) ? ts.emptyArray : ts.mapDefined(existingImports, function (_a) { + var declaration = _a.declaration; + var namespace = getNamespaceImportName(declaration); + if (namespace) { + var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); + if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { + return getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken); + } + } + }); + return useExistingImportActions.concat(getCodeActionsForAddImport(exportInfos, context, existingImports)); } - codefix.getCodeActionForImport = getCodeActionForImport; function getNamespaceImportName(declaration) { - if (declaration.kind === 239 /* ImportDeclaration */) { + if (declaration.kind === 242 /* ImportDeclaration */) { var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings; - return namedBindings && namedBindings.kind === 241 /* NamespaceImport */ ? namedBindings.name : undefined; + return namedBindings && namedBindings.kind === 244 /* NamespaceImport */ ? namedBindings.name : undefined; } else { return declaration.name; } } // TODO(anhans): This doesn't seem important to cache... just use an iterator instead of creating a new array? - function getImportDeclarations(moduleSymbol, checker, _a, cachedImportDeclarations) { - var imports = _a.imports; + function getImportDeclarations(_a, checker, _b, cachedImportDeclarations) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var imports = _b.imports; if (cachedImportDeclarations === void 0) { cachedImportDeclarations = []; } var moduleSymbolId = ts.getUniqueSymbolId(moduleSymbol, checker); var cached = cachedImportDeclarations[moduleSymbolId]; if (!cached) { cached = cachedImportDeclarations[moduleSymbolId] = ts.mapDefined(imports, function (importModuleSpecifier) { - return checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + var declaration = checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + return declaration && { declaration: declaration, importKind: importKind }; }); } return cached; @@ -96085,27 +98891,28 @@ var ts; function getImportDeclaration(_a) { var parent = _a.parent; switch (parent.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return parent; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return parent.parent; - case 245 /* ExportDeclaration */: - case 182 /* CallExpression */:// For "require()" calls + case 248 /* ExportDeclaration */: + case 185 /* CallExpression */: // For "require()" calls // Ignore these, can't add imports to them. return undefined; default: ts.Debug.fail(); } } - function getCodeActionForNewImport(context, moduleSpecifier) { - var kind = context.kind, sourceFile = context.sourceFile, symbolName = context.symbolName; + function getCodeActionForNewImport(context, _a) { + var moduleSpecifier = _a.moduleSpecifier, importKind = _a.importKind; + var sourceFile = context.sourceFile, symbolName = context.symbolName; var lastImportDeclaration = ts.findLast(sourceFile.statements, ts.isAnyImportSyntax); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier); var quotedModuleSpecifier = createStringLiteralWithQuoteStyle(sourceFile, moduleSpecifierWithoutQuotes); - var importDecl = kind !== 3 /* Equals */ + var importDecl = importKind !== 3 /* Equals */ ? ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClauseOfKind(kind, symbolName), quotedModuleSpecifier) + /*modifiers*/ undefined, createImportClauseOfKind(importKind, symbolName), quotedModuleSpecifier) : ts.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createIdentifier(symbolName), ts.createExternalModuleReference(quotedModuleSpecifier)); @@ -96120,7 +98927,7 @@ var ts; // if this file doesn't have any import statements, insert an import statement and then insert a new line // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. - return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes); } function createStringLiteralWithQuoteStyle(sourceFile, text) { var literal = ts.createLiteral(text); @@ -96147,11 +98954,12 @@ var ts; ts.Debug.assertNever(kind); } } - function getModuleSpecifiersForNewImport(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { + function getNewImportInfos(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { var baseUrl = options.baseUrl, paths = options.paths, rootDirs = options.rootDirs; var addJsExtension = usesJsExtensionOnImports(sourceFile); - var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { + var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (_a) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var modulePathsGroups = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); var global = tryGetModuleNameFromAmbientModule(moduleSymbol) || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) @@ -96209,11 +99017,11 @@ var ts; var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl); return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; }); + return modulePathsGroups.map(function (group) { return group.map(function (moduleSpecifier) { return ({ moduleSpecifier: moduleSpecifier, importKind: importKind }); }); }); }); - // Only return results for the re-export with the shortest possible path (and also give the other path even if that's long.) - return ts.best(ts.arrayIterator(choicesForEachExportingModule), function (a, b) { return a[0].length < b[0].length; }); + // Sort to keep the shortest paths first, but keep [relativePath, importRelativeToBaseUrl] groups together + return ts.flatten(choicesForEachExportingModule.sort(function (a, b) { return ts.first(a).moduleSpecifier.length - ts.first(b).moduleSpecifier.length; })); } - codefix.getModuleSpecifiersForNewImport = getModuleSpecifiersForNewImport; /** * Looks for a existing imports that use symlinks to this module. * Only if no symlink is available, the real path will be used. @@ -96411,47 +99219,51 @@ var ts; var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); return !ts.pathIsRelative(relativePath) ? "./" + relativePath : relativePath; } - function getCodeActionsForAddImport(moduleSymbols, ctx, declarations) { - var fromExistingImport = ts.firstDefined(declarations, function (declaration) { - if (declaration.kind === 239 /* ImportDeclaration */ && declaration.importClause) { - var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined); + function getCodeActionsForAddImport(exportInfos, ctx, existingImports) { + var fromExistingImport = ts.firstDefined(existingImports, function (_a) { + var declaration = _a.declaration, importKind = _a.importKind; + if (declaration.kind === 242 /* ImportDeclaration */ && declaration.importClause) { + var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined, importKind); if (changes) { var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText()); - return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes); } } }); if (fromExistingImport) { return [fromExistingImport]; } - var existingDeclaration = ts.firstDefined(declarations, moduleSpecifierFromAnyImport); - var moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.program, ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); - return moduleSpecifiers.map(function (spec) { return getCodeActionForNewImport(ctx, spec); }); + var existingDeclaration = ts.firstDefined(existingImports, newImportInfoFromExistingSpecifier); + var newImportInfos = existingDeclaration + ? [existingDeclaration] + : getNewImportInfos(ctx.program, ctx.sourceFile, exportInfos, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); + return newImportInfos.map(function (info) { return getCodeActionForNewImport(ctx, info); }); } - function moduleSpecifierFromAnyImport(node) { - var expression = node.kind === 239 /* ImportDeclaration */ - ? node.moduleSpecifier - : node.moduleReference.kind === 249 /* ExternalModuleReference */ - ? node.moduleReference.expression + function newImportInfoFromExistingSpecifier(_a) { + var declaration = _a.declaration, importKind = _a.importKind; + var expression = declaration.kind === 242 /* ImportDeclaration */ + ? declaration.moduleSpecifier + : declaration.moduleReference.kind === 252 /* ExternalModuleReference */ + ? declaration.moduleReference.expression : undefined; - return expression && ts.isStringLiteral(expression) ? expression.text : undefined; + return expression && ts.isStringLiteral(expression) ? { moduleSpecifier: expression.text, importKind: importKind } : undefined; } - function tryUpdateExistingImport(context, importClause) { - var symbolName = context.symbolName, sourceFile = context.sourceFile, kind = context.kind; + function tryUpdateExistingImport(context, importClause, importKind) { + var symbolName = context.symbolName, sourceFile = context.sourceFile; var name = importClause.name; - var namedBindings = (importClause.kind !== 238 /* ImportEqualsDeclaration */ && importClause).namedBindings; - switch (kind) { + var namedBindings = (importClause.kind !== 241 /* ImportEqualsDeclaration */ && importClause).namedBindings; + switch (importKind) { case 1 /* Default */: return name ? undefined : ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(ts.createIdentifier(symbolName), namedBindings)); }); case 0 /* Named */: { var newImportSpecifier_1 = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(symbolName)); - if (namedBindings && namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length !== 0) { + if (namedBindings && namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length !== 0) { // There are already named imports; add another. return ChangeTracker.with(context, function (t) { return t.insertNodeInListAfter(sourceFile, namedBindings.elements[namedBindings.elements.length - 1], newImportSpecifier_1); }); } - if (!namedBindings || namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length === 0) { + if (!namedBindings || namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length === 0) { return ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(name, ts.createNamedImports([newImportSpecifier_1]))); }); @@ -96465,7 +99277,7 @@ var ts; case 3 /* Equals */: return undefined; default: - ts.Debug.assertNever(kind); + ts.Debug.assertNever(importKind); } } function getCodeActionForUseExistingNamespaceImport(namespacePrefix, context, symbolToken) { @@ -96480,36 +99292,39 @@ var ts; * namespace instead of altering the import declaration. For example, "foo" would * become "ns.foo" */ - // Prefix the node instead of it replacing it, because this may be used for import completions and we don't want the text changes to overlap with the identifier being completed. var changes = ChangeTracker.with(context, function (tracker) { - return tracker.changeIdentifierToPropertyAccess(sourceFile, namespacePrefix, symbolToken); + return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolToken)); }); - return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes, "CodeChange", /*moduleSpecifier*/ undefined); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes); } function getImportCodeActions(context) { - var importFixContext = convertToImportCodeFixContext(context); return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code - ? getActionsForUMDImport(importFixContext) - : getActionsForNonUMDImport(importFixContext, context.program.getSourceFiles(), context.cancellationToken); + ? getActionsForUMDImport(context) + : getActionsForNonUMDImport(context); } function getActionsForUMDImport(context) { - var checker = context.checker, symbolToken = context.symbolToken, compilerOptions = context.compilerOptions; - var umdSymbol = checker.getSymbolAtLocation(symbolToken); - var symbol; - var symbolName; - if (umdSymbol.flags & 2097152 /* Alias */) { - symbol = checker.getAliasedSymbol(umdSymbol); - symbolName = context.symbolName; + var token = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var checker = context.program.getTypeChecker(); + var umdSymbol; + if (ts.isIdentifier(token)) { + // try the identifier to see if it is the umd symbol + umdSymbol = checker.getSymbolAtLocation(token); } - else if (ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken) { + if (!ts.isUMDExportSymbol(umdSymbol)) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), symbolToken.parent.tagName, 107455 /* Value */, /*excludeGlobals*/ false)); - symbolName = symbol.name; + var parent = token.parent; + var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(parent); + if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 258 /* JsxOpeningFragment */) { + umdSymbol = checker.resolveName(checker.getJsxNamespace(parent), isNodeOpeningLikeElement ? parent.tagName : parent, 67216319 /* Value */, /*excludeGlobals*/ false); + } } - else { - throw ts.Debug.fail("Either the symbol or the JSX namespace should be a UMD global if we got here"); + if (ts.isUMDExportSymbol(umdSymbol)) { + var symbol = checker.getAliasedSymbol(umdSymbol); + if (symbol) { + return getCodeActionsForImport([{ moduleSymbol: symbol, importKind: getUmdImportKind(context.program.getCompilerOptions()) }], convertToImportCodeFixContext(context, token, umdSymbol.name)); + } } - return getCodeActionForImport(symbol, __assign({}, context, { symbolName: symbolName, kind: getUmdImportKind(compilerOptions) })); + return undefined; } function getUmdImportKind(compilerOptions) { // Import a synthetic `default` if enabled. @@ -96530,15 +99345,30 @@ var ts; // Fall back to the `import * as ns` style import. return 2 /* Namespace */; default: - throw ts.Debug.assertNever(moduleKind); + return ts.Debug.assertNever(moduleKind); } } - function getActionsForNonUMDImport(context, allSourceFiles, cancellationToken) { - var sourceFile = context.sourceFile, checker = context.checker, symbolName = context.symbolName, symbolToken = context.symbolToken; + function getActionsForNonUMDImport(context) { + // This will always be an Identifier, since the diagnostics we fix only fail on identifiers. + var sourceFile = context.sourceFile, span = context.span, program = context.program, cancellationToken = context.cancellationToken; + var checker = program.getTypeChecker(); + var symbolToken = ts.getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false); + var isJsxNamespace = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken; + if (!isJsxNamespace && !ts.isIdentifier(symbolToken)) { + return undefined; + } + var symbolName = isJsxNamespace ? checker.getJsxNamespace() : symbolToken.text; + var allSourceFiles = program.getSourceFiles(); + var compilerOptions = program.getCompilerOptions(); // "default" is a keyword and not a legal identifier for the import, so we don't expect it here ts.Debug.assert(symbolName !== "default"); - var symbolIdActionMap = new ImportCodeActionMap(); var currentTokenMeaning = ts.getMeaningFromLocation(symbolToken); + // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. + // Maps symbol id to info for modules providing that symbol (original export + re-exports). + var originalSymbolToExportInfos = ts.createMultiMap(); + function addSymbol(moduleSymbol, exportedSymbol, importKind) { + originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind }); + } forEachExternalModuleToImportFrom(checker, sourceFile, allSourceFiles, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); // check the default export @@ -96547,17 +99377,14 @@ var ts; var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport); if ((localSymbol && localSymbol.escapedName === symbolName || getEscapedNameForExportDefault(defaultExport) === symbolName || - moduleSymbolToValidIdentifier(moduleSymbol, context.compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { - // check if this symbol is already used - var symbolId = ts.getUniqueSymbolId(localSymbol || defaultExport, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 1 /* Default */ }))); + moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { + addSymbol(moduleSymbol, localSymbol || defaultExport, 1 /* Default */); } } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - var symbolId = ts.getUniqueSymbolId(exportSymbolWithIdenticalName, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 0 /* Named */ }))); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); } function getEscapedNameForExportDefault(symbol) { return ts.firstDefined(symbol.declarations, function (declaration) { @@ -96575,7 +99402,7 @@ var ts; }); } }); - return symbolIdActionMap.getAllActions(); + return ts.arrayFrom(ts.flatMapIterator(originalSymbolToExportInfos.values(), function (exportInfos) { return getCodeActionsForImport(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName)); })); } function checkSymbolHasMeaning(_a, meaning) { var declarations = _a.declarations; @@ -96601,7 +99428,6 @@ var ts; } } } - codefix.forEachExternalModule = forEachExternalModule; /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -96656,59 +99482,61 @@ var ts; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile, program = context.program, span = context.span; + var sourceFile = context.sourceFile, program = context.program, span = context.span, host = context.host, formatContext = context.formatContext; if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { return undefined; } - var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), - changes: [codefix.createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)])], - fixId: fixId, - }, + var fixes = [ { description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), - changes: [codefix.createFileTextChanges(sourceFile.fileName, [{ - span: { - start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, - length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 - }, - newText: "// @ts-nocheck" + newLineCharacter - }])], + changes: [codefix.createFileTextChanges(sourceFile.fileName, [ + ts.createTextChange(sourceFile.checkJsDirective + ? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) + : ts.createTextSpan(0, 0), "// @ts-nocheck" + ts.getNewLineOrDefaultFromHost(host, formatContext.options)), + ])], // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. fixId: undefined, - }]; + } + ]; + if (isValidSuppressLocation(sourceFile, span.start)) { + fixes.unshift({ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, sourceFile, span.start); }), + fixId: fixId, + }); + } + return fixes; }, fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { - if (err.start !== undefined) { - changes.push(getIgnoreCommentLocationForLocation(err.file, err.start, ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options))); - } - }); }, + getAllCodeActions: function (context) { + var seenLines = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + if (isValidSuppressLocation(diag.file, diag.start)) { + makeChange(changes, diag.file, diag.start, seenLines); + } + }); + }, }); - function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { - var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; - var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + function isValidSuppressLocation(sourceFile, position) { + return !ts.isInComment(sourceFile, position) && !ts.isInString(sourceFile, position) && !ts.isInTemplateString(sourceFile, position); + } + function makeChange(changes, sourceFile, position, seenLines) { + var lineNumber = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + // Only need to add `// @ts-ignore` for a line once. + if (seenLines && !ts.addToSeen(seenLines, lineNumber)) { + return; + } + var lineStartPosition = ts.getStartPositionOfLine(lineNumber, sourceFile); var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); // First try to see if we can put the '// @ts-ignore' on the previous line. // We need to make sure that we are not in the middle of a string literal or a comment. - // We also want to check if the previous line holds a comment for a node on the next line - // if so, we do not want to separate the node from its comment if we can. - if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { - var token = ts.getTouchingToken(sourceFile, startPosition, /*includeJsDocComment*/ false); - var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); - if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { - return { - span: { start: startPosition, length: 0 }, - newText: "// @ts-ignore" + newLineCharacter - }; - } - } - // If all fails, add an extra new line immediately before the error span. - return { - span: { start: position, length: 0 }, - newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter - }; + // If so, we do not want to separate the node from its comment if we can. + // Otherwise, add an extra new line immediately before the error span. + var insertAtLineStart = isValidSuppressLocation(sourceFile, startPosition); + var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position, /*includeJsDocComment*/ false); + var clone = ts.setStartsOnNewLine(ts.getSynthesizedDeepClone(token), true); + ts.addSyntheticLeadingComment(clone, 2 /* SingleLineCommentTrivia */, " @ts-ignore"); + changes.replaceNode(sourceFile, token, clone, { preserveLeadingWhitespace: true, prefix: insertAtLineStart ? undefined : changes.newLineCharacter }); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -96749,17 +99577,17 @@ var ts; var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); var optional = !!(symbol.flags & 16777216 /* Optional */); switch (declaration.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 149 /* PropertySignature */: - case 150 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 150 /* PropertySignature */: + case 151 /* PropertyDeclaration */: var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 151 /* MethodSignature */: - case 152 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 153 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -96799,7 +99627,7 @@ var ts; } } function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 152 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 153 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); if (!signatureDeclaration) { return undefined; } @@ -96921,28 +99749,26 @@ var ts; ]; codefix.registerCodeFix({ errorCodes: errorCodes, - getCodeActions: function (_a) { - var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; + getCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, start = context.span.start, errorCode = context.errorCode, cancellationToken = context.cancellationToken; if (ts.isSourceFileJavaScript(sourceFile)) { return undefined; // TODO: GH#20113 } var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var fix = getFix(sourceFile, token, errorCode, program, cancellationToken); - if (!fix) + var declaration; + var changes = ts.textChanges.ChangeTracker.with(context, function (changes) { declaration = doChange(changes, sourceFile, token, errorCode, program, cancellationToken); }); + if (changes.length === 0) return undefined; - var declaration = fix.declaration, textChanges = fix.textChanges; - var name = ts.getNameOfDeclaration(declaration); - var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name.getText()]); - return [{ description: description, changes: [{ fileName: sourceFile.fileName, textChanges: textChanges }], fixId: fixId }]; + var name = ts.getNameOfDeclaration(declaration).getText(); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name]); + return [{ description: description, changes: changes, fixId: fixId }]; }, fixIds: [fixId], getAllCodeActions: function (context) { var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken; var seenFunctions = ts.createMap(); - return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { - var fix = getFix(sourceFile, ts.getTokenAtPosition(err.file, err.start, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions); - if (fix) - changes.push.apply(changes, fix.textChanges); + return codefix.codeFixAll(context, errorCodes, function (changes, err) { + doChange(changes, sourceFile, ts.getTokenAtPosition(err.file, err.start, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions); }); }, }); @@ -96956,7 +99782,7 @@ var ts; return ts.Diagnostics.Infer_type_of_0_from_usage; } } - function getFix(sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { + function doChange(changes, sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { if (!isAllowedTokenKind(token.kind)) { return undefined; } @@ -96964,10 +99790,14 @@ var ts; // Variable and Property declarations case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: - return getCodeActionForVariableDeclaration(token.parent, sourceFile, program, cancellationToken); + annotateVariableDeclaration(changes, sourceFile, token.parent, program, cancellationToken); + return token.parent; case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: { var symbol = program.getTypeChecker().getSymbolAtLocation(token); - return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration, sourceFile, program, cancellationToken); + if (symbol && symbol.valueDeclaration) { + annotateVariableDeclaration(changes, sourceFile, symbol.valueDeclaration, program, cancellationToken); + return symbol.valueDeclaration; + } } } var containingFunction = ts.getContainingFunction(token); @@ -96978,22 +99808,34 @@ var ts; // Parameter declarations case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: if (ts.isSetAccessor(containingFunction)) { - return getCodeActionForSetAccessor(containingFunction, sourceFile, program, cancellationToken); + annotateSetAccessor(changes, sourceFile, containingFunction, program, cancellationToken); + return containingFunction; } // falls through case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - return !seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction)) - ? getCodeActionForParameters(token.parent, containingFunction, sourceFile, program, cancellationToken) - : undefined; + if (!seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction))) { + var param = ts.cast(token.parent, ts.isParameter); + annotateParameters(changes, param, containingFunction, sourceFile, program, cancellationToken); + return param; + } + return undefined; // Get Accessor declarations case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: - return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + if (ts.isGetAccessor(containingFunction) && ts.isIdentifier(containingFunction.name)) { + annotate(changes, sourceFile, containingFunction, inferTypeForVariableFromUsage(containingFunction.name, program, cancellationToken), program); + return containingFunction; + } + return undefined; // Set Accessor declarations case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: - return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + if (ts.isSetAccessor(containingFunction)) { + annotateSetAccessor(changes, sourceFile, containingFunction, program, cancellationToken); + return containingFunction; + } + return undefined; default: - throw ts.Debug.fail(String(errorCode)); + return ts.Debug.fail(String(errorCode)); } } function isAllowedTokenKind(kind) { @@ -97003,138 +99845,94 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; default: return false; } } - function getCodeActionForVariableDeclaration(declaration, sourceFile, program, cancellationToken) { - if (!ts.isIdentifier(declaration.name)) - return undefined; - var type = inferTypeForVariableFromUsage(declaration.name, sourceFile, program, cancellationToken); - return makeFix(declaration, declaration.name.getEnd(), type, program); + function annotateVariableDeclaration(changes, sourceFile, declaration, program, cancellationToken) { + if (ts.isIdentifier(declaration.name)) { + annotate(changes, sourceFile, declaration, inferTypeForVariableFromUsage(declaration.name, program, cancellationToken), program); + } } function isApplicableFunctionForInference(declaration) { switch (declaration.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: return true; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return !!declaration.name; } return false; } - function getCodeActionForParameters(parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { + function annotateParameters(changes, parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { - return undefined; + return; } var types = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) || - containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, sourceFile, program, cancellationToken) : undefined; }); - if (!types) - return undefined; + containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : undefined; }); // We didn't actually find a set of type inference positions matching each parameter position - if (containingFunction.parameters.length !== types.length) { - return undefined; + if (!types || containingFunction.parameters.length !== types.length) { + return; } - var textChanges = ts.arrayFrom(ts.mapDefinedIterator(ts.zipToIterator(containingFunction.parameters, types), function (_a) { - var parameter = _a[0], type = _a[1]; - return type && !parameter.type && !parameter.initializer ? makeChange(containingFunction, parameter.end, type, program) : undefined; - })); - return textChanges.length ? { declaration: parameterDeclaration, textChanges: textChanges } : undefined; + ts.zipWith(containingFunction.parameters, types, function (parameter, type) { + if (!parameter.type && !parameter.initializer) { + annotate(changes, sourceFile, parameter, type, program); + } + }); } - function getCodeActionForSetAccessor(setAccessorDeclaration, sourceFile, program, cancellationToken) { - var setAccessorParameter = setAccessorDeclaration.parameters[0]; - if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { - return undefined; + function annotateSetAccessor(changes, sourceFile, setAccessorDeclaration, program, cancellationToken) { + var param = ts.firstOrUndefined(setAccessorDeclaration.parameters); + if (param && ts.isIdentifier(setAccessorDeclaration.name) && ts.isIdentifier(param.name)) { + var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken) || + inferTypeForVariableFromUsage(param.name, program, cancellationToken); + annotate(changes, sourceFile, param, type, program); } - var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, sourceFile, program, cancellationToken) || - inferTypeForVariableFromUsage(setAccessorParameter.name, sourceFile, program, cancellationToken); - return makeFix(setAccessorParameter, setAccessorParameter.name.getEnd(), type, program); } - function getCodeActionForGetAccessor(getAccessorDeclaration, sourceFile, program, cancellationToken) { - if (!ts.isIdentifier(getAccessorDeclaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name, sourceFile, program, cancellationToken); - var closeParenToken = ts.findChildOfKind(getAccessorDeclaration, 20 /* CloseParenToken */, sourceFile); - return makeFix(getAccessorDeclaration, closeParenToken.getEnd(), type, program); + function annotate(changes, sourceFile, declaration, type, program) { + var typeNode = type && getTypeNodeIfAccessible(type, declaration, program.getTypeChecker()); + if (typeNode) + changes.insertTypeAnnotation(sourceFile, declaration, typeNode); } - function makeFix(declaration, start, type, program) { - return type && { declaration: declaration, textChanges: [makeChange(declaration, start, type, program)] }; + function getTypeNodeIfAccessible(type, enclosingScope, checker) { + var typeIsAccessible = true; + var notAccessible = function () { typeIsAccessible = false; }; + var res = checker.typeToTypeNode(type, enclosingScope, /*flags*/ undefined, { + trackSymbol: function (symbol, declaration, meaning) { + typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === 0 /* Accessible */; + }, + reportInaccessibleThisError: notAccessible, + reportPrivateInBaseOfClassExpression: notAccessible, + reportInaccessibleUniqueSymbolError: notAccessible, + }); + return typeIsAccessible ? res : undefined; } - function makeChange(declaration, start, type, program) { - var typeString = type && typeToString(type, declaration, program.getTypeChecker()); - return typeString === undefined ? undefined : { span: ts.createTextSpan(start, 0), newText: ": " + typeString }; + function getReferences(token, program, cancellationToken) { + // Position shouldn't matter since token is not a SourceFile. + return ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function (entry) { + return entry.type === "node" ? ts.tryCast(entry.node, ts.isIdentifier) : undefined; + }); } - function getReferences(token, sourceFile, program, cancellationToken) { - var references = ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), sourceFile, token.getStart(sourceFile)); - if (!references || references.length !== 1) { - return []; - } - return references[0].references.map(function (r) { return ts.getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false); }); - } - function inferTypeForVariableFromUsage(token, sourceFile, program, cancellationToken) { - return InferFromReference.inferTypeFromReferences(getReferences(token, sourceFile, program, cancellationToken), program.getTypeChecker(), cancellationToken); + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + return InferFromReference.inferTypeFromReferences(getReferences(token, program, cancellationToken), program.getTypeChecker(), cancellationToken); } function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) { switch (containingFunction.kind) { - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - var isConstructor = containingFunction.kind === 153 /* Constructor */; + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + var isConstructor = containingFunction.kind === 154 /* Constructor */; var searchToken = isConstructor ? ts.findChildOfKind(containingFunction, 123 /* ConstructorKeyword */, sourceFile) : containingFunction.name; if (searchToken) { - return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, sourceFile, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); + return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); } } } - function getTypeAccessiblityWriter(checker) { - var str = ""; - var typeIsAccessible = true; - var writeText = function (text) { return str += text; }; - return { - getText: function () { return typeIsAccessible ? str : undefined; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeProperty: writeText, - writeSymbol: writeText, - write: writeText, - writeTextOfNode: writeText, - rawWrite: writeText, - writeLiteral: writeText, - getTextPos: function () { return 0; }, - getLine: function () { return 0; }, - getColumn: function () { return 0; }, - getIndent: function () { return 0; }, - isAtStartOfLine: function () { return false; }, - writeLine: function () { return writeText(" "); }, - increaseIndent: ts.noop, - decreaseIndent: ts.noop, - clear: function () { str = ""; typeIsAccessible = true; }, - trackSymbol: function (symbol, declaration, meaning) { - if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { - typeIsAccessible = false; - } - }, - reportInaccessibleThisError: function () { typeIsAccessible = false; }, - reportPrivateInBaseOfClassExpression: function () { typeIsAccessible = false; }, - reportInaccessibleUniqueSymbolError: function () { typeIsAccessible = false; } - }; - } - function typeToString(type, enclosingDeclaration, checker) { - var writer = getTypeAccessiblityWriter(checker); - checker.writeType(type, enclosingDeclaration, /*flags*/ undefined, writer); - return writer.getText(); - } var InferFromReference; (function (InferFromReference) { function inferTypeFromReferences(references, checker, cancellationToken) { @@ -97151,40 +99949,40 @@ var ts; if (references.length === 0) { return undefined; } - if (declaration.parameters) { - var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; - cancellationToken.throwIfCancellationRequested(); - inferTypeFromContext(reference, checker, usageContext); - } - var isConstructor = declaration.kind === 153 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - if (callContexts) { - var paramTypes = []; - for (var parameterIndex = 0; parameterIndex < declaration.parameters.length; parameterIndex++) { - var types = []; - var isRestParameter_1 = ts.isRestParameter(declaration.parameters[parameterIndex]); - for (var _a = 0, callContexts_1 = callContexts; _a < callContexts_1.length; _a++) { - var callContext = callContexts_1[_a]; - if (callContext.argumentTypes.length > parameterIndex) { - if (isRestParameter_1) { - types = ts.concatenate(types, ts.map(callContext.argumentTypes.slice(parameterIndex), function (a) { return checker.getBaseTypeOfLiteralType(a); })); - } - else { - types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); - } - } - } - if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); - paramTypes[parameterIndex] = isRestParameter_1 ? checker.createArrayType(type) : type; + if (!declaration.parameters) { + return undefined; + } + var usageContext = {}; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + var isConstructor = declaration.kind === 154 /* Constructor */; + var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; + return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var types = []; + var isRest = ts.isRestParameter(parameter); + for (var _i = 0, callContexts_1 = callContexts; _i < callContexts_1.length; _i++) { + var callContext = callContexts_1[_i]; + if (callContext.argumentTypes.length <= parameterIndex) { + continue; + } + if (isRest) { + for (var i = parameterIndex; i < callContext.argumentTypes.length; i++) { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); } } - return paramTypes; + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } } - } - return undefined; + if (!types.length) { + return undefined; + } + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); + return isRest ? checker.createArrayType(type) : type; + }); } InferFromReference.inferTypeForParametersFromReferences = inferTypeForParametersFromReferences; function inferTypeFromContext(node, checker, usageContext) { @@ -97192,21 +99990,21 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: usageContext.isNumber = true; break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); break; - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpressionContext(node.parent, checker, usageContext); } @@ -97214,10 +100012,10 @@ var ts; inferTypeFromContextualType(node, checker, usageContext); } break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); break; default: @@ -97240,6 +100038,8 @@ var ts; case 37 /* PlusToken */: usageContext.isNumberOrString = true; break; + // case SyntaxKind.ExclamationToken: + // no inferences here; } } function inferTypeFromBinaryExpressionContext(node, parent, checker, usageContext) { @@ -97317,7 +100117,7 @@ var ts; // LogicalOperator case 54 /* BarBarToken */: if (node === parent.left && - (node.parent.parent.kind === 227 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 230 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); @@ -97345,7 +100145,7 @@ var ts; } } inferTypeFromContext(parent, checker, callContext.returnType); - if (parent.kind === 182 /* CallExpression */) { + if (parent.kind === 185 /* CallExpression */) { (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); } else { @@ -97505,31 +100305,23 @@ var ts; var opts = context.program.getCompilerOptions(); var variations = []; // import Bluebird from "bluebird"; - var replacement = ts.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(namespace.name, /*namedBindings*/ undefined), node.moduleSpecifier); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, node, replacement, { useNonAdjustedEndPosition: true }); - var changes = changeTracker.getChanges(); - variations.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), - changes: changes - }); + variations.push(createAction(context, sourceFile, node, codefix.makeImportDeclaration(namespace.name, /*namedImports*/ undefined, node.moduleSpecifier))); if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) { // import Bluebird = require("bluebird"); - var replacement_1 = ts.createImportEqualsDeclaration( + variations.push(createAction(context, sourceFile, node, ts.createImportEqualsDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)); - var changeTracker_1 = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker_1.replaceNode(sourceFile, node, replacement_1, { useNonAdjustedEndPosition: true }); - var changes_1 = changeTracker_1.getChanges(); - variations.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes_1[0].textChanges[0].newText]), - changes: changes_1 - }); + /*modifiers*/ undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)))); } return variations; } + function createAction(context, sourceFile, node, replacement) { + // TODO: GH#21246 Should be able to use `replaceNode`, but be sure to preserve comments (see `codeFixCalledES2015Import11.ts`) + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceRange(sourceFile, { pos: node.getStart(), end: node.end }, replacement); }); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), + changes: changes, + }; + } codefix.registerCodeFix({ errorCodes: [ ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code, @@ -97539,7 +100331,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 182 /* CallExpression */ : 183 /* NewExpression */; + var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 185 /* CallExpression */ : 186 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); }); if (!node) { return []; @@ -97554,19 +100346,179 @@ var ts; if (!ts.isImportCall(relatedImport)) { ts.addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport)); } - var propertyAccess = ts.createPropertyAccess(expr, "default"); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, expr, propertyAccess, {}); - var changes = changeTracker.getChanges(); fixes.push({ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Use_synthetic_default_member), - changes: changes + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, expr, ts.createPropertyAccess(expr, "default"), {}); }), }); return fixes; } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; + var fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; + var fixIdAddInitializer = "addMissingPropertyInitializer"; + var errorCodes = [ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var propertyDeclaration = getPropertyDeclaration(context.sourceFile, context.span.start); + if (!propertyDeclaration) + return; + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + var result = [ + getActionForAddMissingUndefinedType(context, propertyDeclaration), + getActionForAddMissingDefiniteAssignmentAssertion(context, propertyDeclaration, newLineCharacter) + ]; + ts.append(result, getActionForAddMissingInitializer(context, propertyDeclaration, newLineCharacter)); + return result; + }, + fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], + getAllCodeActions: function (context) { + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var propertyDeclaration = getPropertyDeclaration(diag.file, diag.start); + if (!propertyDeclaration) + return; + switch (context.fixId) { + case fixIdAddDefiniteAssignmentAssertions: + addDefiniteAssignmentAssertion(changes, diag.file, propertyDeclaration, newLineCharacter); + break; + case fixIdAddUndefinedType: + addUndefinedType(changes, diag.file, propertyDeclaration); + break; + case fixIdAddInitializer: + var checker = context.program.getTypeChecker(); + var initializer = getInitializer(checker, propertyDeclaration); + if (!initializer) + return; + addInitializer(changes, diag.file, propertyDeclaration, initializer, newLineCharacter); + break; + default: + ts.Debug.fail(JSON.stringify(context.fixId)); + } + }); + }, + }); + function getPropertyDeclaration(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return ts.isIdentifier(token) ? ts.cast(token.parent, ts.isPropertyDeclaration) : undefined; + } + function getActionForAddMissingDefiniteAssignmentAssertion(context, propertyDeclaration, newLineCharacter) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_definite_assignment_assertion_to_property_0), [propertyDeclaration.getText()]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addDefiniteAssignmentAssertion(t, context.sourceFile, propertyDeclaration, newLineCharacter); }); + return { description: description, changes: changes, fixId: fixIdAddDefiniteAssignmentAssertions }; + } + function addDefiniteAssignmentAssertion(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, newLineCharacter) { + var property = ts.updateProperty(propertyDeclaration, propertyDeclaration.decorators, propertyDeclaration.modifiers, propertyDeclaration.name, ts.createToken(51 /* ExclamationToken */), propertyDeclaration.type, propertyDeclaration.initializer); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property, { suffix: newLineCharacter }); + } + function getActionForAddMissingUndefinedType(context, propertyDeclaration) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_undefined_type_to_property_0), [propertyDeclaration.name.getText()]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addUndefinedType(t, context.sourceFile, propertyDeclaration); }); + return { description: description, changes: changes, fixId: fixIdAddUndefinedType }; + } + function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { + var undefinedTypeNode = ts.createKeywordTypeNode(140 /* UndefinedKeyword */); + var types = ts.isUnionTypeNode(propertyDeclaration.type) ? propertyDeclaration.type.types.concat(undefinedTypeNode) : [propertyDeclaration.type, undefinedTypeNode]; + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration.type, ts.createUnionTypeNode(types)); + } + function getActionForAddMissingInitializer(context, propertyDeclaration, newLineCharacter) { + var checker = context.program.getTypeChecker(); + var initializer = getInitializer(checker, propertyDeclaration); + if (!initializer) + return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_initializer_to_property_0), [propertyDeclaration.name.getText()]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addInitializer(t, context.sourceFile, propertyDeclaration, initializer, newLineCharacter); }); + return { description: description, changes: changes, fixId: fixIdAddInitializer }; + } + function addInitializer(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, initializer, newLineCharacter) { + var property = ts.updateProperty(propertyDeclaration, propertyDeclaration.decorators, propertyDeclaration.modifiers, propertyDeclaration.name, propertyDeclaration.questionToken, propertyDeclaration.type, initializer); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property, { suffix: newLineCharacter }); + } + function getInitializer(checker, propertyDeclaration) { + return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type)); + } + function getDefaultValueFromType(checker, type) { + if (type.flags & 2 /* String */) { + return ts.createLiteral(""); + } + else if (type.flags & 4 /* Number */) { + return ts.createNumericLiteral("0"); + } + else if (type.flags & 8 /* Boolean */) { + return ts.createFalse(); + } + else if (type.flags & 224 /* Literal */) { + return ts.createLiteral(type.value); + } + else if (type.flags & 131072 /* Union */) { + return ts.firstDefined(type.types, function (t) { return getDefaultValueFromType(checker, t); }); + } + else if (ts.getObjectFlags(type) & 1 /* Class */) { + var classDeclaration = ts.getClassLikeDeclarationOfSymbol(type.symbol); + if (!classDeclaration || ts.hasModifier(classDeclaration, 128 /* Abstract */)) + return undefined; + var constructorDeclaration = ts.find(classDeclaration.members, function (m) { return ts.isConstructorDeclaration(m) && !!m.body; }); + if (constructorDeclaration && constructorDeclaration.parameters.length) + return undefined; + return ts.createNew(ts.createIdentifier(type.symbol.name), /*typeArguments*/ undefined, /*argumentsArray*/ undefined); + } + return undefined; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "useDefaultImport"; + var errorCodes = [ts.Diagnostics.Import_may_be_converted_to_a_default_import.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, start = context.span.start; + var info = getInfo(sourceFile, start); + if (!info) + return undefined; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start); + if (info) + doChange(changes, diag.file, info); + }); }, + }); + function getInfo(sourceFile, pos) { + var name = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + if (!ts.isIdentifier(name)) + return undefined; // bad input + var parent = name.parent; + if (ts.isImportEqualsDeclaration(parent) && ts.isExternalModuleReference(parent.moduleReference)) { + return { importNode: parent, name: name, moduleSpecifier: parent.moduleReference.expression }; + } + else if (ts.isNamespaceImport(parent)) { + var importNode = parent.parent.parent; + return { importNode: importNode, name: name, moduleSpecifier: importNode.moduleSpecifier }; + } + } + function doChange(changes, sourceFile, info) { + changes.replaceNode(sourceFile, info.importNode, codefix.makeImportDeclaration(info.name, /*namedImports*/ undefined, info.moduleSpecifier)); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); /// +/// +/// +/// /// /// /// @@ -97585,953 +100537,8 @@ var ts; /// /// /// -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var annotateWithTypeFromJSDoc; - (function (annotateWithTypeFromJSDoc) { - var refactorName = "Annotate with type from JSDoc"; - var actionName = "annotate"; - var description = ts.Diagnostics.Annotate_with_type_from_JSDoc.message; - refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - if (ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var node = ts.getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false); - if (hasUsableJSDoc(ts.findAncestor(node, isDeclarationWithType))) { - return [{ - name: refactorName, - description: description, - actions: [ - { - description: description, - name: actionName - } - ] - }]; - } - } - function hasUsableJSDoc(decl) { - if (!decl) { - return false; - } - if (ts.isFunctionLikeDeclaration(decl)) { - return decl.parameters.some(hasUsableJSDoc) || (!decl.type && !!ts.getJSDocReturnType(decl)); - } - return !decl.type && !!ts.getJSDocType(decl); - } - function getEditsForAction(context, action) { - if (actionName !== action) { - return ts.Debug.fail("actionName !== action: " + actionName + " !== " + action); - } - var node = ts.getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false); - var decl = ts.findAncestor(node, isDeclarationWithType); - if (!decl || decl.type) { - return undefined; - } - var jsdocType = ts.getJSDocType(decl); - var isFunctionWithJSDoc = ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); })); - if (isFunctionWithJSDoc || jsdocType && decl.kind === 147 /* Parameter */) { - return getEditsForFunctionAnnotation(context); - } - else if (jsdocType) { - return getEditsForAnnotation(context); - } - else { - ts.Debug.assert(!!refactor, "No applicable refactor found."); - } - } - function getEditsForAnnotation(context) { - var sourceFile = context.file; - var token = ts.getTokenAtPosition(sourceFile, context.startPosition, /*includeJsDocComment*/ false); - var decl = ts.findAncestor(token, isDeclarationWithType); - var jsdocType = ts.getJSDocType(decl); - if (!decl || !jsdocType || decl.type) { - return ts.Debug.fail("!decl || !jsdocType || decl.type: !" + decl + " || !" + jsdocType + " || " + decl.type); - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var declarationWithType = addType(decl, transformJSDocType(jsdocType)); - ts.suppressLeadingAndTrailingTrivia(declarationWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, declarationWithType); - return { - edits: changeTracker.getChanges(), - renameFilename: undefined, - renameLocation: undefined - }; - } - function getEditsForFunctionAnnotation(context) { - var sourceFile = context.file; - var token = ts.getTokenAtPosition(sourceFile, context.startPosition, /*includeJsDocComment*/ false); - var decl = ts.findAncestor(token, ts.isFunctionLikeDeclaration); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var functionWithType = addTypesToFunctionLike(decl); - ts.suppressLeadingAndTrailingTrivia(functionWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, functionWithType); - return { - edits: changeTracker.getChanges(), - renameFilename: undefined, - renameLocation: undefined - }; - } - function isDeclarationWithType(node) { - return ts.isFunctionLikeDeclaration(node) || - node.kind === 227 /* VariableDeclaration */ || - node.kind === 147 /* Parameter */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 150 /* PropertyDeclaration */; - } - function addTypesToFunctionLike(decl) { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(decl, /*checkJSDoc*/ true); - var parameters = decl.parameters.map(function (p) { return ts.createParameter(p.decorators, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, transformJSDocType(ts.getEffectiveTypeAnnotationNode(p, /*checkJSDoc*/ true)), p.initializer); }); - var returnType = transformJSDocType(ts.getEffectiveReturnTypeNode(decl, /*checkJSDoc*/ true)); - switch (decl.kind) { - case 229 /* FunctionDeclaration */: - return ts.createFunctionDeclaration(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 153 /* Constructor */: - return ts.createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); - case 187 /* FunctionExpression */: - return ts.createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 188 /* ArrowFunction */: - return ts.createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); - case 152 /* MethodDeclaration */: - return ts.createMethod(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, decl.questionToken, typeParameters, parameters, returnType, decl.body); - case 154 /* GetAccessor */: - return ts.createGetAccessor(decl.decorators, decl.modifiers, decl.name, decl.parameters, returnType, decl.body); - case 155 /* SetAccessor */: - return ts.createSetAccessor(decl.decorators, decl.modifiers, decl.name, parameters, decl.body); - default: - return ts.Debug.assertNever(decl, "Unexpected SyntaxKind: " + decl.kind); - } - } - function addType(decl, jsdocType) { - switch (decl.kind) { - case 227 /* VariableDeclaration */: - return ts.createVariableDeclaration(decl.name, jsdocType, decl.initializer); - case 149 /* PropertySignature */: - return ts.createPropertySignature(decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); - case 150 /* PropertyDeclaration */: - return ts.createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); - default: - return ts.Debug.fail("Unexpected SyntaxKind: " + decl.kind); - } - } - function transformJSDocType(node) { - if (node === undefined) { - return undefined; - } - switch (node.kind) { - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: - return ts.createTypeReferenceNode("any", ts.emptyArray); - case 276 /* JSDocOptionalType */: - return transformJSDocOptionalType(node); - case 275 /* JSDocNonNullableType */: - return transformJSDocType(node.type); - case 274 /* JSDocNullableType */: - return transformJSDocNullableType(node); - case 278 /* JSDocVariadicType */: - return transformJSDocVariadicType(node); - case 277 /* JSDocFunctionType */: - return transformJSDocFunctionType(node); - case 147 /* Parameter */: - return transformJSDocParameter(node); - case 160 /* TypeReference */: - return transformJSDocTypeReference(node); - default: - var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); - ts.setEmitFlags(visited, 1 /* SingleLine */); - return visited; - } - } - function transformJSDocOptionalType(node) { - return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("undefined", ts.emptyArray)]); - } - function transformJSDocNullableType(node) { - return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("null", ts.emptyArray)]); - } - function transformJSDocVariadicType(node) { - return ts.createArrayTypeNode(ts.visitNode(node.type, transformJSDocType)); - } - function transformJSDocFunctionType(node) { - var parameters = node.parameters && node.parameters.map(transformJSDocType); - return ts.createFunctionTypeNode(ts.emptyArray, parameters, node.type); - } - function transformJSDocParameter(node) { - var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 278 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; - var name = node.name || (isRest ? "rest" : "arg" + index); - var dotdotdot = isRest ? ts.createToken(24 /* DotDotDotToken */) : node.dotDotDotToken; - return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); - } - function transformJSDocTypeReference(node) { - var name = node.typeName; - var args = node.typeArguments; - if (ts.isIdentifier(node.typeName)) { - if (ts.isJSDocIndexSignature(node)) { - return transformJSDocIndexSignature(node); - } - var text = node.typeName.text; - switch (node.typeName.text) { - case "String": - case "Boolean": - case "Object": - case "Number": - text = text.toLowerCase(); - break; - case "array": - case "date": - case "promise": - text = text[0].toUpperCase() + text.slice(1); - break; - } - name = ts.createIdentifier(text); - if ((text === "Array" || text === "Promise") && !node.typeArguments) { - args = ts.createNodeArray([ts.createTypeReferenceNode("any", ts.emptyArray)]); - } - else { - args = ts.visitNodes(node.typeArguments, transformJSDocType); - } - } - return ts.createTypeReferenceNode(name, args); - } - function transformJSDocIndexSignature(node) { - var index = ts.createParameter( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "number" : "string", []), - /*initializer*/ undefined); - var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); - ts.setEmitFlags(indexSignature, 1 /* SingleLine */); - return indexSignature; - } - })(annotateWithTypeFromJSDoc = refactor.annotateWithTypeFromJSDoc || (refactor.annotateWithTypeFromJSDoc = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var convertFunctionToES6Class; - (function (convertFunctionToES6Class) { - var refactorName = "Convert to ES2015 class"; - var actionName = "convert"; - var description = ts.Diagnostics.Convert_function_to_an_ES2015_class.message; - refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - if (!ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var symbol = getConstructorSymbol(context); - if (!symbol) { - return undefined; - } - if (ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = symbol.valueDeclaration.initializer.symbol; - } - if ((symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { - return [ - { - name: refactorName, - description: description, - actions: [ - { - description: description, - name: actionName - } - ] - } - ]; - } - } - function getEditsForAction(context, action) { - // Somehow wrong action got invoked? - if (actionName !== action) { - return undefined; - } - var sourceFile = context.file; - var ctorSymbol = getConstructorSymbol(context); - var deletedNodes = []; - var deletes = []; - if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { - return undefined; - } - var ctorDeclaration = ctorSymbol.valueDeclaration; - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var precedingNode; - var newClassDeclaration; - switch (ctorDeclaration.kind) { - case 229 /* FunctionDeclaration */: - precedingNode = ctorDeclaration; - deleteNode(ctorDeclaration); - newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); - break; - case 227 /* VariableDeclaration */: - precedingNode = ctorDeclaration.parent.parent; - if (ctorDeclaration.parent.declarations.length === 1) { - deleteNode(precedingNode); - } - else { - deleteNode(ctorDeclaration, /*inList*/ true); - } - newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); - break; - } - if (!newClassDeclaration) { - return undefined; - } - // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); - for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { - var deleteCallback = deletes_1[_i]; - deleteCallback(); - } - return { - edits: changeTracker.getChanges(), - renameFilename: undefined, - renameLocation: undefined, - }; - function deleteNode(node, inList) { - if (inList === void 0) { inList = false; } - if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { - // Parent node has already been deleted; do nothing - return; - } - deletedNodes.push(node); - if (inList) { - deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); - } - else { - deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); - } - } - function createClassElementsFromSymbol(symbol) { - var memberElements = []; - // all instance members are stored in the "member" array of symbol - if (symbol.members) { - symbol.members.forEach(function (member) { - var memberElement = createClassElement(member, /*modifiers*/ undefined); - if (memberElement) { - memberElements.push(memberElement); - } - }); - } - // all static members are stored in the "exports" array of symbol - if (symbol.exports) { - symbol.exports.forEach(function (member) { - var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); - if (memberElement) { - memberElements.push(memberElement); - } - }); - } - return memberElements; - function shouldConvertDeclaration(_target, source) { - // Right now the only thing we can convert are function expressions - other values shouldn't get - // transformed. We can update this once ES public class properties are available. - return ts.isFunctionLike(source); - } - function createClassElement(symbol, modifiers) { - // both properties and methods are bound as property symbols - if (!(symbol.flags & 4 /* Property */)) { - return; - } - var memberDeclaration = symbol.valueDeclaration; - var assignmentBinaryExpression = memberDeclaration.parent; - if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { - return; - } - // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 211 /* ExpressionStatement */ - ? assignmentBinaryExpression.parent : assignmentBinaryExpression; - deleteNode(nodeToDelete); - if (!assignmentBinaryExpression.right) { - return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, - /*type*/ undefined, /*initializer*/ undefined); - } - switch (assignmentBinaryExpression.right.kind) { - case 187 /* FunctionExpression */: { - var functionExpression = assignmentBinaryExpression.right; - var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120 /* AsyncKeyword */)); - var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); - copyComments(assignmentBinaryExpression, method); - return method; - } - case 188 /* ArrowFunction */: { - var arrowFunction = assignmentBinaryExpression.right; - var arrowFunctionBody = arrowFunction.body; - var bodyBlock = void 0; - // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 208 /* Block */) { - bodyBlock = arrowFunctionBody; - } - else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); - } - var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120 /* AsyncKeyword */)); - var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); - copyComments(assignmentBinaryExpression, method); - return method; - } - default: { - // Don't try to declare members in JavaScript files - if (ts.isSourceFileJavaScript(sourceFile)) { - return; - } - var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, - /*type*/ undefined, assignmentBinaryExpression.right); - copyComments(assignmentBinaryExpression.parent, prop); - return prop; - } - } - } - } - function copyComments(sourceNode, targetNode) { - ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { - if (kind === 3 /* MultiLineCommentTrivia */) { - // Remove leading /* - pos += 2; - // Remove trailing */ - end -= 2; - } - else { - // Remove leading // - pos += 2; - } - ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); - }); - } - function createClassFromVariableDeclaration(node) { - var initializer = node.initializer; - if (!initializer || initializer.kind !== 187 /* FunctionExpression */) { - return undefined; - } - if (node.name.kind !== 71 /* Identifier */) { - return undefined; - } - var memberElements = createClassElementsFromSymbol(initializer.symbol); - if (initializer.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); - } - var modifiers = getModifierKindFromSource(precedingNode, 84 /* ExportKeyword */); - var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; - } - function createClassFromFunctionDeclaration(node) { - var memberElements = createClassElementsFromSymbol(ctorSymbol); - if (node.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); - } - var modifiers = getModifierKindFromSource(node, 84 /* ExportKeyword */); - var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; - } - function getModifierKindFromSource(source, kind) { - return ts.filter(source.modifiers, function (modifier) { return modifier.kind === kind; }); - } - } - function getConstructorSymbol(_a) { - var startPosition = _a.startPosition, file = _a.file, program = _a.program; - var checker = program.getTypeChecker(); - var token = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - return checker.getSymbolAtLocation(token); - } - })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var actionName = "Convert to ES6 module"; - var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); - refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - var file = context.file, startPosition = context.startPosition; - if (!ts.isSourceFileJavaScript(file) || !file.commonJsModuleIndicator) { - return undefined; - } - var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - return !isAtTriggerLocation(file, node) ? undefined : [ - { - name: actionName, - description: description, - actions: [ - { - description: description, - name: actionName, - }, - ], - }, - ]; - } - function isAtTriggerLocation(sourceFile, node, onSecondTry) { - if (onSecondTry === void 0) { onSecondTry = false; } - switch (node.kind) { - case 182 /* CallExpression */: - return isAtTopLevelRequire(node); - case 180 /* PropertyAccessExpression */: - return ts.isExportsOrModuleExportsOrAlias(sourceFile, node) - || ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression); - case 228 /* VariableDeclarationList */: - var decl = node.declarations[0]; - return ts.isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); - case 227 /* VariableDeclaration */: - return ts.isExportsOrModuleExportsOrAlias(sourceFile, node.initializer); - default: - return ts.isExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node) - || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, /*onSecondTry*/ true); - } - } - function isAtTopLevelRequire(call) { - if (!ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ true)) { - return false; - } - var propAccess = call.parent; - var varDecl = ts.isPropertyAccessExpression(propAccess) ? propAccess.parent : propAccess; - if (ts.isExpressionStatement(varDecl) && ts.isSourceFile(varDecl.parent)) { - return true; - } - if (!ts.isVariableDeclaration(varDecl)) { - return false; - } - var varDeclList = varDecl.parent; - if (varDeclList.kind !== 228 /* VariableDeclarationList */) { - return false; - } - var varStatement = varDeclList.parent; - return varStatement.kind === 209 /* VariableStatement */ && varStatement.parent.kind === 269 /* SourceFile */; - } - function getEditsForAction(context, _actionName) { - ts.Debug.assertEqual(actionName, _actionName); - var file = context.file, program = context.program; - ts.Debug.assert(ts.isSourceFileJavaScript(file)); - var edits = ts.textChanges.ChangeTracker.with(context, function (changes) { - var moduleExportsChangedToDefault = convertFileToEs6Module(file, program.getTypeChecker(), changes, program.getCompilerOptions().target); - if (moduleExportsChangedToDefault) { - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var importingFile = _a[_i]; - fixImportOfModuleExports(importingFile, file, changes); - } - } - }); - return { edits: edits, renameFilename: undefined, renameLocation: undefined }; - } - function fixImportOfModuleExports(importingFile, exportingFile, changes) { - for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { - var moduleSpecifier = _a[_i]; - var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); - if (!imported || imported.resolvedFileName !== exportingFile.fileName) { - continue; - } - var parent = moduleSpecifier.parent; - switch (parent.kind) { - case 249 /* ExternalModuleReference */: { - var importEq = parent.parent; - changes.replaceNode(importingFile, importEq, makeImport(importEq.name, /*namedImports*/ undefined, moduleSpecifier.text)); - break; - } - case 182 /* CallExpression */: { - var call = parent; - if (ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ false)) { - changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); - } - break; - } - } - } - } - /** @returns Whether we converted a `module.exports =` to a default export. */ - function convertFileToEs6Module(sourceFile, checker, changes, target) { - var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; - var exports = collectExportRenames(sourceFile, checker, identifiers); - convertExportsAccesses(sourceFile, exports, changes); - var moduleExportsChangedToDefault = false; - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); - moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; - } - return moduleExportsChangedToDefault; - } - function collectExportRenames(sourceFile, checker, identifiers) { - var res = ts.createMap(); - forEachExportReference(sourceFile, function (node) { - var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; - if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) - || checker.resolveName(node.name.text, node, 107455 /* Value */, /*excludeGlobals*/ true))) { - // Unconditionally add an underscore in case `text` is a keyword. - res.set(text, makeUniqueName("_" + text, identifiers)); - } - }); - return res; - } - function convertExportsAccesses(sourceFile, exports, changes) { - forEachExportReference(sourceFile, function (node, isAssignmentLhs) { - if (isAssignmentLhs) { - return; - } - var text = node.name.text; - changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); - }); - } - function forEachExportReference(sourceFile, cb) { - sourceFile.forEachChild(function recur(node) { - if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { - var parent = node.parent; - cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58 /* EqualsToken */); - } - node.forEachChild(recur); - }); - } - function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { - switch (statement.kind) { - case 209 /* VariableStatement */: - convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); - return false; - case 211 /* ExpressionStatement */: { - var expression = statement.expression; - switch (expression.kind) { - case 182 /* CallExpression */: { - if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteral*/ true)) { - // For side-effecting require() call, just make a side-effecting import. - changes.replaceNode(sourceFile, statement, makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0].text)); - } - return false; - } - case 195 /* BinaryExpression */: { - var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; - return operatorToken.kind === 58 /* EqualsToken */ && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); - } - } - } - // falls through - default: - return false; - } - } - function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { - var declarationList = statement.declarationList; - var foundImport = false; - var newNodes = ts.flatMap(declarationList.declarations, function (decl) { - var name = decl.name, initializer = decl.initializer; - if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { - // `const alias = module.exports;` can be removed. - foundImport = true; - return []; - } - if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteral*/ true)) { - foundImport = true; - return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); - } - else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteral*/ true)) { - foundImport = true; - return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); - } - else { - // Move it out to its own variable statement. - return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); - } - }); - if (foundImport) { - // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. - changes.replaceNodeWithNodes(sourceFile, statement, newNodes); - } - } - /** Converts `const name = require("moduleSpecifier").propertyName` */ - function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { - switch (name.kind) { - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: { - // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` - var tmp = makeUniqueName(propertyName, identifiers); - return [ - makeSingleImport(tmp, propertyName, moduleSpecifier), - makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), - ]; - } - case 71 /* Identifier */: - // `const a = require("b").c` --> `import { c as a } from "./b"; - return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; - default: - ts.Debug.assertNever(name); - } - } - function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { - if (!ts.isPropertyAccessExpression(left)) { - return false; - } - if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { - if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { - // `const alias = module.exports;` or `module.exports = alias;` can be removed. - changes.deleteNode(sourceFile, statement); - } - else { - var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; - var changedToDefaultExport = false; - if (!newNodes) { - (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); - } - changes.replaceNodeWithNodes(sourceFile, statement, newNodes); - return changedToDefaultExport; - } - } - else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { - convertNamedExport(sourceFile, statement, left.name, right, changes, exports); - } - return false; - var _a; - } - /** - * Convert `module.exports = { ... }` to individual exports.. - * We can't always do this if the module has interesting members -- then it will be a default export instead. - */ - function tryChangeModuleExportsObject(object) { - return ts.mapAllOrFail(object.properties, function (prop) { - switch (prop.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. - case 266 /* ShorthandPropertyAssignment */: - case 267 /* SpreadAssignment */: - return undefined; - case 265 /* PropertyAssignment */: { - var _a = prop, name = _a.name, initializer = _a.initializer; - return !ts.isIdentifier(name) ? undefined : convertExportsDotXEquals(name.text, initializer); - } - case 152 /* MethodDeclaration */: { - var m = prop; - return !ts.isIdentifier(m.name) ? undefined : functionExpressionToDeclaration(m.name.text, [ts.createToken(84 /* ExportKeyword */)], m); - } - default: - ts.Debug.assertNever(prop); - } - }); - } - function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { - // If "originalKeywordKind" was set, this is e.g. `exports. - var text = propertyName.text; - var rename = exports.get(text); - if (rename !== undefined) { - /* - const _class = 0; - export { _class as class }; - */ - var newNodes = [ - makeConst(/*modifiers*/ undefined, rename, right), - makeExportDeclaration([ts.createExportSpecifier(rename, text)]), - ]; - changes.replaceNodeWithNodes(sourceFile, statement, newNodes); - } - else { - changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); - } - } - function convertModuleExportsToExportDefault(exported, checker) { - var modifiers = [ts.createToken(84 /* ExportKeyword */), ts.createToken(79 /* DefaultKeyword */)]; - switch (exported.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: { - // `module.exports = function f() {}` --> `export default function f() {}` - var fn = exported; - return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; - } - case 200 /* ClassExpression */: { - // `module.exports = class C {}` --> `export default class C {}` - var cls = exported; - return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; - } - case 182 /* CallExpression */: - if (ts.isRequireCall(exported, /*checkArgumentIsStringLiteral*/ true)) { - return convertReExportAll(exported.arguments[0], checker); - } - // falls through - default: - // `module.exports = 0;` --> `export default 0;` - return [[ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, exported)], true]; - } - } - function convertReExportAll(reExported, checker) { - // `module.exports = require("x");` ==> `export * from "x"; export { default } from "x";` - var moduleSpecifier = reExported.text; - var moduleSymbol = checker.getSymbolAtLocation(reExported); - var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; - return exports.has("export=") - ? [[reExportDefault(moduleSpecifier)], true] - : !exports.has("default") - ? [[reExportStar(moduleSpecifier)], false] - // If there's some non-default export, must include both `export *` and `export default`. - : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; - } - function reExportStar(moduleSpecifier) { - return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier); - } - function reExportDefault(moduleSpecifier) { - return makeExportDeclaration([ts.createExportSpecifier(/*propertyName*/ undefined, "default")], moduleSpecifier); - } - function convertExportsDotXEquals(name, exported) { - var modifiers = [ts.createToken(84 /* ExportKeyword */)]; - switch (exported.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - // `exports.f = function() {}` --> `export function f() {}` - return functionExpressionToDeclaration(name, modifiers, exported); - case 200 /* ClassExpression */: - // `exports.C = class {}` --> `export class C {}` - return classExpressionToDeclaration(name, modifiers, exported); - default: - // `exports.x = 0;` --> `export const x = 0;` - return makeConst(modifiers, ts.createIdentifier(name), exported); - } - } - /** - * Converts `const <> = require("x");`. - * Returns nodes that will replace the variable declaration for the commonjs import. - * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. - */ - function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { - switch (name.kind) { - case 175 /* ObjectBindingPattern */: { - var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { - return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) - ? undefined - : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); - }); - if (importSpecifiers) { - return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier)]; - } - } - // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 176 /* ArrayBindingPattern */: { - /* - import x from "x"; - const [a, b, c] = x; - */ - var tmp = makeUniqueName(ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); - return [ - makeImport(ts.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), - makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), - ]; - } - case 71 /* Identifier */: - return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); - default: - ts.Debug.assertNever(name); - } - } - /** - * Convert `import x = require("x").` - * Also converts uses like `x.y()` to `y()` and uses a named import. - */ - function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { - var nameSymbol = checker.getSymbolAtLocation(name); - // Maps from module property name to name actually used. (The same if there isn't shadowing.) - var namedBindingsNames = ts.createMap(); - // True if there is some non-property use like `x()` or `f(x)`. - var needDefaultImport = false; - for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { - var use = _a[_i]; - if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { - // This was a use of a different symbol with the same name, due to shadowing. Ignore. - continue; - } - var parent = use.parent; - if (ts.isPropertyAccessExpression(parent)) { - var expression = parent.expression, propertyName = parent.name.text; - ts.Debug.assert(expression === use); // Else shouldn't have been in `collectIdentifiers` - var idName = namedBindingsNames.get(propertyName); - if (idName === undefined) { - idName = makeUniqueName(propertyName, identifiers); - namedBindingsNames.set(propertyName, idName); - } - changes.replaceNode(file, parent, ts.createIdentifier(idName)); - } - else { - needDefaultImport = true; - } - } - var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { - var propertyName = _a[0], idName = _a[1]; - return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); - })); - if (!namedBindings) { - // If it was unused, ensure that we at least import *something*. - needDefaultImport = true; - } - return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; - } - // Identifiers helpers - function makeUniqueName(name, identifiers) { - while (identifiers.original.has(name) || identifiers.additional.has(name)) { - name = "_" + name; - } - identifiers.additional.set(name, true); - return name; - } - function collectFreeIdentifiers(file) { - var map = ts.createMultiMap(); - file.forEachChild(function recur(node) { - if (ts.isIdentifier(node) && isFreeIdentifier(node)) { - map.add(node.text, node); - } - node.forEachChild(recur); - }); - return map; - } - function isFreeIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { - case 180 /* PropertyAccessExpression */: - return parent.name !== node; - case 177 /* BindingElement */: - return parent.propertyName !== node; - default: - return true; - } - } - // Node helpers - function functionExpressionToDeclaration(name, additionalModifiers, fn) { - return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); - } - function classExpressionToDeclaration(name, additionalModifiers, cls) { - return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); - } - function makeSingleImport(localName, propertyName, moduleSpecifier) { - return propertyName === "default" - ? makeImport(ts.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier) - : makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); - } - function makeImport(name, namedImports, moduleSpecifier) { - var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); - return ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifier)); - } - function makeImportSpecifier(propertyName, name) { - return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); - } - function makeConst(modifiers, name, init) { - return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, /*type*/ undefined, init)], 2 /* Const */)); - } - function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { - return ts.createExportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); - } - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); +/// +/// /// /// /* @internal */ @@ -98756,7 +100763,7 @@ var ts; } else if (ts.isVariableStatement(node)) { var numInitializers = 0; - var lastInitializer = undefined; + var lastInitializer = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (declaration.initializer) { @@ -98785,20 +100792,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 150 /* PropertyDeclaration */) { + if (current.kind === 151 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 147 /* Parameter */) { + else if (current.kind === 148 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 153 /* Constructor */) { + if (ctorOrMethod.kind === 154 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 152 /* MethodDeclaration */) { + else if (current.kind === 153 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -98815,6 +100822,10 @@ var ts; PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; })(PermittedJumps || (PermittedJumps = {})); + // We believe it's true because the node is from the (unmodified) tree. + ts.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + // For understanding how skipTrivia functioned: + ts.Debug.assert(!ts.positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); if (!ts.isStatement(nodeToCheck) && !(ts.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) { return [ts.createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; } @@ -98837,7 +100848,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 227 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 230 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); return true; @@ -98846,13 +100857,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 97 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 182 /* CallExpression */) { + if (node.parent.kind === 185 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -98867,9 +100878,9 @@ var ts; } if (!node || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - if (node.parent.kind === 269 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } @@ -98880,20 +100891,20 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 212 /* IfStatement */: + case 215 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 208 /* Block */: - if (node.parent && node.parent.kind === 225 /* TryStatement */ && node.parent.finallyBlock === node) { + case 211 /* Block */: + if (node.parent && node.parent.kind === 228 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -98905,11 +100916,11 @@ var ts; break; } switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); @@ -98917,8 +100928,8 @@ var ts; seenLabels.pop(); break; } - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: { var label = node.label; if (label) { @@ -98928,20 +100939,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 219 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 222 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -98995,7 +101006,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 147 /* Parameter */) { + if (current.kind === 148 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -99006,7 +101017,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 269 /* SourceFile */) { + if (current.kind === 272 /* SourceFile */) { return scopes; } } @@ -99096,32 +101107,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : "anonymous function"; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return "arrow function"; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return "method '" + scope.name.getText(); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: ts.Debug.assertNever(scope); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 230 /* ClassDeclaration */ - ? "class '" + scope.name.text + "'" + return scope.kind === 233 /* ClassDeclaration */ + ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 235 /* ModuleBlock */ + return scope.kind === 238 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -99149,12 +101160,12 @@ var ts; var functionNameText = getUniqueName(ts.isClassLike(scope) ? "newMethod" : "newFunction", file.text); var isJS = ts.isInJavaScriptFile(scope); var functionName = ts.createIdentifier(functionNameText); - var returnType = undefined; + var returnType; var parameters = []; var callArguments = []; var writes; usagesInScope.forEach(function (usage, name) { - var typeNode = undefined; + var typeNode; if (!isJS) { var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" @@ -99329,7 +101340,7 @@ var ts; } } if (isReadonlyArray(range.range)) { - changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes); + changeTracker.replaceNodeRangeWithNodes(context.file, ts.first(range.range), ts.last(range.range), newNodes); } else { changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); @@ -99348,9 +101359,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 139 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 140 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(139 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(140 /* UndefinedKeyword */)]); } } /** @@ -99377,7 +101388,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(115 /* StaticKeyword */)); } - modifiers.push(ts.createToken(131 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(132 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -99389,7 +101400,7 @@ var ts; var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true); // Consume - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } else { var newVariableDeclaration = ts.createVariableDeclaration(localNameText, variableType, initializer); @@ -99404,14 +101415,14 @@ var ts; changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); // Consume var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } - else if (node.parent.kind === 211 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 214 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)); - changeTracker.replaceRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }, newVariableStatement); + changeTracker.replaceNode(context.file, node.parent, newVariableStatement, ts.textChanges.useNonAdjustedPositions); } else { var newVariableStatement = ts.createVariableStatement( @@ -99425,13 +101436,13 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 211 /* ExpressionStatement */) { + if (node.parent.kind === 214 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. - changeTracker.deleteRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }); + changeTracker.deleteNode(context.file, node.parent, ts.textChanges.useNonAdjustedPositions); } else { var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } } } @@ -99441,7 +101452,7 @@ var ts; return { renameFilename: renameFilename, renameLocation: renameLocation, edits: edits }; } function getContainingVariableDeclarationIfInList(node, scope) { - var prevNode = undefined; + var prevNode; while (node !== undefined && node !== scope) { if (ts.isVariableDeclaration(node) && node.initializer === prevNode && @@ -99462,20 +101473,20 @@ var ts; var delta = 0; var lastPos = -1; for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], fileName = _a.fileName, textChanges_1 = _a.textChanges; + var _a = edits_1[_i], fileName = _a.fileName, textChanges_2 = _a.textChanges; ts.Debug.assert(fileName === renameFilename); - for (var _b = 0, textChanges_2 = textChanges_1; _b < textChanges_2.length; _b++) { - var change = textChanges_2[_b]; - var span_15 = change.span, newText = change.newText; + for (var _b = 0, textChanges_3 = textChanges_2; _b < textChanges_3.length; _b++) { + var change = textChanges_3[_b]; + var span_14 = change.span, newText = change.newText; var index = newText.indexOf(functionNameText); if (index !== -1) { - lastPos = span_15.start + delta + index; + lastPos = span_14.start + delta + index; // If the reference comes first, return immediately. if (!isDeclaredBeforeUse) { return lastPos; } } - delta += newText.length - span_15.length; + delta += newText.length - span_14.length; } } // If the declaration comes first, return the position of the last occurrence. @@ -99484,7 +101495,7 @@ var ts; return lastPos; } function getFirstDeclaration(type) { - var firstDeclaration = undefined; + var firstDeclaration; var symbol = type.symbol; if (symbol && symbol.declarations) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -99542,7 +101553,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 220 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 223 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -99606,7 +101617,7 @@ var ts; function getNodeToInsertPropertyBefore(maxPos, scope) { var members = scope.members; ts.Debug.assert(members.length > 0); // There must be at least one child, since we extracted from one. - var prevMember = undefined; + var prevMember; var allProperties = true; for (var _i = 0, members_6 = members; _i < members_6.length; _i++) { var member = members_6[_i]; @@ -99628,7 +101639,7 @@ var ts; } function getNodeToInsertConstantBefore(node, scope) { ts.Debug.assert(!ts.isClassLike(scope)); - var prevScope = undefined; + var prevScope; for (var curr = node; curr !== scope; curr = curr.parent) { if (isScope(curr)) { prevScope = curr; @@ -99636,7 +101647,7 @@ var ts; } for (var curr = (prevScope || node).parent;; curr = curr.parent) { if (isBlockLike(curr)) { - var prevStatement = undefined; + var prevStatement = void 0; for (var _i = 0, _a = curr.statements; _i < _a.length; _i++) { var statement = _a[_i]; if (statement.pos > node.pos) { @@ -99644,6 +101655,11 @@ var ts; } prevStatement = statement; } + if (!prevStatement && ts.isCaseClause(curr)) { + // We must have been in the expression of the case clause. + ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent)); + return curr.parent.parent; + } // There must be at least one statement since we started in one. ts.Debug.assert(prevStatement !== undefined); return prevStatement; @@ -99696,13 +101712,13 @@ var ts; var visibleDeclarationsInExtractedRange = []; var exposedVariableSymbolSet = ts.createMap(); // Key is symbol ID var exposedVariableDeclarations = []; - var firstExposedNonVariableDeclaration = undefined; + var firstExposedNonVariableDeclaration; var expression = !isReadonlyArray(targetRange.range) ? targetRange.range : targetRange.range.length === 1 && ts.isExpressionStatement(targetRange.range[0]) ? targetRange.range[0].expression : undefined; - var expressionDiagnostic = undefined; + var expressionDiagnostic; if (expression === undefined) { var statements = targetRange.range; var start = ts.first(statements).getStart(); @@ -99717,7 +101733,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 229 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 232 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -99780,7 +101796,7 @@ var ts; : ts.getEnclosingBlockScopeContainer(scopes[0]); ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); } - var _loop_10 = function (i) { + var _loop_11 = function (i) { var scopeUsages = usagesPerScope[i]; // Special case: in the innermost scope, all usages are available. // (The computed value reflects the value at the top-level of the scope, but the @@ -99790,7 +101806,7 @@ var ts; constantErrorsPerScope[i].push(ts.createDiagnosticForNode(errorNode, Messages.cannotAccessVariablesFromNestedScopes)); } var hasWrite = false; - var readonlyClassPropertyWrite = undefined; + var readonlyClassPropertyWrite; usagesPerScope[i].usages.forEach(function (value) { if (value.usage === 2 /* Write */) { hasWrite = true; @@ -99820,7 +101836,7 @@ var ts; } }; for (var i = 0; i < scopes.length; i++) { - _loop_10(i); + _loop_11(i); } return { target: target, usagesPerScope: usagesPerScope, functionErrorsPerScope: functionErrorsPerScope, constantErrorsPerScope: constantErrorsPerScope, exposedVariableDeclarations: exposedVariableDeclarations }; function hasTypeParameters(node) { @@ -99929,7 +101945,8 @@ var ts; return symbolId; } // find first declaration in this file - var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + var decls = symbol.getDeclarations(); + var declInFile = decls && ts.find(decls, function (d) { return d.getSourceFile() === sourceFile; }); if (!declInFile) { return undefined; } @@ -100019,7 +102036,8 @@ var ts; if (!symbol) { return undefined; } - if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + var decls = symbol.getDeclarations(); + if (decls && decls.some(function (d) { return d.parent === scopeDecl; })) { return ts.createIdentifier(symbol.name); } var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); @@ -100054,30 +102072,30 @@ var ts; */ function isExtractableExpression(node) { switch (node.parent.kind) { - case 268 /* EnumMember */: + case 271 /* EnumMember */: return false; } switch (node.kind) { case 9 /* StringLiteral */: - return node.parent.kind !== 239 /* ImportDeclaration */ && - node.parent.kind !== 243 /* ImportSpecifier */; - case 199 /* SpreadElement */: - case 175 /* ObjectBindingPattern */: - case 177 /* BindingElement */: + return node.parent.kind !== 242 /* ImportDeclaration */ && + node.parent.kind !== 246 /* ImportSpecifier */; + case 202 /* SpreadElement */: + case 178 /* ObjectBindingPattern */: + case 180 /* BindingElement */: return false; case 71 /* Identifier */: - return node.parent.kind !== 177 /* BindingElement */ && - node.parent.kind !== 243 /* ImportSpecifier */ && - node.parent.kind !== 247 /* ExportSpecifier */; + return node.parent.kind !== 180 /* BindingElement */ && + node.parent.kind !== 246 /* ImportSpecifier */ && + node.parent.kind !== 250 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 208 /* Block */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: - case 261 /* CaseClause */: + case 211 /* Block */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: + case 264 /* CaseClause */: return true; default: return false; @@ -100086,165 +102104,7 @@ var ts; })(extractSymbol = refactor.extractSymbol || (refactor.extractSymbol = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var installTypesForPackage; - (function (installTypesForPackage) { - var refactorName = "Install missing types package"; - var actionName = "install"; - var description = "Install missing types package"; - refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - if (ts.getStrictOptionValue(context.program.getCompilerOptions(), "noImplicitAny")) { - // Then it will be available via `fixCannotFindModule`. - return undefined; - } - var action = getAction(context); - return action && [ - { - name: refactorName, - description: description, - actions: [ - { - description: action.description, - name: actionName, - }, - ], - }, - ]; - } - function getEditsForAction(context, _actionName) { - ts.Debug.assertEqual(actionName, _actionName); - var action = getAction(context); // Should be defined if we said there was an action available. - return { - edits: [], - renameFilename: undefined, - renameLocation: undefined, - commands: action.commands, - }; - } - function getAction(context) { - var file = context.file, startPosition = context.startPosition; - var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - if (!ts.isStringLiteral(node) || !isModuleIdentifier(node)) { - return undefined; - } - var resolvedTo = ts.getResolvedModule(file, node.text); - // Still offer to install types if it resolved to e.g. a ".js" file. - // `tryGetCodeActionForInstallPackageTypes` will verify that we're looking for a valid package name, - // so the fix won't trigger for imports of ".js" files that couldn't be better replaced by typings. - if (resolvedTo && ts.extensionIsTypeScript(resolvedTo.extension)) { - return undefined; - } - return ts.codefix.tryGetCodeActionForInstallPackageTypes(context.host, file.fileName, node.text); - } - function isModuleIdentifier(node) { - switch (node.parent.kind) { - case 239 /* ImportDeclaration */: - case 249 /* ExternalModuleReference */: - return true; - default: - return false; - } - } - })(installTypesForPackage = refactor.installTypesForPackage || (refactor.installTypesForPackage = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var installTypesForPackage; - (function (installTypesForPackage) { - var actionName = "Convert to default import"; - var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); - refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - var file = context.file, startPosition = context.startPosition, program = context.program; - if (!program.getCompilerOptions().allowSyntheticDefaultImports) { - return undefined; - } - var importInfo = getConvertibleImportAtPosition(file, startPosition); - if (!importInfo) { - return undefined; - } - var module = ts.getResolvedModule(file, importInfo.moduleSpecifier.text); - var resolvedFile = program.getSourceFile(module.resolvedFileName); - if (!(resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { - return undefined; - } - return [ - { - name: actionName, - description: description, - actions: [ - { - description: description, - name: actionName, - }, - ], - }, - ]; - } - function getEditsForAction(context, _actionName) { - var file = context.file, startPosition = context.startPosition; - ts.Debug.assertEqual(actionName, _actionName); - var importInfo = getConvertibleImportAtPosition(file, startPosition); - if (!importInfo) { - return undefined; - } - var importStatement = importInfo.importStatement, name = importInfo.name, moduleSpecifier = importInfo.moduleSpecifier; - var newImportClause = ts.createImportClause(name, /*namedBindings*/ undefined); - var newImportStatement = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newImportClause, moduleSpecifier); - return { - edits: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(file, importStatement, newImportStatement); }), - renameFilename: undefined, - renameLocation: undefined, - }; - } - function getConvertibleImportAtPosition(file, startPosition) { - var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - while (true) { - switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: - var eq = node; - var moduleReference = eq.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) - ? { importStatement: eq, name: eq.name, moduleSpecifier: moduleReference.expression } - : undefined; - case 239 /* ImportDeclaration */: - var d = node; - var importClause = d.importClause; - return !importClause.name && importClause.namedBindings.kind === 241 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) - ? { importStatement: d, name: importClause.namedBindings.name, moduleSpecifier: d.moduleSpecifier } - : undefined; - // For known child node kinds of convertible imports, try again with parent node. - case 241 /* NamespaceImport */: - case 249 /* ExternalModuleReference */: - case 91 /* ImportKeyword */: - case 71 /* Identifier */: - case 9 /* StringLiteral */: - case 39 /* AsteriskToken */: - break; - default: - return undefined; - } - node = node.parent; - } - } - })(installTypesForPackage = refactor.installTypesForPackage || (refactor.installTypesForPackage = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/// -/// -/// /// -/// -/// /// /// /// @@ -100260,11 +102120,13 @@ var ts; /// /// /// +/// /// /// /// /// /// +/// /// /// /// @@ -100343,6 +102205,9 @@ var ts; var token = ts.scanner.scan(); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { + if (token === 71 /* Identifier */) { + ts.Debug.fail("Did not expect " + ts.Debug.showSyntaxKind(this) + " to have an Identifier in its trivia"); + } nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; @@ -100353,7 +102218,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(290 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(293 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { @@ -100439,8 +102304,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 271 /* FirstJSDocNode */ || kid.kind > 289 /* LastJSDocNode */; }); - return child.kind < 144 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 274 /* FirstJSDocNode */ || kid.kind > 292 /* LastJSDocNode */; }); + return child.kind < 145 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -100451,7 +102316,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 144 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 145 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -100793,27 +102658,15 @@ var ts; } function getDeclarationName(declaration) { var name = ts.getNameOfDeclaration(declaration); - if (name) { - var result_6 = ts.getTextOfIdentifierOrLiteral(name); - if (result_6 !== undefined) { - return result_6; - } - if (name.kind === 145 /* ComputedPropertyName */) { - var expr = name.expression; - if (expr.kind === 180 /* PropertyAccessExpression */) { - return expr.name.text; - } - return ts.getTextOfIdentifierOrLiteral(expr); - } - } - return undefined; + return name && (ts.isPropertyNameLiteral(name) ? ts.getTextOfIdentifierOrLiteral(name) : + name.kind === 146 /* ComputedPropertyName */ && ts.isPropertyAccessExpression(name.expression) ? name.expression.name.text : undefined); } function visit(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -100833,31 +102686,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 164 /* TypeLiteral */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 165 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: { + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -100868,19 +102721,19 @@ var ts; } } // falls through - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: addDeclaration(node); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -100892,7 +102745,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -100901,7 +102754,7 @@ var ts; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -101393,6 +103246,10 @@ var ts; var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); return semanticDiagnostics.concat(declarationDiagnostics); } + function getSuggestionDiagnostics(fileName) { + synchronizeHostData(); + return ts.computeSuggestionDiagnostics(getValidSourceFile(fileName), program); + } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); @@ -101415,9 +103272,7 @@ var ts; var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); if (node === sourceFile) { - return undefined; - } - if (ts.isLabelName(node)) { + // Avoid giving quickInfo for the sourceFile as a whole. return undefined; } var typeChecker = program.getTypeChecker(); @@ -101426,34 +103281,37 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + if (ts.isLabelName(node)) { + // Type here will be 'any', avoid displaying this. + return undefined; + } + // falls through + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 97 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); - if (type) { - return { - kind: "" /* unknown */, - kindModifiers: "" /* none */, - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined, - tags: type.symbol ? type.symbol.getJsDocTags() : undefined - }; - } + return type && { + kind: "" /* unknown */, + kindModifiers: "" /* none */, + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), + documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined, + tags: type.symbol ? type.symbol.getJsDocTags() : undefined + }; } return undefined; } - var displayPartsDocumentationsAndKind = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, ts.getContainerNode(node), node); + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, ts.getContainerNode(node), node), symbolKind = _a.symbolKind, displayParts = _a.displayParts, documentation = _a.documentation, tags = _a.tags; return { - kind: displayPartsDocumentationsAndKind.symbolKind, + kind: symbolKind, kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation, - tags: displayPartsDocumentationsAndKind.tags + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: displayParts, + documentation: documentation, + tags: tags, }; } function getSymbolAtLocationForQuickInfo(node, checker) { @@ -101461,11 +103319,9 @@ var ts; && ts.isPropertyAssignment(node.parent) && node.parent.name === node) { var type = checker.getContextualType(node.parent.parent); - if (type) { - var property = checker.getPropertyOfType(type, ts.getTextOfIdentifierOrLiteral(node)); - if (property) { - return property; - } + var property = type && checker.getPropertyOfType(type, ts.getTextOfIdentifierOrLiteral(node)); + if (property) { + return property; } } return checker.getSymbolAtLocation(node); @@ -101490,44 +103346,24 @@ var ts; } /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { - var results = getOccurrencesAtPositionCore(fileName, position); - if (results) { - var sourceFile_2 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - // Get occurrences only supports reporting occurrences for the file queried. So - // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_2; }); - } - return results; + var canonicalFileName = getCanonicalFileName(ts.normalizeSlashes(fileName)); + return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { + ts.Debug.assert(getCanonicalFileName(ts.normalizeSlashes(entry.fileName)) === canonicalFileName); // Get occurrences only supports reporting occurrences for the file queried. + return { + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, + isDefinition: false, + isInString: highlightSpan.isInString, + }; + }); }); } function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); - var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); }); + var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return ts.Debug.assertDefined(program.getSourceFile(f)); }); var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function getOccurrencesAtPositionCore(fileName, position) { - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - function convertDocumentHighlights(documentHighlights) { - if (!documentHighlights) { - return undefined; - } - var result = []; - for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) { - var entry = documentHighlights_1[_i]; - for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { - var highlightSpan = _b[_a]; - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, - isDefinition: false, - isInString: highlightSpan.isInString, - }); - } - } - return result; - } - } function findRenameLocations(fileName, position, findInStrings, findInComments) { return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } @@ -101591,15 +103427,15 @@ var ts; return; } switch (node.kind) { - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 9 /* StringLiteral */: case 86 /* FalseKeyword */: case 101 /* TrueKeyword */: case 95 /* NullKeyword */: case 97 /* SuperKeyword */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 71 /* Identifier */: break; // Cant create the text span @@ -101616,7 +103452,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 234 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 237 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -101677,47 +103513,20 @@ var ts; var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } + var braceMatching = ts.createMapFromTemplate((_a = {}, + _a[17 /* OpenBraceToken */] = 18 /* CloseBraceToken */, + _a[19 /* OpenParenToken */] = 20 /* CloseParenToken */, + _a[21 /* OpenBracketToken */] = 22 /* CloseBracketToken */, + _a[29 /* GreaterThanToken */] = 27 /* LessThanToken */, + _a)); + braceMatching.forEach(function (value, key) { return braceMatching.set(value.toString(), Number(key)); }); function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var result = []; var token = ts.getTouchingToken(sourceFile, position, /*includeJsDocComment*/ false); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - // Ensure that there is a corresponding token to match ours. - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) { - var current = childNodes_1[_i]; - if (current.kind === matchKind) { - var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - // We want to order the braces when we return the result. - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 17 /* OpenBraceToken */: return 18 /* CloseBraceToken */; - case 19 /* OpenParenToken */: return 20 /* CloseParenToken */; - case 21 /* OpenBracketToken */: return 22 /* CloseBracketToken */; - case 27 /* LessThanToken */: return 29 /* GreaterThanToken */; - case 18 /* CloseBraceToken */: return 17 /* OpenBraceToken */; - case 20 /* CloseParenToken */: return 19 /* OpenParenToken */; - case 22 /* CloseBracketToken */: return 21 /* OpenBracketToken */; - case 29 /* GreaterThanToken */: return 27 /* LessThanToken */; - } - return undefined; - } + var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined; + var match = matchKind && ts.findChildOfKind(token.parent, matchKind, sourceFile); + // We want to order the braces when we return the result. + return match ? [ts.createTextSpanFromNode(token, sourceFile), ts.createTextSpanFromNode(match, sourceFile)].sort(function (a, b) { return a.start - b.start; }) : ts.emptyArray; } function getIndentationAtPosition(fileName, position, editorOptions) { var start = ts.timestamp(); @@ -101770,6 +103579,13 @@ var ts; var formatContext = ts.formatting.getFormatContext(formatOptions); return ts.codefix.getAllFixes({ fixId: fixId, sourceFile: sourceFile, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); } + function organizeImports(scope, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host, program); + } function applyCodeActionCommand(fileName, actionOrUndefined) { var action = typeof fileName === "string" ? actionOrUndefined : fileName; return ts.isArray(action) ? Promise.all(action.map(applySingleCodeActionCommand)) : applySingleCodeActionCommand(action); @@ -101782,6 +103598,7 @@ var ts; : Promise.reject("Host does not implement `installPackage`"); default: ts.Debug.fail(); + // TODO: Debug.assertNever(action); will only work if there is more than one type. } } function getDocCommentTemplateAtPosition(fileName, position) { @@ -101865,7 +103682,7 @@ var ts; if (!ts.isInComment(sourceFile, matchPosition)) { continue; } - var descriptor = undefined; + var descriptor = void 0; for (var i = 0; i < descriptors.length; i++) { if (matchArray[i + firstDescriptorCaptureIndex]) { descriptor = descriptors[i]; @@ -101976,6 +103793,7 @@ var ts; cleanupSemanticCache: cleanupSemanticCache, getSyntacticDiagnostics: getSyntacticDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, + getSuggestionDiagnostics: getSuggestionDiagnostics, getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, getSyntacticClassifications: getSyntacticClassifications, getSemanticClassifications: getSemanticClassifications, @@ -102014,6 +103832,7 @@ var ts; getCodeFixesAtPosition: getCodeFixesAtPosition, getCombinedCodeFix: getCombinedCodeFix, applyCodeActionCommand: applyCodeActionCommand, + organizeImports: organizeImports, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, getSourceFile: getSourceFile, @@ -102021,6 +103840,7 @@ var ts; getApplicableRefactors: getApplicableRefactors, getEditsForRefactor: getEditsForRefactor, }; + var _a; } ts.createLanguageService = createLanguageService; /* @internal */ @@ -102056,7 +103876,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 249 /* ExternalModuleReference */ || + node.parent.kind === 252 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -102068,13 +103888,13 @@ var ts; switch (node.kind) { case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 145 /* ComputedPropertyName */) { + if (node.parent.kind === 146 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 71 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 179 /* ObjectLiteralExpression */ || node.parent.parent.kind === 258 /* JsxAttributes */) && + (node.parent.parent.kind === 182 /* ObjectLiteralExpression */ || node.parent.parent.kind === 261 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -102091,20 +103911,20 @@ var ts; function getPropertySymbolsFromType(type, propName) { var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); if (name && type) { - var result_7 = []; + var result_6 = []; var symbol = type.getProperty(name); if (type.flags & 131072 /* Union */) { ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { - result_7.push(symbol); + result_6.push(symbol); } }); - return result_7; + return result_6; } if (symbol) { - result_7.push(symbol); - return result_7; + result_6.push(symbol); + return result_6; } } return undefined; @@ -102113,7 +103933,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 181 /* ElementAccessExpression */ && + node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -102194,114 +104014,114 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 227 /* VariableDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 230 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return spanInVariableDeclaration(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return spanInParameterDeclaration(node); - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanInBlock(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInBlock(node.block); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return spanInForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 177 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 180 /* BindingElement */: // span on complete node return textSpan(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 148 /* Decorator */: + case 149 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return undefined; // Tokens: case 25 /* SemicolonToken */: @@ -102331,7 +104151,7 @@ var ts; case 74 /* CatchKeyword */: case 87 /* FinallyKeyword */: return spanInNextNode(node); - case 143 /* OfKeyword */: + case 144 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -102344,51 +104164,50 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 71 /* Identifier */ || - node.kind === 199 /* SpreadElement */ || - node.kind === 265 /* PropertyAssignment */ || - node.kind === 266 /* ShorthandPropertyAssignment */) && + node.kind === 202 /* SpreadElement */ || + node.kind === 268 /* PropertyAssignment */ || + node.kind === 269 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 195 /* BinaryExpression */) { - var binaryExpression = node; + if (node.kind === 198 /* BinaryExpression */) { + var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of // [a, b, c] = expression or // {a, b, c} = expression - if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { - return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(left); } - if (binaryExpression.operatorToken.kind === 58 /* EqualsToken */ && - ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + if (operatorToken.kind === 58 /* EqualsToken */ && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { // Set breakpoint on assignment expression element of destructuring pattern // a = expression of // [a = expression, b, c] = someExpression or // { a = expression, b, c } = someExpression return textSpan(node); } - if (binaryExpression.operatorToken.kind === 26 /* CommaToken */) { - return spanInNode(binaryExpression.left); + if (operatorToken.kind === 26 /* CommaToken */) { + return spanInNode(left); } } if (ts.isExpressionNode(node)) { switch (node.parent.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 148 /* Decorator */: + case 149 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return textSpan(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (node.parent.operatorToken.kind === 26 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -102396,46 +104215,49 @@ var ts; break; } } - // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 265 /* PropertyAssignment */ && - node.parent.name === node && - !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { - return spanInNode(node.parent.initializer); - } - // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 185 /* TypeAssertionExpression */ && node.parent.type === node) { - return spanInNextNode(node.parent.type); - } - // return type of function go to previous token - if (ts.isFunctionLike(node.parent) && node.parent.type === node) { - return spanInPreviousNode(node); - } - // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 227 /* VariableDeclaration */ || - node.parent.kind === 147 /* Parameter */)) { - var paramOrVarDecl = node.parent; - if (paramOrVarDecl.initializer === node || - paramOrVarDecl.type === node || - ts.isAssignmentOperator(node.kind)) { - return spanInPreviousNode(node); + switch (node.parent.kind) { + case 268 /* PropertyAssignment */: + // If this is name of property assignment, set breakpoint in the initializer + if (node.parent.name === node && + !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { + return spanInNode(node.parent.initializer); + } + break; + case 188 /* TypeAssertionExpression */: + // Breakpoint in type assertion goes to its operand + if (node.parent.type === node) { + return spanInNextNode(node.parent.type); + } + break; + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: { + // initializer of variable/parameter declaration go to previous node + var _b = node.parent, initializer = _b.initializer, type = _b.type; + if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + break; } - } - if (node.parent.kind === 195 /* BinaryExpression */) { - var binaryExpression = node.parent; - if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && - (binaryExpression.right === node || - binaryExpression.operatorToken === node)) { - // If initializer of destructuring assignment move to previous token - return spanInPreviousNode(node); + case 198 /* BinaryExpression */: { + var left = node.parent.left; + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { + // If initializer of destructuring assignment move to previous token + return spanInPreviousNode(node); + } + break; } + default: + // return type of function go to previous token + if (ts.isFunctionLike(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } } // Default go to parent to set the breakpoint return spanInNode(node.parent); } } function textSpanFromVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && - variableDeclaration.parent.declarations[0] === variableDeclaration) { + if (ts.isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } @@ -102446,7 +104268,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 216 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 219 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -102457,10 +104279,10 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 217 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 220 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (ts.isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and @@ -102498,7 +104320,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 230 /* ClassDeclaration */ && functionDeclaration.kind !== 153 /* Constructor */); + (functionDeclaration.parent.kind === 233 /* ClassDeclaration */ && functionDeclaration.kind !== 154 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -102521,26 +104343,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // falls through // Set on parent if on same line otherwise on first statement - case 214 /* WhileStatement */: - case 212 /* IfStatement */: - case 216 /* ForInStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 219 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 231 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -102565,23 +104387,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 177 /* BindingElement */) { + if (bindingPattern.parent.kind === 180 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 176 /* ArrayBindingPattern */ && node.kind !== 175 /* ObjectBindingPattern */); - var elements = node.kind === 178 /* ArrayLiteralExpression */ ? - node.elements : - node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 179 /* ArrayBindingPattern */ && node.kind !== 178 /* ObjectBindingPattern */); + var elements = node.kind === 181 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -102589,18 +104409,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 195 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 198 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -102608,25 +104428,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 233 /* EnumDeclaration */: - case 230 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -102634,7 +104454,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -102650,7 +104470,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -102665,12 +104485,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 213 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 182 /* CallExpression */ || - node.parent.kind === 183 /* NewExpression */) { + if (node.parent.kind === 216 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 185 /* CallExpression */ || + node.parent.kind === 186 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 186 /* ParenthesizedExpression */) { + if (node.parent.kind === 189 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -102679,21 +104499,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 186 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 189 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -102703,20 +104523,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ || - node.parent.kind === 147 /* Parameter */) { + node.parent.kind === 268 /* PropertyAssignment */ || + node.parent.kind === 148 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 185 /* TypeAssertionExpression */) { + if (node.parent.kind === 188 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 213 /* DoStatement */) { + if (node.parent.kind === 216 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -102724,7 +104544,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.kind === 220 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -103020,8 +104840,7 @@ var ts; message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine), start: diagnostic.start, length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), + category: ts.diagnosticCategoryName(diagnostic), code: diagnostic.code }; } @@ -103071,7 +104890,7 @@ var ts; }; LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) { var newLine = ts.getNewLineOrDefaultFromHost(this.host); - return ts.realizeDiagnostics(diagnostics, newLine); + return realizeDiagnostics(diagnostics, newLine); }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; @@ -103109,6 +104928,10 @@ var ts; return _this.realizeDiagnostics(diagnostics); }); }; + LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) { + var _this = this; + return this.forwardJSONCall("getSuggestionDiagnostics('" + fileName + "')", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); }); + }; LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () { var _this = this; return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () { @@ -103441,7 +105264,7 @@ var ts; if (_this.safeList === undefined) { _this.safeList = ts.JsTyping.loadSafeList(_this.host, ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName)); } - return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports); + return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports, info.typesRegistry); }); }; return CoreServicesShimObject; diff --git a/src/lib/typescriptServices.d.ts b/src/lib/typescriptServices.d.ts index 5a5a7670..47cc9cee 100644 --- a/src/lib/typescriptServices.d.ts +++ b/src/lib/typescriptServices.d.ts @@ -187,177 +187,180 @@ declare namespace ts { ConstructorKeyword = 123, DeclareKeyword = 124, GetKeyword = 125, - IsKeyword = 126, - KeyOfKeyword = 127, - ModuleKeyword = 128, - NamespaceKeyword = 129, - NeverKeyword = 130, - ReadonlyKeyword = 131, - RequireKeyword = 132, - NumberKeyword = 133, - ObjectKeyword = 134, - SetKeyword = 135, - StringKeyword = 136, - SymbolKeyword = 137, - TypeKeyword = 138, - UndefinedKeyword = 139, - UniqueKeyword = 140, - FromKeyword = 141, - GlobalKeyword = 142, - OfKeyword = 143, - QualifiedName = 144, - ComputedPropertyName = 145, - TypeParameter = 146, - Parameter = 147, - Decorator = 148, - PropertySignature = 149, - PropertyDeclaration = 150, - MethodSignature = 151, - MethodDeclaration = 152, - Constructor = 153, - GetAccessor = 154, - SetAccessor = 155, - CallSignature = 156, - ConstructSignature = 157, - IndexSignature = 158, - TypePredicate = 159, - TypeReference = 160, - FunctionType = 161, - ConstructorType = 162, - TypeQuery = 163, - TypeLiteral = 164, - ArrayType = 165, - TupleType = 166, - UnionType = 167, - IntersectionType = 168, - ParenthesizedType = 169, - ThisType = 170, - TypeOperator = 171, - IndexedAccessType = 172, - MappedType = 173, - LiteralType = 174, - ObjectBindingPattern = 175, - ArrayBindingPattern = 176, - BindingElement = 177, - ArrayLiteralExpression = 178, - ObjectLiteralExpression = 179, - PropertyAccessExpression = 180, - ElementAccessExpression = 181, - CallExpression = 182, - NewExpression = 183, - TaggedTemplateExpression = 184, - TypeAssertionExpression = 185, - ParenthesizedExpression = 186, - FunctionExpression = 187, - ArrowFunction = 188, - DeleteExpression = 189, - TypeOfExpression = 190, - VoidExpression = 191, - AwaitExpression = 192, - PrefixUnaryExpression = 193, - PostfixUnaryExpression = 194, - BinaryExpression = 195, - ConditionalExpression = 196, - TemplateExpression = 197, - YieldExpression = 198, - SpreadElement = 199, - ClassExpression = 200, - OmittedExpression = 201, - ExpressionWithTypeArguments = 202, - AsExpression = 203, - NonNullExpression = 204, - MetaProperty = 205, - TemplateSpan = 206, - SemicolonClassElement = 207, - Block = 208, - VariableStatement = 209, - EmptyStatement = 210, - ExpressionStatement = 211, - IfStatement = 212, - DoStatement = 213, - WhileStatement = 214, - ForStatement = 215, - ForInStatement = 216, - ForOfStatement = 217, - ContinueStatement = 218, - BreakStatement = 219, - ReturnStatement = 220, - WithStatement = 221, - SwitchStatement = 222, - LabeledStatement = 223, - ThrowStatement = 224, - TryStatement = 225, - DebuggerStatement = 226, - VariableDeclaration = 227, - VariableDeclarationList = 228, - FunctionDeclaration = 229, - ClassDeclaration = 230, - InterfaceDeclaration = 231, - TypeAliasDeclaration = 232, - EnumDeclaration = 233, - ModuleDeclaration = 234, - ModuleBlock = 235, - CaseBlock = 236, - NamespaceExportDeclaration = 237, - ImportEqualsDeclaration = 238, - ImportDeclaration = 239, - ImportClause = 240, - NamespaceImport = 241, - NamedImports = 242, - ImportSpecifier = 243, - ExportAssignment = 244, - ExportDeclaration = 245, - NamedExports = 246, - ExportSpecifier = 247, - MissingDeclaration = 248, - ExternalModuleReference = 249, - JsxElement = 250, - JsxSelfClosingElement = 251, - JsxOpeningElement = 252, - JsxClosingElement = 253, - JsxFragment = 254, - JsxOpeningFragment = 255, - JsxClosingFragment = 256, - JsxAttribute = 257, - JsxAttributes = 258, - JsxSpreadAttribute = 259, - JsxExpression = 260, - CaseClause = 261, - DefaultClause = 262, - HeritageClause = 263, - CatchClause = 264, - PropertyAssignment = 265, - ShorthandPropertyAssignment = 266, - SpreadAssignment = 267, - EnumMember = 268, - SourceFile = 269, - Bundle = 270, - JSDocTypeExpression = 271, - JSDocAllType = 272, - JSDocUnknownType = 273, - JSDocNullableType = 274, - JSDocNonNullableType = 275, - JSDocOptionalType = 276, - JSDocFunctionType = 277, - JSDocVariadicType = 278, - JSDocComment = 279, - JSDocTypeLiteral = 280, - JSDocTag = 281, - JSDocAugmentsTag = 282, - JSDocClassTag = 283, - JSDocParameterTag = 284, - JSDocReturnTag = 285, - JSDocTypeTag = 286, - JSDocTemplateTag = 287, - JSDocTypedefTag = 288, - JSDocPropertyTag = 289, - SyntaxList = 290, - NotEmittedStatement = 291, - PartiallyEmittedExpression = 292, - CommaListExpression = 293, - MergeDeclarationMarker = 294, - EndOfDeclarationMarker = 295, - Count = 296, + InferKeyword = 126, + IsKeyword = 127, + KeyOfKeyword = 128, + ModuleKeyword = 129, + NamespaceKeyword = 130, + NeverKeyword = 131, + ReadonlyKeyword = 132, + RequireKeyword = 133, + NumberKeyword = 134, + ObjectKeyword = 135, + SetKeyword = 136, + StringKeyword = 137, + SymbolKeyword = 138, + TypeKeyword = 139, + UndefinedKeyword = 140, + UniqueKeyword = 141, + FromKeyword = 142, + GlobalKeyword = 143, + OfKeyword = 144, + QualifiedName = 145, + ComputedPropertyName = 146, + TypeParameter = 147, + Parameter = 148, + Decorator = 149, + PropertySignature = 150, + PropertyDeclaration = 151, + MethodSignature = 152, + MethodDeclaration = 153, + Constructor = 154, + GetAccessor = 155, + SetAccessor = 156, + CallSignature = 157, + ConstructSignature = 158, + IndexSignature = 159, + TypePredicate = 160, + TypeReference = 161, + FunctionType = 162, + ConstructorType = 163, + TypeQuery = 164, + TypeLiteral = 165, + ArrayType = 166, + TupleType = 167, + UnionType = 168, + IntersectionType = 169, + ConditionalType = 170, + InferType = 171, + ParenthesizedType = 172, + ThisType = 173, + TypeOperator = 174, + IndexedAccessType = 175, + MappedType = 176, + LiteralType = 177, + ObjectBindingPattern = 178, + ArrayBindingPattern = 179, + BindingElement = 180, + ArrayLiteralExpression = 181, + ObjectLiteralExpression = 182, + PropertyAccessExpression = 183, + ElementAccessExpression = 184, + CallExpression = 185, + NewExpression = 186, + TaggedTemplateExpression = 187, + TypeAssertionExpression = 188, + ParenthesizedExpression = 189, + FunctionExpression = 190, + ArrowFunction = 191, + DeleteExpression = 192, + TypeOfExpression = 193, + VoidExpression = 194, + AwaitExpression = 195, + PrefixUnaryExpression = 196, + PostfixUnaryExpression = 197, + BinaryExpression = 198, + ConditionalExpression = 199, + TemplateExpression = 200, + YieldExpression = 201, + SpreadElement = 202, + ClassExpression = 203, + OmittedExpression = 204, + ExpressionWithTypeArguments = 205, + AsExpression = 206, + NonNullExpression = 207, + MetaProperty = 208, + TemplateSpan = 209, + SemicolonClassElement = 210, + Block = 211, + VariableStatement = 212, + EmptyStatement = 213, + ExpressionStatement = 214, + IfStatement = 215, + DoStatement = 216, + WhileStatement = 217, + ForStatement = 218, + ForInStatement = 219, + ForOfStatement = 220, + ContinueStatement = 221, + BreakStatement = 222, + ReturnStatement = 223, + WithStatement = 224, + SwitchStatement = 225, + LabeledStatement = 226, + ThrowStatement = 227, + TryStatement = 228, + DebuggerStatement = 229, + VariableDeclaration = 230, + VariableDeclarationList = 231, + FunctionDeclaration = 232, + ClassDeclaration = 233, + InterfaceDeclaration = 234, + TypeAliasDeclaration = 235, + EnumDeclaration = 236, + ModuleDeclaration = 237, + ModuleBlock = 238, + CaseBlock = 239, + NamespaceExportDeclaration = 240, + ImportEqualsDeclaration = 241, + ImportDeclaration = 242, + ImportClause = 243, + NamespaceImport = 244, + NamedImports = 245, + ImportSpecifier = 246, + ExportAssignment = 247, + ExportDeclaration = 248, + NamedExports = 249, + ExportSpecifier = 250, + MissingDeclaration = 251, + ExternalModuleReference = 252, + JsxElement = 253, + JsxSelfClosingElement = 254, + JsxOpeningElement = 255, + JsxClosingElement = 256, + JsxFragment = 257, + JsxOpeningFragment = 258, + JsxClosingFragment = 259, + JsxAttribute = 260, + JsxAttributes = 261, + JsxSpreadAttribute = 262, + JsxExpression = 263, + CaseClause = 264, + DefaultClause = 265, + HeritageClause = 266, + CatchClause = 267, + PropertyAssignment = 268, + ShorthandPropertyAssignment = 269, + SpreadAssignment = 270, + EnumMember = 271, + SourceFile = 272, + Bundle = 273, + JSDocTypeExpression = 274, + JSDocAllType = 275, + JSDocUnknownType = 276, + JSDocNullableType = 277, + JSDocNonNullableType = 278, + JSDocOptionalType = 279, + JSDocFunctionType = 280, + JSDocVariadicType = 281, + JSDocComment = 282, + JSDocTypeLiteral = 283, + JSDocTag = 284, + JSDocAugmentsTag = 285, + JSDocClassTag = 286, + JSDocParameterTag = 287, + JSDocReturnTag = 288, + JSDocTypeTag = 289, + JSDocTemplateTag = 290, + JSDocTypedefTag = 291, + JSDocPropertyTag = 292, + SyntaxList = 293, + NotEmittedStatement = 294, + PartiallyEmittedExpression = 295, + CommaListExpression = 296, + MergeDeclarationMarker = 297, + EndOfDeclarationMarker = 298, + Count = 299, FirstAssignment = 58, LastAssignment = 70, FirstCompoundAssignment = 59, @@ -365,15 +368,15 @@ declare namespace ts { FirstReservedWord = 72, LastReservedWord = 107, FirstKeyword = 72, - LastKeyword = 143, + LastKeyword = 144, FirstFutureReservedWord = 108, LastFutureReservedWord = 116, - FirstTypeNode = 159, - LastTypeNode = 174, + FirstTypeNode = 160, + LastTypeNode = 177, FirstPunctuation = 17, LastPunctuation = 70, FirstToken = 0, - LastToken = 143, + LastToken = 144, FirstTriviaToken = 2, LastTriviaToken = 7, FirstLiteralToken = 8, @@ -382,11 +385,11 @@ declare namespace ts { LastTemplateToken = 16, FirstBinaryOperator = 27, LastBinaryOperator = 70, - FirstNode = 144, - FirstJSDocNode = 271, - LastJSDocNode = 289, - FirstJSDocTagNode = 281, - LastJSDocTagNode = 289, + FirstNode = 145, + FirstJSDocNode = 274, + LastJSDocNode = 292, + FirstJSDocTagNode = 284, + LastJSDocTagNode = 292, } enum NodeFlags { None = 0, @@ -474,6 +477,8 @@ declare namespace ts { type AtToken = Token; type ReadonlyToken = Token; type AwaitKeywordToken = Token; + type PlusToken = Token; + type MinusToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; interface Identifier extends PrimaryExpression, Declaration { @@ -517,7 +522,7 @@ declare namespace ts { } interface TypeParameterDeclaration extends NamedDeclaration { kind: SyntaxKind.TypeParameter; - parent?: DeclarationWithTypeParameters; + parent?: DeclarationWithTypeParameters | InferTypeNode; name: Identifier; constraint?: TypeNode; default?: TypeNode; @@ -639,7 +644,8 @@ declare namespace ts { body?: Block | Expression; } type FunctionLikeDeclaration = FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | GetAccessorDeclaration | SetAccessorDeclaration | FunctionExpression | ArrowFunction; - type FunctionLike = FunctionLikeDeclaration | FunctionTypeNode | ConstructorTypeNode | IndexSignatureDeclaration | MethodSignature | ConstructSignatureDeclaration | CallSignatureDeclaration | JSDocFunctionType; + /** @deprecated Use SignatureDeclaration */ + type FunctionLike = SignatureDeclaration; interface FunctionDeclaration extends FunctionLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.FunctionDeclaration; name?: Identifier; @@ -647,10 +653,12 @@ declare namespace ts { } interface MethodSignature extends SignatureDeclarationBase, TypeElement { kind: SyntaxKind.MethodSignature; + parent?: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode; name: PropertyName; } interface MethodDeclaration extends FunctionLikeDeclarationBase, ClassElement, ObjectLiteralElement, JSDocContainer { kind: SyntaxKind.MethodDeclaration; + parent?: ClassLikeDeclaration | ObjectLiteralExpression; name: PropertyName; body?: FunctionBody; } @@ -734,6 +742,17 @@ declare namespace ts { kind: SyntaxKind.IntersectionType; types: NodeArray; } + interface ConditionalTypeNode extends TypeNode { + kind: SyntaxKind.ConditionalType; + checkType: TypeNode; + extendsType: TypeNode; + trueType: TypeNode; + falseType: TypeNode; + } + interface InferTypeNode extends TypeNode { + kind: SyntaxKind.InferType; + typeParameter: TypeParameterDeclaration; + } interface ParenthesizedTypeNode extends TypeNode { kind: SyntaxKind.ParenthesizedType; type: TypeNode; @@ -750,9 +769,9 @@ declare namespace ts { } interface MappedTypeNode extends TypeNode, Declaration { kind: SyntaxKind.MappedType; - readonlyToken?: ReadonlyToken; + readonlyToken?: ReadonlyToken | PlusToken | MinusToken; typeParameter: TypeParameterDeclaration; - questionToken?: QuestionToken; + questionToken?: QuestionToken | PlusToken | MinusToken; type?: TypeNode; } interface LiteralTypeNode extends TypeNode { @@ -762,6 +781,7 @@ declare namespace ts { interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; } + type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; interface Expression extends Node { _expressionBrand: any; } @@ -969,7 +989,7 @@ declare namespace ts { interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; } - type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression | ParenthesizedExpression; + type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; interface PropertyAccessExpression extends MemberExpression, NamedDeclaration { kind: SyntaxKind.PropertyAccessExpression; @@ -1252,6 +1272,7 @@ declare namespace ts { } interface ClassDeclaration extends ClassLikeDeclarationBase, DeclarationStatement { kind: SyntaxKind.ClassDeclaration; + /** May be undefined in `export default class { ... }`. */ name?: Identifier; } interface ClassExpression extends ClassLikeDeclarationBase, PrimaryExpression { @@ -1392,6 +1413,10 @@ declare namespace ts { name: Identifier; } type ImportOrExportSpecifier = ImportSpecifier | ExportSpecifier; + /** + * This is either an `export =` or an `export default` declaration. + * Unless `isExportEquals` is set, this node was parsed as an `export default`. + */ interface ExportAssignment extends DeclarationStatement { kind: SyntaxKind.ExportAssignment; parent?: SourceFile; @@ -1726,19 +1751,21 @@ declare namespace ts { /** Note that the resulting nodes cannot be checked. */ typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode; /** Note that the resulting nodes cannot be checked. */ - signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration; + signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration & { + typeArguments?: NodeArray; + } | undefined; /** Note that the resulting nodes cannot be checked. */ - indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration; + indexInfoToIndexSignatureDeclaration(indexInfo: IndexInfo, kind: IndexKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): IndexSignatureDeclaration | undefined; /** Note that the resulting nodes cannot be checked. */ - symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): EntityName; + symbolToEntityName(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): EntityName | undefined; /** Note that the resulting nodes cannot be checked. */ - symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Expression; + symbolToExpression(symbol: Symbol, meaning: SymbolFlags, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): Expression | undefined; /** Note that the resulting nodes cannot be checked. */ symbolToTypeParameterDeclarations(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): NodeArray | undefined; /** Note that the resulting nodes cannot be checked. */ - symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): ParameterDeclaration; + symbolToParameterDeclaration(symbol: Symbol, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): ParameterDeclaration | undefined; /** Note that the resulting nodes cannot be checked. */ - typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeParameterDeclaration; + typeParameterToDeclaration(parameter: TypeParameter, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeParameterDeclaration | undefined; getSymbolsInScope(location: Node, meaning: SymbolFlags): Symbol[]; getSymbolAtLocation(node: Node): Symbol | undefined; getSymbolsOfParameterPropertyDeclaration(parameter: ParameterDeclaration, parameterName: string): Symbol[]; @@ -1775,7 +1802,7 @@ declare namespace ts { */ getResolvedSignature(node: CallLikeExpression, candidatesOutArray?: Signature[], argumentCount?: number): Signature; getSignatureFromDeclaration(declaration: SignatureDeclaration): Signature | undefined; - isImplementationOfOverload(node: FunctionLike): boolean | undefined; + isImplementationOfOverload(node: SignatureDeclaration): boolean | undefined; isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; isUnknownSymbol(symbol: Symbol): boolean; @@ -1785,7 +1812,7 @@ declare namespace ts { getAliasedSymbol(symbol: Symbol): Symbol; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type | undefined; - getJsxIntrinsicTagNames(): Symbol[]; + getJsxIntrinsicTagNamesAt(location: Node): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; @@ -1821,6 +1848,7 @@ declare namespace ts { InObjectTypeLiteral = 4194304, InTypeAlias = 8388608, InInitialEntityName = 16777216, + InReverseMappedType = 33554432, } enum TypeFormatFlags { None = 0, @@ -1933,28 +1961,28 @@ declare namespace ts { JSContainer = 67108864, Enum = 384, Variable = 3, - Value = 107455, - Type = 793064, + Value = 67216319, + Type = 67901928, Namespace = 1920, Module = 1536, Accessor = 98304, - FunctionScopedVariableExcludes = 107454, - BlockScopedVariableExcludes = 107455, - ParameterExcludes = 107455, + FunctionScopedVariableExcludes = 67216318, + BlockScopedVariableExcludes = 67216319, + ParameterExcludes = 67216319, PropertyExcludes = 0, - EnumMemberExcludes = 900095, - FunctionExcludes = 106927, - ClassExcludes = 899519, - InterfaceExcludes = 792968, - RegularEnumExcludes = 899327, - ConstEnumExcludes = 899967, - ValueModuleExcludes = 106639, + EnumMemberExcludes = 68008959, + FunctionExcludes = 67215791, + ClassExcludes = 68008383, + InterfaceExcludes = 67901832, + RegularEnumExcludes = 68008191, + ConstEnumExcludes = 68008831, + ValueModuleExcludes = 67215503, NamespaceModuleExcludes = 0, - MethodExcludes = 99263, - GetAccessorExcludes = 41919, - SetAccessorExcludes = 74687, - TypeParameterExcludes = 530920, - TypeAliasExcludes = 793064, + MethodExcludes = 67208127, + GetAccessorExcludes = 67150783, + SetAccessorExcludes = 67183551, + TypeParameterExcludes = 67639784, + TypeAliasExcludes = 67901928, AliasExcludes = 2097152, ModuleMember = 2623475, ExportHasLocal = 944, @@ -2044,8 +2072,9 @@ declare namespace ts { Intersection = 262144, Index = 524288, IndexedAccess = 1048576, - NonPrimitive = 33554432, - MarkerType = 134217728, + Conditional = 2097152, + Substitution = 4194304, + NonPrimitive = 134217728, Literal = 224, Unit = 13536, StringOrNumberLiteral = 96, @@ -2057,10 +2086,13 @@ declare namespace ts { ESSymbolLike = 1536, UnionOrIntersection = 393216, StructuredType = 458752, - StructuredOrTypeVariable = 2064384, TypeVariable = 1081344, - Narrowable = 35620607, - NotUnionOrUnit = 33620481, + InstantiableNonPrimitive = 7372800, + InstantiablePrimitive = 524288, + Instantiable = 7897088, + StructuredOrInstantiable = 8355840, + Narrowable = 142575359, + NotUnionOrUnit = 134283777, } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { @@ -2099,6 +2131,8 @@ declare namespace ts { ObjectLiteralPatternWithComputedProperties = 512, ContainsSpread = 1024, ReverseMapped = 2048, + JsxAttributes = 4096, + MarkerType = 8192, ClassOrInterface = 3, } interface ObjectType extends Type { @@ -2147,17 +2181,42 @@ declare namespace ts { elementType: Type; finalArrayType?: Type; } - interface TypeVariable extends Type { + interface InstantiableType extends Type { } - interface TypeParameter extends TypeVariable { + interface TypeParameter extends InstantiableType { } - interface IndexedAccessType extends TypeVariable { + interface IndexedAccessType extends InstantiableType { objectType: Type; indexType: Type; constraint?: Type; } - interface IndexType extends Type { - type: TypeVariable | UnionOrIntersectionType; + type TypeVariable = TypeParameter | IndexedAccessType; + interface IndexType extends InstantiableType { + type: InstantiableType | UnionOrIntersectionType; + } + interface ConditionalRoot { + node: ConditionalTypeNode; + checkType: Type; + extendsType: Type; + trueType: Type; + falseType: Type; + isDistributive: boolean; + inferTypeParameters: TypeParameter[]; + outerTypeParameters?: TypeParameter[]; + instantiations?: Map; + aliasSymbol: Symbol; + aliasTypeArguments: Type[]; + } + interface ConditionalType extends InstantiableType { + root: ConditionalRoot; + checkType: Type; + extendsType: Type; + resolvedTrueType?: Type; + resolvedFalseType?: Type; + } + interface SubstitutionType extends InstantiableType { + typeVariable: TypeVariable; + substitute: Type; } enum SignatureKind { Call = 0, @@ -2179,39 +2238,14 @@ declare namespace ts { } enum InferencePriority { NakedTypeVariable = 1, - MappedType = 2, - ReturnType = 4, + HomomorphicMappedType = 2, + MappedTypeConstraint = 4, + ReturnType = 8, + LiteralKeyof = 16, + NoConstraints = 32, + AlwaysStrict = 64, + PriorityImpliesCombination = 28, } - interface InferenceInfo { - typeParameter: TypeParameter; - candidates: Type[]; - contraCandidates: Type[]; - inferredType: Type; - priority: InferencePriority; - topLevel: boolean; - isFixed: boolean; - } - enum InferenceFlags { - None = 0, - InferUnionTypes = 1, - NoDefault = 2, - AnyDefault = 4, - } - /** - * Ternary values are defined such that - * x & y is False if either x or y is False. - * x & y is Maybe if either x or y is Maybe, but neither x or y is False. - * x & y is True if both x and y are True. - * x | y is False if both x and y are False. - * x | y is Maybe if either x or y is Maybe, but neither x or y is True. - * x | y is True if either x or y is True. - */ - enum Ternary { - False = 0, - Maybe = 1, - True = -1, - } - type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; interface JsFileExtensionInfo { extension: string; isMixedContent: boolean; @@ -2247,7 +2281,8 @@ declare namespace ts { enum DiagnosticCategory { Warning = 0, Error = 1, - Message = 2, + Suggestion = 2, + Message = 3, } enum ModuleResolutionKind { Classic = 1, @@ -2338,15 +2373,6 @@ declare namespace ts { exclude?: string[]; [option: string]: string[] | boolean | undefined; } - interface DiscoverTypingsInfo { - fileNames: string[]; - projectRootPath: string; - safeListPath: string; - packageNameToTypingLocation: Map; - typeAcquisition: TypeAcquisition; - compilerOptions: CompilerOptions; - unresolvedImports: ReadonlyArray; - } enum ModuleKind { None = 0, CommonJS = 1, @@ -2726,6 +2752,7 @@ declare namespace ts { newLine?: NewLineKind; omitTrailingSemicolon?: boolean; } + /** @deprecated See comment on SymbolWriter */ interface SymbolTracker { trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; reportInaccessibleThisError?(): void; @@ -2740,6 +2767,9 @@ declare namespace ts { span: TextSpan; newLength: number; } + interface SortedArray extends Array { + " __sortedArrayBrand": any; + } interface SyntaxList extends Node { _children: Node[]; } @@ -2810,12 +2840,13 @@ declare namespace ts { } } declare namespace ts { - const versionMajorMinor = "2.7"; + const versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ const version: string; } declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; + function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): Diagnostic[]; } declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; declare function clearTimeout(handle: any): void; @@ -2827,11 +2858,6 @@ declare namespace ts { } type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind) => void; type DirectoryWatcherCallback = (fileName: string) => void; - interface WatchedFile { - fileName: string; - callback: FileWatcherCallback; - mtime?: Date; - } interface System { args: string[]; newLine: string; @@ -3103,6 +3129,8 @@ declare namespace ts { function isTupleTypeNode(node: Node): node is TupleTypeNode; function isUnionTypeNode(node: Node): node is UnionTypeNode; function isIntersectionTypeNode(node: Node): node is IntersectionTypeNode; + function isConditionalTypeNode(node: Node): node is ConditionalTypeNode; + function isInferTypeNode(node: Node): node is InferTypeNode; function isParenthesizedTypeNode(node: Node): node is ParenthesizedTypeNode; function isThisTypeNode(node: Node): node is ThisTypeNode; function isTypeOperatorNode(node: Node): node is TypeOperatorNode; @@ -3231,6 +3259,7 @@ declare namespace ts { /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n: Node): boolean; function isLiteralExpression(node: Node): node is LiteralExpression; @@ -3240,7 +3269,7 @@ declare namespace ts { function isEntityName(node: Node): node is EntityName; function isPropertyName(node: Node): node is PropertyName; function isBindingName(node: Node): node is BindingName; - function isFunctionLike(node: Node): node is FunctionLike; + function isFunctionLike(node: Node): node is SignatureDeclaration; function isClassElement(node: Node): node is ClassElement; function isClassLike(node: Node): node is ClassLikeDeclaration; function isAccessor(node: Node): node is AccessorDeclaration; @@ -3258,7 +3287,8 @@ declare namespace ts { function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; function isTemplateLiteral(node: Node): node is TemplateLiteral; function isAssertionExpression(node: Node): node is AssertionExpression; - function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement; + function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; + function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; /** True if node is of a kind that may contain comment text. */ @@ -3266,6 +3296,7 @@ declare namespace ts { function isSetAccessor(node: Node): node is SetAccessorDeclaration; function isGetAccessor(node: Node): node is GetAccessorDeclaration; function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; + function isStringLiteralLike(node: Node): node is StringLiteralLike; } declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; @@ -3374,8 +3405,8 @@ declare namespace ts { function updateDecorator(node: Decorator, expression: Expression): Decorator; function createPropertySignature(modifiers: ReadonlyArray | undefined, name: PropertyName | string, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; function updatePropertySignature(node: PropertySignature, modifiers: ReadonlyArray | undefined, name: PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertySignature; - function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; - function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function createProperty(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; + function updateProperty(node: PropertyDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, name: string | PropertyName, questionOrExclamationToken: QuestionToken | ExclamationToken | undefined, type: TypeNode | undefined, initializer: Expression | undefined): PropertyDeclaration; function createMethodSignature(typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function updateMethodSignature(node: MethodSignature, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined, name: PropertyName, questionToken: QuestionToken | undefined): MethodSignature; function createMethod(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, asteriskToken: AsteriskToken | undefined, name: string | PropertyName, questionToken: QuestionToken | undefined, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, body: Block | undefined): MethodDeclaration; @@ -3414,6 +3445,10 @@ declare namespace ts { function createIntersectionTypeNode(types: TypeNode[]): IntersectionTypeNode; function updateIntersectionTypeNode(node: IntersectionTypeNode, types: NodeArray): IntersectionTypeNode; function createUnionOrIntersectionTypeNode(kind: SyntaxKind.UnionType | SyntaxKind.IntersectionType, types: ReadonlyArray): UnionOrIntersectionTypeNode; + function createConditionalTypeNode(checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function updateConditionalTypeNode(node: ConditionalTypeNode, checkType: TypeNode, extendsType: TypeNode, trueType: TypeNode, falseType: TypeNode): ConditionalTypeNode; + function createInferTypeNode(typeParameter: TypeParameterDeclaration): InferTypeNode; + function updateInferTypeNode(node: InferTypeNode, typeParameter: TypeParameterDeclaration): InferTypeNode; function createParenthesizedType(type: TypeNode): ParenthesizedTypeNode; function updateParenthesizedType(node: ParenthesizedTypeNode, type: TypeNode): ParenthesizedTypeNode; function createThisTypeNode(): ThisTypeNode; @@ -3422,8 +3457,8 @@ declare namespace ts { function updateTypeOperatorNode(node: TypeOperatorNode, type: TypeNode): TypeOperatorNode; function createIndexedAccessTypeNode(objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; function updateIndexedAccessTypeNode(node: IndexedAccessTypeNode, objectType: TypeNode, indexType: TypeNode): IndexedAccessTypeNode; - function createMappedTypeNode(readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; - function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function createMappedTypeNode(readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; + function updateMappedTypeNode(node: MappedTypeNode, readonlyToken: ReadonlyToken | PlusToken | MinusToken | undefined, typeParameter: TypeParameterDeclaration, questionToken: QuestionToken | PlusToken | MinusToken | undefined, type: TypeNode | undefined): MappedTypeNode; function createLiteralTypeNode(literal: LiteralTypeNode["literal"]): LiteralTypeNode; function updateLiteralTypeNode(node: LiteralTypeNode, literal: LiteralTypeNode["literal"]): LiteralTypeNode; function createObjectBindingPattern(elements: ReadonlyArray): ObjectBindingPattern; @@ -4288,6 +4323,7 @@ declare namespace ts { cleanupSemanticCache(): void; getSyntacticDiagnostics(fileName: string): Diagnostic[]; getSemanticDiagnostics(fileName: string): Diagnostic[]; + getSuggestionDiagnostics(fileName: string): Diagnostic[]; getCompilerOptionsDiagnostics(): Diagnostic[]; /** * @deprecated Use getEncodedSyntacticClassifications instead. @@ -4343,6 +4379,7 @@ declare namespace ts { applyCodeActionCommand(fileName: string, action: CodeActionCommand | CodeActionCommand[]): Promise; getApplicableRefactors(fileName: string, positionOrRaneg: number | TextRange): ApplicableRefactorInfo[]; getEditsForRefactor(fileName: string, formatOptions: FormatCodeSettings, positionOrRange: number | TextRange, refactorName: string, actionName: string): RefactorEditInfo | undefined; + organizeImports(scope: OrganizeImportsScope, formatOptions: FormatCodeSettings): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program; dispose(): void; @@ -4351,6 +4388,7 @@ declare namespace ts { type: "file"; fileName: string; } + type OrganizeImportsScope = CombinedCodeFixScope; interface GetCompletionsAtPositionOptions { includeExternalModuleExports: boolean; includeInsertTextCompletions: boolean; @@ -4696,6 +4734,7 @@ declare namespace ts { argumentCount: number; } interface CompletionInfo { + /** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */ isGlobalCompletion: boolean; isMemberCompletion: boolean; /** diff --git a/src/lib/typescriptServices.js b/src/lib/typescriptServices.js index b4b5a798..9f2daf60 100644 --- a/src/lib/typescriptServices.js +++ b/src/lib/typescriptServices.js @@ -182,198 +182,201 @@ var ts; SyntaxKind[SyntaxKind["ConstructorKeyword"] = 123] = "ConstructorKeyword"; SyntaxKind[SyntaxKind["DeclareKeyword"] = 124] = "DeclareKeyword"; SyntaxKind[SyntaxKind["GetKeyword"] = 125] = "GetKeyword"; - SyntaxKind[SyntaxKind["IsKeyword"] = 126] = "IsKeyword"; - SyntaxKind[SyntaxKind["KeyOfKeyword"] = 127] = "KeyOfKeyword"; - SyntaxKind[SyntaxKind["ModuleKeyword"] = 128] = "ModuleKeyword"; - SyntaxKind[SyntaxKind["NamespaceKeyword"] = 129] = "NamespaceKeyword"; - SyntaxKind[SyntaxKind["NeverKeyword"] = 130] = "NeverKeyword"; - SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 131] = "ReadonlyKeyword"; - SyntaxKind[SyntaxKind["RequireKeyword"] = 132] = "RequireKeyword"; - SyntaxKind[SyntaxKind["NumberKeyword"] = 133] = "NumberKeyword"; - SyntaxKind[SyntaxKind["ObjectKeyword"] = 134] = "ObjectKeyword"; - SyntaxKind[SyntaxKind["SetKeyword"] = 135] = "SetKeyword"; - SyntaxKind[SyntaxKind["StringKeyword"] = 136] = "StringKeyword"; - SyntaxKind[SyntaxKind["SymbolKeyword"] = 137] = "SymbolKeyword"; - SyntaxKind[SyntaxKind["TypeKeyword"] = 138] = "TypeKeyword"; - SyntaxKind[SyntaxKind["UndefinedKeyword"] = 139] = "UndefinedKeyword"; - SyntaxKind[SyntaxKind["UniqueKeyword"] = 140] = "UniqueKeyword"; - SyntaxKind[SyntaxKind["FromKeyword"] = 141] = "FromKeyword"; - SyntaxKind[SyntaxKind["GlobalKeyword"] = 142] = "GlobalKeyword"; - SyntaxKind[SyntaxKind["OfKeyword"] = 143] = "OfKeyword"; + SyntaxKind[SyntaxKind["InferKeyword"] = 126] = "InferKeyword"; + SyntaxKind[SyntaxKind["IsKeyword"] = 127] = "IsKeyword"; + SyntaxKind[SyntaxKind["KeyOfKeyword"] = 128] = "KeyOfKeyword"; + SyntaxKind[SyntaxKind["ModuleKeyword"] = 129] = "ModuleKeyword"; + SyntaxKind[SyntaxKind["NamespaceKeyword"] = 130] = "NamespaceKeyword"; + SyntaxKind[SyntaxKind["NeverKeyword"] = 131] = "NeverKeyword"; + SyntaxKind[SyntaxKind["ReadonlyKeyword"] = 132] = "ReadonlyKeyword"; + SyntaxKind[SyntaxKind["RequireKeyword"] = 133] = "RequireKeyword"; + SyntaxKind[SyntaxKind["NumberKeyword"] = 134] = "NumberKeyword"; + SyntaxKind[SyntaxKind["ObjectKeyword"] = 135] = "ObjectKeyword"; + SyntaxKind[SyntaxKind["SetKeyword"] = 136] = "SetKeyword"; + SyntaxKind[SyntaxKind["StringKeyword"] = 137] = "StringKeyword"; + SyntaxKind[SyntaxKind["SymbolKeyword"] = 138] = "SymbolKeyword"; + SyntaxKind[SyntaxKind["TypeKeyword"] = 139] = "TypeKeyword"; + SyntaxKind[SyntaxKind["UndefinedKeyword"] = 140] = "UndefinedKeyword"; + SyntaxKind[SyntaxKind["UniqueKeyword"] = 141] = "UniqueKeyword"; + SyntaxKind[SyntaxKind["FromKeyword"] = 142] = "FromKeyword"; + SyntaxKind[SyntaxKind["GlobalKeyword"] = 143] = "GlobalKeyword"; + SyntaxKind[SyntaxKind["OfKeyword"] = 144] = "OfKeyword"; // Parse tree nodes // Names - SyntaxKind[SyntaxKind["QualifiedName"] = 144] = "QualifiedName"; - SyntaxKind[SyntaxKind["ComputedPropertyName"] = 145] = "ComputedPropertyName"; + SyntaxKind[SyntaxKind["QualifiedName"] = 145] = "QualifiedName"; + SyntaxKind[SyntaxKind["ComputedPropertyName"] = 146] = "ComputedPropertyName"; // Signature elements - SyntaxKind[SyntaxKind["TypeParameter"] = 146] = "TypeParameter"; - SyntaxKind[SyntaxKind["Parameter"] = 147] = "Parameter"; - SyntaxKind[SyntaxKind["Decorator"] = 148] = "Decorator"; + SyntaxKind[SyntaxKind["TypeParameter"] = 147] = "TypeParameter"; + SyntaxKind[SyntaxKind["Parameter"] = 148] = "Parameter"; + SyntaxKind[SyntaxKind["Decorator"] = 149] = "Decorator"; // TypeMember - SyntaxKind[SyntaxKind["PropertySignature"] = 149] = "PropertySignature"; - SyntaxKind[SyntaxKind["PropertyDeclaration"] = 150] = "PropertyDeclaration"; - SyntaxKind[SyntaxKind["MethodSignature"] = 151] = "MethodSignature"; - SyntaxKind[SyntaxKind["MethodDeclaration"] = 152] = "MethodDeclaration"; - SyntaxKind[SyntaxKind["Constructor"] = 153] = "Constructor"; - SyntaxKind[SyntaxKind["GetAccessor"] = 154] = "GetAccessor"; - SyntaxKind[SyntaxKind["SetAccessor"] = 155] = "SetAccessor"; - SyntaxKind[SyntaxKind["CallSignature"] = 156] = "CallSignature"; - SyntaxKind[SyntaxKind["ConstructSignature"] = 157] = "ConstructSignature"; - SyntaxKind[SyntaxKind["IndexSignature"] = 158] = "IndexSignature"; + SyntaxKind[SyntaxKind["PropertySignature"] = 150] = "PropertySignature"; + SyntaxKind[SyntaxKind["PropertyDeclaration"] = 151] = "PropertyDeclaration"; + SyntaxKind[SyntaxKind["MethodSignature"] = 152] = "MethodSignature"; + SyntaxKind[SyntaxKind["MethodDeclaration"] = 153] = "MethodDeclaration"; + SyntaxKind[SyntaxKind["Constructor"] = 154] = "Constructor"; + SyntaxKind[SyntaxKind["GetAccessor"] = 155] = "GetAccessor"; + SyntaxKind[SyntaxKind["SetAccessor"] = 156] = "SetAccessor"; + SyntaxKind[SyntaxKind["CallSignature"] = 157] = "CallSignature"; + SyntaxKind[SyntaxKind["ConstructSignature"] = 158] = "ConstructSignature"; + SyntaxKind[SyntaxKind["IndexSignature"] = 159] = "IndexSignature"; // Type - SyntaxKind[SyntaxKind["TypePredicate"] = 159] = "TypePredicate"; - SyntaxKind[SyntaxKind["TypeReference"] = 160] = "TypeReference"; - SyntaxKind[SyntaxKind["FunctionType"] = 161] = "FunctionType"; - SyntaxKind[SyntaxKind["ConstructorType"] = 162] = "ConstructorType"; - SyntaxKind[SyntaxKind["TypeQuery"] = 163] = "TypeQuery"; - SyntaxKind[SyntaxKind["TypeLiteral"] = 164] = "TypeLiteral"; - SyntaxKind[SyntaxKind["ArrayType"] = 165] = "ArrayType"; - SyntaxKind[SyntaxKind["TupleType"] = 166] = "TupleType"; - SyntaxKind[SyntaxKind["UnionType"] = 167] = "UnionType"; - SyntaxKind[SyntaxKind["IntersectionType"] = 168] = "IntersectionType"; - SyntaxKind[SyntaxKind["ParenthesizedType"] = 169] = "ParenthesizedType"; - SyntaxKind[SyntaxKind["ThisType"] = 170] = "ThisType"; - SyntaxKind[SyntaxKind["TypeOperator"] = 171] = "TypeOperator"; - SyntaxKind[SyntaxKind["IndexedAccessType"] = 172] = "IndexedAccessType"; - SyntaxKind[SyntaxKind["MappedType"] = 173] = "MappedType"; - SyntaxKind[SyntaxKind["LiteralType"] = 174] = "LiteralType"; + SyntaxKind[SyntaxKind["TypePredicate"] = 160] = "TypePredicate"; + SyntaxKind[SyntaxKind["TypeReference"] = 161] = "TypeReference"; + SyntaxKind[SyntaxKind["FunctionType"] = 162] = "FunctionType"; + SyntaxKind[SyntaxKind["ConstructorType"] = 163] = "ConstructorType"; + SyntaxKind[SyntaxKind["TypeQuery"] = 164] = "TypeQuery"; + SyntaxKind[SyntaxKind["TypeLiteral"] = 165] = "TypeLiteral"; + SyntaxKind[SyntaxKind["ArrayType"] = 166] = "ArrayType"; + SyntaxKind[SyntaxKind["TupleType"] = 167] = "TupleType"; + SyntaxKind[SyntaxKind["UnionType"] = 168] = "UnionType"; + SyntaxKind[SyntaxKind["IntersectionType"] = 169] = "IntersectionType"; + SyntaxKind[SyntaxKind["ConditionalType"] = 170] = "ConditionalType"; + SyntaxKind[SyntaxKind["InferType"] = 171] = "InferType"; + SyntaxKind[SyntaxKind["ParenthesizedType"] = 172] = "ParenthesizedType"; + SyntaxKind[SyntaxKind["ThisType"] = 173] = "ThisType"; + SyntaxKind[SyntaxKind["TypeOperator"] = 174] = "TypeOperator"; + SyntaxKind[SyntaxKind["IndexedAccessType"] = 175] = "IndexedAccessType"; + SyntaxKind[SyntaxKind["MappedType"] = 176] = "MappedType"; + SyntaxKind[SyntaxKind["LiteralType"] = 177] = "LiteralType"; // Binding patterns - SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 175] = "ObjectBindingPattern"; - SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 176] = "ArrayBindingPattern"; - SyntaxKind[SyntaxKind["BindingElement"] = 177] = "BindingElement"; + SyntaxKind[SyntaxKind["ObjectBindingPattern"] = 178] = "ObjectBindingPattern"; + SyntaxKind[SyntaxKind["ArrayBindingPattern"] = 179] = "ArrayBindingPattern"; + SyntaxKind[SyntaxKind["BindingElement"] = 180] = "BindingElement"; // Expression - SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 178] = "ArrayLiteralExpression"; - SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 179] = "ObjectLiteralExpression"; - SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 180] = "PropertyAccessExpression"; - SyntaxKind[SyntaxKind["ElementAccessExpression"] = 181] = "ElementAccessExpression"; - SyntaxKind[SyntaxKind["CallExpression"] = 182] = "CallExpression"; - SyntaxKind[SyntaxKind["NewExpression"] = 183] = "NewExpression"; - SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 184] = "TaggedTemplateExpression"; - SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 185] = "TypeAssertionExpression"; - SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 186] = "ParenthesizedExpression"; - SyntaxKind[SyntaxKind["FunctionExpression"] = 187] = "FunctionExpression"; - SyntaxKind[SyntaxKind["ArrowFunction"] = 188] = "ArrowFunction"; - SyntaxKind[SyntaxKind["DeleteExpression"] = 189] = "DeleteExpression"; - SyntaxKind[SyntaxKind["TypeOfExpression"] = 190] = "TypeOfExpression"; - SyntaxKind[SyntaxKind["VoidExpression"] = 191] = "VoidExpression"; - SyntaxKind[SyntaxKind["AwaitExpression"] = 192] = "AwaitExpression"; - SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 193] = "PrefixUnaryExpression"; - SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 194] = "PostfixUnaryExpression"; - SyntaxKind[SyntaxKind["BinaryExpression"] = 195] = "BinaryExpression"; - SyntaxKind[SyntaxKind["ConditionalExpression"] = 196] = "ConditionalExpression"; - SyntaxKind[SyntaxKind["TemplateExpression"] = 197] = "TemplateExpression"; - SyntaxKind[SyntaxKind["YieldExpression"] = 198] = "YieldExpression"; - SyntaxKind[SyntaxKind["SpreadElement"] = 199] = "SpreadElement"; - SyntaxKind[SyntaxKind["ClassExpression"] = 200] = "ClassExpression"; - SyntaxKind[SyntaxKind["OmittedExpression"] = 201] = "OmittedExpression"; - SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 202] = "ExpressionWithTypeArguments"; - SyntaxKind[SyntaxKind["AsExpression"] = 203] = "AsExpression"; - SyntaxKind[SyntaxKind["NonNullExpression"] = 204] = "NonNullExpression"; - SyntaxKind[SyntaxKind["MetaProperty"] = 205] = "MetaProperty"; + SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 181] = "ArrayLiteralExpression"; + SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 182] = "ObjectLiteralExpression"; + SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 183] = "PropertyAccessExpression"; + SyntaxKind[SyntaxKind["ElementAccessExpression"] = 184] = "ElementAccessExpression"; + SyntaxKind[SyntaxKind["CallExpression"] = 185] = "CallExpression"; + SyntaxKind[SyntaxKind["NewExpression"] = 186] = "NewExpression"; + SyntaxKind[SyntaxKind["TaggedTemplateExpression"] = 187] = "TaggedTemplateExpression"; + SyntaxKind[SyntaxKind["TypeAssertionExpression"] = 188] = "TypeAssertionExpression"; + SyntaxKind[SyntaxKind["ParenthesizedExpression"] = 189] = "ParenthesizedExpression"; + SyntaxKind[SyntaxKind["FunctionExpression"] = 190] = "FunctionExpression"; + SyntaxKind[SyntaxKind["ArrowFunction"] = 191] = "ArrowFunction"; + SyntaxKind[SyntaxKind["DeleteExpression"] = 192] = "DeleteExpression"; + SyntaxKind[SyntaxKind["TypeOfExpression"] = 193] = "TypeOfExpression"; + SyntaxKind[SyntaxKind["VoidExpression"] = 194] = "VoidExpression"; + SyntaxKind[SyntaxKind["AwaitExpression"] = 195] = "AwaitExpression"; + SyntaxKind[SyntaxKind["PrefixUnaryExpression"] = 196] = "PrefixUnaryExpression"; + SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 197] = "PostfixUnaryExpression"; + SyntaxKind[SyntaxKind["BinaryExpression"] = 198] = "BinaryExpression"; + SyntaxKind[SyntaxKind["ConditionalExpression"] = 199] = "ConditionalExpression"; + SyntaxKind[SyntaxKind["TemplateExpression"] = 200] = "TemplateExpression"; + SyntaxKind[SyntaxKind["YieldExpression"] = 201] = "YieldExpression"; + SyntaxKind[SyntaxKind["SpreadElement"] = 202] = "SpreadElement"; + SyntaxKind[SyntaxKind["ClassExpression"] = 203] = "ClassExpression"; + SyntaxKind[SyntaxKind["OmittedExpression"] = 204] = "OmittedExpression"; + SyntaxKind[SyntaxKind["ExpressionWithTypeArguments"] = 205] = "ExpressionWithTypeArguments"; + SyntaxKind[SyntaxKind["AsExpression"] = 206] = "AsExpression"; + SyntaxKind[SyntaxKind["NonNullExpression"] = 207] = "NonNullExpression"; + SyntaxKind[SyntaxKind["MetaProperty"] = 208] = "MetaProperty"; // Misc - SyntaxKind[SyntaxKind["TemplateSpan"] = 206] = "TemplateSpan"; - SyntaxKind[SyntaxKind["SemicolonClassElement"] = 207] = "SemicolonClassElement"; + SyntaxKind[SyntaxKind["TemplateSpan"] = 209] = "TemplateSpan"; + SyntaxKind[SyntaxKind["SemicolonClassElement"] = 210] = "SemicolonClassElement"; // Element - SyntaxKind[SyntaxKind["Block"] = 208] = "Block"; - SyntaxKind[SyntaxKind["VariableStatement"] = 209] = "VariableStatement"; - SyntaxKind[SyntaxKind["EmptyStatement"] = 210] = "EmptyStatement"; - SyntaxKind[SyntaxKind["ExpressionStatement"] = 211] = "ExpressionStatement"; - SyntaxKind[SyntaxKind["IfStatement"] = 212] = "IfStatement"; - SyntaxKind[SyntaxKind["DoStatement"] = 213] = "DoStatement"; - SyntaxKind[SyntaxKind["WhileStatement"] = 214] = "WhileStatement"; - SyntaxKind[SyntaxKind["ForStatement"] = 215] = "ForStatement"; - SyntaxKind[SyntaxKind["ForInStatement"] = 216] = "ForInStatement"; - SyntaxKind[SyntaxKind["ForOfStatement"] = 217] = "ForOfStatement"; - SyntaxKind[SyntaxKind["ContinueStatement"] = 218] = "ContinueStatement"; - SyntaxKind[SyntaxKind["BreakStatement"] = 219] = "BreakStatement"; - SyntaxKind[SyntaxKind["ReturnStatement"] = 220] = "ReturnStatement"; - SyntaxKind[SyntaxKind["WithStatement"] = 221] = "WithStatement"; - SyntaxKind[SyntaxKind["SwitchStatement"] = 222] = "SwitchStatement"; - SyntaxKind[SyntaxKind["LabeledStatement"] = 223] = "LabeledStatement"; - SyntaxKind[SyntaxKind["ThrowStatement"] = 224] = "ThrowStatement"; - SyntaxKind[SyntaxKind["TryStatement"] = 225] = "TryStatement"; - SyntaxKind[SyntaxKind["DebuggerStatement"] = 226] = "DebuggerStatement"; - SyntaxKind[SyntaxKind["VariableDeclaration"] = 227] = "VariableDeclaration"; - SyntaxKind[SyntaxKind["VariableDeclarationList"] = 228] = "VariableDeclarationList"; - SyntaxKind[SyntaxKind["FunctionDeclaration"] = 229] = "FunctionDeclaration"; - SyntaxKind[SyntaxKind["ClassDeclaration"] = 230] = "ClassDeclaration"; - SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 231] = "InterfaceDeclaration"; - SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 232] = "TypeAliasDeclaration"; - SyntaxKind[SyntaxKind["EnumDeclaration"] = 233] = "EnumDeclaration"; - SyntaxKind[SyntaxKind["ModuleDeclaration"] = 234] = "ModuleDeclaration"; - SyntaxKind[SyntaxKind["ModuleBlock"] = 235] = "ModuleBlock"; - SyntaxKind[SyntaxKind["CaseBlock"] = 236] = "CaseBlock"; - SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 237] = "NamespaceExportDeclaration"; - SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 238] = "ImportEqualsDeclaration"; - SyntaxKind[SyntaxKind["ImportDeclaration"] = 239] = "ImportDeclaration"; - SyntaxKind[SyntaxKind["ImportClause"] = 240] = "ImportClause"; - SyntaxKind[SyntaxKind["NamespaceImport"] = 241] = "NamespaceImport"; - SyntaxKind[SyntaxKind["NamedImports"] = 242] = "NamedImports"; - SyntaxKind[SyntaxKind["ImportSpecifier"] = 243] = "ImportSpecifier"; - SyntaxKind[SyntaxKind["ExportAssignment"] = 244] = "ExportAssignment"; - SyntaxKind[SyntaxKind["ExportDeclaration"] = 245] = "ExportDeclaration"; - SyntaxKind[SyntaxKind["NamedExports"] = 246] = "NamedExports"; - SyntaxKind[SyntaxKind["ExportSpecifier"] = 247] = "ExportSpecifier"; - SyntaxKind[SyntaxKind["MissingDeclaration"] = 248] = "MissingDeclaration"; + SyntaxKind[SyntaxKind["Block"] = 211] = "Block"; + SyntaxKind[SyntaxKind["VariableStatement"] = 212] = "VariableStatement"; + SyntaxKind[SyntaxKind["EmptyStatement"] = 213] = "EmptyStatement"; + SyntaxKind[SyntaxKind["ExpressionStatement"] = 214] = "ExpressionStatement"; + SyntaxKind[SyntaxKind["IfStatement"] = 215] = "IfStatement"; + SyntaxKind[SyntaxKind["DoStatement"] = 216] = "DoStatement"; + SyntaxKind[SyntaxKind["WhileStatement"] = 217] = "WhileStatement"; + SyntaxKind[SyntaxKind["ForStatement"] = 218] = "ForStatement"; + SyntaxKind[SyntaxKind["ForInStatement"] = 219] = "ForInStatement"; + SyntaxKind[SyntaxKind["ForOfStatement"] = 220] = "ForOfStatement"; + SyntaxKind[SyntaxKind["ContinueStatement"] = 221] = "ContinueStatement"; + SyntaxKind[SyntaxKind["BreakStatement"] = 222] = "BreakStatement"; + SyntaxKind[SyntaxKind["ReturnStatement"] = 223] = "ReturnStatement"; + SyntaxKind[SyntaxKind["WithStatement"] = 224] = "WithStatement"; + SyntaxKind[SyntaxKind["SwitchStatement"] = 225] = "SwitchStatement"; + SyntaxKind[SyntaxKind["LabeledStatement"] = 226] = "LabeledStatement"; + SyntaxKind[SyntaxKind["ThrowStatement"] = 227] = "ThrowStatement"; + SyntaxKind[SyntaxKind["TryStatement"] = 228] = "TryStatement"; + SyntaxKind[SyntaxKind["DebuggerStatement"] = 229] = "DebuggerStatement"; + SyntaxKind[SyntaxKind["VariableDeclaration"] = 230] = "VariableDeclaration"; + SyntaxKind[SyntaxKind["VariableDeclarationList"] = 231] = "VariableDeclarationList"; + SyntaxKind[SyntaxKind["FunctionDeclaration"] = 232] = "FunctionDeclaration"; + SyntaxKind[SyntaxKind["ClassDeclaration"] = 233] = "ClassDeclaration"; + SyntaxKind[SyntaxKind["InterfaceDeclaration"] = 234] = "InterfaceDeclaration"; + SyntaxKind[SyntaxKind["TypeAliasDeclaration"] = 235] = "TypeAliasDeclaration"; + SyntaxKind[SyntaxKind["EnumDeclaration"] = 236] = "EnumDeclaration"; + SyntaxKind[SyntaxKind["ModuleDeclaration"] = 237] = "ModuleDeclaration"; + SyntaxKind[SyntaxKind["ModuleBlock"] = 238] = "ModuleBlock"; + SyntaxKind[SyntaxKind["CaseBlock"] = 239] = "CaseBlock"; + SyntaxKind[SyntaxKind["NamespaceExportDeclaration"] = 240] = "NamespaceExportDeclaration"; + SyntaxKind[SyntaxKind["ImportEqualsDeclaration"] = 241] = "ImportEqualsDeclaration"; + SyntaxKind[SyntaxKind["ImportDeclaration"] = 242] = "ImportDeclaration"; + SyntaxKind[SyntaxKind["ImportClause"] = 243] = "ImportClause"; + SyntaxKind[SyntaxKind["NamespaceImport"] = 244] = "NamespaceImport"; + SyntaxKind[SyntaxKind["NamedImports"] = 245] = "NamedImports"; + SyntaxKind[SyntaxKind["ImportSpecifier"] = 246] = "ImportSpecifier"; + SyntaxKind[SyntaxKind["ExportAssignment"] = 247] = "ExportAssignment"; + SyntaxKind[SyntaxKind["ExportDeclaration"] = 248] = "ExportDeclaration"; + SyntaxKind[SyntaxKind["NamedExports"] = 249] = "NamedExports"; + SyntaxKind[SyntaxKind["ExportSpecifier"] = 250] = "ExportSpecifier"; + SyntaxKind[SyntaxKind["MissingDeclaration"] = 251] = "MissingDeclaration"; // Module references - SyntaxKind[SyntaxKind["ExternalModuleReference"] = 249] = "ExternalModuleReference"; + SyntaxKind[SyntaxKind["ExternalModuleReference"] = 252] = "ExternalModuleReference"; // JSX - SyntaxKind[SyntaxKind["JsxElement"] = 250] = "JsxElement"; - SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 251] = "JsxSelfClosingElement"; - SyntaxKind[SyntaxKind["JsxOpeningElement"] = 252] = "JsxOpeningElement"; - SyntaxKind[SyntaxKind["JsxClosingElement"] = 253] = "JsxClosingElement"; - SyntaxKind[SyntaxKind["JsxFragment"] = 254] = "JsxFragment"; - SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 255] = "JsxOpeningFragment"; - SyntaxKind[SyntaxKind["JsxClosingFragment"] = 256] = "JsxClosingFragment"; - SyntaxKind[SyntaxKind["JsxAttribute"] = 257] = "JsxAttribute"; - SyntaxKind[SyntaxKind["JsxAttributes"] = 258] = "JsxAttributes"; - SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 259] = "JsxSpreadAttribute"; - SyntaxKind[SyntaxKind["JsxExpression"] = 260] = "JsxExpression"; + SyntaxKind[SyntaxKind["JsxElement"] = 253] = "JsxElement"; + SyntaxKind[SyntaxKind["JsxSelfClosingElement"] = 254] = "JsxSelfClosingElement"; + SyntaxKind[SyntaxKind["JsxOpeningElement"] = 255] = "JsxOpeningElement"; + SyntaxKind[SyntaxKind["JsxClosingElement"] = 256] = "JsxClosingElement"; + SyntaxKind[SyntaxKind["JsxFragment"] = 257] = "JsxFragment"; + SyntaxKind[SyntaxKind["JsxOpeningFragment"] = 258] = "JsxOpeningFragment"; + SyntaxKind[SyntaxKind["JsxClosingFragment"] = 259] = "JsxClosingFragment"; + SyntaxKind[SyntaxKind["JsxAttribute"] = 260] = "JsxAttribute"; + SyntaxKind[SyntaxKind["JsxAttributes"] = 261] = "JsxAttributes"; + SyntaxKind[SyntaxKind["JsxSpreadAttribute"] = 262] = "JsxSpreadAttribute"; + SyntaxKind[SyntaxKind["JsxExpression"] = 263] = "JsxExpression"; // Clauses - SyntaxKind[SyntaxKind["CaseClause"] = 261] = "CaseClause"; - SyntaxKind[SyntaxKind["DefaultClause"] = 262] = "DefaultClause"; - SyntaxKind[SyntaxKind["HeritageClause"] = 263] = "HeritageClause"; - SyntaxKind[SyntaxKind["CatchClause"] = 264] = "CatchClause"; + SyntaxKind[SyntaxKind["CaseClause"] = 264] = "CaseClause"; + SyntaxKind[SyntaxKind["DefaultClause"] = 265] = "DefaultClause"; + SyntaxKind[SyntaxKind["HeritageClause"] = 266] = "HeritageClause"; + SyntaxKind[SyntaxKind["CatchClause"] = 267] = "CatchClause"; // Property assignments - SyntaxKind[SyntaxKind["PropertyAssignment"] = 265] = "PropertyAssignment"; - SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 266] = "ShorthandPropertyAssignment"; - SyntaxKind[SyntaxKind["SpreadAssignment"] = 267] = "SpreadAssignment"; + SyntaxKind[SyntaxKind["PropertyAssignment"] = 268] = "PropertyAssignment"; + SyntaxKind[SyntaxKind["ShorthandPropertyAssignment"] = 269] = "ShorthandPropertyAssignment"; + SyntaxKind[SyntaxKind["SpreadAssignment"] = 270] = "SpreadAssignment"; // Enum - SyntaxKind[SyntaxKind["EnumMember"] = 268] = "EnumMember"; + SyntaxKind[SyntaxKind["EnumMember"] = 271] = "EnumMember"; // Top-level nodes - SyntaxKind[SyntaxKind["SourceFile"] = 269] = "SourceFile"; - SyntaxKind[SyntaxKind["Bundle"] = 270] = "Bundle"; + SyntaxKind[SyntaxKind["SourceFile"] = 272] = "SourceFile"; + SyntaxKind[SyntaxKind["Bundle"] = 273] = "Bundle"; // JSDoc nodes - SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 271] = "JSDocTypeExpression"; + SyntaxKind[SyntaxKind["JSDocTypeExpression"] = 274] = "JSDocTypeExpression"; // The * type - SyntaxKind[SyntaxKind["JSDocAllType"] = 272] = "JSDocAllType"; + SyntaxKind[SyntaxKind["JSDocAllType"] = 275] = "JSDocAllType"; // The ? type - SyntaxKind[SyntaxKind["JSDocUnknownType"] = 273] = "JSDocUnknownType"; - SyntaxKind[SyntaxKind["JSDocNullableType"] = 274] = "JSDocNullableType"; - SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 275] = "JSDocNonNullableType"; - SyntaxKind[SyntaxKind["JSDocOptionalType"] = 276] = "JSDocOptionalType"; - SyntaxKind[SyntaxKind["JSDocFunctionType"] = 277] = "JSDocFunctionType"; - SyntaxKind[SyntaxKind["JSDocVariadicType"] = 278] = "JSDocVariadicType"; - SyntaxKind[SyntaxKind["JSDocComment"] = 279] = "JSDocComment"; - SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 280] = "JSDocTypeLiteral"; - SyntaxKind[SyntaxKind["JSDocTag"] = 281] = "JSDocTag"; - SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 282] = "JSDocAugmentsTag"; - SyntaxKind[SyntaxKind["JSDocClassTag"] = 283] = "JSDocClassTag"; - SyntaxKind[SyntaxKind["JSDocParameterTag"] = 284] = "JSDocParameterTag"; - SyntaxKind[SyntaxKind["JSDocReturnTag"] = 285] = "JSDocReturnTag"; - SyntaxKind[SyntaxKind["JSDocTypeTag"] = 286] = "JSDocTypeTag"; - SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 287] = "JSDocTemplateTag"; - SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 288] = "JSDocTypedefTag"; - SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 289] = "JSDocPropertyTag"; + SyntaxKind[SyntaxKind["JSDocUnknownType"] = 276] = "JSDocUnknownType"; + SyntaxKind[SyntaxKind["JSDocNullableType"] = 277] = "JSDocNullableType"; + SyntaxKind[SyntaxKind["JSDocNonNullableType"] = 278] = "JSDocNonNullableType"; + SyntaxKind[SyntaxKind["JSDocOptionalType"] = 279] = "JSDocOptionalType"; + SyntaxKind[SyntaxKind["JSDocFunctionType"] = 280] = "JSDocFunctionType"; + SyntaxKind[SyntaxKind["JSDocVariadicType"] = 281] = "JSDocVariadicType"; + SyntaxKind[SyntaxKind["JSDocComment"] = 282] = "JSDocComment"; + SyntaxKind[SyntaxKind["JSDocTypeLiteral"] = 283] = "JSDocTypeLiteral"; + SyntaxKind[SyntaxKind["JSDocTag"] = 284] = "JSDocTag"; + SyntaxKind[SyntaxKind["JSDocAugmentsTag"] = 285] = "JSDocAugmentsTag"; + SyntaxKind[SyntaxKind["JSDocClassTag"] = 286] = "JSDocClassTag"; + SyntaxKind[SyntaxKind["JSDocParameterTag"] = 287] = "JSDocParameterTag"; + SyntaxKind[SyntaxKind["JSDocReturnTag"] = 288] = "JSDocReturnTag"; + SyntaxKind[SyntaxKind["JSDocTypeTag"] = 289] = "JSDocTypeTag"; + SyntaxKind[SyntaxKind["JSDocTemplateTag"] = 290] = "JSDocTemplateTag"; + SyntaxKind[SyntaxKind["JSDocTypedefTag"] = 291] = "JSDocTypedefTag"; + SyntaxKind[SyntaxKind["JSDocPropertyTag"] = 292] = "JSDocPropertyTag"; // Synthesized list - SyntaxKind[SyntaxKind["SyntaxList"] = 290] = "SyntaxList"; + SyntaxKind[SyntaxKind["SyntaxList"] = 293] = "SyntaxList"; // Transformation nodes - SyntaxKind[SyntaxKind["NotEmittedStatement"] = 291] = "NotEmittedStatement"; - SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 292] = "PartiallyEmittedExpression"; - SyntaxKind[SyntaxKind["CommaListExpression"] = 293] = "CommaListExpression"; - SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 294] = "MergeDeclarationMarker"; - SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 295] = "EndOfDeclarationMarker"; + SyntaxKind[SyntaxKind["NotEmittedStatement"] = 294] = "NotEmittedStatement"; + SyntaxKind[SyntaxKind["PartiallyEmittedExpression"] = 295] = "PartiallyEmittedExpression"; + SyntaxKind[SyntaxKind["CommaListExpression"] = 296] = "CommaListExpression"; + SyntaxKind[SyntaxKind["MergeDeclarationMarker"] = 297] = "MergeDeclarationMarker"; + SyntaxKind[SyntaxKind["EndOfDeclarationMarker"] = 298] = "EndOfDeclarationMarker"; // Enum value count - SyntaxKind[SyntaxKind["Count"] = 296] = "Count"; + SyntaxKind[SyntaxKind["Count"] = 299] = "Count"; // Markers SyntaxKind[SyntaxKind["FirstAssignment"] = 58] = "FirstAssignment"; SyntaxKind[SyntaxKind["LastAssignment"] = 70] = "LastAssignment"; @@ -382,15 +385,15 @@ var ts; SyntaxKind[SyntaxKind["FirstReservedWord"] = 72] = "FirstReservedWord"; SyntaxKind[SyntaxKind["LastReservedWord"] = 107] = "LastReservedWord"; SyntaxKind[SyntaxKind["FirstKeyword"] = 72] = "FirstKeyword"; - SyntaxKind[SyntaxKind["LastKeyword"] = 143] = "LastKeyword"; + SyntaxKind[SyntaxKind["LastKeyword"] = 144] = "LastKeyword"; SyntaxKind[SyntaxKind["FirstFutureReservedWord"] = 108] = "FirstFutureReservedWord"; SyntaxKind[SyntaxKind["LastFutureReservedWord"] = 116] = "LastFutureReservedWord"; - SyntaxKind[SyntaxKind["FirstTypeNode"] = 159] = "FirstTypeNode"; - SyntaxKind[SyntaxKind["LastTypeNode"] = 174] = "LastTypeNode"; + SyntaxKind[SyntaxKind["FirstTypeNode"] = 160] = "FirstTypeNode"; + SyntaxKind[SyntaxKind["LastTypeNode"] = 177] = "LastTypeNode"; SyntaxKind[SyntaxKind["FirstPunctuation"] = 17] = "FirstPunctuation"; SyntaxKind[SyntaxKind["LastPunctuation"] = 70] = "LastPunctuation"; SyntaxKind[SyntaxKind["FirstToken"] = 0] = "FirstToken"; - SyntaxKind[SyntaxKind["LastToken"] = 143] = "LastToken"; + SyntaxKind[SyntaxKind["LastToken"] = 144] = "LastToken"; SyntaxKind[SyntaxKind["FirstTriviaToken"] = 2] = "FirstTriviaToken"; SyntaxKind[SyntaxKind["LastTriviaToken"] = 7] = "LastTriviaToken"; SyntaxKind[SyntaxKind["FirstLiteralToken"] = 8] = "FirstLiteralToken"; @@ -399,13 +402,13 @@ var ts; SyntaxKind[SyntaxKind["LastTemplateToken"] = 16] = "LastTemplateToken"; SyntaxKind[SyntaxKind["FirstBinaryOperator"] = 27] = "FirstBinaryOperator"; SyntaxKind[SyntaxKind["LastBinaryOperator"] = 70] = "LastBinaryOperator"; - SyntaxKind[SyntaxKind["FirstNode"] = 144] = "FirstNode"; - SyntaxKind[SyntaxKind["FirstJSDocNode"] = 271] = "FirstJSDocNode"; - SyntaxKind[SyntaxKind["LastJSDocNode"] = 289] = "LastJSDocNode"; - SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 281] = "FirstJSDocTagNode"; - SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 289] = "LastJSDocTagNode"; + SyntaxKind[SyntaxKind["FirstNode"] = 145] = "FirstNode"; + SyntaxKind[SyntaxKind["FirstJSDocNode"] = 274] = "FirstJSDocNode"; + SyntaxKind[SyntaxKind["LastJSDocNode"] = 292] = "LastJSDocNode"; + SyntaxKind[SyntaxKind["FirstJSDocTagNode"] = 284] = "FirstJSDocTagNode"; + SyntaxKind[SyntaxKind["LastJSDocTagNode"] = 292] = "LastJSDocTagNode"; /* @internal */ SyntaxKind[SyntaxKind["FirstContextualKeyword"] = 117] = "FirstContextualKeyword"; - /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 143] = "LastContextualKeyword"; + /* @internal */ SyntaxKind[SyntaxKind["LastContextualKeyword"] = 144] = "LastContextualKeyword"; })(SyntaxKind = ts.SyntaxKind || (ts.SyntaxKind = {})); var NodeFlags; (function (NodeFlags) { @@ -601,6 +604,7 @@ var ts; NodeBuilderFlags[NodeBuilderFlags["InObjectTypeLiteral"] = 4194304] = "InObjectTypeLiteral"; NodeBuilderFlags[NodeBuilderFlags["InTypeAlias"] = 8388608] = "InTypeAlias"; NodeBuilderFlags[NodeBuilderFlags["InInitialEntityName"] = 16777216] = "InInitialEntityName"; + NodeBuilderFlags[NodeBuilderFlags["InReverseMappedType"] = 33554432] = "InReverseMappedType"; })(NodeBuilderFlags = ts.NodeBuilderFlags || (ts.NodeBuilderFlags = {})); // Ensure the shared flags between this and `NodeBuilderFlags` stay in alignment var TypeFormatFlags; @@ -725,32 +729,32 @@ var ts; SymbolFlags[SymbolFlags["All"] = 67108863] = "All"; SymbolFlags[SymbolFlags["Enum"] = 384] = "Enum"; SymbolFlags[SymbolFlags["Variable"] = 3] = "Variable"; - SymbolFlags[SymbolFlags["Value"] = 107455] = "Value"; - SymbolFlags[SymbolFlags["Type"] = 793064] = "Type"; + SymbolFlags[SymbolFlags["Value"] = 67216319] = "Value"; + SymbolFlags[SymbolFlags["Type"] = 67901928] = "Type"; SymbolFlags[SymbolFlags["Namespace"] = 1920] = "Namespace"; SymbolFlags[SymbolFlags["Module"] = 1536] = "Module"; SymbolFlags[SymbolFlags["Accessor"] = 98304] = "Accessor"; // Variables can be redeclared, but can not redeclare a block-scoped declaration with the // same name, or any other value that is not a variable, e.g. ValueModule or Class - SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 107454] = "FunctionScopedVariableExcludes"; + SymbolFlags[SymbolFlags["FunctionScopedVariableExcludes"] = 67216318] = "FunctionScopedVariableExcludes"; // Block-scoped declarations are not allowed to be re-declared // they can not merge with anything in the value space - SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 107455] = "BlockScopedVariableExcludes"; - SymbolFlags[SymbolFlags["ParameterExcludes"] = 107455] = "ParameterExcludes"; + SymbolFlags[SymbolFlags["BlockScopedVariableExcludes"] = 67216319] = "BlockScopedVariableExcludes"; + SymbolFlags[SymbolFlags["ParameterExcludes"] = 67216319] = "ParameterExcludes"; SymbolFlags[SymbolFlags["PropertyExcludes"] = 0] = "PropertyExcludes"; - SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 900095] = "EnumMemberExcludes"; - SymbolFlags[SymbolFlags["FunctionExcludes"] = 106927] = "FunctionExcludes"; - SymbolFlags[SymbolFlags["ClassExcludes"] = 899519] = "ClassExcludes"; - SymbolFlags[SymbolFlags["InterfaceExcludes"] = 792968] = "InterfaceExcludes"; - SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 899327] = "RegularEnumExcludes"; - SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 899967] = "ConstEnumExcludes"; - SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 106639] = "ValueModuleExcludes"; + SymbolFlags[SymbolFlags["EnumMemberExcludes"] = 68008959] = "EnumMemberExcludes"; + SymbolFlags[SymbolFlags["FunctionExcludes"] = 67215791] = "FunctionExcludes"; + SymbolFlags[SymbolFlags["ClassExcludes"] = 68008383] = "ClassExcludes"; + SymbolFlags[SymbolFlags["InterfaceExcludes"] = 67901832] = "InterfaceExcludes"; + SymbolFlags[SymbolFlags["RegularEnumExcludes"] = 68008191] = "RegularEnumExcludes"; + SymbolFlags[SymbolFlags["ConstEnumExcludes"] = 68008831] = "ConstEnumExcludes"; + SymbolFlags[SymbolFlags["ValueModuleExcludes"] = 67215503] = "ValueModuleExcludes"; SymbolFlags[SymbolFlags["NamespaceModuleExcludes"] = 0] = "NamespaceModuleExcludes"; - SymbolFlags[SymbolFlags["MethodExcludes"] = 99263] = "MethodExcludes"; - SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 41919] = "GetAccessorExcludes"; - SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 74687] = "SetAccessorExcludes"; - SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 530920] = "TypeParameterExcludes"; - SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 793064] = "TypeAliasExcludes"; + SymbolFlags[SymbolFlags["MethodExcludes"] = 67208127] = "MethodExcludes"; + SymbolFlags[SymbolFlags["GetAccessorExcludes"] = 67150783] = "GetAccessorExcludes"; + SymbolFlags[SymbolFlags["SetAccessorExcludes"] = 67183551] = "SetAccessorExcludes"; + SymbolFlags[SymbolFlags["TypeParameterExcludes"] = 67639784] = "TypeParameterExcludes"; + SymbolFlags[SymbolFlags["TypeAliasExcludes"] = 67901928] = "TypeAliasExcludes"; SymbolFlags[SymbolFlags["AliasExcludes"] = 2097152] = "AliasExcludes"; SymbolFlags[SymbolFlags["ModuleMember"] = 2623475] = "ModuleMember"; SymbolFlags[SymbolFlags["ExportHasLocal"] = 944] = "ExportHasLocal"; @@ -856,18 +860,19 @@ var ts; TypeFlags[TypeFlags["Intersection"] = 262144] = "Intersection"; TypeFlags[TypeFlags["Index"] = 524288] = "Index"; TypeFlags[TypeFlags["IndexedAccess"] = 1048576] = "IndexedAccess"; + TypeFlags[TypeFlags["Conditional"] = 2097152] = "Conditional"; + TypeFlags[TypeFlags["Substitution"] = 4194304] = "Substitution"; /* @internal */ - TypeFlags[TypeFlags["FreshLiteral"] = 2097152] = "FreshLiteral"; + TypeFlags[TypeFlags["FreshLiteral"] = 8388608] = "FreshLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsWideningType"] = 4194304] = "ContainsWideningType"; + TypeFlags[TypeFlags["ContainsWideningType"] = 16777216] = "ContainsWideningType"; /* @internal */ - TypeFlags[TypeFlags["ContainsObjectLiteral"] = 8388608] = "ContainsObjectLiteral"; + TypeFlags[TypeFlags["ContainsObjectLiteral"] = 33554432] = "ContainsObjectLiteral"; /* @internal */ - TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 16777216] = "ContainsAnyFunctionType"; - TypeFlags[TypeFlags["NonPrimitive"] = 33554432] = "NonPrimitive"; + TypeFlags[TypeFlags["ContainsAnyFunctionType"] = 67108864] = "ContainsAnyFunctionType"; + TypeFlags[TypeFlags["NonPrimitive"] = 134217728] = "NonPrimitive"; /* @internal */ - TypeFlags[TypeFlags["JsxAttributes"] = 67108864] = "JsxAttributes"; - TypeFlags[TypeFlags["MarkerType"] = 134217728] = "MarkerType"; + TypeFlags[TypeFlags["GenericMappedType"] = 536870912] = "GenericMappedType"; /* @internal */ TypeFlags[TypeFlags["Nullable"] = 12288] = "Nullable"; TypeFlags[TypeFlags["Literal"] = 224] = "Literal"; @@ -879,7 +884,7 @@ var ts; TypeFlags[TypeFlags["DefinitelyFalsy"] = 14560] = "DefinitelyFalsy"; TypeFlags[TypeFlags["PossiblyFalsy"] = 14574] = "PossiblyFalsy"; /* @internal */ - TypeFlags[TypeFlags["Intrinsic"] = 33585807] = "Intrinsic"; + TypeFlags[TypeFlags["Intrinsic"] = 134249103] = "Intrinsic"; /* @internal */ TypeFlags[TypeFlags["Primitive"] = 16382] = "Primitive"; TypeFlags[TypeFlags["StringLike"] = 524322] = "StringLike"; @@ -889,16 +894,20 @@ var ts; TypeFlags[TypeFlags["ESSymbolLike"] = 1536] = "ESSymbolLike"; TypeFlags[TypeFlags["UnionOrIntersection"] = 393216] = "UnionOrIntersection"; TypeFlags[TypeFlags["StructuredType"] = 458752] = "StructuredType"; - TypeFlags[TypeFlags["StructuredOrTypeVariable"] = 2064384] = "StructuredOrTypeVariable"; TypeFlags[TypeFlags["TypeVariable"] = 1081344] = "TypeVariable"; + TypeFlags[TypeFlags["InstantiableNonPrimitive"] = 7372800] = "InstantiableNonPrimitive"; + TypeFlags[TypeFlags["InstantiablePrimitive"] = 524288] = "InstantiablePrimitive"; + TypeFlags[TypeFlags["Instantiable"] = 7897088] = "Instantiable"; + TypeFlags[TypeFlags["StructuredOrInstantiable"] = 8355840] = "StructuredOrInstantiable"; // 'Narrowable' types are types where narrowing actually narrows. // This *should* be every type other than null, undefined, void, and never - TypeFlags[TypeFlags["Narrowable"] = 35620607] = "Narrowable"; - TypeFlags[TypeFlags["NotUnionOrUnit"] = 33620481] = "NotUnionOrUnit"; + TypeFlags[TypeFlags["Narrowable"] = 142575359] = "Narrowable"; + TypeFlags[TypeFlags["NotUnionOrUnit"] = 134283777] = "NotUnionOrUnit"; /* @internal */ - TypeFlags[TypeFlags["RequiresWidening"] = 12582912] = "RequiresWidening"; + TypeFlags[TypeFlags["RequiresWidening"] = 50331648] = "RequiresWidening"; + /* @internal */ + TypeFlags[TypeFlags["PropagatingFlags"] = 117440512] = "PropagatingFlags"; /* @internal */ - TypeFlags[TypeFlags["PropagatingFlags"] = 29360128] = "PropagatingFlags"; })(TypeFlags = ts.TypeFlags || (ts.TypeFlags = {})); var ObjectFlags; (function (ObjectFlags) { @@ -914,6 +923,8 @@ var ts; ObjectFlags[ObjectFlags["ObjectLiteralPatternWithComputedProperties"] = 512] = "ObjectLiteralPatternWithComputedProperties"; ObjectFlags[ObjectFlags["ContainsSpread"] = 1024] = "ContainsSpread"; ObjectFlags[ObjectFlags["ReverseMapped"] = 2048] = "ReverseMapped"; + ObjectFlags[ObjectFlags["JsxAttributes"] = 4096] = "JsxAttributes"; + ObjectFlags[ObjectFlags["MarkerType"] = 8192] = "MarkerType"; ObjectFlags[ObjectFlags["ClassOrInterface"] = 3] = "ClassOrInterface"; })(ObjectFlags = ts.ObjectFlags || (ts.ObjectFlags = {})); /* @internal */ @@ -938,9 +949,15 @@ var ts; var InferencePriority; (function (InferencePriority) { InferencePriority[InferencePriority["NakedTypeVariable"] = 1] = "NakedTypeVariable"; - InferencePriority[InferencePriority["MappedType"] = 2] = "MappedType"; - InferencePriority[InferencePriority["ReturnType"] = 4] = "ReturnType"; + InferencePriority[InferencePriority["HomomorphicMappedType"] = 2] = "HomomorphicMappedType"; + InferencePriority[InferencePriority["MappedTypeConstraint"] = 4] = "MappedTypeConstraint"; + InferencePriority[InferencePriority["ReturnType"] = 8] = "ReturnType"; + InferencePriority[InferencePriority["LiteralKeyof"] = 16] = "LiteralKeyof"; + InferencePriority[InferencePriority["NoConstraints"] = 32] = "NoConstraints"; + InferencePriority[InferencePriority["AlwaysStrict"] = 64] = "AlwaysStrict"; + InferencePriority[InferencePriority["PriorityImpliesCombination"] = 28] = "PriorityImpliesCombination"; })(InferencePriority = ts.InferencePriority || (ts.InferencePriority = {})); + /* @internal */ var InferenceFlags; (function (InferenceFlags) { InferenceFlags[InferenceFlags["None"] = 0] = "None"; @@ -957,6 +974,7 @@ var ts; * x | y is Maybe if either x or y is Maybe, but neither x or y is True. * x | y is True if either x or y is True. */ + /* @internal */ var Ternary; (function (Ternary) { Ternary[Ternary["False"] = 0] = "False"; @@ -977,13 +995,23 @@ var ts; SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["ThisProperty"] = 4] = "ThisProperty"; // F.name = expr SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Property"] = 5] = "Property"; + // F.prototype = { ... } + SpecialPropertyAssignmentKind[SpecialPropertyAssignmentKind["Prototype"] = 6] = "Prototype"; })(SpecialPropertyAssignmentKind = ts.SpecialPropertyAssignmentKind || (ts.SpecialPropertyAssignmentKind = {})); var DiagnosticCategory; (function (DiagnosticCategory) { DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning"; DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error"; - DiagnosticCategory[DiagnosticCategory["Message"] = 2] = "Message"; + DiagnosticCategory[DiagnosticCategory["Suggestion"] = 2] = "Suggestion"; + DiagnosticCategory[DiagnosticCategory["Message"] = 3] = "Message"; })(DiagnosticCategory = ts.DiagnosticCategory || (ts.DiagnosticCategory = {})); + /* @internal */ + function diagnosticCategoryName(d, lowerCase) { + if (lowerCase === void 0) { lowerCase = true; } + var name = DiagnosticCategory[d.category]; + return lowerCase ? name.toLowerCase() : name; + } + ts.diagnosticCategoryName = diagnosticCategoryName; var ModuleResolutionKind; (function (ModuleResolutionKind) { ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic"; @@ -1413,6 +1441,68 @@ var ts; ListFormat[ListFormat["Parameters"] = 1296] = "Parameters"; ListFormat[ListFormat["IndexSignatureParameters"] = 4432] = "IndexSignatureParameters"; })(ListFormat = ts.ListFormat || (ts.ListFormat = {})); + /* @internal */ + var PragmaKindFlags; + (function (PragmaKindFlags) { + PragmaKindFlags[PragmaKindFlags["None"] = 0] = "None"; + /** + * Triple slash comment of the form + * /// + */ + PragmaKindFlags[PragmaKindFlags["TripleSlashXML"] = 1] = "TripleSlashXML"; + /** + * Single line comment of the form + * // @pragma-name argval1 argval2 + * or + * /// @pragma-name argval1 argval2 + */ + PragmaKindFlags[PragmaKindFlags["SingleLine"] = 2] = "SingleLine"; + /** + * Multiline non-jsdoc pragma of the form + * /* @pragma-name argval1 argval2 * / + */ + PragmaKindFlags[PragmaKindFlags["MultiLine"] = 4] = "MultiLine"; + PragmaKindFlags[PragmaKindFlags["All"] = 7] = "All"; + PragmaKindFlags[PragmaKindFlags["Default"] = 7] = "Default"; + })(PragmaKindFlags = ts.PragmaKindFlags || (ts.PragmaKindFlags = {})); + /** + * This function only exists to cause exact types to be inferred for all the literals within `commentPragmas` + */ + /* @internal */ + function _contextuallyTypePragmas(args) { + return args; + } + // While not strictly a type, this is here because `PragmaMap` needs to be here to be used with `SourceFile`, and we don't + // fancy effectively defining it twice, once in value-space and once in type-space + /* @internal */ + ts.commentPragmas = _contextuallyTypePragmas({ + "reference": { + args: [ + { name: "types", optional: true, captureSpan: true }, + { name: "path", optional: true, captureSpan: true }, + { name: "no-default-lib", optional: true } + ], + kind: 1 /* TripleSlashXML */ + }, + "amd-dependency": { + args: [{ name: "path" }, { name: "name", optional: true }], + kind: 1 /* TripleSlashXML */ + }, + "amd-module": { + args: [{ name: "name" }], + kind: 1 /* TripleSlashXML */ + }, + "ts-check": { + kind: 2 /* SingleLine */ + }, + "ts-nocheck": { + kind: 2 /* SingleLine */ + }, + "jsx": { + args: [{ name: "factory" }], + kind: 4 /* MultiLine */ + }, + }); })(ts || (ts = {})); /*@internal*/ var ts; @@ -1513,9 +1603,9 @@ var ts; (function (ts) { // WARNING: The script `configureNightly.ts` uses a regexp to parse out these values. // If changing the text in this section, be sure to test `configureNightly` too. - ts.versionMajorMinor = "2.7"; + ts.versionMajorMinor = "2.8"; /** The version of the TypeScript compiler release */ - ts.version = ts.versionMajorMinor + ".2"; + ts.version = ts.versionMajorMinor + ".1"; })(ts || (ts = {})); (function (ts) { function isExternalModuleNameRelative(moduleName) { @@ -1525,10 +1615,18 @@ var ts; return ts.pathIsRelative(moduleName) || ts.isRootedDiskPath(moduleName); } ts.isExternalModuleNameRelative = isExternalModuleNameRelative; + function sortAndDeduplicateDiagnostics(diagnostics) { + return ts.sortAndDeduplicate(diagnostics, ts.compareDiagnostics); + } + ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; })(ts || (ts = {})); /* @internal */ (function (ts) { ts.emptyArray = []; + function closeFileWatcher(watcher) { + watcher.close(); + } + ts.closeFileWatcher = closeFileWatcher; /** Create a MapLike with good performance. */ function createDictionaryObject() { var map = Object.create(/*prototype*/ null); // tslint:disable-line:no-null-keyword @@ -1816,6 +1914,11 @@ var ts; return false; } ts.contains = contains; + function arraysEqual(a, b, equalityComparer) { + if (equalityComparer === void 0) { equalityComparer = equateValues; } + return a.length === b.length && a.every(function (x, i) { return equalityComparer(x, b[i]); }); + } + ts.arraysEqual = arraysEqual; function indexOfAnyCharCode(text, charCodes, start) { for (var i = start || 0; i < text.length; i++) { if (contains(charCodes, text.charCodeAt(i))) { @@ -1896,23 +1999,21 @@ var ts; } ts.mapIterator = mapIterator; function sameMap(array, f) { - var result; if (array) { for (var i = 0; i < array.length; i++) { - if (result) { - result.push(f(array[i], i)); - } - else { - var item = array[i]; - var mapped = f(item, i); - if (item !== mapped) { - result = array.slice(0, i); - result.push(mapped); + var item = array[i]; + var mapped = f(item, i); + if (item !== mapped) { + var result = array.slice(0, i); + result.push(mapped); + for (i++; i < array.length; i++) { + result.push(f(array[i], i)); } + return result; } } } - return result || array; + return array; } ts.sameMap = sameMap; /** @@ -2229,6 +2330,17 @@ var ts; } return deduplicated; } + function insertSorted(array, insert, compare) { + if (array.length === 0) { + array.push(insert); + return; + } + var insertIndex = binarySearch(array, insert, identity, compare); + if (insertIndex < 0) { + array.splice(~insertIndex, 0, insert); + } + } + ts.insertSorted = insertSorted; function sortAndDeduplicate(array, comparer, equalityComparer) { return deduplicateSorted(sort(array, comparer), equalityComparer || comparer); } @@ -2721,19 +2833,21 @@ var ts; } ts.equalOwnProperties = equalOwnProperties; function arrayToMap(array, makeKey, makeValue) { + if (makeValue === void 0) { makeValue = identity; } var result = createMap(); for (var _i = 0, array_6 = array; _i < array_6.length; _i++) { var value = array_6[_i]; - result.set(makeKey(value), makeValue ? makeValue(value) : value); + result.set(makeKey(value), makeValue(value)); } return result; } ts.arrayToMap = arrayToMap; function arrayToNumericMap(array, makeKey, makeValue) { + if (makeValue === void 0) { makeValue = identity; } var result = []; for (var _i = 0, array_7 = array; _i < array_7.length; _i++) { var value = array_7[_i]; - result[makeKey(value)] = makeValue ? makeValue(value) : value; + result[makeKey(value)] = makeValue(value); } return result; } @@ -2742,6 +2856,20 @@ var ts; return arrayToMap(array, makeKey || (function (s) { return s; }), function () { return true; }); } ts.arrayToSet = arrayToSet; + function arrayToMultiMap(values, makeKey, makeValue) { + if (makeValue === void 0) { makeValue = identity; } + var result = createMultiMap(); + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + result.add(makeKey(value), makeValue(value)); + } + return result; + } + ts.arrayToMultiMap = arrayToMultiMap; + function group(values, getGroupId) { + return arrayFrom(arrayToMultiMap(values, getGroupId).values()); + } + ts.group = group; function cloneMap(map) { var clone = createMap(); copyEntries(map, clone); @@ -2824,7 +2952,12 @@ var ts; function cast(value, test) { if (value !== undefined && test(value)) return value; - Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + if (value && typeof value.kind === "number") { + Debug.fail("Invalid cast. The supplied " + Debug.showSyntaxKind(value) + " did not pass the test '" + Debug.getFunctionName(test) + "'."); + } + else { + Debug.fail("Invalid cast. The supplied value did not pass the test '" + Debug.getFunctionName(test) + "'."); + } } ts.cast = cast; /** Does nothing. */ @@ -2913,7 +3046,6 @@ var ts; return text.replace(/{(\d+)}/g, function (_match, index) { return args[+index + baseIndex]; }); } ts.formatStringFromArgs = formatStringFromArgs; - ts.localizedDiagnosticMessages = undefined; function getLocaleSpecificMessage(message) { return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message; } @@ -3203,6 +3335,11 @@ var ts; 0 /* EqualTo */; } ts.compareDiagnostics = compareDiagnostics; + /** True is greater than false. */ + function compareBooleans(a, b) { + return compareValues(a ? 1 : 0, b ? 1 : 0); + } + ts.compareBooleans = compareBooleans; function compareMessageText(text1, text2) { while (text1 && text2) { // We still have both chains. @@ -3222,10 +3359,6 @@ var ts; // We still have one chain remaining. The shorter chain should come first. return text1 ? 1 /* GreaterThan */ : -1 /* LessThan */; } - function sortAndDeduplicateDiagnostics(diagnostics) { - return sortAndDeduplicate(diagnostics, compareDiagnostics); - } - ts.sortAndDeduplicateDiagnostics = sortAndDeduplicateDiagnostics; function normalizeSlashes(path) { return path.replace(/\\/g, "/"); } @@ -3763,7 +3896,6 @@ var ts; function matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, currentDirectory, depth, getFileSystemEntries) { path = normalizePath(path); currentDirectory = normalizePath(currentDirectory); - var comparer = useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive; var patterns = getFileMatcherPatterns(path, excludes, includes, useCaseSensitiveFileNames, currentDirectory); var regexFlag = useCaseSensitiveFileNames ? "" : "i"; var includeFileRegexes = patterns.includeFilePatterns && patterns.includeFilePatterns.map(function (pattern) { return new RegExp(pattern, regexFlag); }); @@ -3796,7 +3928,7 @@ var ts; } } }; - for (var _i = 0, _b = sort(files, comparer); _i < _b.length; _i++) { + for (var _i = 0, _b = sort(files, compareStringsCaseSensitive); _i < _b.length; _i++) { var current = _b[_i]; _loop_1(current); } @@ -3806,7 +3938,7 @@ var ts; return; } } - for (var _c = 0, _d = sort(directories, comparer); _c < _d.length; _c++) { + for (var _c = 0, _d = sort(directories, compareStringsCaseSensitive); _c < _d.length; _c++) { var current = _d[_c]; var name = combinePaths(path, current); var absoluteName = combinePaths(absolutePath, current); @@ -3838,7 +3970,7 @@ var ts; // Sort the offsets array using either the literal or canonical path representations. includeBasePaths.sort(useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive); var _loop_2 = function (includeBasePath) { - if (ts.every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { + if (every(basePaths, function (basePath) { return !containsPath(basePath, includeBasePath, path, !useCaseSensitiveFileNames); })) { basePaths.push(includeBasePath); } }; @@ -4014,6 +4146,10 @@ var ts; this.flags = flags; this.escapedName = name; this.declarations = undefined; + this.valueDeclaration = undefined; + this.id = undefined; + this.mergeId = undefined; + this.parent = undefined; } function Type(checker, flags) { this.flags = flags; @@ -4106,6 +4242,19 @@ var ts; throw e; } Debug.fail = fail; + function assertDefined(value, message) { + assert(value !== undefined && value !== null, message); + return value; + } + Debug.assertDefined = assertDefined; + function assertEachDefined(value, message) { + for (var _i = 0, value_1 = value; _i < value_1.length; _i++) { + var v = value_1[_i]; + assertDefined(v, message); + } + return value; + } + Debug.assertEachDefined = assertEachDefined; function assertNever(member, message, stackCrawlMark) { return fail(message || "Illegal value: " + member, stackCrawlMark || assertNever); } @@ -4124,6 +4273,26 @@ var ts; } } Debug.getFunctionName = getFunctionName; + function showSymbol(symbol) { + var symbolFlags = ts.SymbolFlags; + return "{ flags: " + (symbolFlags ? showFlags(symbol.flags, symbolFlags) : symbol.flags) + "; declarations: " + map(symbol.declarations, showSyntaxKind) + " }"; + } + Debug.showSymbol = showSymbol; + function showFlags(flags, flagsEnum) { + var out = []; + for (var pow = 0; pow <= 30; pow++) { + var n = 1 << pow; + if (flags & n) { + out.push(flagsEnum[n]); + } + } + return out.join("|"); + } + function showSyntaxKind(node) { + var syntaxKind = ts.SyntaxKind; + return syntaxKind ? syntaxKind[node.kind] : node.kind.toString(); + } + Debug.showSyntaxKind = showSyntaxKind; })(Debug = ts.Debug || (ts.Debug = {})); /** Remove an item from an array, moving everything to its right one space left. */ function orderedRemoveItem(array, item) { @@ -4201,16 +4370,16 @@ var ts; */ function matchedText(pattern, candidate) { Debug.assert(isPatternMatch(pattern, candidate)); - return candidate.substr(pattern.prefix.length, candidate.length - pattern.suffix.length); + return candidate.substring(pattern.prefix.length, candidate.length - pattern.suffix.length); } ts.matchedText = matchedText; /** Return the object corresponding to the best pattern to match `candidate`. */ function findBestPatternMatch(values, getPattern, candidate) { - var matchedValue = undefined; + var matchedValue; // use length of prefix as betterness criteria var longestMatchPrefixLength = -1; - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var v = values_1[_i]; + for (var _i = 0, values_2 = values; _i < values_2.length; _i++) { + var v = values_2[_i]; var pattern = getPattern(v); if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) { longestMatchPrefixLength = pattern.prefix.length; @@ -4299,6 +4468,38 @@ var ts; return t === undefined ? undefined : [t]; } ts.singleElementArray = singleElementArray; + function enumerateInsertsAndDeletes(newItems, oldItems, comparer, inserted, deleted, unchanged) { + unchanged = unchanged || noop; + var newIndex = 0; + var oldIndex = 0; + var newLen = newItems.length; + var oldLen = oldItems.length; + while (newIndex < newLen && oldIndex < oldLen) { + var newItem = newItems[newIndex]; + var oldItem = oldItems[oldIndex]; + var compareResult = comparer(newItem, oldItem); + if (compareResult === -1 /* LessThan */) { + inserted(newItem); + newIndex++; + } + else if (compareResult === 1 /* GreaterThan */) { + deleted(oldItem); + oldIndex++; + } + else { + unchanged(oldItem, newItem); + newIndex++; + oldIndex++; + } + } + while (newIndex < newLen) { + inserted(newItems[newIndex++]); + } + while (oldIndex < oldLen) { + deleted(oldItems[oldIndex++]); + } + } + ts.enumerateInsertsAndDeletes = enumerateInsertsAndDeletes; })(ts || (ts = {})); /// var ts; @@ -4310,7 +4511,7 @@ var ts; */ /* @internal */ function setStackTraceLimit() { - if (Error.stackTraceLimit < 100) { + if (Error.stackTraceLimit < 100) { // Also tests that we won't set the property if it doesn't exist. Error.stackTraceLimit = 100; } } @@ -4321,6 +4522,314 @@ var ts; FileWatcherEventKind[FileWatcherEventKind["Changed"] = 1] = "Changed"; FileWatcherEventKind[FileWatcherEventKind["Deleted"] = 2] = "Deleted"; })(FileWatcherEventKind = ts.FileWatcherEventKind || (ts.FileWatcherEventKind = {})); + /* @internal */ + var PollingInterval; + (function (PollingInterval) { + PollingInterval[PollingInterval["High"] = 2000] = "High"; + PollingInterval[PollingInterval["Medium"] = 500] = "Medium"; + PollingInterval[PollingInterval["Low"] = 250] = "Low"; + })(PollingInterval = ts.PollingInterval || (ts.PollingInterval = {})); + function getPriorityValues(highPriorityValue) { + var mediumPriorityValue = highPriorityValue * 2; + var lowPriorityValue = mediumPriorityValue * 4; + return [highPriorityValue, mediumPriorityValue, lowPriorityValue]; + } + function pollingInterval(watchPriority) { + return pollingIntervalsForPriority[watchPriority]; + } + var pollingIntervalsForPriority = getPriorityValues(250); + /* @internal */ + function watchFileUsingPriorityPollingInterval(host, fileName, callback, watchPriority) { + return host.watchFile(fileName, callback, pollingInterval(watchPriority)); + } + ts.watchFileUsingPriorityPollingInterval = watchFileUsingPriorityPollingInterval; + /* @internal */ + ts.missingFileModifiedTime = new Date(0); // Any subsequent modification will occur after this time + function createPollingIntervalBasedLevels(levels) { + return _a = {}, + _a[PollingInterval.Low] = levels.Low, + _a[PollingInterval.Medium] = levels.Medium, + _a[PollingInterval.High] = levels.High, + _a; + var _a; + } + var defaultChunkLevels = { Low: 32, Medium: 64, High: 256 }; + var pollingChunkSize = createPollingIntervalBasedLevels(defaultChunkLevels); + /* @internal */ + ts.unchangedPollThresholds = createPollingIntervalBasedLevels(defaultChunkLevels); + /* @internal */ + function setCustomPollingValues(system) { + if (!system.getEnvironmentVariable) { + return; + } + var pollingIntervalChanged = setCustomLevels("TSC_WATCH_POLLINGINTERVAL", PollingInterval); + pollingChunkSize = getCustomPollingBasedLevels("TSC_WATCH_POLLINGCHUNKSIZE", defaultChunkLevels) || pollingChunkSize; + ts.unchangedPollThresholds = getCustomPollingBasedLevels("TSC_WATCH_UNCHANGEDPOLLTHRESHOLDS", defaultChunkLevels) || ts.unchangedPollThresholds; + function getLevel(envVar, level) { + return system.getEnvironmentVariable(envVar + "_" + level.toUpperCase()); + } + function getCustomLevels(baseVariable) { + var customLevels; + setCustomLevel("Low"); + setCustomLevel("Medium"); + setCustomLevel("High"); + return customLevels; + function setCustomLevel(level) { + var customLevel = getLevel(baseVariable, level); + if (customLevel) { + (customLevels || (customLevels = {}))[level] = Number(customLevel); + } + } + } + function setCustomLevels(baseVariable, levels) { + var customLevels = getCustomLevels(baseVariable); + if (customLevels) { + setLevel("Low"); + setLevel("Medium"); + setLevel("High"); + return true; + } + return false; + function setLevel(level) { + levels[level] = customLevels[level] || levels[level]; + } + } + function getCustomPollingBasedLevels(baseVariable, defaultLevels) { + var customLevels = getCustomLevels(baseVariable); + return (pollingIntervalChanged || customLevels) && + createPollingIntervalBasedLevels(customLevels ? __assign({}, defaultLevels, customLevels) : defaultLevels); + } + } + ts.setCustomPollingValues = setCustomPollingValues; + /* @internal */ + function createDynamicPriorityPollingWatchFile(host) { + var watchedFiles = []; + var changedFilesInLastPoll = []; + var lowPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Low); + var mediumPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.Medium); + var highPollingIntervalQueue = createPollingIntervalQueue(PollingInterval.High); + return watchFile; + function watchFile(fileName, callback, defaultPollingInterval) { + var file = { + fileName: fileName, + callback: callback, + unchangedPolls: 0, + mtime: getModifiedTime(fileName) + }; + watchedFiles.push(file); + addToPollingIntervalQueue(file, defaultPollingInterval); + return { + close: function () { + file.isClosed = true; + // Remove from watchedFiles + ts.unorderedRemoveItem(watchedFiles, file); + // Do not update polling interval queue since that will happen as part of polling + } + }; + } + function createPollingIntervalQueue(pollingInterval) { + var queue = []; + queue.pollingInterval = pollingInterval; + queue.pollIndex = 0; + queue.pollScheduled = false; + return queue; + } + function pollPollingIntervalQueue(queue) { + queue.pollIndex = pollQueue(queue, queue.pollingInterval, queue.pollIndex, pollingChunkSize[queue.pollingInterval]); + // Set the next polling index and timeout + if (queue.length) { + scheduleNextPoll(queue.pollingInterval); + } + else { + ts.Debug.assert(queue.pollIndex === 0); + queue.pollScheduled = false; + } + } + function pollLowPollingIntervalQueue(queue) { + // Always poll complete list of changedFilesInLastPoll + pollQueue(changedFilesInLastPoll, PollingInterval.Low, /*pollIndex*/ 0, changedFilesInLastPoll.length); + // Finally do the actual polling of the queue + pollPollingIntervalQueue(queue); + // Schedule poll if there are files in changedFilesInLastPoll but no files in the actual queue + // as pollPollingIntervalQueue wont schedule for next poll + if (!queue.pollScheduled && changedFilesInLastPoll.length) { + scheduleNextPoll(PollingInterval.Low); + } + } + function pollQueue(queue, pollingInterval, pollIndex, chunkSize) { + // Max visit would be all elements of the queue + var needsVisit = queue.length; + var definedValueCopyToIndex = pollIndex; + for (var polled = 0; polled < chunkSize && needsVisit > 0; nextPollIndex(), needsVisit--) { + var watchedFile = queue[pollIndex]; + if (!watchedFile) { + continue; + } + else if (watchedFile.isClosed) { + queue[pollIndex] = undefined; + continue; + } + polled++; + var fileChanged = onWatchedFileStat(watchedFile, getModifiedTime(watchedFile.fileName)); + if (watchedFile.isClosed) { + // Closed watcher as part of callback + queue[pollIndex] = undefined; + } + else if (fileChanged) { + watchedFile.unchangedPolls = 0; + // Changed files go to changedFilesInLastPoll queue + if (queue !== changedFilesInLastPoll) { + queue[pollIndex] = undefined; + addChangedFileToLowPollingIntervalQueue(watchedFile); + } + } + else if (watchedFile.unchangedPolls !== ts.unchangedPollThresholds[pollingInterval]) { + watchedFile.unchangedPolls++; + } + else if (queue === changedFilesInLastPoll) { + // Restart unchangedPollCount for unchanged file and move to low polling interval queue + watchedFile.unchangedPolls = 1; + queue[pollIndex] = undefined; + addToPollingIntervalQueue(watchedFile, PollingInterval.Low); + } + else if (pollingInterval !== PollingInterval.High) { + watchedFile.unchangedPolls++; + queue[pollIndex] = undefined; + addToPollingIntervalQueue(watchedFile, pollingInterval === PollingInterval.Low ? PollingInterval.Medium : PollingInterval.High); + } + if (queue[pollIndex]) { + // Copy this file to the non hole location + if (definedValueCopyToIndex < pollIndex) { + queue[definedValueCopyToIndex] = watchedFile; + queue[pollIndex] = undefined; + } + definedValueCopyToIndex++; + } + } + // Return next poll index + return pollIndex; + function nextPollIndex() { + pollIndex++; + if (pollIndex === queue.length) { + if (definedValueCopyToIndex < pollIndex) { + // There are holes from nextDefinedValueIndex to end of queue, change queue size + queue.length = definedValueCopyToIndex; + } + pollIndex = 0; + definedValueCopyToIndex = 0; + } + } + } + function pollingIntervalQueue(pollingInterval) { + switch (pollingInterval) { + case PollingInterval.Low: + return lowPollingIntervalQueue; + case PollingInterval.Medium: + return mediumPollingIntervalQueue; + case PollingInterval.High: + return highPollingIntervalQueue; + } + } + function addToPollingIntervalQueue(file, pollingInterval) { + pollingIntervalQueue(pollingInterval).push(file); + scheduleNextPollIfNotAlreadyScheduled(pollingInterval); + } + function addChangedFileToLowPollingIntervalQueue(file) { + changedFilesInLastPoll.push(file); + scheduleNextPollIfNotAlreadyScheduled(PollingInterval.Low); + } + function scheduleNextPollIfNotAlreadyScheduled(pollingInterval) { + if (!pollingIntervalQueue(pollingInterval).pollScheduled) { + scheduleNextPoll(pollingInterval); + } + } + function scheduleNextPoll(pollingInterval) { + pollingIntervalQueue(pollingInterval).pollScheduled = host.setTimeout(pollingInterval === PollingInterval.Low ? pollLowPollingIntervalQueue : pollPollingIntervalQueue, pollingInterval, pollingIntervalQueue(pollingInterval)); + } + function getModifiedTime(fileName) { + return host.getModifiedTime(fileName) || ts.missingFileModifiedTime; + } + } + ts.createDynamicPriorityPollingWatchFile = createDynamicPriorityPollingWatchFile; + /** + * Returns true if file status changed + */ + /*@internal*/ + function onWatchedFileStat(watchedFile, modifiedTime) { + var oldTime = watchedFile.mtime.getTime(); + var newTime = modifiedTime.getTime(); + if (oldTime !== newTime) { + watchedFile.mtime = modifiedTime; + var eventKind = oldTime === 0 + ? FileWatcherEventKind.Created + : newTime === 0 + ? FileWatcherEventKind.Deleted + : FileWatcherEventKind.Changed; + watchedFile.callback(watchedFile.fileName, eventKind); + return true; + } + return false; + } + ts.onWatchedFileStat = onWatchedFileStat; + /** + * Watch the directory recursively using host provided method to watch child directories + * that means if this is recursive watcher, watch the children directories as well + * (eg on OS that dont support recursive watch using fs.watch use fs.watchFile) + */ + /*@internal*/ + function createRecursiveDirectoryWatcher(host) { + return createDirectoryWatcher; + /** + * Create the directory watcher for the dirPath. + */ + function createDirectoryWatcher(dirName, callback) { + var watcher = host.watchDirectory(dirName, function (fileName) { + // Call the actual callback + callback(fileName); + // Iterate through existing children and update the watches if needed + updateChildWatches(result, callback); + }); + var result = { + close: function () { + watcher.close(); + result.childWatches.forEach(ts.closeFileWatcher); + result = undefined; + }, + dirName: dirName, + childWatches: ts.emptyArray + }; + updateChildWatches(result, callback); + return result; + } + function updateChildWatches(watcher, callback) { + // Iterate through existing children and update the watches if needed + if (watcher) { + watcher.childWatches = watchChildDirectories(watcher.dirName, watcher.childWatches, callback); + } + } + /** + * Watch the directories in the parentDir + */ + function watchChildDirectories(parentDir, existingChildWatches, callback) { + var newChildWatches; + ts.enumerateInsertsAndDeletes(host.directoryExists(parentDir) ? host.getAccessileSortedChildDirectories(parentDir) : ts.emptyArray, existingChildWatches, function (child, childWatcher) { return host.filePathComparer(ts.getNormalizedAbsolutePath(child, parentDir), childWatcher.dirName); }, createAndAddChildDirectoryWatcher, ts.closeFileWatcher, addChildDirectoryWatcher); + return newChildWatches || ts.emptyArray; + /** + * Create new childDirectoryWatcher and add it to the new ChildDirectoryWatcher list + */ + function createAndAddChildDirectoryWatcher(childName) { + var result = createDirectoryWatcher(ts.getNormalizedAbsolutePath(childName, parentDir), callback); + addChildDirectoryWatcher(result); + } + /** + * Add child directory watcher to the new ChildDirectoryWatcher list + */ + function addChildDirectoryWatcher(childWatcher) { + (newChildWatches || (newChildWatches = [])).push(childWatcher); + } + } + } + ts.createRecursiveDirectoryWatcher = createRecursiveDirectoryWatcher; function getNodeMajorVersion() { if (typeof process === "undefined") { return undefined; @@ -4345,70 +4854,107 @@ var ts; var _fs = require("fs"); var _path = require("path"); var _os = require("os"); - var _crypto = require("crypto"); - var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; - function createWatchedFileSet() { - var dirWatchers = ts.createMap(); - // One file can have multiple watchers - var fileWatcherCallbacks = ts.createMultiMap(); - return { addFile: addFile, removeFile: removeFile }; - function reduceDirWatcherRefCountForFile(fileName) { - var dirName = ts.getDirectoryPath(fileName); - var watcher = dirWatchers.get(dirName); - if (watcher) { - watcher.referenceCount -= 1; - if (watcher.referenceCount <= 0) { - watcher.close(); - dirWatchers.delete(dirName); - } - } - } - function addDirWatcher(dirPath) { - var watcher = dirWatchers.get(dirPath); - if (watcher) { - watcher.referenceCount += 1; - return; - } - watcher = fsWatchDirectory(dirPath || ".", function (eventName, relativeFileName) { return fileEventHandler(eventName, relativeFileName, dirPath); }); - watcher.referenceCount = 1; - dirWatchers.set(dirPath, watcher); - return; - } - function addFileWatcherCallback(filePath, callback) { - fileWatcherCallbacks.add(filePath, callback); - } - function addFile(fileName, callback) { - addFileWatcherCallback(fileName, callback); - addDirWatcher(ts.getDirectoryPath(fileName)); - return { fileName: fileName, callback: callback }; - } - function removeFile(watchedFile) { - removeFileWatcherCallback(watchedFile.fileName, watchedFile.callback); - reduceDirWatcherRefCountForFile(watchedFile.fileName); - } - function removeFileWatcherCallback(filePath, callback) { - fileWatcherCallbacks.remove(filePath, callback); - } - function fileEventHandler(eventName, relativeFileName, baseDirPath) { - // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" - var fileName = !ts.isString(relativeFileName) - ? undefined - : ts.getNormalizedAbsolutePath(relativeFileName, baseDirPath); - // Some applications save a working file via rename operations - if ((eventName === "change" || eventName === "rename")) { - var callbacks = fileWatcherCallbacks.get(fileName); - if (callbacks) { - for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { - var fileCallback = callbacks_1[_i]; - fileCallback(fileName, FileWatcherEventKind.Changed); - } - } - } - } + // crypto can be absent on reduced node installations + var _crypto; + try { + _crypto = require("crypto"); + } + catch (_a) { + _crypto = undefined; } - var watchedFileSet = createWatchedFileSet(); var nodeVersion = getNodeMajorVersion(); var isNode4OrLater = nodeVersion >= 4; + var platform = _os.platform(); + var useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + var FileSystemEntryKind; + (function (FileSystemEntryKind) { + FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; + FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; + })(FileSystemEntryKind || (FileSystemEntryKind = {})); + var useNonPollingWatchers = process.env.TSC_NONPOLLING_WATCHER; + var tscWatchFile = process.env.TSC_WATCHFILE; + var tscWatchDirectory = process.env.TSC_WATCHDIRECTORY; + var dynamicPollingWatchFile; + var nodeSystem = { + args: process.argv.slice(2), + newLine: _os.EOL, + useCaseSensitiveFileNames: useCaseSensitiveFileNames, + write: function (s) { + process.stdout.write(s); + }, + readFile: readFile, + writeFile: writeFile, + watchFile: getWatchFile(), + watchDirectory: getWatchDirectory(), + resolvePath: function (path) { return _path.resolve(path); }, + fileExists: fileExists, + directoryExists: directoryExists, + createDirectory: function (directoryName) { + if (!nodeSystem.directoryExists(directoryName)) { + _fs.mkdirSync(directoryName); + } + }, + getExecutingFilePath: function () { + return __filename; + }, + getCurrentDirectory: function () { + return process.cwd(); + }, + getDirectories: getDirectories, + getEnvironmentVariable: function (name) { + return process.env[name] || ""; + }, + readDirectory: readDirectory, + getModifiedTime: getModifiedTime, + createHash: _crypto ? createMD5HashUsingNativeCrypto : generateDjb2Hash, + getMemoryUsage: function () { + if (global.gc) { + global.gc(); + } + return process.memoryUsage().heapUsed; + }, + getFileSize: function (path) { + try { + var stat = _fs.statSync(path); + if (stat.isFile()) { + return stat.size; + } + } + catch ( /*ignore*/_a) { /*ignore*/ } + return 0; + }, + exit: function (exitCode) { + process.exit(exitCode); + }, + realpath: function (path) { + try { + return _fs.realpathSync(path); + } + catch (_a) { + return path; + } + }, + debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), + tryEnableSourceMapsForHost: function () { + try { + require("source-map-support").install(); + } + catch (_a) { + // Could not enable source maps. + } + }, + setTimeout: setTimeout, + clearTimeout: clearTimeout, + clearScreen: function () { + process.stdout.write("\x1Bc"); + }, + setBlocking: function () { + if (process.stdout && process.stdout._handle && process.stdout._handle.setBlocking) { + process.stdout._handle.setBlocking(true); + } + } + }; + return nodeSystem; function isFileSystemCaseSensitive() { // win32\win64 are case insensitive platforms if (platform === "win32" || platform === "win64") { @@ -4424,46 +4970,187 @@ var ts; return ch === up ? ch.toLowerCase() : up; }); } - var platform = _os.platform(); - var useCaseSensitiveFileNames = isFileSystemCaseSensitive(); + function getWatchFile() { + switch (tscWatchFile) { + case "PriorityPollingInterval": + // Use polling interval based on priority when create watch using host.watchFile + return fsWatchFile; + case "DynamicPriorityPolling": + // Use polling interval but change the interval depending on file changes and their default polling interval + return createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }); + case "UseFsEvents": + // Use notifications from FS to watch with falling back to fs.watchFile + return watchFileUsingFsWatch; + case "UseFsEventsWithFallbackDynamicPolling": + // Use notifications from FS to watch with falling back to dynamic watch file + dynamicPollingWatchFile = createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout }); + return createWatchFileUsingDynamicWatchFile(dynamicPollingWatchFile); + case "UseFsEventsOnParentDirectory": + // Use notifications from FS to watch with falling back to fs.watchFile + return createNonPollingWatchFile(); + } + return useNonPollingWatchers ? + createNonPollingWatchFile() : + // Default to do not use polling interval as it is before this experiment branch + function (fileName, callback) { return fsWatchFile(fileName, callback); }; + } + function getWatchDirectory() { + // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows + // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) + var fsSupportsRecursive = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin"); + if (fsSupportsRecursive) { + return watchDirectoryUsingFsWatch; + } + var watchDirectory = tscWatchDirectory === "RecursiveDirectoryUsingFsWatchFile" ? + createWatchDirectoryUsing(fsWatchFile) : + tscWatchDirectory === "RecursiveDirectoryUsingDynamicPriorityPolling" ? + createWatchDirectoryUsing(dynamicPollingWatchFile || createDynamicPriorityPollingWatchFile({ getModifiedTime: getModifiedTime, setTimeout: setTimeout })) : + watchDirectoryUsingFsWatch; + var watchDirectoryRecursively = createRecursiveDirectoryWatcher({ + filePathComparer: useCaseSensitiveFileNames ? ts.compareStringsCaseSensitive : ts.compareStringsCaseInsensitive, + directoryExists: directoryExists, + getAccessileSortedChildDirectories: function (path) { return getAccessibleFileSystemEntries(path).directories; }, + watchDirectory: watchDirectory + }); + return function (directoryName, callback, recursive) { + if (recursive) { + return watchDirectoryRecursively(directoryName, callback); + } + watchDirectory(directoryName, callback); + }; + } + function createNonPollingWatchFile() { + // One file can have multiple watchers + var fileWatcherCallbacks = ts.createMultiMap(); + var dirWatchers = ts.createMap(); + var toCanonicalName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); + return nonPollingWatchFile; + function nonPollingWatchFile(fileName, callback) { + var filePath = toCanonicalName(fileName); + fileWatcherCallbacks.add(filePath, callback); + var dirPath = ts.getDirectoryPath(filePath) || "."; + var watcher = dirWatchers.get(dirPath) || createDirectoryWatcher(ts.getDirectoryPath(fileName) || ".", dirPath); + watcher.referenceCount++; + return { + close: function () { + if (watcher.referenceCount === 1) { + watcher.close(); + dirWatchers.delete(dirPath); + } + else { + watcher.referenceCount--; + } + fileWatcherCallbacks.remove(filePath, callback); + } + }; + } + function createDirectoryWatcher(dirName, dirPath) { + var watcher = fsWatchDirectory(dirName, function (_eventName, relativeFileName) { + // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined" + var fileName = !ts.isString(relativeFileName) + ? undefined + : ts.getNormalizedAbsolutePath(relativeFileName, dirName); + // Some applications save a working file via rename operations + var callbacks = fileWatcherCallbacks.get(toCanonicalName(fileName)); + if (callbacks) { + for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) { + var fileCallback = callbacks_1[_i]; + fileCallback(fileName, FileWatcherEventKind.Changed); + } + } + }); + watcher.referenceCount = 0; + dirWatchers.set(dirPath, watcher); + return watcher; + } + } function fsWatchFile(fileName, callback, pollingInterval) { _fs.watchFile(fileName, { persistent: true, interval: pollingInterval || 250 }, fileChanged); + var eventKind; return { close: function () { return _fs.unwatchFile(fileName, fileChanged); } }; function fileChanged(curr, prev) { - var isCurrZero = +curr.mtime === 0; - var isPrevZero = +prev.mtime === 0; - var created = !isCurrZero && isPrevZero; - var deleted = isCurrZero && !isPrevZero; - var eventKind = created - ? FileWatcherEventKind.Created - : deleted - ? FileWatcherEventKind.Deleted - : FileWatcherEventKind.Changed; - if (eventKind === FileWatcherEventKind.Changed && +curr.mtime <= +prev.mtime) { + // previous event kind check is to ensure we recongnize the file as previously also missing when it is restored or renamed twice (that is it disappears and reappears) + // In such case, prevTime returned is same as prev time of event when file was deleted as per node documentation + var isPreviouslyDeleted = +prev.mtime === 0 || eventKind === FileWatcherEventKind.Deleted; + if (+curr.mtime === 0) { + if (isPreviouslyDeleted) { + // Already deleted file, no need to callback again + return; + } + eventKind = FileWatcherEventKind.Deleted; + } + else if (isPreviouslyDeleted) { + eventKind = FileWatcherEventKind.Created; + } + // If there is no change in modified time, ignore the event + else if (+curr.mtime === +prev.mtime) { return; } + else { + // File changed + eventKind = FileWatcherEventKind.Changed; + } callback(fileName, eventKind); } } - function fsWatchDirectory(directoryName, callback, recursive) { + function createFileWatcherCallback(callback) { + return function (_fileName, eventKind) { return callback(eventKind === FileWatcherEventKind.Changed ? "change" : "rename", ""); }; + } + function createFsWatchCallbackForFileWatcherCallback(fileName, callback) { + return function (eventName) { + if (eventName === "rename") { + callback(fileName, fileExists(fileName) ? FileWatcherEventKind.Created : FileWatcherEventKind.Deleted); + } + else { + // Change + callback(fileName, FileWatcherEventKind.Changed); + } + }; + } + function createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback) { + return function (eventName, relativeFileName) { + // In watchDirectory we only care about adding and removing files (when event name is + // "rename"); changes made within files are handled by corresponding fileWatchers (when + // event name is "change") + if (eventName === "rename") { + // When deleting a file, the passed baseFileName is null + callback(!relativeFileName ? directoryName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); + } + }; + } + function fsWatch(fileOrDirectory, entryKind, callback, recursive, fallbackPollingWatchFile, pollingInterval) { var options; - /** Watcher for the directory depending on whether it is missing or present */ - var watcher = !directoryExists(directoryName) ? - watchMissingDirectory() : - watchPresentDirectory(); + /** Watcher for the file system entry depending on whether it is missing or present */ + var watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ? + watchMissingFileSystemEntry() : + watchPresentFileSystemEntry(); return { close: function () { - // Close the watcher (either existing directory watcher or missing directory watcher) + // Close the watcher (either existing file system entry watcher or missing file system entry watcher) watcher.close(); + watcher = undefined; } }; /** - * Watch the directory that is currently present - * and when the watched directory is deleted, switch to missing directory watcher + * Invoke the callback with rename and update the watcher if not closed + * @param createWatcher */ - function watchPresentDirectory() { + function invokeCallbackAndUpdateWatcher(createWatcher) { + // Call the callback for current directory + callback("rename", ""); + // If watcher is not closed, update it + if (watcher) { + watcher.close(); + watcher = createWatcher(); + } + } + /** + * Watch the file or directory that is currently present + * and when the watched file or directory is deleted, switch to missing file system entry watcher + */ + function watchPresentFileSystemEntry() { // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) if (options === undefined) { @@ -4474,34 +5161,56 @@ var ts; options = { persistent: true }; } } - var dirWatcher = _fs.watch(directoryName, options, callback); - dirWatcher.on("error", function () { - if (!directoryExists(directoryName)) { - // Deleting directory - watcher = watchMissingDirectory(); - // Call the callback for current directory - callback("rename", ""); - } - }); - return dirWatcher; + try { + var presentWatcher = _fs.watch(fileOrDirectory, options, callback); + // Watch the missing file or directory or error + presentWatcher.on("error", function () { return invokeCallbackAndUpdateWatcher(watchMissingFileSystemEntry); }); + return presentWatcher; + } + catch (e) { + // Catch the exception and use polling instead + // Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point + // so instead of throwing error, use fs.watchFile + return watchPresentFileSystemEntryWithFsWatchFile(); + } } /** - * Watch the directory that is missing - * and switch to existing directory when the directory is created + * Watch the file or directory using fs.watchFile since fs.watch threw exception + * Eg. on linux the number of watches are limited and one could easily exhaust watches and the exception ENOSPC is thrown when creating watcher at that point */ - function watchMissingDirectory() { - return fsWatchFile(directoryName, function (_fileName, eventKind) { - if (eventKind === FileWatcherEventKind.Created && directoryExists(directoryName)) { - watcher.close(); - watcher = watchPresentDirectory(); - // Call the callback for current directory + function watchPresentFileSystemEntryWithFsWatchFile() { + return fallbackPollingWatchFile(fileOrDirectory, createFileWatcherCallback(callback), pollingInterval); + } + /** + * Watch the file or directory that is missing + * and switch to existing file or directory when the missing filesystem entry is created + */ + function watchMissingFileSystemEntry() { + return fallbackPollingWatchFile(fileOrDirectory, function (_fileName, eventKind) { + if (eventKind === FileWatcherEventKind.Created && fileSystemEntryExists(fileOrDirectory, entryKind)) { + // Call the callback for current file or directory // For now it could be callback for the inner directory creation, // but just return current directory, better than current no-op - callback("rename", ""); + invokeCallbackAndUpdateWatcher(watchPresentFileSystemEntry); } - }); + }, pollingInterval); } } + function watchFileUsingFsWatch(fileName, callback, pollingInterval) { + return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback), /*recursive*/ false, fsWatchFile, pollingInterval); + } + function createWatchFileUsingDynamicWatchFile(watchFile) { + return function (fileName, callback, pollingInterval) { return fsWatch(fileName, 0 /* File */, createFsWatchCallbackForFileWatcherCallback(fileName, callback), /*recursive*/ false, watchFile, pollingInterval); }; + } + function fsWatchDirectory(directoryName, callback, recursive) { + return fsWatch(directoryName, 1 /* Directory */, callback, !!recursive, fsWatchFile); + } + function watchDirectoryUsingFsWatch(directoryName, callback, recursive) { + return fsWatchDirectory(directoryName, createFsWatchCallbackForDirectoryWatcherCallback(directoryName, callback), recursive); + } + function createWatchDirectoryUsing(fsWatchFile) { + return function (directoryName, callback) { return fsWatchFile(directoryName, function () { return callback(directoryName); }, PollingInterval.Medium); }; + } function readFile(fileName, _encoding) { if (!fileExists(fileName)) { return undefined; @@ -4582,11 +5291,6 @@ var ts; function readDirectory(path, extensions, excludes, includes, depth) { return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries); } - var FileSystemEntryKind; - (function (FileSystemEntryKind) { - FileSystemEntryKind[FileSystemEntryKind["File"] = 0] = "File"; - FileSystemEntryKind[FileSystemEntryKind["Directory"] = 1] = "Directory"; - })(FileSystemEntryKind || (FileSystemEntryKind = {})); function fileSystemEntryExists(path, entryKind) { try { var stat = _fs.statSync(path); @@ -4608,114 +5312,27 @@ var ts; function getDirectories(path) { return ts.filter(_fs.readdirSync(path), function (dir) { return fileSystemEntryExists(ts.combinePaths(path, dir), 1 /* Directory */); }); } - var nodeSystem = { - clearScreen: function () { - process.stdout.write("\x1Bc"); - }, - args: process.argv.slice(2), - newLine: _os.EOL, - useCaseSensitiveFileNames: useCaseSensitiveFileNames, - write: function (s) { - process.stdout.write(s); - }, - readFile: readFile, - writeFile: writeFile, - watchFile: function (fileName, callback, pollingInterval) { - if (useNonPollingWatchers) { - var watchedFile_1 = watchedFileSet.addFile(fileName, callback); - return { - close: function () { return watchedFileSet.removeFile(watchedFile_1); } - }; - } - else { - return fsWatchFile(fileName, callback, pollingInterval); - } - }, - watchDirectory: function (directoryName, callback, recursive) { - // Node 4.0 `fs.watch` function supports the "recursive" option on both OSX and Windows - // (ref: https://github.com/nodejs/node/pull/2649 and https://github.com/Microsoft/TypeScript/issues/4643) - return fsWatchDirectory(directoryName, function (eventName, relativeFileName) { - // In watchDirectory we only care about adding and removing files (when event name is - // "rename"); changes made within files are handled by corresponding fileWatchers (when - // event name is "change") - if (eventName === "rename") { - // When deleting a file, the passed baseFileName is null - callback(!relativeFileName ? relativeFileName : ts.normalizePath(ts.combinePaths(directoryName, relativeFileName))); - } - }, recursive); - }, - resolvePath: function (path) { return _path.resolve(path); }, - fileExists: fileExists, - directoryExists: directoryExists, - createDirectory: function (directoryName) { - if (!nodeSystem.directoryExists(directoryName)) { - _fs.mkdirSync(directoryName); - } - }, - getExecutingFilePath: function () { - return __filename; - }, - getCurrentDirectory: function () { - return process.cwd(); - }, - getDirectories: getDirectories, - getEnvironmentVariable: function (name) { - return process.env[name] || ""; - }, - readDirectory: readDirectory, - getModifiedTime: function (path) { - try { - return _fs.statSync(path).mtime; - } - catch (e) { - return undefined; - } - }, - createHash: function (data) { - var hash = _crypto.createHash("md5"); - hash.update(data); - return hash.digest("hex"); - }, - getMemoryUsage: function () { - if (global.gc) { - global.gc(); - } - return process.memoryUsage().heapUsed; - }, - getFileSize: function (path) { - try { - var stat = _fs.statSync(path); - if (stat.isFile()) { - return stat.size; - } - } - catch (_a) { } - return 0; - }, - exit: function (exitCode) { - process.exit(exitCode); - }, - realpath: function (path) { - try { - return _fs.realpathSync(path); - } - catch (_a) { - return path; - } - }, - debugMode: ts.some(process.execArgv, function (arg) { return /^--(inspect|debug)(-brk)?(=\d+)?$/i.test(arg); }), - tryEnableSourceMapsForHost: function () { - try { - require("source-map-support").install(); - } - catch (_a) { - // Could not enable source maps. - } - }, - setTimeout: setTimeout, - clearTimeout: clearTimeout - }; - return nodeSystem; + function getModifiedTime(path) { + try { + return _fs.statSync(path).mtime; + } + catch (e) { + return undefined; + } + } + /** + * djb2 hashing algorithm + * http://www.cse.yorku.ca/~oz/hash.html + */ + function generateDjb2Hash(data) { + var chars = data.split("").map(function (str) { return str.charCodeAt(0); }); + return "" + chars.reduce(function (prev, curr) { return ((prev << 5) + prev) + curr; }, 5381); + } + function createMD5HashUsingNativeCrypto(data) { + var hash = _crypto.createHash("md5"); + hash.update(data); + return hash.digest("hex"); + } } function getChakraSystem() { var realpath = ChakraHost.realpath && (function (path) { return ChakraHost.realpath(path); }); @@ -4784,6 +5401,7 @@ var ts; return sys; })(); if (ts.sys && ts.sys.getEnvironmentVariable) { + setCustomPollingValues(ts.sys); ts.Debug.currentAssertionLevel = /^development$/i.test(ts.sys.getEnvironmentVariable("NODE_ENV")) ? 1 /* Normal */ : 0 /* None */; @@ -5040,6 +5658,7 @@ var ts; unique_symbol_types_are_not_allowed_here: diag(1335, ts.DiagnosticCategory.Error, "unique_symbol_types_are_not_allowed_here_1335", "'unique symbol' types are not allowed here."), An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: diag(1336, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead_1336", "An index signature parameter type cannot be a type alias. Consider writing '[{0}: {1}]: {2}' instead."), An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: diag(1337, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead_1337", "An index signature parameter type cannot be a union type. Consider using a mapped object type instead."), + infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: diag(1338, ts.DiagnosticCategory.Error, "infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type_1338", "'infer' declarations are only permitted in the 'extends' clause of a conditional type."), Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."), Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."), Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."), @@ -5298,6 +5917,7 @@ var ts; Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: diag(2564, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor_2564", "Property '{0}' has no initializer and is not definitely assigned in the constructor."), Property_0_is_used_before_being_assigned: diag(2565, ts.DiagnosticCategory.Error, "Property_0_is_used_before_being_assigned_2565", "Property '{0}' is used before being assigned."), A_rest_element_cannot_have_a_property_name: diag(2566, ts.DiagnosticCategory.Error, "A_rest_element_cannot_have_a_property_name_2566", "A rest element cannot have a property name."), + Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: diag(2567, ts.DiagnosticCategory.Error, "Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations_2567", "Enum declarations can only merge with namespace or other enum declarations."), JSX_element_attributes_type_0_may_not_be_a_union_type: diag(2600, ts.DiagnosticCategory.Error, "JSX_element_attributes_type_0_may_not_be_a_union_type_2600", "JSX element attributes type '{0}' may not be a union type."), The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: diag(2601, ts.DiagnosticCategory.Error, "The_return_type_of_a_JSX_element_constructor_must_return_an_object_type_2601", "The return type of a JSX element constructor must return an object type."), JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: diag(2602, ts.DiagnosticCategory.Error, "JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist_2602", "JSX element implicitly has type 'any' because the global type 'JSX.Element' does not exist."), @@ -5380,6 +6000,7 @@ var ts; Cannot_invoke_an_object_which_is_possibly_null: diag(2721, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_2721", "Cannot invoke an object which is possibly 'null'."), Cannot_invoke_an_object_which_is_possibly_undefined: diag(2722, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_undefined_2722", "Cannot invoke an object which is possibly 'undefined'."), Cannot_invoke_an_object_which_is_possibly_null_or_undefined: diag(2723, ts.DiagnosticCategory.Error, "Cannot_invoke_an_object_which_is_possibly_null_or_undefined_2723", "Cannot invoke an object which is possibly 'null' or 'undefined'."), + Module_0_has_no_exported_member_1_Did_you_mean_2: diag(2724, ts.DiagnosticCategory.Error, "Module_0_has_no_exported_member_1_Did_you_mean_2_2724", "Module '{0}' has no exported member '{1}'. Did you mean '{2}'?"), Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."), Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."), Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."), @@ -5451,7 +6072,7 @@ var ts; Exported_type_alias_0_has_or_is_using_private_name_1: diag(4081, ts.DiagnosticCategory.Error, "Exported_type_alias_0_has_or_is_using_private_name_1_4081", "Exported type alias '{0}' has or is using private name '{1}'."), Default_export_of_the_module_has_or_is_using_private_name_0: diag(4082, ts.DiagnosticCategory.Error, "Default_export_of_the_module_has_or_is_using_private_name_0_4082", "Default export of the module has or is using private name '{0}'."), Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: diag(4083, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1_4083", "Type parameter '{0}' of exported type alias has or is using private name '{1}'."), - Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, ts.DiagnosticCategory.Message, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."), + Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: diag(4090, ts.DiagnosticCategory.Error, "Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_librar_4090", "Conflicting definitions for '{0}' found at '{1}' and '{2}'. Consider installing a specific version of this library to resolve the conflict."), Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: diag(4091, ts.DiagnosticCategory.Error, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2_4091", "Parameter '{0}' of index signature from exported interface has or is using name '{1}' from private module '{2}'."), Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: diag(4092, ts.DiagnosticCategory.Error, "Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1_4092", "Parameter '{0}' of index signature from exported interface has or is using private name '{1}'."), Property_0_of_exported_class_expression_may_not_be_private_or_protected: diag(4094, ts.DiagnosticCategory.Error, "Property_0_of_exported_class_expression_may_not_be_private_or_protected_4094", "Property '{0}' of exported class expression may not be private or protected."), @@ -5624,7 +6245,7 @@ var ts; Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: diag(6144, ts.DiagnosticCategory.Message, "Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1_6144", "Module '{0}' was resolved as locally declared ambient module in file '{1}'."), Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: diag(6145, ts.DiagnosticCategory.Message, "Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified_6145", "Module '{0}' was resolved as ambient module declared in '{1}' since this file was not modified."), Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: diag(6146, ts.DiagnosticCategory.Message, "Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h_6146", "Specify the JSX factory function to use when targeting 'react' JSX emit, e.g. 'React.createElement' or 'h'."), - Resolution_for_module_0_was_found_in_cache: diag(6147, ts.DiagnosticCategory.Message, "Resolution_for_module_0_was_found_in_cache_6147", "Resolution for module '{0}' was found in cache."), + Resolution_for_module_0_was_found_in_cache_from_location_1: diag(6147, ts.DiagnosticCategory.Message, "Resolution_for_module_0_was_found_in_cache_from_location_1_6147", "Resolution for module '{0}' was found in cache from location '{1}'."), Directory_0_does_not_exist_skipping_all_lookups_in_it: diag(6148, ts.DiagnosticCategory.Message, "Directory_0_does_not_exist_skipping_all_lookups_in_it_6148", "Directory '{0}' does not exist, skipping all lookups in it."), Show_diagnostic_information: diag(6149, ts.DiagnosticCategory.Message, "Show_diagnostic_information_6149", "Show diagnostic information."), Show_verbose_diagnostic_information: diag(6150, ts.DiagnosticCategory.Message, "Show_verbose_diagnostic_information_6150", "Show verbose diagnostic information."), @@ -5668,6 +6289,8 @@ var ts; Numeric_separators_are_not_allowed_here: diag(6188, ts.DiagnosticCategory.Error, "Numeric_separators_are_not_allowed_here_6188", "Numeric separators are not allowed here."), Multiple_consecutive_numeric_separators_are_not_permitted: diag(6189, ts.DiagnosticCategory.Error, "Multiple_consecutive_numeric_separators_are_not_permitted_6189", "Multiple consecutive numeric separators are not permitted."), Found_package_json_at_0_Package_ID_is_1: diag(6190, ts.DiagnosticCategory.Message, "Found_package_json_at_0_Package_ID_is_1_6190", "Found 'package.json' at '{0}'. Package ID is '{1}'."), + Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: diag(6191, ts.DiagnosticCategory.Message, "Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen_6191", "Whether to keep outdated console output in watch mode instead of clearing the screen."), + All_imports_in_import_declaration_are_unused: diag(6192, ts.DiagnosticCategory.Error, "All_imports_in_import_declaration_are_unused_6192", "All imports in import declaration are unused."), Variable_0_implicitly_has_an_1_type: diag(7005, ts.DiagnosticCategory.Error, "Variable_0_implicitly_has_an_1_type_7005", "Variable '{0}' implicitly has an '{1}' type."), Parameter_0_implicitly_has_an_1_type: diag(7006, ts.DiagnosticCategory.Error, "Parameter_0_implicitly_has_an_1_type_7006", "Parameter '{0}' implicitly has an '{1}' type."), Member_0_implicitly_has_an_1_type: diag(7008, ts.DiagnosticCategory.Error, "Member_0_implicitly_has_an_1_type_7008", "Member '{0}' implicitly has an '{1}' type."), @@ -5727,6 +6350,7 @@ var ts; Expected_0_type_arguments_provide_these_with_an_extends_tag: diag(8026, ts.DiagnosticCategory.Error, "Expected_0_type_arguments_provide_these_with_an_extends_tag_8026", "Expected {0} type arguments; provide these with an '@extends' tag."), Expected_0_1_type_arguments_provide_these_with_an_extends_tag: diag(8027, ts.DiagnosticCategory.Error, "Expected_0_1_type_arguments_provide_these_with_an_extends_tag_8027", "Expected {0}-{1} type arguments; provide these with an '@extends' tag."), JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: diag(8028, ts.DiagnosticCategory.Error, "JSDoc_may_only_appear_in_the_last_parameter_of_a_signature_8028", "JSDoc '...' may only appear in the last parameter of a signature."), + JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: diag(8029, ts.DiagnosticCategory.Error, "JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_h_8029", "JSDoc '@param' tag has name '{0}', but there is no parameter with that name. It would match 'arguments' if it had an array type."), Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: diag(9002, ts.DiagnosticCategory.Error, "Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_clas_9002", "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause."), class_expressions_are_not_currently_supported: diag(9003, ts.DiagnosticCategory.Error, "class_expressions_are_not_currently_supported_9003", "'class' expressions are not currently supported."), Language_service_is_disabled: diag(9004, ts.DiagnosticCategory.Error, "Language_service_is_disabled_9004", "Language service is disabled."), @@ -5747,14 +6371,20 @@ var ts; JSX_fragment_has_no_corresponding_closing_tag: diag(17014, ts.DiagnosticCategory.Error, "JSX_fragment_has_no_corresponding_closing_tag_17014", "JSX fragment has no corresponding closing tag."), Expected_corresponding_closing_tag_for_JSX_fragment: diag(17015, ts.DiagnosticCategory.Error, "Expected_corresponding_closing_tag_for_JSX_fragment_17015", "Expected corresponding closing tag for JSX fragment."), JSX_fragment_is_not_supported_when_using_jsxFactory: diag(17016, ts.DiagnosticCategory.Error, "JSX_fragment_is_not_supported_when_using_jsxFactory_17016", "JSX fragment is not supported when using --jsxFactory"), + JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma: diag(17017, ts.DiagnosticCategory.Error, "JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma_17017", "JSX fragment is not supported when using an inline JSX factory pragma"), Circularity_detected_while_resolving_configuration_Colon_0: diag(18000, ts.DiagnosticCategory.Error, "Circularity_detected_while_resolving_configuration_Colon_0_18000", "Circularity detected while resolving configuration: {0}"), A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: diag(18001, ts.DiagnosticCategory.Error, "A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not_18001", "A path in an 'extends' option must be relative or rooted, but '{0}' is not."), The_files_list_in_config_file_0_is_empty: diag(18002, ts.DiagnosticCategory.Error, "The_files_list_in_config_file_0_is_empty_18002", "The 'files' list in config file '{0}' is empty."), No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: diag(18003, ts.DiagnosticCategory.Error, "No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2_18003", "No inputs were found in config file '{0}'. Specified 'include' paths were '{1}' and 'exclude' paths were '{2}'."), + File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module: diag(80001, ts.DiagnosticCategory.Suggestion, "File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module_80001", "File is a CommonJS module; it may be converted to an ES6 module."), + This_constructor_function_may_be_converted_to_a_class_declaration: diag(80002, ts.DiagnosticCategory.Suggestion, "This_constructor_function_may_be_converted_to_a_class_declaration_80002", "This constructor function may be converted to a class declaration."), + Import_may_be_converted_to_a_default_import: diag(80003, ts.DiagnosticCategory.Suggestion, "Import_may_be_converted_to_a_default_import_80003", "Import may be converted to a default import."), + JSDoc_types_may_be_moved_to_TypeScript_types: diag(80004, ts.DiagnosticCategory.Suggestion, "JSDoc_types_may_be_moved_to_TypeScript_types_80004", "JSDoc types may be moved to TypeScript types."), Add_missing_super_call: diag(90001, ts.DiagnosticCategory.Message, "Add_missing_super_call_90001", "Add missing 'super()' call"), Make_super_call_the_first_statement_in_the_constructor: diag(90002, ts.DiagnosticCategory.Message, "Make_super_call_the_first_statement_in_the_constructor_90002", "Make 'super()' call the first statement in the constructor"), Change_extends_to_implements: diag(90003, ts.DiagnosticCategory.Message, "Change_extends_to_implements_90003", "Change 'extends' to 'implements'"), Remove_declaration_for_Colon_0: diag(90004, ts.DiagnosticCategory.Message, "Remove_declaration_for_Colon_0_90004", "Remove declaration for: '{0}'"), + Remove_import_from_0: diag(90005, ts.DiagnosticCategory.Message, "Remove_import_from_0_90005", "Remove import from '{0}'"), Implement_interface_0: diag(90006, ts.DiagnosticCategory.Message, "Implement_interface_0_90006", "Implement interface '{0}'"), Implement_inherited_abstract_class: diag(90007, ts.DiagnosticCategory.Message, "Implement_inherited_abstract_class_90007", "Implement inherited abstract class"), Add_this_to_unresolved_variable: diag(90008, ts.DiagnosticCategory.Message, "Add_this_to_unresolved_variable_90008", "Add 'this.' to unresolved variable"), @@ -5791,6 +6421,9 @@ var ts; Replace_import_with_0: diag(95015, ts.DiagnosticCategory.Message, "Replace_import_with_0_95015", "Replace import with '{0}'."), Use_synthetic_default_member: diag(95016, ts.DiagnosticCategory.Message, "Use_synthetic_default_member_95016", "Use synthetic 'default' member."), Convert_to_ES6_module: diag(95017, ts.DiagnosticCategory.Message, "Convert_to_ES6_module_95017", "Convert to ES6 module"), + Add_undefined_type_to_property_0: diag(95018, ts.DiagnosticCategory.Message, "Add_undefined_type_to_property_0_95018", "Add 'undefined' type to property '{0}'"), + Add_initializer_to_property_0: diag(95019, ts.DiagnosticCategory.Message, "Add_initializer_to_property_0_95019", "Add initializer to property '{0}'"), + Add_definite_assignment_assertion_to_property_0: diag(95020, ts.DiagnosticCategory.Message, "Add_definite_assignment_assertion_to_property_0_95020", "Add definite assignment assertion to property '{0}'"), }; })(ts || (ts = {})); /// @@ -5831,47 +6464,48 @@ var ts; "false": 86 /* FalseKeyword */, "finally": 87 /* FinallyKeyword */, "for": 88 /* ForKeyword */, - "from": 141 /* FromKeyword */, + "from": 142 /* FromKeyword */, "function": 89 /* FunctionKeyword */, "get": 125 /* GetKeyword */, "if": 90 /* IfKeyword */, "implements": 108 /* ImplementsKeyword */, "import": 91 /* ImportKeyword */, "in": 92 /* InKeyword */, + "infer": 126 /* InferKeyword */, "instanceof": 93 /* InstanceOfKeyword */, "interface": 109 /* InterfaceKeyword */, - "is": 126 /* IsKeyword */, - "keyof": 127 /* KeyOfKeyword */, + "is": 127 /* IsKeyword */, + "keyof": 128 /* KeyOfKeyword */, "let": 110 /* LetKeyword */, - "module": 128 /* ModuleKeyword */, - "namespace": 129 /* NamespaceKeyword */, - "never": 130 /* NeverKeyword */, + "module": 129 /* ModuleKeyword */, + "namespace": 130 /* NamespaceKeyword */, + "never": 131 /* NeverKeyword */, "new": 94 /* NewKeyword */, "null": 95 /* NullKeyword */, - "number": 133 /* NumberKeyword */, - "object": 134 /* ObjectKeyword */, + "number": 134 /* NumberKeyword */, + "object": 135 /* ObjectKeyword */, "package": 111 /* PackageKeyword */, "private": 112 /* PrivateKeyword */, "protected": 113 /* ProtectedKeyword */, "public": 114 /* PublicKeyword */, - "readonly": 131 /* ReadonlyKeyword */, - "require": 132 /* RequireKeyword */, - "global": 142 /* GlobalKeyword */, + "readonly": 132 /* ReadonlyKeyword */, + "require": 133 /* RequireKeyword */, + "global": 143 /* GlobalKeyword */, "return": 96 /* ReturnKeyword */, - "set": 135 /* SetKeyword */, + "set": 136 /* SetKeyword */, "static": 115 /* StaticKeyword */, - "string": 136 /* StringKeyword */, + "string": 137 /* StringKeyword */, "super": 97 /* SuperKeyword */, "switch": 98 /* SwitchKeyword */, - "symbol": 137 /* SymbolKeyword */, + "symbol": 138 /* SymbolKeyword */, "this": 99 /* ThisKeyword */, "throw": 100 /* ThrowKeyword */, "true": 101 /* TrueKeyword */, "try": 102 /* TryKeyword */, - "type": 138 /* TypeKeyword */, + "type": 139 /* TypeKeyword */, "typeof": 103 /* TypeOfKeyword */, - "undefined": 139 /* UndefinedKeyword */, - "unique": 140 /* UniqueKeyword */, + "undefined": 140 /* UndefinedKeyword */, + "unique": 141 /* UniqueKeyword */, "var": 104 /* VarKeyword */, "void": 105 /* VoidKeyword */, "while": 106 /* WhileKeyword */, @@ -5879,7 +6513,7 @@ var ts; "yield": 116 /* YieldKeyword */, "async": 120 /* AsyncKeyword */, "await": 121 /* AwaitKeyword */, - "of": 143 /* OfKeyword */, + "of": 144 /* OfKeyword */, "{": 17 /* OpenBraceToken */, "}": 18 /* CloseBraceToken */, "(": 19 /* OpenParenToken */, @@ -6070,7 +6704,9 @@ var ts; ts.getPositionOfLineAndCharacter = getPositionOfLineAndCharacter; /* @internal */ function computePositionOfLineAndCharacter(lineStarts, line, character, debugText) { - ts.Debug.assert(line >= 0 && line < lineStarts.length); + if (line < 0 || line >= lineStarts.length) { + ts.Debug.fail("Bad line number. Line: " + line + ", lineStarts.length: " + lineStarts.length + " , line map is correct? " + (debugText !== undefined ? ts.arraysEqual(lineStarts, computeLineStarts(debugText)) : "unknown")); + } var res = lineStarts[line] + character; if (line < lineStarts.length - 1) { ts.Debug.assert(res < lineStarts[line + 1]); @@ -7816,7 +8452,7 @@ var ts; } } function getSourceFileOfNode(node) { - while (node && node.kind !== 269 /* SourceFile */) { + while (node && node.kind !== 272 /* SourceFile */) { node = node.parent; } return node; @@ -7824,11 +8460,11 @@ var ts; ts.getSourceFileOfNode = getSourceFileOfNode; function isStatementWithLocals(node) { switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return true; } return false; @@ -7937,7 +8573,7 @@ var ts; // the syntax list itself considers them as normal trivia. Therefore if we simply skip // trivia for the list, we may have skipped the JSDocComment as well. So we should process its // first child to determine the actual position of its first token. - if (node.kind === 290 /* SyntaxList */ && node._children.length > 0) { + if (node.kind === 293 /* SyntaxList */ && node._children.length > 0) { return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc); } return ts.skipTrivia((sourceFile || getSourceFileOfNode(node)).text, node.pos); @@ -7952,18 +8588,15 @@ var ts; ts.getNonDecoratorTokenPosOfNode = getNonDecoratorTokenPosOfNode; function getSourceTextOfNodeFromSourceFile(sourceFile, node, includeTrivia) { if (includeTrivia === void 0) { includeTrivia = false; } - if (nodeIsMissing(node)) { - return ""; - } - var text = sourceFile.text; - return text.substring(includeTrivia ? node.pos : ts.skipTrivia(text, node.pos), node.end); + return getTextOfNodeFromSourceText(sourceFile.text, node, includeTrivia); } ts.getSourceTextOfNodeFromSourceFile = getSourceTextOfNodeFromSourceFile; - function getTextOfNodeFromSourceText(sourceText, node) { + function getTextOfNodeFromSourceText(sourceText, node, includeTrivia) { + if (includeTrivia === void 0) { includeTrivia = false; } if (nodeIsMissing(node)) { return ""; } - return sourceText.substring(ts.skipTrivia(sourceText, node.pos), node.end); + return sourceText.substring(includeTrivia ? node.pos : ts.skipTrivia(sourceText, node.pos), node.end); } ts.getTextOfNodeFromSourceText = getTextOfNodeFromSourceText; function getTextOfNode(node, includeTrivia) { @@ -8054,12 +8687,11 @@ var ts; ts.isBlockOrCatchScoped = isBlockOrCatchScoped; function isCatchClauseVariableDeclarationOrBindingElement(declaration) { var node = getRootDeclaration(declaration); - return node.kind === 227 /* VariableDeclaration */ && node.parent.kind === 264 /* CatchClause */; + return node.kind === 230 /* VariableDeclaration */ && node.parent.kind === 267 /* CatchClause */; } ts.isCatchClauseVariableDeclarationOrBindingElement = isCatchClauseVariableDeclarationOrBindingElement; function isAmbientModule(node) { - return node && node.kind === 234 /* ModuleDeclaration */ && - (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); + return ts.isModuleDeclaration(node) && (node.name.kind === 9 /* StringLiteral */ || isGlobalScopeAugmentation(node)); } ts.isAmbientModule = isAmbientModule; function isModuleWithStringLiteralName(node) { @@ -8077,11 +8709,11 @@ var ts; ts.isShorthandAmbientModuleSymbol = isShorthandAmbientModuleSymbol; function isShorthandAmbientModule(node) { // The only kind of module that can be missing a body is a shorthand ambient module. - return node && node.kind === 234 /* ModuleDeclaration */ && (!node.body); + return node && node.kind === 237 /* ModuleDeclaration */ && (!node.body); } function isBlockScopedContainerTopLevel(node) { - return node.kind === 269 /* SourceFile */ || - node.kind === 234 /* ModuleDeclaration */ || + return node.kind === 272 /* SourceFile */ || + node.kind === 237 /* ModuleDeclaration */ || ts.isFunctionLike(node); } ts.isBlockScopedContainerTopLevel = isBlockScopedContainerTopLevel; @@ -8090,43 +8722,44 @@ var ts; } ts.isGlobalScopeAugmentation = isGlobalScopeAugmentation; function isExternalModuleAugmentation(node) { + return isAmbientModule(node) && isModuleAugmentationExternal(node); + } + ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + function isModuleAugmentationExternal(node) { // external module augmentation is a ambient module declaration that is either: // - defined in the top level scope and source file is an external module // - defined inside ambient module declaration located in the top level scope and source file not an external module - if (!node || !isAmbientModule(node)) { - return false; - } switch (node.parent.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node.parent); - case 235 /* ModuleBlock */: - return isAmbientModule(node.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); + case 238 /* ModuleBlock */: + return isAmbientModule(node.parent.parent) && ts.isSourceFile(node.parent.parent.parent) && !ts.isExternalModule(node.parent.parent.parent); } return false; } - ts.isExternalModuleAugmentation = isExternalModuleAugmentation; + ts.isModuleAugmentationExternal = isModuleAugmentationExternal; function isEffectiveExternalModule(node, compilerOptions) { return ts.isExternalModule(node) || compilerOptions.isolatedModules || ((ts.getEmitModuleKind(compilerOptions) === ts.ModuleKind.CommonJS) && !!node.commonJsModuleIndicator); } ts.isEffectiveExternalModule = isEffectiveExternalModule; function isBlockScope(node, parentNode) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 264 /* CatchClause */: - case 234 /* ModuleDeclaration */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 267 /* CatchClause */: + case 237 /* ModuleDeclaration */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; - case 208 /* Block */: + case 211 /* Block */: // function block is not considered block-scope container // see comment in binder.ts: bind(...), case for SyntaxKind.Block return parentNode && !ts.isFunctionLike(parentNode); @@ -8136,25 +8769,25 @@ var ts; ts.isBlockScope = isBlockScope; function isDeclarationWithTypeParameters(node) { switch (node.kind) { - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: ts.assertTypeIsNever(node); @@ -8164,8 +8797,8 @@ var ts; ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters; function isAnyImportSyntax(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: return true; default: return false; @@ -8202,21 +8835,20 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return escapeLeadingUnderscores(name.text); - case 145 /* ComputedPropertyName */: - if (isStringOrNumericLiteral(name.expression)) { - return escapeLeadingUnderscores(name.expression.text); - } + case 146 /* ComputedPropertyName */: + return isStringOrNumericLiteral(name.expression) ? escapeLeadingUnderscores(name.expression.text) : undefined; + default: + ts.Debug.assertNever(name); } - return undefined; } ts.getTextOfPropertyName = getTextOfPropertyName; function entityNameToString(name) { switch (name.kind) { case 71 /* Identifier */: return getFullWidth(name) === 0 ? ts.idText(name) : getTextOfNode(name); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return entityNameToString(name.left) + "." + entityNameToString(name.right); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return entityNameToString(name.expression) + "." + entityNameToString(name.name); } } @@ -8226,11 +8858,21 @@ var ts; return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNode = createDiagnosticForNode; + function createDiagnosticForNodeArray(sourceFile, nodes, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, nodes.pos); + return ts.createFileDiagnostic(sourceFile, start, nodes.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeArray = createDiagnosticForNodeArray; function createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3) { var span = getErrorSpanForNode(sourceFile, node); return ts.createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3); } ts.createDiagnosticForNodeInSourceFile = createDiagnosticForNodeInSourceFile; + function createDiagnosticForNodeSpan(sourceFile, startNode, endNode, message, arg0, arg1, arg2, arg3) { + var start = ts.skipTrivia(sourceFile.text, startNode.pos); + return ts.createFileDiagnostic(sourceFile, start, endNode.end - start, message, arg0, arg1, arg2, arg3); + } + ts.createDiagnosticForNodeSpan = createDiagnosticForNodeSpan; function createDiagnosticForNodeFromMessageChain(node, messageChain) { var sourceFile = getSourceFileOfNode(node); var span = getErrorSpanForNode(sourceFile, node); @@ -8253,7 +8895,7 @@ var ts; ts.getSpanOfTokenAtPosition = getSpanOfTokenAtPosition; function getErrorSpanForArrowFunction(sourceFile, node) { var pos = ts.skipTrivia(sourceFile.text, node.pos); - if (node.body && node.body.kind === 208 /* Block */) { + if (node.body && node.body.kind === 211 /* Block */) { var startLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.pos).line; var endLine = ts.getLineAndCharacterOfPosition(sourceFile, node.body.end).line; if (startLine < endLine) { @@ -8267,7 +8909,7 @@ var ts; function getErrorSpanForNode(sourceFile, node) { var errorNode = node; switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var pos_1 = ts.skipTrivia(sourceFile.text, 0, /*stopAfterLineBreak*/ false); if (pos_1 === sourceFile.text.length) { // file is empty - return span for the beginning of the file @@ -8276,23 +8918,23 @@ var ts; return getSpanOfTokenAtPosition(sourceFile, pos_1); // This list is a work in progress. Add missing node kinds to improve their error // spans. - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 232 /* TypeAliasDeclaration */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: errorNode = node.name; break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return getErrorSpanForArrowFunction(sourceFile, node); } if (errorNode === undefined) { @@ -8300,9 +8942,19 @@ var ts; // construct. return getSpanOfTokenAtPosition(sourceFile, node.pos); } - var pos = nodeIsMissing(errorNode) + var isMissing = nodeIsMissing(errorNode); + var pos = isMissing ? errorNode.pos : ts.skipTrivia(sourceFile.text, errorNode.pos); + // These asserts should all be satisfied for a properly constructed `errorNode`. + if (isMissing) { + ts.Debug.assert(pos === errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos === errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } + else { + ts.Debug.assert(pos >= errorNode.pos, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + ts.Debug.assert(pos <= errorNode.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + } return ts.createTextSpanFromBounds(pos, errorNode.end); } ts.getErrorSpanForNode = getErrorSpanForNode; @@ -8311,7 +8963,7 @@ var ts; } ts.isExternalOrCommonJsModule = isExternalOrCommonJsModule; function isConstEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */ && isConst(node); + return node.kind === 236 /* EnumDeclaration */ && isConst(node); } ts.isConstEnumDeclaration = isConstEnumDeclaration; function isConst(node) { @@ -8324,15 +8976,15 @@ var ts; } ts.isLet = isLet; function isSuperCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 97 /* SuperKeyword */; } ts.isSuperCall = isSuperCall; function isImportCall(n) { - return n.kind === 182 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; + return n.kind === 185 /* CallExpression */ && n.expression.kind === 91 /* ImportKeyword */; } ts.isImportCall = isImportCall; function isPrologueDirective(node) { - return node.kind === 211 /* ExpressionStatement */ + return node.kind === 214 /* ExpressionStatement */ && node.expression.kind === 9 /* StringLiteral */; } ts.isPrologueDirective = isPrologueDirective; @@ -8341,11 +8993,11 @@ var ts; } ts.getLeadingCommentRangesOfNode = getLeadingCommentRangesOfNode; function getJSDocCommentRanges(node, text) { - var commentRanges = (node.kind === 147 /* Parameter */ || - node.kind === 146 /* TypeParameter */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 188 /* ArrowFunction */ || - node.kind === 186 /* ParenthesizedExpression */) ? + var commentRanges = (node.kind === 148 /* Parameter */ || + node.kind === 147 /* TypeParameter */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 191 /* ArrowFunction */ || + node.kind === 189 /* ParenthesizedExpression */) ? ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) : ts.getLeadingCommentRanges(text, node.pos); // True if the comment starts with '/**' but not if it is '/**/' @@ -8361,40 +9013,42 @@ var ts; ts.fullTripleSlashAMDReferencePathRegEx = /^(\/\/\/\s*/; var defaultLibReferenceRegEx = /^(\/\/\/\s*/; function isPartOfTypeNode(node) { - if (159 /* FirstTypeNode */ <= node.kind && node.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= node.kind && node.kind <= 177 /* LastTypeNode */) { return true; } switch (node.kind) { case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: + case 138 /* SymbolKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: return true; case 105 /* VoidKeyword */: - return node.parent.kind !== 191 /* VoidExpression */; - case 202 /* ExpressionWithTypeArguments */: + return node.parent.kind !== 194 /* VoidExpression */; + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(node); + case 147 /* TypeParameter */: + return node.parent.kind === 176 /* MappedType */ || node.parent.kind === 171 /* InferType */; // Identifiers and qualified names may be type nodes, depending on their context. Climb // above them to find the lowest container case 71 /* Identifier */: // If the identifier is the RHS of a qualified name, then it's a type iff its parent is. - if (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) { + if (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) { node = node.parent; } - else if (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node) { + else if (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node) { node = node.parent; } // At this point, node is either a qualified name or an identifier - ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */ || node.kind === 180 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); + ts.Debug.assert(node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */ || node.kind === 183 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'."); // falls through - case 144 /* QualifiedName */: - case 180 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: var parent = node.parent; - if (parent.kind === 163 /* TypeQuery */) { + if (parent.kind === 164 /* TypeQuery */) { return false; } // Do not recursively call isPartOfTypeNode on the parent. In the example: @@ -8403,38 +9057,38 @@ var ts; // // Calling isPartOfTypeNode would consider the qualified name A.B a type node. // Only C and A.B.C are type nodes. - if (159 /* FirstTypeNode */ <= parent.kind && parent.kind <= 174 /* LastTypeNode */) { + if (160 /* FirstTypeNode */ <= parent.kind && parent.kind <= 177 /* LastTypeNode */) { return true; } switch (parent.kind) { - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !isExpressionWithTypeArgumentsInClassExtendsClause(parent); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return node === parent.constraint; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: return node === parent.type; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node === parent.type; - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return node === parent.type; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return node === parent.type; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return ts.contains(parent.typeArguments, node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: // TODO (drosen): TaggedTemplateExpressions may eventually support type arguments. return false; } @@ -8458,23 +9112,23 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitor(node); - case 236 /* CaseBlock */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 223 /* LabeledStatement */: - case 225 /* TryStatement */: - case 264 /* CatchClause */: + case 239 /* CaseBlock */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: return ts.forEachChild(node, traverse); } } @@ -8484,30 +9138,29 @@ var ts; return traverse(body); function traverse(node) { switch (node.kind) { - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: visitor(node); var operand = node.expression; if (operand) { traverse(operand); } return; - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // These are not allowed inside a generator now, but eventually they may be allowed // as local types. Regardless, any yield statements contained within them should be // skipped in this traversal. return; default: if (ts.isFunctionLike(node)) { - var name = node.name; - if (name && name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // Note that we will not include methods/accessors of a class because they would require // first descending into the class. This is by design. - traverse(name.expression); + traverse(node.name.expression); return; } } @@ -8527,10 +9180,10 @@ var ts; * @param node The type node. */ function getRestParameterElementType(node) { - if (node && node.kind === 165 /* ArrayType */) { + if (node && node.kind === 166 /* ArrayType */) { return node.elementType; } - else if (node && node.kind === 160 /* TypeReference */) { + else if (node && node.kind === 161 /* TypeReference */) { return ts.singleOrUndefined(node.typeArguments); } else { @@ -8540,12 +9193,12 @@ var ts; ts.getRestParameterElementType = getRestParameterElementType; function getMembersOfDeclaration(node) { switch (node.kind) { - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 164 /* TypeLiteral */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 165 /* TypeLiteral */: return node.members; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.properties; } } @@ -8553,14 +9206,14 @@ var ts; function isVariableLike(node) { if (node) { switch (node.kind) { - case 177 /* BindingElement */: - case 268 /* EnumMember */: - case 147 /* Parameter */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 266 /* ShorthandPropertyAssignment */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 271 /* EnumMember */: + case 148 /* Parameter */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 269 /* ShorthandPropertyAssignment */: + case 230 /* VariableDeclaration */: return true; } } @@ -8568,8 +9221,8 @@ var ts; } ts.isVariableLike = isVariableLike; function isVariableDeclarationInVariableStatement(node) { - return node.parent.kind === 228 /* VariableDeclarationList */ - && node.parent.parent.kind === 209 /* VariableStatement */; + return node.parent.kind === 231 /* VariableDeclarationList */ + && node.parent.parent.kind === 212 /* VariableStatement */; } ts.isVariableDeclarationInVariableStatement = isVariableDeclarationInVariableStatement; function isValidESSymbolDeclaration(node) { @@ -8580,13 +9233,13 @@ var ts; ts.isValidESSymbolDeclaration = isValidESSymbolDeclaration; function introducesArgumentsExoticObject(node) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return true; } return false; @@ -8597,7 +9250,7 @@ var ts; if (beforeUnwrapLabelCallback) { beforeUnwrapLabelCallback(node); } - if (node.statement.kind !== 223 /* LabeledStatement */) { + if (node.statement.kind !== 226 /* LabeledStatement */) { return node.statement; } node = node.statement; @@ -8605,17 +9258,17 @@ var ts; } ts.unwrapInnermostStatementOfLabel = unwrapInnermostStatementOfLabel; function isFunctionBlock(node) { - return node && node.kind === 208 /* Block */ && ts.isFunctionLike(node.parent); + return node && node.kind === 211 /* Block */ && ts.isFunctionLike(node.parent); } ts.isFunctionBlock = isFunctionBlock; function isObjectLiteralMethod(node) { - return node && node.kind === 152 /* MethodDeclaration */ && node.parent.kind === 179 /* ObjectLiteralExpression */; + return node && node.kind === 153 /* MethodDeclaration */ && node.parent.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralMethod = isObjectLiteralMethod; function isObjectLiteralOrClassExpressionMethod(node) { - return node.kind === 152 /* MethodDeclaration */ && - (node.parent.kind === 179 /* ObjectLiteralExpression */ || - node.parent.kind === 200 /* ClassExpression */); + return node.kind === 153 /* MethodDeclaration */ && + (node.parent.kind === 182 /* ObjectLiteralExpression */ || + node.parent.kind === 203 /* ClassExpression */); } ts.isObjectLiteralOrClassExpressionMethod = isObjectLiteralOrClassExpressionMethod; function isIdentifierTypePredicate(predicate) { @@ -8628,7 +9281,7 @@ var ts; ts.isThisTypePredicate = isThisTypePredicate; function getPropertyAssignment(objectLiteral, key, key2) { return ts.filter(objectLiteral.properties, function (property) { - if (property.kind === 265 /* PropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */) { var propName = getTextOfPropertyName(property.name); return key === propName || (key2 && key2 === propName); } @@ -8650,7 +9303,7 @@ var ts; return undefined; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // If the grandparent node is an object literal (as opposed to a class), // then the computed property is not a 'this' container. // A computed property name in a class needs to be a this container @@ -8665,9 +9318,9 @@ var ts; // the *body* of the container. node = node.parent; break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8678,26 +9331,26 @@ var ts; node = node.parent; } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (!includeArrowFunctions) { continue; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 234 /* ModuleDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 233 /* EnumDeclaration */: - case 269 /* SourceFile */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 237 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 236 /* EnumDeclaration */: + case 272 /* SourceFile */: return node; } } @@ -8707,9 +9360,9 @@ var ts; var container = getThisContainer(node, /*includeArrowFunctions*/ false); if (container) { switch (container.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return container; } } @@ -8731,27 +9384,27 @@ var ts; return node; } switch (node.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: node = node.parent; break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!stopOnFunctions) { continue; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return node; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are always applied outside of the body of a class or method. - if (node.parent.kind === 147 /* Parameter */ && ts.isClassElement(node.parent.parent)) { + if (node.parent.kind === 148 /* Parameter */ && ts.isClassElement(node.parent.parent)) { // If the decorator's parent is a Parameter, we resolve the this container from // the grandparent class declaration. node = node.parent.parent; @@ -8767,14 +9420,14 @@ var ts; } ts.getSuperContainer = getSuperContainer; function getImmediatelyInvokedFunctionExpression(func) { - if (func.kind === 187 /* FunctionExpression */ || func.kind === 188 /* ArrowFunction */) { + if (func.kind === 190 /* FunctionExpression */ || func.kind === 191 /* ArrowFunction */) { var prev = func; var parent = func.parent; - while (parent.kind === 186 /* ParenthesizedExpression */) { + while (parent.kind === 189 /* ParenthesizedExpression */) { prev = parent; parent = parent.parent; } - if (parent.kind === 182 /* CallExpression */ && parent.expression === prev) { + if (parent.kind === 185 /* CallExpression */ && parent.expression === prev) { return parent; } } @@ -8785,7 +9438,7 @@ var ts; */ function isSuperProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 97 /* SuperKeyword */; } ts.isSuperProperty = isSuperProperty; @@ -8794,57 +9447,58 @@ var ts; */ function isThisProperty(node) { var kind = node.kind; - return (kind === 180 /* PropertyAccessExpression */ || kind === 181 /* ElementAccessExpression */) + return (kind === 183 /* PropertyAccessExpression */ || kind === 184 /* ElementAccessExpression */) && node.expression.kind === 99 /* ThisKeyword */; } ts.isThisProperty = isThisProperty; function getEntityNameFromTypeNode(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return isEntityNameExpression(node.expression) ? node.expression : undefined; case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return node; } return undefined; } ts.getEntityNameFromTypeNode = getEntityNameFromTypeNode; function getInvokedExpression(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { - return node.tag; + switch (node.kind) { + case 187 /* TaggedTemplateExpression */: + return node.tag; + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + return node.tagName; + default: + return node.expression; } - else if (ts.isJsxOpeningLikeElement(node)) { - return node.tagName; - } - // Will either be a CallExpression, NewExpression, or Decorator. - return node.expression; } ts.getInvokedExpression = getInvokedExpression; function nodeCanBeDecorated(node, parent, grandparent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // classes are valid targets return true; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // property declarations are valid if their parent is a class declaration. - return parent.kind === 230 /* ClassDeclaration */; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + return parent.kind === 233 /* ClassDeclaration */; + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // if this method has a body and its parent is a class declaration, this is a valid target. return node.body !== undefined - && parent.kind === 230 /* ClassDeclaration */; - case 147 /* Parameter */: + && parent.kind === 233 /* ClassDeclaration */; + case 148 /* Parameter */: // if the parameter's parent has a body and its grandparent is a class declaration, this is a valid target; return parent.body !== undefined - && (parent.kind === 153 /* Constructor */ - || parent.kind === 152 /* MethodDeclaration */ - || parent.kind === 155 /* SetAccessor */) - && grandparent.kind === 230 /* ClassDeclaration */; + && (parent.kind === 154 /* Constructor */ + || parent.kind === 153 /* MethodDeclaration */ + || parent.kind === 156 /* SetAccessor */) + && grandparent.kind === 233 /* ClassDeclaration */; } return false; } @@ -8860,19 +9514,19 @@ var ts; ts.nodeOrChildIsDecorated = nodeOrChildIsDecorated; function childIsDecorated(node, parent) { switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.forEach(node.members, function (m) { return nodeOrChildIsDecorated(m, node, parent); }); - case 152 /* MethodDeclaration */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 156 /* SetAccessor */: return ts.forEach(node.parameters, function (p) { return nodeIsDecorated(p, node, parent); }); } } ts.childIsDecorated = childIsDecorated; function isJSXTagName(node) { var parent = node.parent; - if (parent.kind === 252 /* JsxOpeningElement */ || - parent.kind === 251 /* JsxSelfClosingElement */ || - parent.kind === 253 /* JsxClosingElement */) { + if (parent.kind === 255 /* JsxOpeningElement */ || + parent.kind === 254 /* JsxSelfClosingElement */ || + parent.kind === 256 /* JsxClosingElement */) { return parent.tagName === node; } return false; @@ -8885,45 +9539,45 @@ var ts; case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 12 /* RegularExpressionLiteral */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 203 /* AsExpression */: - case 185 /* TypeAssertionExpression */: - case 204 /* NonNullExpression */: - case 186 /* ParenthesizedExpression */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 191 /* VoidExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 199 /* SpreadElement */: - case 197 /* TemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 206 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 207 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 194 /* VoidExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 202 /* SpreadElement */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: - case 201 /* OmittedExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 198 /* YieldExpression */: - case 192 /* AwaitExpression */: - case 205 /* MetaProperty */: + case 204 /* OmittedExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 201 /* YieldExpression */: + case 195 /* AwaitExpression */: + case 208 /* MetaProperty */: return true; - case 144 /* QualifiedName */: - while (node.parent.kind === 144 /* QualifiedName */) { + case 145 /* QualifiedName */: + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node); + return node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node); case 71 /* Identifier */: - if (node.parent.kind === 163 /* TypeQuery */ || isJSXTagName(node)) { + if (node.parent.kind === 164 /* TypeQuery */ || isJSXTagName(node)) { return true; } // falls through @@ -8939,47 +9593,47 @@ var ts; function isInExpressionContext(node) { var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 180 /* BindingElement */: return parent.initializer === node; - case 211 /* ExpressionStatement */: - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 220 /* ReturnStatement */: - case 221 /* WithStatement */: - case 222 /* SwitchStatement */: - case 261 /* CaseClause */: - case 224 /* ThrowStatement */: + case 214 /* ExpressionStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 223 /* ReturnStatement */: + case 224 /* WithStatement */: + case 225 /* SwitchStatement */: + case 264 /* CaseClause */: + case 227 /* ThrowStatement */: return parent.expression === node; - case 215 /* ForStatement */: + case 218 /* ForStatement */: var forStatement = parent; - return (forStatement.initializer === node && forStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forStatement.initializer === node && forStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forStatement.condition === node || forStatement.incrementor === node; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var forInStatement = parent; - return (forInStatement.initializer === node && forInStatement.initializer.kind !== 228 /* VariableDeclarationList */) || + return (forInStatement.initializer === node && forInStatement.initializer.kind !== 231 /* VariableDeclarationList */) || forInStatement.expression === node; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return node === parent.expression; - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return node === parent.expression; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return node === parent.expression; - case 148 /* Decorator */: - case 260 /* JsxExpression */: - case 259 /* JsxSpreadAttribute */: - case 267 /* SpreadAssignment */: + case 149 /* Decorator */: + case 263 /* JsxExpression */: + case 262 /* JsxSpreadAttribute */: + case 270 /* SpreadAssignment */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return parent.expression === node && isExpressionWithTypeArgumentsInClassExtendsClause(parent); default: return isExpressionNode(parent); @@ -8987,7 +9641,7 @@ var ts; } ts.isInExpressionContext = isInExpressionContext; function isExternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleImportEqualsDeclaration = isExternalModuleImportEqualsDeclaration; function getExternalModuleImportEqualsDeclarationExpression(node) { @@ -8996,7 +9650,7 @@ var ts; } ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression; function isInternalModuleImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 249 /* ExternalModuleReference */; + return node.kind === 241 /* ImportEqualsDeclaration */ && node.moduleReference.kind !== 252 /* ExternalModuleReference */; } ts.isInternalModuleImportEqualsDeclaration = isInternalModuleImportEqualsDeclaration; function isSourceFileJavaScript(file) { @@ -9016,11 +9670,11 @@ var ts; ts.isIdentifier(node.typeName) && node.typeName.escapedText === "Object" && node.typeArguments && node.typeArguments.length === 2 && - (node.typeArguments[0].kind === 136 /* StringKeyword */ || node.typeArguments[0].kind === 133 /* NumberKeyword */); + (node.typeArguments[0].kind === 137 /* StringKeyword */ || node.typeArguments[0].kind === 134 /* NumberKeyword */); } ts.isJSDocIndexSignature = isJSDocIndexSignature; function isRequireCall(callExpression, checkArgumentIsStringLiteral) { - if (callExpression.kind !== 182 /* CallExpression */) { + if (callExpression.kind !== 185 /* CallExpression */) { return false; } var _a = callExpression, expression = _a.expression, args = _a.arguments; @@ -9043,17 +9697,117 @@ var ts; } ts.isStringDoubleQuoted = isStringDoubleQuoted; /** - * Returns true if the node is a variable declaration whose initializer is a function or class expression. - * This function does not test if the node is in a JavaScript file or not. + * Given the symbol of a declaration, find the symbol of its Javascript container-like initializer, + * if it has one. Otherwise just return the original symbol. + * + * Container-like initializer behave like namespaces, so the binder needs to add contained symbols + * to their exports. An example is a function with assignments to `this` inside. */ - function isDeclarationOfFunctionOrClassExpression(s) { - if (s.valueDeclaration && s.valueDeclaration.kind === 227 /* VariableDeclaration */) { - var declaration = s.valueDeclaration; - return declaration.initializer && (declaration.initializer.kind === 187 /* FunctionExpression */ || declaration.initializer.kind === 200 /* ClassExpression */); + function getJSInitializerSymbol(symbol) { + if (!symbol || !symbol.valueDeclaration) { + return symbol; + } + var declaration = symbol.valueDeclaration; + var e = getDeclaredJavascriptInitializer(declaration) || getAssignedJavascriptInitializer(declaration); + return e && e.symbol ? e.symbol : symbol; + } + ts.getJSInitializerSymbol = getJSInitializerSymbol; + /** Get the declaration initializer, when the initializer is container-like (See getJavascriptInitializer) */ + function getDeclaredJavascriptInitializer(node) { + if (node && ts.isVariableDeclaration(node) && node.initializer) { + return getJavascriptInitializer(node.initializer, /*isPrototypeAssignment*/ false) || + ts.isIdentifier(node.name) && getDefaultedJavascriptInitializer(node.name, node.initializer, /*isPrototypeAssignment*/ false); + } + } + ts.getDeclaredJavascriptInitializer = getDeclaredJavascriptInitializer; + /** + * Get the assignment 'initializer' -- the righthand side-- when the initializer is container-like (See getJavascriptInitializer). + * We treat the right hand side of assignments with container-like initalizers as declarations. + */ + function getAssignedJavascriptInitializer(node) { + if (node && node.parent && ts.isBinaryExpression(node.parent) && node.parent.operatorToken.kind === 58 /* EqualsToken */) { + var isPrototypeAssignment = ts.isPropertyAccessExpression(node.parent.left) && node.parent.left.name.escapedText === "prototype"; + return getJavascriptInitializer(node.parent.right, isPrototypeAssignment) || + getDefaultedJavascriptInitializer(node.parent.left, node.parent.right, isPrototypeAssignment); + } + } + ts.getAssignedJavascriptInitializer = getAssignedJavascriptInitializer; + /** + * Recognized Javascript container-like initializers are: + * 1. (function() {})() -- IIFEs + * 2. function() { } -- Function expressions + * 3. class { } -- Class expressions + * 4. {} -- Empty object literals + * 5. { ... } -- Non-empty object literals, when used to initialize a prototype, like `C.prototype = { m() { } }` + * + * This function returns the provided initializer, or undefined if it is not valid. + */ + function getJavascriptInitializer(initializer, isPrototypeAssignment) { + if (ts.isCallExpression(initializer)) { + var e = skipParentheses(initializer.expression); + return e.kind === 190 /* FunctionExpression */ || e.kind === 191 /* ArrowFunction */ ? initializer : undefined; + } + if (initializer.kind === 190 /* FunctionExpression */ || initializer.kind === 203 /* ClassExpression */) { + return initializer; + } + if (ts.isObjectLiteralExpression(initializer) && (initializer.properties.length === 0 || isPrototypeAssignment)) { + return initializer; + } + } + ts.getJavascriptInitializer = getJavascriptInitializer; + /** + * A defaulted Javascript initializer matches the pattern + * `Lhs = Lhs || JavascriptInitializer` + * or `var Lhs = Lhs || JavascriptInitializer` + * + * The second Lhs is required to be the same as the first except that it may be prefixed with + * 'window.', 'global.' or 'self.' The second Lhs is otherwise ignored by the binder and checker. + */ + function getDefaultedJavascriptInitializer(name, initializer, isPrototypeAssignment) { + var e = ts.isBinaryExpression(initializer) && initializer.operatorToken.kind === 54 /* BarBarToken */ && getJavascriptInitializer(initializer.right, isPrototypeAssignment); + if (e && isSameEntityName(name, initializer.left)) { + return e; + } + } + /** Given a Javascript initializer, return the outer name. That is, the lhs of the assignment or the declaration name. */ + function getOuterNameOfJsInitializer(node) { + if (ts.isBinaryExpression(node.parent)) { + var parent = (node.parent.operatorToken.kind === 54 /* BarBarToken */ && ts.isBinaryExpression(node.parent.parent)) ? node.parent.parent : node.parent; + if (parent.operatorToken.kind === 58 /* EqualsToken */ && ts.isIdentifier(parent.left)) { + return parent.left; + } + } + else if (ts.isVariableDeclaration(node.parent)) { + return node.parent.name; + } + } + ts.getOuterNameOfJsInitializer = getOuterNameOfJsInitializer; + /** + * Is the 'declared' name the same as the one in the initializer? + * @return true for identical entity names, as well as ones where the initializer is prefixed with + * 'window', 'self' or 'global'. For example: + * + * var my = my || {} + * var min = window.min || {} + * my.app = self.my.app || class { } + */ + function isSameEntityName(name, initializer) { + if (ts.isIdentifier(name) && ts.isIdentifier(initializer)) { + return name.escapedText === initializer.escapedText; + } + if (ts.isIdentifier(name) && ts.isPropertyAccessExpression(initializer)) { + return (initializer.expression.kind === 99 /* ThisKeyword */ || + ts.isIdentifier(initializer.expression) && + (initializer.expression.escapedText === "window" || + initializer.expression.escapedText === "self" || + initializer.expression.escapedText === "global")) && + isSameEntityName(name, initializer.name); + } + if (ts.isPropertyAccessExpression(name) && ts.isPropertyAccessExpression(initializer)) { + return name.name.escapedText === initializer.name.escapedText && isSameEntityName(name.expression, initializer.expression); } return false; } - ts.isDeclarationOfFunctionOrClassExpression = isDeclarationOfFunctionOrClassExpression; function getRightMostAssignedExpression(node) { while (isAssignmentExpression(node, /*excludeCompoundAssignements*/ true)) { node = node.right; @@ -9072,65 +9826,62 @@ var ts; /// Given a BinaryExpression, returns SpecialPropertyAssignmentKind for the various kinds of property /// assignments we treat as special in the binder function getSpecialPropertyAssignmentKind(expr) { - if (!isInJavaScriptFile(expr)) { - return 0 /* None */; - } - if (expr.operatorToken.kind !== 58 /* EqualsToken */ || expr.left.kind !== 180 /* PropertyAccessExpression */) { + if (!isInJavaScriptFile(expr) || + expr.operatorToken.kind !== 58 /* EqualsToken */ || + !ts.isPropertyAccessExpression(expr.left)) { return 0 /* None */; } var lhs = expr.left; - if (lhs.expression.kind === 71 /* Identifier */) { - var lhsId = lhs.expression; - if (lhsId.escapedText === "exports") { - // exports.name = expr - return 1 /* ExportsProperty */; - } - else if (lhsId.escapedText === "module" && lhs.name.escapedText === "exports") { - // module.exports = expr - return 2 /* ModuleExports */; - } - else { - // F.x = expr - return 5 /* Property */; - } - } - else if (lhs.expression.kind === 99 /* ThisKeyword */) { + if (lhs.expression.kind === 99 /* ThisKeyword */) { return 4 /* ThisProperty */; } - else if (lhs.expression.kind === 180 /* PropertyAccessExpression */) { - // chained dot, e.g. x.y.z = expr; this var is the 'x.y' part - var innerPropertyAccess = lhs.expression; - if (innerPropertyAccess.expression.kind === 71 /* Identifier */) { - // module.exports.name = expr - var innerPropertyAccessIdentifier = innerPropertyAccess.expression; - if (innerPropertyAccessIdentifier.escapedText === "module" && innerPropertyAccess.name.escapedText === "exports") { - return 1 /* ExportsProperty */; - } - if (innerPropertyAccess.name.escapedText === "prototype") { - return 3 /* PrototypeProperty */; - } + else if (ts.isIdentifier(lhs.expression) && lhs.expression.escapedText === "module" && lhs.name.escapedText === "exports") { + // module.exports = expr + return 2 /* ModuleExports */; + } + else if (isEntityNameExpression(lhs.expression)) { + if (lhs.name.escapedText === "prototype" && ts.isObjectLiteralExpression(expr.right)) { + // F.prototype = { ... } + return 6 /* Prototype */; } + else if (ts.isPropertyAccessExpression(lhs.expression) && lhs.expression.name.escapedText === "prototype") { + // F.G....prototype.x = expr + return 3 /* PrototypeProperty */; + } + var nextToLast = lhs; + while (ts.isPropertyAccessExpression(nextToLast.expression)) { + nextToLast = nextToLast.expression; + } + ts.Debug.assert(ts.isIdentifier(nextToLast.expression)); + var id = nextToLast.expression; + if (id.escapedText === "exports" || + id.escapedText === "module" && nextToLast.name.escapedText === "exports") { + // exports.name = expr OR module.exports.name = expr + return 1 /* ExportsProperty */; + } + // F.G...x = expr + return 5 /* Property */; } return 0 /* None */; } ts.getSpecialPropertyAssignmentKind = getSpecialPropertyAssignmentKind; function isSpecialPropertyDeclaration(expr) { return isInJavaScriptFile(expr) && - expr.parent && expr.parent.kind === 211 /* ExpressionStatement */ && + expr.parent && expr.parent.kind === 214 /* ExpressionStatement */ && !!ts.getJSDocTypeTag(expr.parent); } ts.isSpecialPropertyDeclaration = isSpecialPropertyDeclaration; function getExternalModuleName(node) { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { return node.moduleSpecifier; } - if (node.kind === 238 /* ImportEqualsDeclaration */) { + if (node.kind === 241 /* ImportEqualsDeclaration */) { var reference = node.moduleReference; - if (reference.kind === 249 /* ExternalModuleReference */) { + if (reference.kind === 252 /* ExternalModuleReference */) { return reference.expression; } } - if (node.kind === 245 /* ExportDeclaration */) { + if (node.kind === 248 /* ExportDeclaration */) { return node.moduleSpecifier; } if (isModuleWithStringLiteralName(node)) { @@ -9139,31 +9890,32 @@ var ts; } ts.getExternalModuleName = getExternalModuleName; function getNamespaceDeclarationNode(node) { - if (node.kind === 238 /* ImportEqualsDeclaration */) { - return node; - } - var importClause = node.importClause; - if (importClause && importClause.namedBindings && importClause.namedBindings.kind === 241 /* NamespaceImport */) { - return importClause.namedBindings; + switch (node.kind) { + case 242 /* ImportDeclaration */: + return node.importClause && ts.tryCast(node.importClause.namedBindings, ts.isNamespaceImport); + case 241 /* ImportEqualsDeclaration */: + return node; + case 248 /* ExportDeclaration */: + return undefined; + default: + return ts.Debug.assertNever(node); } } ts.getNamespaceDeclarationNode = getNamespaceDeclarationNode; function isDefaultImport(node) { - return node.kind === 239 /* ImportDeclaration */ - && node.importClause - && !!node.importClause.name; + return node.kind === 242 /* ImportDeclaration */ && node.importClause && !!node.importClause.name; } ts.isDefaultImport = isDefaultImport; function hasQuestionToken(node) { if (node) { switch (node.kind) { - case 147 /* Parameter */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 266 /* ShorthandPropertyAssignment */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 269 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return node.questionToken !== undefined; } } @@ -9171,7 +9923,7 @@ var ts; } ts.hasQuestionToken = hasQuestionToken; function isJSDocConstructSignature(node) { - return node.kind === 277 /* JSDocFunctionType */ && + return node.kind === 280 /* JSDocFunctionType */ && node.parameters.length > 0 && node.parameters[0].name && node.parameters[0].name.escapedText === "new"; @@ -9183,22 +9935,32 @@ var ts; node.expression.operatorToken.kind === 58 /* EqualsToken */ && node.expression.right; } - function getSingleInitializerOfVariableStatement(node, child) { - return ts.isVariableStatement(node) && - node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0].initializer === child) && - node.declarationList.declarations[0].initializer; + function getSourceOfDefaultedAssignment(node) { + return ts.isExpressionStatement(node) && + ts.isBinaryExpression(node.expression) && + getSpecialPropertyAssignmentKind(node.expression) !== 0 /* None */ && + ts.isBinaryExpression(node.expression.right) && + node.expression.right.operatorToken.kind === 54 /* BarBarToken */ && + node.expression.right.right; } - function getSingleVariableOfVariableStatement(node, child) { + function getSingleInitializerOfVariableStatementOrPropertyDeclaration(node) { + switch (node.kind) { + case 212 /* VariableStatement */: + var v = getSingleVariableOfVariableStatement(node); + return v && v.initializer; + case 151 /* PropertyDeclaration */: + return node.initializer; + } + } + function getSingleVariableOfVariableStatement(node) { return ts.isVariableStatement(node) && node.declarationList.declarations.length > 0 && - (!child || node.declarationList.declarations[0] === child) && node.declarationList.declarations[0]; } function getNestedModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && + return node.kind === 237 /* ModuleDeclaration */ && node.body && - node.body.kind === 234 /* ModuleDeclaration */ && + node.body.kind === 237 /* ModuleDeclaration */ && node.body; } function getJSDocCommentsAndTags(node) { @@ -9207,7 +9969,7 @@ var ts; return result || ts.emptyArray; function getJSDocCommentsAndTagsWorker(node) { var parent = node.parent; - if (parent && (parent.kind === 265 /* PropertyAssignment */ || getNestedModuleDeclaration(parent))) { + if (parent && (parent.kind === 268 /* PropertyAssignment */ || parent.kind === 151 /* PropertyDeclaration */ || getNestedModuleDeclaration(parent))) { getJSDocCommentsAndTagsWorker(parent); } // Try to recognize this pattern when node is initializer of variable declaration and JSDoc comments are on containing variable statement. @@ -9217,18 +9979,19 @@ var ts; // */ // var x = function(name) { return name.length; } if (parent && parent.parent && - (getSingleVariableOfVariableStatement(parent.parent, node) || getSourceOfAssignment(parent.parent))) { + (getSingleVariableOfVariableStatement(parent.parent) === node || getSourceOfAssignment(parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent); } - if (parent && parent.parent && parent.parent.parent && getSingleInitializerOfVariableStatement(parent.parent.parent, node)) { + if (parent && parent.parent && parent.parent.parent && + (getSingleInitializerOfVariableStatementOrPropertyDeclaration(parent.parent.parent) === node || getSourceOfDefaultedAssignment(parent.parent.parent))) { getJSDocCommentsAndTagsWorker(parent.parent.parent); } if (ts.isBinaryExpression(node) && getSpecialPropertyAssignmentKind(node) !== 0 /* None */ || - node.kind === 180 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 211 /* ExpressionStatement */) { + node.kind === 183 /* PropertyAccessExpression */ && node.parent && node.parent.kind === 214 /* ExpressionStatement */) { getJSDocCommentsAndTagsWorker(parent); } // Pull parameter comments from declaring function as well - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { result = ts.addRange(result, ts.getJSDocParameterTags(node)); } if (isVariableLike(node) && ts.hasInitializer(node) && ts.hasJSDocNodes(node.initializer)) { @@ -9259,8 +10022,9 @@ var ts; ts.getParameterSymbolFromJSDoc = getParameterSymbolFromJSDoc; function getHostSignatureFromJSDoc(node) { var host = getJSDocHost(node); - var decl = getSourceOfAssignment(host) || - getSingleInitializerOfVariableStatement(host) || + var decl = getSourceOfDefaultedAssignment(host) || + getSourceOfAssignment(host) || + getSingleInitializerOfVariableStatementOrPropertyDeclaration(host) || getSingleVariableOfVariableStatement(host) || getNestedModuleDeclaration(host) || host; @@ -9268,7 +10032,7 @@ var ts; } ts.getHostSignatureFromJSDoc = getHostSignatureFromJSDoc; function getJSDocHost(node) { - ts.Debug.assert(node.parent.kind === 279 /* JSDocComment */); + ts.Debug.assert(node.parent.kind === 282 /* JSDocComment */); return node.parent.parent; } ts.getJSDocHost = getJSDocHost; @@ -9297,30 +10061,31 @@ var ts; var parent = node.parent; while (true) { switch (parent.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var binaryOperator = parent.operatorToken.kind; return isAssignmentOperator(binaryOperator) && parent.left === node ? binaryOperator === 58 /* EqualsToken */ ? 1 /* Definite */ : 2 /* Compound */ : 0 /* None */; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: var unaryOperator = parent.operator; return unaryOperator === 43 /* PlusPlusToken */ || unaryOperator === 44 /* MinusMinusToken */ ? 2 /* Compound */ : 0 /* None */; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return parent.initializer === node ? 1 /* Definite */ : 0 /* None */; - case 186 /* ParenthesizedExpression */: - case 178 /* ArrayLiteralExpression */: - case 199 /* SpreadElement */: + case 189 /* ParenthesizedExpression */: + case 181 /* ArrayLiteralExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: node = parent; break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: if (parent.name !== node) { return 0 /* None */; } node = parent.parent; break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: if (parent.name === node) { return 0 /* None */; } @@ -9347,22 +10112,22 @@ var ts; */ function isNodeWithPossibleHoistedDeclaration(node) { switch (node.kind) { - case 208 /* Block */: - case 209 /* VariableStatement */: - case 221 /* WithStatement */: - case 212 /* IfStatement */: - case 222 /* SwitchStatement */: - case 236 /* CaseBlock */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 223 /* LabeledStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 225 /* TryStatement */: - case 264 /* CatchClause */: + case 211 /* Block */: + case 212 /* VariableStatement */: + case 224 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 226 /* LabeledStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 267 /* CatchClause */: return true; } return false; @@ -9375,20 +10140,27 @@ var ts; return node; } function walkUpParenthesizedTypes(node) { - return walkUp(node, 169 /* ParenthesizedType */); + return walkUp(node, 172 /* ParenthesizedType */); } ts.walkUpParenthesizedTypes = walkUpParenthesizedTypes; function walkUpParenthesizedExpressions(node) { - return walkUp(node, 186 /* ParenthesizedExpression */); + return walkUp(node, 189 /* ParenthesizedExpression */); } ts.walkUpParenthesizedExpressions = walkUpParenthesizedExpressions; + function skipParentheses(node) { + while (node.kind === 189 /* ParenthesizedExpression */) { + node = node.expression; + } + return node; + } + ts.skipParentheses = skipParentheses; // a node is delete target iff. it is PropertyAccessExpression/ElementAccessExpression with parentheses skipped function isDeleteTarget(node) { - if (node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { return false; } node = walkUpParenthesizedExpressions(node.parent); - return node && node.kind === 189 /* DeleteExpression */; + return node && node.kind === 192 /* DeleteExpression */; } ts.isDeleteTarget = isDeleteTarget; function isNodeDescendantOf(node, ancestor) { @@ -9400,16 +10172,9 @@ var ts; return false; } ts.isNodeDescendantOf = isNodeDescendantOf; - // True if the given identifier, string literal, or number literal is the name of a declaration node + // True if `name` is the name of a declaration node function isDeclarationName(name) { - switch (name.kind) { - case 71 /* Identifier */: - case 9 /* StringLiteral */: - case 8 /* NumericLiteral */: - return ts.isDeclaration(name.parent) && name.parent.name === name; - default: - return false; - } + return !ts.isSourceFile(name) && !ts.isBindingPattern(name) && ts.isDeclaration(name.parent) && name.parent.name === name; } ts.isDeclarationName = isDeclarationName; // See GH#16030 @@ -9430,7 +10195,7 @@ var ts; ts.isAnyDeclarationName = isAnyDeclarationName; function isLiteralComputedPropertyDeclarationName(node) { return (node.kind === 9 /* StringLiteral */ || node.kind === 8 /* NumericLiteral */) && - node.parent.kind === 145 /* ComputedPropertyName */ && + node.parent.kind === 146 /* ComputedPropertyName */ && ts.isDeclaration(node.parent.parent); } ts.isLiteralComputedPropertyDeclarationName = isLiteralComputedPropertyDeclarationName; @@ -9438,32 +10203,32 @@ var ts; function isIdentifierName(node) { var parent = node.parent; switch (parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 268 /* EnumMember */: - case 265 /* PropertyAssignment */: - case 180 /* PropertyAccessExpression */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 271 /* EnumMember */: + case 268 /* PropertyAssignment */: + case 183 /* PropertyAccessExpression */: // Name in member declaration or property name in property access return parent.name === node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: // Name on right hand side of dot in a type query if (parent.right === node) { - while (parent.kind === 144 /* QualifiedName */) { + while (parent.kind === 145 /* QualifiedName */) { parent = parent.parent; } - return parent.kind === 163 /* TypeQuery */; + return parent.kind === 164 /* TypeQuery */; } return false; - case 177 /* BindingElement */: - case 243 /* ImportSpecifier */: + case 180 /* BindingElement */: + case 246 /* ImportSpecifier */: // Property name in binding element or import specifier return parent.propertyName === node; - case 247 /* ExportSpecifier */: - case 257 /* JsxAttribute */: + case 250 /* ExportSpecifier */: + case 260 /* JsxAttribute */: // Any name in an export specifier or JSX Attribute return true; } @@ -9479,13 +10244,13 @@ var ts; // export = // export default function isAliasSymbolDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 237 /* NamespaceExportDeclaration */ || - node.kind === 240 /* ImportClause */ && !!node.name || - node.kind === 241 /* NamespaceImport */ || - node.kind === 243 /* ImportSpecifier */ || - node.kind === 247 /* ExportSpecifier */ || - node.kind === 244 /* ExportAssignment */ && exportAssignmentIsAlias(node); + return node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 240 /* NamespaceExportDeclaration */ || + node.kind === 243 /* ImportClause */ && !!node.name || + node.kind === 244 /* NamespaceImport */ || + node.kind === 246 /* ImportSpecifier */ || + node.kind === 250 /* ExportSpecifier */ || + node.kind === 247 /* ExportAssignment */ && exportAssignmentIsAlias(node); } ts.isAliasSymbolDeclaration = isAliasSymbolDeclaration; function exportAssignmentIsAlias(node) { @@ -9536,44 +10301,12 @@ var ts; return undefined; } ts.getAncestor = getAncestor; - function getFileReferenceFromReferencePath(comment, commentRange) { - var simpleReferenceRegEx = /^\/\/\/\s*= 48 /* _0 */ && lookAhead <= 57 /* _9 */) { + // If the null character is followed by digits, print as a hex escape to prevent the result from parsing as an octal (which is forbidden in strict mode) + return "\\x00"; + } + // Otherwise, keep printing a literal \0 for the null character + return "\\0"; + } return escapedCharsMap.get(c) || get16BitUnicodeEscapeSequence(c.charCodeAt(0)); } function isIntrinsicJsxName(name) { @@ -10268,7 +10984,7 @@ var ts; ts.getLineOfLocalPositionFromLineMap = getLineOfLocalPositionFromLineMap; function getFirstConstructorWithBody(node) { return ts.forEach(node.members, function (member) { - if (member.kind === 153 /* Constructor */ && nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && nodeIsPresent(member.body)) { return member; } }); @@ -10314,10 +11030,10 @@ var ts; var setAccessor; if (hasDynamicName(accessor)) { firstAccessor = accessor; - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { getAccessor = accessor; } - else if (accessor.kind === 155 /* SetAccessor */) { + else if (accessor.kind === 156 /* SetAccessor */) { setAccessor = accessor; } else { @@ -10326,7 +11042,7 @@ var ts; } else { ts.forEach(declarations, function (member) { - if ((member.kind === 154 /* GetAccessor */ || member.kind === 155 /* SetAccessor */) + if ((member.kind === 155 /* GetAccessor */ || member.kind === 156 /* SetAccessor */) && hasModifier(member, 32 /* Static */) === hasModifier(accessor, 32 /* Static */)) { var memberName = getPropertyNameForPropertyNameNode(member.name); var accessorName = getPropertyNameForPropertyNameNode(accessor.name); @@ -10337,10 +11053,10 @@ var ts; else if (!secondAccessor) { secondAccessor = member; } - if (member.kind === 154 /* GetAccessor */ && !getAccessor) { + if (member.kind === 155 /* GetAccessor */ && !getAccessor) { getAccessor = member; } - if (member.kind === 155 /* SetAccessor */ && !setAccessor) { + if (member.kind === 156 /* SetAccessor */ && !setAccessor) { setAccessor = member; } } @@ -10359,49 +11075,38 @@ var ts; * Gets the effective type annotation of a variable, parameter, or property. If the node was * parsed in a JavaScript file, gets the type annotation from JSDoc. */ - function getEffectiveTypeAnnotationNode(node, checkJSDoc) { - if (ts.hasType(node)) { - return node.type; - } - if (checkJSDoc || isInJavaScriptFile(node)) { - return ts.getJSDocType(node); - } + function getEffectiveTypeAnnotationNode(node) { + return node.type || (isInJavaScriptFile(node) ? ts.getJSDocType(node) : undefined); } ts.getEffectiveTypeAnnotationNode = getEffectiveTypeAnnotationNode; /** * Gets the effective return type annotation of a signature. If the node was parsed in a * JavaScript file, gets the return type annotation from JSDoc. */ - function getEffectiveReturnTypeNode(node, checkJSDoc) { - if (node.type) { - return node.type; - } - if (checkJSDoc || isInJavaScriptFile(node)) { - return ts.getJSDocReturnType(node); - } + function getEffectiveReturnTypeNode(node) { + return node.type || (isInJavaScriptFile(node) ? ts.getJSDocReturnType(node) : undefined); } ts.getEffectiveReturnTypeNode = getEffectiveReturnTypeNode; /** * Gets the effective type parameters. If the node was parsed in a * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. */ - function getEffectiveTypeParameterDeclarations(node, checkJSDoc) { - if (node.typeParameters) { - return node.typeParameters; - } - if (checkJSDoc || isInJavaScriptFile(node)) { - var templateTag = ts.getJSDocTemplateTag(node); - return templateTag && templateTag.typeParameters; - } + function getEffectiveTypeParameterDeclarations(node) { + return node.typeParameters || (isInJavaScriptFile(node) ? getJSDocTypeParameterDeclarations(node) : undefined); } ts.getEffectiveTypeParameterDeclarations = getEffectiveTypeParameterDeclarations; + function getJSDocTypeParameterDeclarations(node) { + var templateTag = ts.getJSDocTemplateTag(node); + return templateTag && templateTag.typeParameters; + } + ts.getJSDocTypeParameterDeclarations = getJSDocTypeParameterDeclarations; /** * Gets the effective type annotation of the value parameter of a set accessor. If the node * was parsed in a JavaScript file, gets the type annotation from JSDoc. */ - function getEffectiveSetAccessorTypeAnnotationNode(node, checkJSDoc) { + function getEffectiveSetAccessorTypeAnnotationNode(node) { var parameter = getSetAccessorValueParameter(node); - return parameter && getEffectiveTypeAnnotationNode(parameter, checkJSDoc); + return parameter && getEffectiveTypeAnnotationNode(parameter); } ts.getEffectiveSetAccessorTypeAnnotationNode = getEffectiveSetAccessorTypeAnnotationNode; function emitNewLineBeforeLeadingComments(lineMap, writer, node, leadingComments) { @@ -10651,7 +11356,7 @@ var ts; case 76 /* ConstKeyword */: return 2048 /* Const */; case 79 /* DefaultKeyword */: return 512 /* Default */; case 120 /* AsyncKeyword */: return 256 /* Async */; - case 131 /* ReadonlyKeyword */: return 64 /* Readonly */; + case 132 /* ReadonlyKeyword */: return 64 /* Readonly */; } return 0 /* None */; } @@ -10668,7 +11373,7 @@ var ts; ts.isAssignmentOperator = isAssignmentOperator; /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ function tryGetClassExtendingExpressionWithTypeArguments(node) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ && + if (node.kind === 205 /* ExpressionWithTypeArguments */ && node.parent.token === 85 /* ExtendsKeyword */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; @@ -10686,8 +11391,8 @@ var ts; function isDestructuringAssignment(node) { if (isAssignmentExpression(node, /*excludeCompoundAssignment*/ true)) { var kind = node.left.kind; - return kind === 179 /* ObjectLiteralExpression */ - || kind === 178 /* ArrayLiteralExpression */; + return kind === 182 /* ObjectLiteralExpression */ + || kind === 181 /* ArrayLiteralExpression */; } return false; } @@ -10697,7 +11402,7 @@ var ts; } ts.isExpressionWithTypeArgumentsInClassExtendsClause = isExpressionWithTypeArgumentsInClassExtendsClause; function isExpressionWithTypeArgumentsInClassImplementsClause(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */ + return node.kind === 205 /* ExpressionWithTypeArguments */ && isEntityNameExpression(node.expression) && node.parent && node.parent.token === 108 /* ImplementsKeyword */ @@ -10707,21 +11412,21 @@ var ts; ts.isExpressionWithTypeArgumentsInClassImplementsClause = isExpressionWithTypeArgumentsInClassImplementsClause; function isEntityNameExpression(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); + node.kind === 183 /* PropertyAccessExpression */ && isEntityNameExpression(node.expression); } ts.isEntityNameExpression = isEntityNameExpression; function isRightSideOfQualifiedNameOrPropertyAccess(node) { - return (node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node) || - (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node); + return (node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node) || + (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node); } ts.isRightSideOfQualifiedNameOrPropertyAccess = isRightSideOfQualifiedNameOrPropertyAccess; function isEmptyObjectLiteral(expression) { - return expression.kind === 179 /* ObjectLiteralExpression */ && + return expression.kind === 182 /* ObjectLiteralExpression */ && expression.properties.length === 0; } ts.isEmptyObjectLiteral = isEmptyObjectLiteral; function isEmptyArrayLiteral(expression) { - return expression.kind === 178 /* ArrayLiteralExpression */ && + return expression.kind === 181 /* ArrayLiteralExpression */ && expression.elements.length === 0; } ts.isEmptyArrayLiteral = isEmptyArrayLiteral; @@ -10990,8 +11695,8 @@ var ts; var parseNode = ts.getParseTreeNode(node); if (parseNode) { switch (parseNode.parent.kind) { - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return parseNode === parseNode.parent.name; } } @@ -11064,21 +11769,21 @@ var ts; if (!parent) return 0 /* Read */; switch (parent.kind) { - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: var operator = parent.operator; return operator === 43 /* PlusPlusToken */ || operator === 44 /* MinusMinusToken */ ? writeOrReadWrite() : 0 /* Read */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var _a = parent, left = _a.left, operatorToken = _a.operatorToken; return left === node && isAssignmentOperator(operatorToken.kind) ? writeOrReadWrite() : 0 /* Read */; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return parent.name !== node ? 0 /* Read */ : accessKind(parent); default: return 0 /* Read */; } function writeOrReadWrite() { // If grandparent is not an ExpressionStatement, this is used as an expression in addition to having a side effect. - return parent.parent && parent.parent.kind === 211 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; + return parent.parent && parent.parent.kind === 214 /* ExpressionStatement */ ? 1 /* Write */ : 2 /* ReadWrite */; } } function compareDataObjects(dst, src) { @@ -11122,6 +11827,7 @@ var ts; map.delete(key); onDeleteValue(existingValue, key); } + // If present notify about existing values else if (onExistingValue) { onExistingValue(existingValue, valueInNewMap, key); } @@ -11179,6 +11885,15 @@ var ts; return !!forEachAncestorDirectory(directory, function (d) { return callback(d) ? true : undefined; }); } ts.forSomeAncestorDirectory = forSomeAncestorDirectory; + function isUMDExportSymbol(symbol) { + return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); + } + ts.isUMDExportSymbol = isUMDExportSymbol; + function showModuleSpecifier(_a) { + var moduleSpecifier = _a.moduleSpecifier; + return ts.isStringLiteral(moduleSpecifier) ? moduleSpecifier.text : getTextOfNode(moduleSpecifier); + } + ts.showModuleSpecifier = showModuleSpecifier; })(ts || (ts = {})); (function (ts) { function getDefaultLibFileName(options) { @@ -11214,27 +11929,20 @@ var ts; } ts.textSpanContainsTextSpan = textSpanContainsTextSpan; function textSpanOverlapsWith(span, other) { - var overlapStart = Math.max(span.start, other.start); - var overlapEnd = Math.min(textSpanEnd(span), textSpanEnd(other)); - return overlapStart < overlapEnd; + return textSpanOverlap(span, other) !== undefined; } ts.textSpanOverlapsWith = textSpanOverlapsWith; function textSpanOverlap(span1, span2) { - var overlapStart = Math.max(span1.start, span2.start); - var overlapEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (overlapStart < overlapEnd) { - return createTextSpanFromBounds(overlapStart, overlapEnd); - } - return undefined; + var overlap = textSpanIntersection(span1, span2); + return overlap && overlap.length === 0 ? undefined : overlap; } ts.textSpanOverlap = textSpanOverlap; function textSpanIntersectsWithTextSpan(span, other) { - return other.start <= textSpanEnd(span) && textSpanEnd(other) >= span.start; + return decodedTextSpanIntersectsWith(span.start, span.length, other.start, other.length); } ts.textSpanIntersectsWithTextSpan = textSpanIntersectsWithTextSpan; function textSpanIntersectsWith(span, start, length) { - var end = start + length; - return start <= textSpanEnd(span) && end >= span.start; + return decodedTextSpanIntersectsWith(span.start, span.length, start, length); } ts.textSpanIntersectsWith = textSpanIntersectsWith; function decodedTextSpanIntersectsWith(start1, length1, start2, length2) { @@ -11248,12 +11956,9 @@ var ts; } ts.textSpanIntersectsWithPosition = textSpanIntersectsWithPosition; function textSpanIntersection(span1, span2) { - var intersectStart = Math.max(span1.start, span2.start); - var intersectEnd = Math.min(textSpanEnd(span1), textSpanEnd(span2)); - if (intersectStart <= intersectEnd) { - return createTextSpanFromBounds(intersectStart, intersectEnd); - } - return undefined; + var start = Math.max(span1.start, span2.start); + var end = Math.min(textSpanEnd(span1), textSpanEnd(span2)); + return start <= end ? createTextSpanFromBounds(start, end) : undefined; } ts.textSpanIntersection = textSpanIntersection; function createTextSpan(start, length) { @@ -11402,9 +12107,9 @@ var ts; } ts.collapseTextChangeRangesAcrossMultipleVersions = collapseTextChangeRangesAcrossMultipleVersions; function getTypeParameterOwner(d) { - if (d && d.kind === 146 /* TypeParameter */) { + if (d && d.kind === 147 /* TypeParameter */) { for (var current = d; current; current = current.parent) { - if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(current) || ts.isClassLike(current) || current.kind === 234 /* InterfaceDeclaration */) { return current; } } @@ -11412,7 +12117,7 @@ var ts; } ts.getTypeParameterOwner = getTypeParameterOwner; function isParameterPropertyDeclaration(node) { - return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 153 /* Constructor */ && ts.isClassLike(node.parent.parent); + return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) && node.parent.kind === 154 /* Constructor */ && ts.isClassLike(node.parent.parent); } ts.isParameterPropertyDeclaration = isParameterPropertyDeclaration; function isEmptyBindingPattern(node) { @@ -11430,7 +12135,7 @@ var ts; } ts.isEmptyBindingElement = isEmptyBindingElement; function walkUpBindingElementsAndPatterns(node) { - while (node && (node.kind === 177 /* BindingElement */ || ts.isBindingPattern(node))) { + while (node && (node.kind === 180 /* BindingElement */ || ts.isBindingPattern(node))) { node = node.parent; } return node; @@ -11438,14 +12143,14 @@ var ts; function getCombinedModifierFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = ts.getModifierFlags(node); - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= ts.getModifierFlags(node); node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= ts.getModifierFlags(node); } return flags; @@ -11461,14 +12166,14 @@ var ts; function getCombinedNodeFlags(node) { node = walkUpBindingElementsAndPatterns(node); var flags = node.flags; - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { node = node.parent; } - if (node && node.kind === 228 /* VariableDeclarationList */) { + if (node && node.kind === 231 /* VariableDeclarationList */) { flags |= node.flags; node = node.parent; } - if (node && node.kind === 209 /* VariableStatement */) { + if (node && node.kind === 212 /* VariableStatement */) { flags |= node.flags; } return flags; @@ -11518,6 +12223,7 @@ var ts; return false; } try { + // tslint:disable-next-line no-unnecessary-qualifier (making clear this is a global mutation!) ts.localizedDiagnosticMessages = JSON.parse(fileContents); } catch (e) { @@ -11604,18 +12310,17 @@ var ts; } // Covers remaining cases switch (hostNode.kind) { - case 209 /* VariableStatement */: - if (hostNode.declarationList && - hostNode.declarationList.declarations[0]) { + case 212 /* VariableStatement */: + if (hostNode.declarationList && hostNode.declarationList.declarations[0]) { return getDeclarationIdentifier(hostNode.declarationList.declarations[0]); } return undefined; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: var expr = hostNode.expression; switch (expr.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return expr.name; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: var arg = expr.argumentExpression; if (ts.isIdentifier(arg)) { return arg; @@ -11624,10 +12329,10 @@ var ts; return undefined; case 1 /* EndOfFileToken */: return undefined; - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { return getDeclarationIdentifier(hostNode.expression); } - case 223 /* LabeledStatement */: { + case 226 /* LabeledStatement */: { if (ts.isDeclaration(hostNode.statement) || ts.isExpression(hostNode.statement)) { return getDeclarationIdentifier(hostNode.statement); } @@ -11645,6 +12350,11 @@ var ts; return declaration.name || nameForNamelessJSDocTypedef(declaration); } ts.getNameOfJSDocTypedef = getNameOfJSDocTypedef; + /** @internal */ + function isNamedDeclaration(node) { + return !!node.name; // A 'name' property should always be a DeclarationName. + } + ts.isNamedDeclaration = isNamedDeclaration; function getNameOfDeclaration(declaration) { if (!declaration) { return undefined; @@ -11652,15 +12362,15 @@ var ts; switch (declaration.kind) { case 71 /* Identifier */: return declaration; - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: { + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: { var name = declaration.name; - if (name.kind === 144 /* QualifiedName */) { + if (name.kind === 145 /* QualifiedName */) { return name.right; } break; } - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var expr = declaration; switch (ts.getSpecialPropertyAssignmentKind(expr)) { case 1 /* ExportsProperty */: @@ -11672,9 +12382,9 @@ var ts; return undefined; } } - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getNameOfJSDocTypedef(declaration); - case 244 /* ExportAssignment */: { + case 247 /* ExportAssignment */: { var expression = declaration.expression; return ts.isIdentifier(expression) ? expression : undefined; } @@ -11711,33 +12421,33 @@ var ts; * for example on a variable declaration whose initializer is a function expression. */ function hasJSDocParameterTags(node) { - return !!getFirstJSDocTag(node, 284 /* JSDocParameterTag */); + return !!getFirstJSDocTag(node, 287 /* JSDocParameterTag */); } ts.hasJSDocParameterTags = hasJSDocParameterTags; /** Gets the JSDoc augments tag for the node if present */ function getJSDocAugmentsTag(node) { - return getFirstJSDocTag(node, 282 /* JSDocAugmentsTag */); + return getFirstJSDocTag(node, 285 /* JSDocAugmentsTag */); } ts.getJSDocAugmentsTag = getJSDocAugmentsTag; /** Gets the JSDoc class tag for the node if present */ function getJSDocClassTag(node) { - return getFirstJSDocTag(node, 283 /* JSDocClassTag */); + return getFirstJSDocTag(node, 286 /* JSDocClassTag */); } ts.getJSDocClassTag = getJSDocClassTag; /** Gets the JSDoc return tag for the node if present */ function getJSDocReturnTag(node) { - return getFirstJSDocTag(node, 285 /* JSDocReturnTag */); + return getFirstJSDocTag(node, 288 /* JSDocReturnTag */); } ts.getJSDocReturnTag = getJSDocReturnTag; /** Gets the JSDoc template tag for the node if present */ function getJSDocTemplateTag(node) { - return getFirstJSDocTag(node, 287 /* JSDocTemplateTag */); + return getFirstJSDocTag(node, 290 /* JSDocTemplateTag */); } ts.getJSDocTemplateTag = getJSDocTemplateTag; /** Gets the JSDoc type tag for the node if present and valid */ function getJSDocTypeTag(node) { // We should have already issued an error if there were multiple type jsdocs, so just use the first one. - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); if (tag && tag.typeExpression && tag.typeExpression.type) { return tag; } @@ -11756,8 +12466,8 @@ var ts; * tag directly on the node would be returned. */ function getJSDocType(node) { - var tag = getFirstJSDocTag(node, 286 /* JSDocTypeTag */); - if (!tag && node.kind === 147 /* Parameter */) { + var tag = getFirstJSDocTag(node, 289 /* JSDocTypeTag */); + if (!tag && node.kind === 148 /* Parameter */) { var paramTags = getJSDocParameterTags(node); if (paramTags) { tag = ts.find(paramTags, function (tag) { return !!tag.typeExpression; }); @@ -11841,608 +12551,616 @@ var ts; ts.isIdentifier = isIdentifier; // Names function isQualifiedName(node) { - return node.kind === 144 /* QualifiedName */; + return node.kind === 145 /* QualifiedName */; } ts.isQualifiedName = isQualifiedName; function isComputedPropertyName(node) { - return node.kind === 145 /* ComputedPropertyName */; + return node.kind === 146 /* ComputedPropertyName */; } ts.isComputedPropertyName = isComputedPropertyName; // Signature elements function isTypeParameterDeclaration(node) { - return node.kind === 146 /* TypeParameter */; + return node.kind === 147 /* TypeParameter */; } ts.isTypeParameterDeclaration = isTypeParameterDeclaration; function isParameter(node) { - return node.kind === 147 /* Parameter */; + return node.kind === 148 /* Parameter */; } ts.isParameter = isParameter; function isDecorator(node) { - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } ts.isDecorator = isDecorator; // TypeMember function isPropertySignature(node) { - return node.kind === 149 /* PropertySignature */; + return node.kind === 150 /* PropertySignature */; } ts.isPropertySignature = isPropertySignature; function isPropertyDeclaration(node) { - return node.kind === 150 /* PropertyDeclaration */; + return node.kind === 151 /* PropertyDeclaration */; } ts.isPropertyDeclaration = isPropertyDeclaration; function isMethodSignature(node) { - return node.kind === 151 /* MethodSignature */; + return node.kind === 152 /* MethodSignature */; } ts.isMethodSignature = isMethodSignature; function isMethodDeclaration(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } ts.isMethodDeclaration = isMethodDeclaration; function isConstructorDeclaration(node) { - return node.kind === 153 /* Constructor */; + return node.kind === 154 /* Constructor */; } ts.isConstructorDeclaration = isConstructorDeclaration; function isGetAccessorDeclaration(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessorDeclaration = isGetAccessorDeclaration; function isSetAccessorDeclaration(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessorDeclaration = isSetAccessorDeclaration; function isCallSignatureDeclaration(node) { - return node.kind === 156 /* CallSignature */; + return node.kind === 157 /* CallSignature */; } ts.isCallSignatureDeclaration = isCallSignatureDeclaration; function isConstructSignatureDeclaration(node) { - return node.kind === 157 /* ConstructSignature */; + return node.kind === 158 /* ConstructSignature */; } ts.isConstructSignatureDeclaration = isConstructSignatureDeclaration; function isIndexSignatureDeclaration(node) { - return node.kind === 158 /* IndexSignature */; + return node.kind === 159 /* IndexSignature */; } ts.isIndexSignatureDeclaration = isIndexSignatureDeclaration; // Type function isTypePredicateNode(node) { - return node.kind === 159 /* TypePredicate */; + return node.kind === 160 /* TypePredicate */; } ts.isTypePredicateNode = isTypePredicateNode; function isTypeReferenceNode(node) { - return node.kind === 160 /* TypeReference */; + return node.kind === 161 /* TypeReference */; } ts.isTypeReferenceNode = isTypeReferenceNode; function isFunctionTypeNode(node) { - return node.kind === 161 /* FunctionType */; + return node.kind === 162 /* FunctionType */; } ts.isFunctionTypeNode = isFunctionTypeNode; function isConstructorTypeNode(node) { - return node.kind === 162 /* ConstructorType */; + return node.kind === 163 /* ConstructorType */; } ts.isConstructorTypeNode = isConstructorTypeNode; function isTypeQueryNode(node) { - return node.kind === 163 /* TypeQuery */; + return node.kind === 164 /* TypeQuery */; } ts.isTypeQueryNode = isTypeQueryNode; function isTypeLiteralNode(node) { - return node.kind === 164 /* TypeLiteral */; + return node.kind === 165 /* TypeLiteral */; } ts.isTypeLiteralNode = isTypeLiteralNode; function isArrayTypeNode(node) { - return node.kind === 165 /* ArrayType */; + return node.kind === 166 /* ArrayType */; } ts.isArrayTypeNode = isArrayTypeNode; function isTupleTypeNode(node) { - return node.kind === 166 /* TupleType */; + return node.kind === 167 /* TupleType */; } ts.isTupleTypeNode = isTupleTypeNode; function isUnionTypeNode(node) { - return node.kind === 167 /* UnionType */; + return node.kind === 168 /* UnionType */; } ts.isUnionTypeNode = isUnionTypeNode; function isIntersectionTypeNode(node) { - return node.kind === 168 /* IntersectionType */; + return node.kind === 169 /* IntersectionType */; } ts.isIntersectionTypeNode = isIntersectionTypeNode; + function isConditionalTypeNode(node) { + return node.kind === 170 /* ConditionalType */; + } + ts.isConditionalTypeNode = isConditionalTypeNode; + function isInferTypeNode(node) { + return node.kind === 171 /* InferType */; + } + ts.isInferTypeNode = isInferTypeNode; function isParenthesizedTypeNode(node) { - return node.kind === 169 /* ParenthesizedType */; + return node.kind === 172 /* ParenthesizedType */; } ts.isParenthesizedTypeNode = isParenthesizedTypeNode; function isThisTypeNode(node) { - return node.kind === 170 /* ThisType */; + return node.kind === 173 /* ThisType */; } ts.isThisTypeNode = isThisTypeNode; function isTypeOperatorNode(node) { - return node.kind === 171 /* TypeOperator */; + return node.kind === 174 /* TypeOperator */; } ts.isTypeOperatorNode = isTypeOperatorNode; function isIndexedAccessTypeNode(node) { - return node.kind === 172 /* IndexedAccessType */; + return node.kind === 175 /* IndexedAccessType */; } ts.isIndexedAccessTypeNode = isIndexedAccessTypeNode; function isMappedTypeNode(node) { - return node.kind === 173 /* MappedType */; + return node.kind === 176 /* MappedType */; } ts.isMappedTypeNode = isMappedTypeNode; function isLiteralTypeNode(node) { - return node.kind === 174 /* LiteralType */; + return node.kind === 177 /* LiteralType */; } ts.isLiteralTypeNode = isLiteralTypeNode; // Binding patterns function isObjectBindingPattern(node) { - return node.kind === 175 /* ObjectBindingPattern */; + return node.kind === 178 /* ObjectBindingPattern */; } ts.isObjectBindingPattern = isObjectBindingPattern; function isArrayBindingPattern(node) { - return node.kind === 176 /* ArrayBindingPattern */; + return node.kind === 179 /* ArrayBindingPattern */; } ts.isArrayBindingPattern = isArrayBindingPattern; function isBindingElement(node) { - return node.kind === 177 /* BindingElement */; + return node.kind === 180 /* BindingElement */; } ts.isBindingElement = isBindingElement; // Expression function isArrayLiteralExpression(node) { - return node.kind === 178 /* ArrayLiteralExpression */; + return node.kind === 181 /* ArrayLiteralExpression */; } ts.isArrayLiteralExpression = isArrayLiteralExpression; function isObjectLiteralExpression(node) { - return node.kind === 179 /* ObjectLiteralExpression */; + return node.kind === 182 /* ObjectLiteralExpression */; } ts.isObjectLiteralExpression = isObjectLiteralExpression; function isPropertyAccessExpression(node) { - return node.kind === 180 /* PropertyAccessExpression */; + return node.kind === 183 /* PropertyAccessExpression */; } ts.isPropertyAccessExpression = isPropertyAccessExpression; function isElementAccessExpression(node) { - return node.kind === 181 /* ElementAccessExpression */; + return node.kind === 184 /* ElementAccessExpression */; } ts.isElementAccessExpression = isElementAccessExpression; function isCallExpression(node) { - return node.kind === 182 /* CallExpression */; + return node.kind === 185 /* CallExpression */; } ts.isCallExpression = isCallExpression; function isNewExpression(node) { - return node.kind === 183 /* NewExpression */; + return node.kind === 186 /* NewExpression */; } ts.isNewExpression = isNewExpression; function isTaggedTemplateExpression(node) { - return node.kind === 184 /* TaggedTemplateExpression */; + return node.kind === 187 /* TaggedTemplateExpression */; } ts.isTaggedTemplateExpression = isTaggedTemplateExpression; function isTypeAssertion(node) { - return node.kind === 185 /* TypeAssertionExpression */; + return node.kind === 188 /* TypeAssertionExpression */; } ts.isTypeAssertion = isTypeAssertion; function isParenthesizedExpression(node) { - return node.kind === 186 /* ParenthesizedExpression */; + return node.kind === 189 /* ParenthesizedExpression */; } ts.isParenthesizedExpression = isParenthesizedExpression; function skipPartiallyEmittedExpressions(node) { - while (node.kind === 292 /* PartiallyEmittedExpression */) { + while (node.kind === 295 /* PartiallyEmittedExpression */) { node = node.expression; } return node; } ts.skipPartiallyEmittedExpressions = skipPartiallyEmittedExpressions; function isFunctionExpression(node) { - return node.kind === 187 /* FunctionExpression */; + return node.kind === 190 /* FunctionExpression */; } ts.isFunctionExpression = isFunctionExpression; function isArrowFunction(node) { - return node.kind === 188 /* ArrowFunction */; + return node.kind === 191 /* ArrowFunction */; } ts.isArrowFunction = isArrowFunction; function isDeleteExpression(node) { - return node.kind === 189 /* DeleteExpression */; + return node.kind === 192 /* DeleteExpression */; } ts.isDeleteExpression = isDeleteExpression; function isTypeOfExpression(node) { - return node.kind === 190 /* TypeOfExpression */; + return node.kind === 193 /* TypeOfExpression */; } ts.isTypeOfExpression = isTypeOfExpression; function isVoidExpression(node) { - return node.kind === 191 /* VoidExpression */; + return node.kind === 194 /* VoidExpression */; } ts.isVoidExpression = isVoidExpression; function isAwaitExpression(node) { - return node.kind === 192 /* AwaitExpression */; + return node.kind === 195 /* AwaitExpression */; } ts.isAwaitExpression = isAwaitExpression; function isPrefixUnaryExpression(node) { - return node.kind === 193 /* PrefixUnaryExpression */; + return node.kind === 196 /* PrefixUnaryExpression */; } ts.isPrefixUnaryExpression = isPrefixUnaryExpression; function isPostfixUnaryExpression(node) { - return node.kind === 194 /* PostfixUnaryExpression */; + return node.kind === 197 /* PostfixUnaryExpression */; } ts.isPostfixUnaryExpression = isPostfixUnaryExpression; function isBinaryExpression(node) { - return node.kind === 195 /* BinaryExpression */; + return node.kind === 198 /* BinaryExpression */; } ts.isBinaryExpression = isBinaryExpression; function isConditionalExpression(node) { - return node.kind === 196 /* ConditionalExpression */; + return node.kind === 199 /* ConditionalExpression */; } ts.isConditionalExpression = isConditionalExpression; function isTemplateExpression(node) { - return node.kind === 197 /* TemplateExpression */; + return node.kind === 200 /* TemplateExpression */; } ts.isTemplateExpression = isTemplateExpression; function isYieldExpression(node) { - return node.kind === 198 /* YieldExpression */; + return node.kind === 201 /* YieldExpression */; } ts.isYieldExpression = isYieldExpression; function isSpreadElement(node) { - return node.kind === 199 /* SpreadElement */; + return node.kind === 202 /* SpreadElement */; } ts.isSpreadElement = isSpreadElement; function isClassExpression(node) { - return node.kind === 200 /* ClassExpression */; + return node.kind === 203 /* ClassExpression */; } ts.isClassExpression = isClassExpression; function isOmittedExpression(node) { - return node.kind === 201 /* OmittedExpression */; + return node.kind === 204 /* OmittedExpression */; } ts.isOmittedExpression = isOmittedExpression; function isExpressionWithTypeArguments(node) { - return node.kind === 202 /* ExpressionWithTypeArguments */; + return node.kind === 205 /* ExpressionWithTypeArguments */; } ts.isExpressionWithTypeArguments = isExpressionWithTypeArguments; function isAsExpression(node) { - return node.kind === 203 /* AsExpression */; + return node.kind === 206 /* AsExpression */; } ts.isAsExpression = isAsExpression; function isNonNullExpression(node) { - return node.kind === 204 /* NonNullExpression */; + return node.kind === 207 /* NonNullExpression */; } ts.isNonNullExpression = isNonNullExpression; function isMetaProperty(node) { - return node.kind === 205 /* MetaProperty */; + return node.kind === 208 /* MetaProperty */; } ts.isMetaProperty = isMetaProperty; // Misc function isTemplateSpan(node) { - return node.kind === 206 /* TemplateSpan */; + return node.kind === 209 /* TemplateSpan */; } ts.isTemplateSpan = isTemplateSpan; function isSemicolonClassElement(node) { - return node.kind === 207 /* SemicolonClassElement */; + return node.kind === 210 /* SemicolonClassElement */; } ts.isSemicolonClassElement = isSemicolonClassElement; // Block function isBlock(node) { - return node.kind === 208 /* Block */; + return node.kind === 211 /* Block */; } ts.isBlock = isBlock; function isVariableStatement(node) { - return node.kind === 209 /* VariableStatement */; + return node.kind === 212 /* VariableStatement */; } ts.isVariableStatement = isVariableStatement; function isEmptyStatement(node) { - return node.kind === 210 /* EmptyStatement */; + return node.kind === 213 /* EmptyStatement */; } ts.isEmptyStatement = isEmptyStatement; function isExpressionStatement(node) { - return node.kind === 211 /* ExpressionStatement */; + return node.kind === 214 /* ExpressionStatement */; } ts.isExpressionStatement = isExpressionStatement; function isIfStatement(node) { - return node.kind === 212 /* IfStatement */; + return node.kind === 215 /* IfStatement */; } ts.isIfStatement = isIfStatement; function isDoStatement(node) { - return node.kind === 213 /* DoStatement */; + return node.kind === 216 /* DoStatement */; } ts.isDoStatement = isDoStatement; function isWhileStatement(node) { - return node.kind === 214 /* WhileStatement */; + return node.kind === 217 /* WhileStatement */; } ts.isWhileStatement = isWhileStatement; function isForStatement(node) { - return node.kind === 215 /* ForStatement */; + return node.kind === 218 /* ForStatement */; } ts.isForStatement = isForStatement; function isForInStatement(node) { - return node.kind === 216 /* ForInStatement */; + return node.kind === 219 /* ForInStatement */; } ts.isForInStatement = isForInStatement; function isForOfStatement(node) { - return node.kind === 217 /* ForOfStatement */; + return node.kind === 220 /* ForOfStatement */; } ts.isForOfStatement = isForOfStatement; function isContinueStatement(node) { - return node.kind === 218 /* ContinueStatement */; + return node.kind === 221 /* ContinueStatement */; } ts.isContinueStatement = isContinueStatement; function isBreakStatement(node) { - return node.kind === 219 /* BreakStatement */; + return node.kind === 222 /* BreakStatement */; } ts.isBreakStatement = isBreakStatement; function isBreakOrContinueStatement(node) { - return node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */; + return node.kind === 222 /* BreakStatement */ || node.kind === 221 /* ContinueStatement */; } ts.isBreakOrContinueStatement = isBreakOrContinueStatement; function isReturnStatement(node) { - return node.kind === 220 /* ReturnStatement */; + return node.kind === 223 /* ReturnStatement */; } ts.isReturnStatement = isReturnStatement; function isWithStatement(node) { - return node.kind === 221 /* WithStatement */; + return node.kind === 224 /* WithStatement */; } ts.isWithStatement = isWithStatement; function isSwitchStatement(node) { - return node.kind === 222 /* SwitchStatement */; + return node.kind === 225 /* SwitchStatement */; } ts.isSwitchStatement = isSwitchStatement; function isLabeledStatement(node) { - return node.kind === 223 /* LabeledStatement */; + return node.kind === 226 /* LabeledStatement */; } ts.isLabeledStatement = isLabeledStatement; function isThrowStatement(node) { - return node.kind === 224 /* ThrowStatement */; + return node.kind === 227 /* ThrowStatement */; } ts.isThrowStatement = isThrowStatement; function isTryStatement(node) { - return node.kind === 225 /* TryStatement */; + return node.kind === 228 /* TryStatement */; } ts.isTryStatement = isTryStatement; function isDebuggerStatement(node) { - return node.kind === 226 /* DebuggerStatement */; + return node.kind === 229 /* DebuggerStatement */; } ts.isDebuggerStatement = isDebuggerStatement; function isVariableDeclaration(node) { - return node.kind === 227 /* VariableDeclaration */; + return node.kind === 230 /* VariableDeclaration */; } ts.isVariableDeclaration = isVariableDeclaration; function isVariableDeclarationList(node) { - return node.kind === 228 /* VariableDeclarationList */; + return node.kind === 231 /* VariableDeclarationList */; } ts.isVariableDeclarationList = isVariableDeclarationList; function isFunctionDeclaration(node) { - return node.kind === 229 /* FunctionDeclaration */; + return node.kind === 232 /* FunctionDeclaration */; } ts.isFunctionDeclaration = isFunctionDeclaration; function isClassDeclaration(node) { - return node.kind === 230 /* ClassDeclaration */; + return node.kind === 233 /* ClassDeclaration */; } ts.isClassDeclaration = isClassDeclaration; function isInterfaceDeclaration(node) { - return node.kind === 231 /* InterfaceDeclaration */; + return node.kind === 234 /* InterfaceDeclaration */; } ts.isInterfaceDeclaration = isInterfaceDeclaration; function isTypeAliasDeclaration(node) { - return node.kind === 232 /* TypeAliasDeclaration */; + return node.kind === 235 /* TypeAliasDeclaration */; } ts.isTypeAliasDeclaration = isTypeAliasDeclaration; function isEnumDeclaration(node) { - return node.kind === 233 /* EnumDeclaration */; + return node.kind === 236 /* EnumDeclaration */; } ts.isEnumDeclaration = isEnumDeclaration; function isModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */; + return node.kind === 237 /* ModuleDeclaration */; } ts.isModuleDeclaration = isModuleDeclaration; function isModuleBlock(node) { - return node.kind === 235 /* ModuleBlock */; + return node.kind === 238 /* ModuleBlock */; } ts.isModuleBlock = isModuleBlock; function isCaseBlock(node) { - return node.kind === 236 /* CaseBlock */; + return node.kind === 239 /* CaseBlock */; } ts.isCaseBlock = isCaseBlock; function isNamespaceExportDeclaration(node) { - return node.kind === 237 /* NamespaceExportDeclaration */; + return node.kind === 240 /* NamespaceExportDeclaration */; } ts.isNamespaceExportDeclaration = isNamespaceExportDeclaration; function isImportEqualsDeclaration(node) { - return node.kind === 238 /* ImportEqualsDeclaration */; + return node.kind === 241 /* ImportEqualsDeclaration */; } ts.isImportEqualsDeclaration = isImportEqualsDeclaration; function isImportDeclaration(node) { - return node.kind === 239 /* ImportDeclaration */; + return node.kind === 242 /* ImportDeclaration */; } ts.isImportDeclaration = isImportDeclaration; function isImportClause(node) { - return node.kind === 240 /* ImportClause */; + return node.kind === 243 /* ImportClause */; } ts.isImportClause = isImportClause; function isNamespaceImport(node) { - return node.kind === 241 /* NamespaceImport */; + return node.kind === 244 /* NamespaceImport */; } ts.isNamespaceImport = isNamespaceImport; function isNamedImports(node) { - return node.kind === 242 /* NamedImports */; + return node.kind === 245 /* NamedImports */; } ts.isNamedImports = isNamedImports; function isImportSpecifier(node) { - return node.kind === 243 /* ImportSpecifier */; + return node.kind === 246 /* ImportSpecifier */; } ts.isImportSpecifier = isImportSpecifier; function isExportAssignment(node) { - return node.kind === 244 /* ExportAssignment */; + return node.kind === 247 /* ExportAssignment */; } ts.isExportAssignment = isExportAssignment; function isExportDeclaration(node) { - return node.kind === 245 /* ExportDeclaration */; + return node.kind === 248 /* ExportDeclaration */; } ts.isExportDeclaration = isExportDeclaration; function isNamedExports(node) { - return node.kind === 246 /* NamedExports */; + return node.kind === 249 /* NamedExports */; } ts.isNamedExports = isNamedExports; function isExportSpecifier(node) { - return node.kind === 247 /* ExportSpecifier */; + return node.kind === 250 /* ExportSpecifier */; } ts.isExportSpecifier = isExportSpecifier; function isMissingDeclaration(node) { - return node.kind === 248 /* MissingDeclaration */; + return node.kind === 251 /* MissingDeclaration */; } ts.isMissingDeclaration = isMissingDeclaration; // Module References function isExternalModuleReference(node) { - return node.kind === 249 /* ExternalModuleReference */; + return node.kind === 252 /* ExternalModuleReference */; } ts.isExternalModuleReference = isExternalModuleReference; // JSX function isJsxElement(node) { - return node.kind === 250 /* JsxElement */; + return node.kind === 253 /* JsxElement */; } ts.isJsxElement = isJsxElement; function isJsxSelfClosingElement(node) { - return node.kind === 251 /* JsxSelfClosingElement */; + return node.kind === 254 /* JsxSelfClosingElement */; } ts.isJsxSelfClosingElement = isJsxSelfClosingElement; function isJsxOpeningElement(node) { - return node.kind === 252 /* JsxOpeningElement */; + return node.kind === 255 /* JsxOpeningElement */; } ts.isJsxOpeningElement = isJsxOpeningElement; function isJsxClosingElement(node) { - return node.kind === 253 /* JsxClosingElement */; + return node.kind === 256 /* JsxClosingElement */; } ts.isJsxClosingElement = isJsxClosingElement; function isJsxFragment(node) { - return node.kind === 254 /* JsxFragment */; + return node.kind === 257 /* JsxFragment */; } ts.isJsxFragment = isJsxFragment; function isJsxOpeningFragment(node) { - return node.kind === 255 /* JsxOpeningFragment */; + return node.kind === 258 /* JsxOpeningFragment */; } ts.isJsxOpeningFragment = isJsxOpeningFragment; function isJsxClosingFragment(node) { - return node.kind === 256 /* JsxClosingFragment */; + return node.kind === 259 /* JsxClosingFragment */; } ts.isJsxClosingFragment = isJsxClosingFragment; function isJsxAttribute(node) { - return node.kind === 257 /* JsxAttribute */; + return node.kind === 260 /* JsxAttribute */; } ts.isJsxAttribute = isJsxAttribute; function isJsxAttributes(node) { - return node.kind === 258 /* JsxAttributes */; + return node.kind === 261 /* JsxAttributes */; } ts.isJsxAttributes = isJsxAttributes; function isJsxSpreadAttribute(node) { - return node.kind === 259 /* JsxSpreadAttribute */; + return node.kind === 262 /* JsxSpreadAttribute */; } ts.isJsxSpreadAttribute = isJsxSpreadAttribute; function isJsxExpression(node) { - return node.kind === 260 /* JsxExpression */; + return node.kind === 263 /* JsxExpression */; } ts.isJsxExpression = isJsxExpression; // Clauses function isCaseClause(node) { - return node.kind === 261 /* CaseClause */; + return node.kind === 264 /* CaseClause */; } ts.isCaseClause = isCaseClause; function isDefaultClause(node) { - return node.kind === 262 /* DefaultClause */; + return node.kind === 265 /* DefaultClause */; } ts.isDefaultClause = isDefaultClause; function isHeritageClause(node) { - return node.kind === 263 /* HeritageClause */; + return node.kind === 266 /* HeritageClause */; } ts.isHeritageClause = isHeritageClause; function isCatchClause(node) { - return node.kind === 264 /* CatchClause */; + return node.kind === 267 /* CatchClause */; } ts.isCatchClause = isCatchClause; // Property assignments function isPropertyAssignment(node) { - return node.kind === 265 /* PropertyAssignment */; + return node.kind === 268 /* PropertyAssignment */; } ts.isPropertyAssignment = isPropertyAssignment; function isShorthandPropertyAssignment(node) { - return node.kind === 266 /* ShorthandPropertyAssignment */; + return node.kind === 269 /* ShorthandPropertyAssignment */; } ts.isShorthandPropertyAssignment = isShorthandPropertyAssignment; function isSpreadAssignment(node) { - return node.kind === 267 /* SpreadAssignment */; + return node.kind === 270 /* SpreadAssignment */; } ts.isSpreadAssignment = isSpreadAssignment; // Enum function isEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } ts.isEnumMember = isEnumMember; // Top-level nodes function isSourceFile(node) { - return node.kind === 269 /* SourceFile */; + return node.kind === 272 /* SourceFile */; } ts.isSourceFile = isSourceFile; function isBundle(node) { - return node.kind === 270 /* Bundle */; + return node.kind === 273 /* Bundle */; } ts.isBundle = isBundle; // JSDoc function isJSDocTypeExpression(node) { - return node.kind === 271 /* JSDocTypeExpression */; + return node.kind === 274 /* JSDocTypeExpression */; } ts.isJSDocTypeExpression = isJSDocTypeExpression; function isJSDocAllType(node) { - return node.kind === 272 /* JSDocAllType */; + return node.kind === 275 /* JSDocAllType */; } ts.isJSDocAllType = isJSDocAllType; function isJSDocUnknownType(node) { - return node.kind === 273 /* JSDocUnknownType */; + return node.kind === 276 /* JSDocUnknownType */; } ts.isJSDocUnknownType = isJSDocUnknownType; function isJSDocNullableType(node) { - return node.kind === 274 /* JSDocNullableType */; + return node.kind === 277 /* JSDocNullableType */; } ts.isJSDocNullableType = isJSDocNullableType; function isJSDocNonNullableType(node) { - return node.kind === 275 /* JSDocNonNullableType */; + return node.kind === 278 /* JSDocNonNullableType */; } ts.isJSDocNonNullableType = isJSDocNonNullableType; function isJSDocOptionalType(node) { - return node.kind === 276 /* JSDocOptionalType */; + return node.kind === 279 /* JSDocOptionalType */; } ts.isJSDocOptionalType = isJSDocOptionalType; function isJSDocFunctionType(node) { - return node.kind === 277 /* JSDocFunctionType */; + return node.kind === 280 /* JSDocFunctionType */; } ts.isJSDocFunctionType = isJSDocFunctionType; function isJSDocVariadicType(node) { - return node.kind === 278 /* JSDocVariadicType */; + return node.kind === 281 /* JSDocVariadicType */; } ts.isJSDocVariadicType = isJSDocVariadicType; function isJSDoc(node) { - return node.kind === 279 /* JSDocComment */; + return node.kind === 282 /* JSDocComment */; } ts.isJSDoc = isJSDoc; function isJSDocAugmentsTag(node) { - return node.kind === 282 /* JSDocAugmentsTag */; + return node.kind === 285 /* JSDocAugmentsTag */; } ts.isJSDocAugmentsTag = isJSDocAugmentsTag; function isJSDocParameterTag(node) { - return node.kind === 284 /* JSDocParameterTag */; + return node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocParameterTag = isJSDocParameterTag; function isJSDocReturnTag(node) { - return node.kind === 285 /* JSDocReturnTag */; + return node.kind === 288 /* JSDocReturnTag */; } ts.isJSDocReturnTag = isJSDocReturnTag; function isJSDocTypeTag(node) { - return node.kind === 286 /* JSDocTypeTag */; + return node.kind === 289 /* JSDocTypeTag */; } ts.isJSDocTypeTag = isJSDocTypeTag; function isJSDocTemplateTag(node) { - return node.kind === 287 /* JSDocTemplateTag */; + return node.kind === 290 /* JSDocTemplateTag */; } ts.isJSDocTemplateTag = isJSDocTemplateTag; function isJSDocTypedefTag(node) { - return node.kind === 288 /* JSDocTypedefTag */; + return node.kind === 291 /* JSDocTypedefTag */; } ts.isJSDocTypedefTag = isJSDocTypedefTag; function isJSDocPropertyTag(node) { - return node.kind === 289 /* JSDocPropertyTag */; + return node.kind === 292 /* JSDocPropertyTag */; } ts.isJSDocPropertyTag = isJSDocPropertyTag; function isJSDocPropertyLikeTag(node) { - return node.kind === 289 /* JSDocPropertyTag */ || node.kind === 284 /* JSDocParameterTag */; + return node.kind === 292 /* JSDocPropertyTag */ || node.kind === 287 /* JSDocParameterTag */; } ts.isJSDocPropertyLikeTag = isJSDocPropertyLikeTag; function isJSDocTypeLiteral(node) { - return node.kind === 280 /* JSDocTypeLiteral */; + return node.kind === 283 /* JSDocTypeLiteral */; } ts.isJSDocTypeLiteral = isJSDocTypeLiteral; })(ts || (ts = {})); @@ -12453,7 +13171,7 @@ var ts; (function (ts) { /* @internal */ function isSyntaxList(n) { - return n.kind === 290 /* SyntaxList */; + return n.kind === 293 /* SyntaxList */; } ts.isSyntaxList = isSyntaxList; /* @internal */ @@ -12463,15 +13181,16 @@ var ts; ts.isNode = isNode; /* @internal */ function isNodeKind(kind) { - return kind >= 144 /* FirstNode */; + return kind >= 145 /* FirstNode */; } ts.isNodeKind = isNodeKind; /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. + * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n) { - return n.kind >= 0 /* FirstToken */ && n.kind <= 143 /* LastToken */; + return n.kind >= 0 /* FirstToken */ && n.kind <= 144 /* LastToken */; } ts.isToken = isToken; // Node Arrays @@ -12526,7 +13245,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 115 /* StaticKeyword */: return true; } @@ -12539,7 +13258,7 @@ var ts; ts.isModifier = isModifier; function isEntityName(node) { var kind = node.kind; - return kind === 144 /* QualifiedName */ + return kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isEntityName = isEntityName; @@ -12548,14 +13267,14 @@ var ts; return kind === 71 /* Identifier */ || kind === 9 /* StringLiteral */ || kind === 8 /* NumericLiteral */ - || kind === 145 /* ComputedPropertyName */; + || kind === 146 /* ComputedPropertyName */; } ts.isPropertyName = isPropertyName; function isBindingName(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 175 /* ObjectBindingPattern */ - || kind === 176 /* ArrayBindingPattern */; + || kind === 178 /* ObjectBindingPattern */ + || kind === 179 /* ArrayBindingPattern */; } ts.isBindingName = isBindingName; // Functions @@ -12570,13 +13289,13 @@ var ts; ts.isFunctionLikeDeclaration = isFunctionLikeDeclaration; function isFunctionLikeDeclarationKind(kind) { switch (kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; default: return false; @@ -12585,13 +13304,13 @@ var ts; /* @internal */ function isFunctionLikeKind(kind) { switch (kind) { - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return true; default: return isFunctionLikeDeclarationKind(kind); @@ -12606,30 +13325,30 @@ var ts; // Classes function isClassElement(node) { var kind = node.kind; - return kind === 153 /* Constructor */ - || kind === 150 /* PropertyDeclaration */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 158 /* IndexSignature */ - || kind === 207 /* SemicolonClassElement */ - || kind === 248 /* MissingDeclaration */; + return kind === 154 /* Constructor */ + || kind === 151 /* PropertyDeclaration */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 159 /* IndexSignature */ + || kind === 210 /* SemicolonClassElement */ + || kind === 251 /* MissingDeclaration */; } ts.isClassElement = isClassElement; function isClassLike(node) { - return node && (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */); + return node && (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */); } ts.isClassLike = isClassLike; function isAccessor(node) { - return node && (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */); + return node && (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */); } ts.isAccessor = isAccessor; /* @internal */ function isMethodOrAccessor(node) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; default: return false; @@ -12639,47 +13358,47 @@ var ts; // Type members function isTypeElement(node) { var kind = node.kind; - return kind === 157 /* ConstructSignature */ - || kind === 156 /* CallSignature */ - || kind === 149 /* PropertySignature */ - || kind === 151 /* MethodSignature */ - || kind === 158 /* IndexSignature */ - || kind === 248 /* MissingDeclaration */; + return kind === 158 /* ConstructSignature */ + || kind === 157 /* CallSignature */ + || kind === 150 /* PropertySignature */ + || kind === 152 /* MethodSignature */ + || kind === 159 /* IndexSignature */ + || kind === 251 /* MissingDeclaration */; } ts.isTypeElement = isTypeElement; function isObjectLiteralElementLike(node) { var kind = node.kind; - return kind === 265 /* PropertyAssignment */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 267 /* SpreadAssignment */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 248 /* MissingDeclaration */; + return kind === 268 /* PropertyAssignment */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 270 /* SpreadAssignment */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 251 /* MissingDeclaration */; } ts.isObjectLiteralElementLike = isObjectLiteralElementLike; // Type function isTypeNodeKind(kind) { - return (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) + return (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) || kind === 119 /* AnyKeyword */ - || kind === 133 /* NumberKeyword */ - || kind === 134 /* ObjectKeyword */ + || kind === 134 /* NumberKeyword */ + || kind === 135 /* ObjectKeyword */ || kind === 122 /* BooleanKeyword */ - || kind === 136 /* StringKeyword */ - || kind === 137 /* SymbolKeyword */ + || kind === 137 /* StringKeyword */ + || kind === 138 /* SymbolKeyword */ || kind === 99 /* ThisKeyword */ || kind === 105 /* VoidKeyword */ - || kind === 139 /* UndefinedKeyword */ + || kind === 140 /* UndefinedKeyword */ || kind === 95 /* NullKeyword */ - || kind === 130 /* NeverKeyword */ - || kind === 202 /* ExpressionWithTypeArguments */ - || kind === 272 /* JSDocAllType */ - || kind === 273 /* JSDocUnknownType */ - || kind === 274 /* JSDocNullableType */ - || kind === 275 /* JSDocNonNullableType */ - || kind === 276 /* JSDocOptionalType */ - || kind === 277 /* JSDocFunctionType */ - || kind === 278 /* JSDocVariadicType */; + || kind === 131 /* NeverKeyword */ + || kind === 205 /* ExpressionWithTypeArguments */ + || kind === 275 /* JSDocAllType */ + || kind === 276 /* JSDocUnknownType */ + || kind === 277 /* JSDocNullableType */ + || kind === 278 /* JSDocNonNullableType */ + || kind === 279 /* JSDocOptionalType */ + || kind === 280 /* JSDocFunctionType */ + || kind === 281 /* JSDocVariadicType */; } /** * Node test that determines whether a node is a valid type node. @@ -12692,8 +13411,8 @@ var ts; ts.isTypeNode = isTypeNode; function isFunctionOrConstructorTypeNode(node) { switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return true; } return false; @@ -12704,8 +13423,8 @@ var ts; function isBindingPattern(node) { if (node) { var kind = node.kind; - return kind === 176 /* ArrayBindingPattern */ - || kind === 175 /* ObjectBindingPattern */; + return kind === 179 /* ArrayBindingPattern */ + || kind === 178 /* ObjectBindingPattern */; } return false; } @@ -12713,15 +13432,15 @@ var ts; /* @internal */ function isAssignmentPattern(node) { var kind = node.kind; - return kind === 178 /* ArrayLiteralExpression */ - || kind === 179 /* ObjectLiteralExpression */; + return kind === 181 /* ArrayLiteralExpression */ + || kind === 182 /* ObjectLiteralExpression */; } ts.isAssignmentPattern = isAssignmentPattern; /* @internal */ function isArrayBindingElement(node) { var kind = node.kind; - return kind === 177 /* BindingElement */ - || kind === 201 /* OmittedExpression */; + return kind === 180 /* BindingElement */ + || kind === 204 /* OmittedExpression */; } ts.isArrayBindingElement = isArrayBindingElement; /** @@ -12730,9 +13449,9 @@ var ts; /* @internal */ function isDeclarationBindingElement(bindingElement) { switch (bindingElement.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 180 /* BindingElement */: return true; } return false; @@ -12753,8 +13472,8 @@ var ts; /* @internal */ function isObjectBindingOrAssignmentPattern(node) { switch (node.kind) { - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return true; } return false; @@ -12766,8 +13485,8 @@ var ts; /* @internal */ function isArrayBindingOrAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return true; } return false; @@ -12776,18 +13495,18 @@ var ts; // Expression function isPropertyAccessOrQualifiedName(node) { var kind = node.kind; - return kind === 180 /* PropertyAccessExpression */ - || kind === 144 /* QualifiedName */; + return kind === 183 /* PropertyAccessExpression */ + || kind === 145 /* QualifiedName */; } ts.isPropertyAccessOrQualifiedName = isPropertyAccessOrQualifiedName; function isCallLikeExpression(node) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 184 /* TaggedTemplateExpression */: - case 148 /* Decorator */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 187 /* TaggedTemplateExpression */: + case 149 /* Decorator */: return true; default: return false; @@ -12795,12 +13514,12 @@ var ts; } ts.isCallLikeExpression = isCallLikeExpression; function isCallOrNewExpression(node) { - return node.kind === 182 /* CallExpression */ || node.kind === 183 /* NewExpression */; + return node.kind === 185 /* CallExpression */ || node.kind === 186 /* NewExpression */; } ts.isCallOrNewExpression = isCallOrNewExpression; function isTemplateLiteral(node) { var kind = node.kind; - return kind === 197 /* TemplateExpression */ + return kind === 200 /* TemplateExpression */ || kind === 13 /* NoSubstitutionTemplateLiteral */; } ts.isTemplateLiteral = isTemplateLiteral; @@ -12811,33 +13530,33 @@ var ts; ts.isLeftHandSideExpression = isLeftHandSideExpression; function isLeftHandSideExpressionKind(kind) { switch (kind) { - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: - case 183 /* NewExpression */: - case 182 /* CallExpression */: - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 254 /* JsxFragment */: - case 184 /* TaggedTemplateExpression */: - case 178 /* ArrayLiteralExpression */: - case 186 /* ParenthesizedExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 187 /* FunctionExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 186 /* NewExpression */: + case 185 /* CallExpression */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 257 /* JsxFragment */: + case 187 /* TaggedTemplateExpression */: + case 181 /* ArrayLiteralExpression */: + case 189 /* ParenthesizedExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 190 /* FunctionExpression */: case 71 /* Identifier */: case 12 /* RegularExpressionLiteral */: case 8 /* NumericLiteral */: case 9 /* StringLiteral */: case 13 /* NoSubstitutionTemplateLiteral */: - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 101 /* TrueKeyword */: case 97 /* SuperKeyword */: - case 204 /* NonNullExpression */: - case 205 /* MetaProperty */: - case 91 /* ImportKeyword */:// technically this is only an Expression if it's in a CallExpression + case 207 /* NonNullExpression */: + case 208 /* MetaProperty */: + case 91 /* ImportKeyword */: // technically this is only an Expression if it's in a CallExpression return true; default: return false; @@ -12850,13 +13569,13 @@ var ts; ts.isUnaryExpression = isUnaryExpression; function isUnaryExpressionKind(kind) { switch (kind) { - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 185 /* TypeAssertionExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 188 /* TypeAssertionExpression */: return true; default: return isLeftHandSideExpressionKind(kind); @@ -12865,9 +13584,9 @@ var ts; /* @internal */ function isUnaryExpressionWithWrite(expr) { switch (expr.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; default: @@ -12886,15 +13605,15 @@ var ts; ts.isExpression = isExpression; function isExpressionKind(kind) { switch (kind) { - case 196 /* ConditionalExpression */: - case 198 /* YieldExpression */: - case 188 /* ArrowFunction */: - case 195 /* BinaryExpression */: - case 199 /* SpreadElement */: - case 203 /* AsExpression */: - case 201 /* OmittedExpression */: - case 293 /* CommaListExpression */: - case 292 /* PartiallyEmittedExpression */: + case 199 /* ConditionalExpression */: + case 201 /* YieldExpression */: + case 191 /* ArrowFunction */: + case 198 /* BinaryExpression */: + case 202 /* SpreadElement */: + case 206 /* AsExpression */: + case 204 /* OmittedExpression */: + case 296 /* CommaListExpression */: + case 295 /* PartiallyEmittedExpression */: return true; default: return isUnaryExpressionKind(kind); @@ -12902,18 +13621,18 @@ var ts; } function isAssertionExpression(node) { var kind = node.kind; - return kind === 185 /* TypeAssertionExpression */ - || kind === 203 /* AsExpression */; + return kind === 188 /* TypeAssertionExpression */ + || kind === 206 /* AsExpression */; } ts.isAssertionExpression = isAssertionExpression; /* @internal */ function isPartiallyEmittedExpression(node) { - return node.kind === 292 /* PartiallyEmittedExpression */; + return node.kind === 295 /* PartiallyEmittedExpression */; } ts.isPartiallyEmittedExpression = isPartiallyEmittedExpression; /* @internal */ function isNotEmittedStatement(node) { - return node.kind === 291 /* NotEmittedStatement */; + return node.kind === 294 /* NotEmittedStatement */; } ts.isNotEmittedStatement = isNotEmittedStatement; /* @internal */ @@ -12922,16 +13641,15 @@ var ts; || isPartiallyEmittedExpression(node); } ts.isNotEmittedOrPartiallyEmittedNode = isNotEmittedOrPartiallyEmittedNode; - // Statement function isIterationStatement(node, lookInLabeledStatements) { switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return true; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return lookInLabeledStatements && isIterationStatement(node.statement, lookInLabeledStatements); } return false; @@ -12939,7 +13657,7 @@ var ts; ts.isIterationStatement = isIterationStatement; /* @internal */ function isForInOrOfStatement(node) { - return node.kind === 216 /* ForInStatement */ || node.kind === 217 /* ForOfStatement */; + return node.kind === 219 /* ForInStatement */ || node.kind === 220 /* ForOfStatement */; } ts.isForInOrOfStatement = isForInOrOfStatement; // Element @@ -12963,111 +13681,111 @@ var ts; /* @internal */ function isModuleBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */ + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */ || kind === 71 /* Identifier */; } ts.isModuleBody = isModuleBody; /* @internal */ function isNamespaceBody(node) { var kind = node.kind; - return kind === 235 /* ModuleBlock */ - || kind === 234 /* ModuleDeclaration */; + return kind === 238 /* ModuleBlock */ + || kind === 237 /* ModuleDeclaration */; } ts.isNamespaceBody = isNamespaceBody; /* @internal */ function isJSDocNamespaceBody(node) { var kind = node.kind; return kind === 71 /* Identifier */ - || kind === 234 /* ModuleDeclaration */; + || kind === 237 /* ModuleDeclaration */; } ts.isJSDocNamespaceBody = isJSDocNamespaceBody; /* @internal */ function isNamedImportBindings(node) { var kind = node.kind; - return kind === 242 /* NamedImports */ - || kind === 241 /* NamespaceImport */; + return kind === 245 /* NamedImports */ + || kind === 244 /* NamespaceImport */; } ts.isNamedImportBindings = isNamedImportBindings; /* @internal */ function isModuleOrEnumDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ || node.kind === 233 /* EnumDeclaration */; + return node.kind === 237 /* ModuleDeclaration */ || node.kind === 236 /* EnumDeclaration */; } ts.isModuleOrEnumDeclaration = isModuleOrEnumDeclaration; function isDeclarationKind(kind) { - return kind === 188 /* ArrowFunction */ - || kind === 177 /* BindingElement */ - || kind === 230 /* ClassDeclaration */ - || kind === 200 /* ClassExpression */ - || kind === 153 /* Constructor */ - || kind === 233 /* EnumDeclaration */ - || kind === 268 /* EnumMember */ - || kind === 247 /* ExportSpecifier */ - || kind === 229 /* FunctionDeclaration */ - || kind === 187 /* FunctionExpression */ - || kind === 154 /* GetAccessor */ - || kind === 240 /* ImportClause */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 243 /* ImportSpecifier */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 257 /* JsxAttribute */ - || kind === 152 /* MethodDeclaration */ - || kind === 151 /* MethodSignature */ - || kind === 234 /* ModuleDeclaration */ - || kind === 237 /* NamespaceExportDeclaration */ - || kind === 241 /* NamespaceImport */ - || kind === 147 /* Parameter */ - || kind === 265 /* PropertyAssignment */ - || kind === 150 /* PropertyDeclaration */ - || kind === 149 /* PropertySignature */ - || kind === 155 /* SetAccessor */ - || kind === 266 /* ShorthandPropertyAssignment */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 146 /* TypeParameter */ - || kind === 227 /* VariableDeclaration */ - || kind === 288 /* JSDocTypedefTag */; + return kind === 191 /* ArrowFunction */ + || kind === 180 /* BindingElement */ + || kind === 233 /* ClassDeclaration */ + || kind === 203 /* ClassExpression */ + || kind === 154 /* Constructor */ + || kind === 236 /* EnumDeclaration */ + || kind === 271 /* EnumMember */ + || kind === 250 /* ExportSpecifier */ + || kind === 232 /* FunctionDeclaration */ + || kind === 190 /* FunctionExpression */ + || kind === 155 /* GetAccessor */ + || kind === 243 /* ImportClause */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 246 /* ImportSpecifier */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 260 /* JsxAttribute */ + || kind === 153 /* MethodDeclaration */ + || kind === 152 /* MethodSignature */ + || kind === 237 /* ModuleDeclaration */ + || kind === 240 /* NamespaceExportDeclaration */ + || kind === 244 /* NamespaceImport */ + || kind === 148 /* Parameter */ + || kind === 268 /* PropertyAssignment */ + || kind === 151 /* PropertyDeclaration */ + || kind === 150 /* PropertySignature */ + || kind === 156 /* SetAccessor */ + || kind === 269 /* ShorthandPropertyAssignment */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 147 /* TypeParameter */ + || kind === 230 /* VariableDeclaration */ + || kind === 291 /* JSDocTypedefTag */; } function isDeclarationStatementKind(kind) { - return kind === 229 /* FunctionDeclaration */ - || kind === 248 /* MissingDeclaration */ - || kind === 230 /* ClassDeclaration */ - || kind === 231 /* InterfaceDeclaration */ - || kind === 232 /* TypeAliasDeclaration */ - || kind === 233 /* EnumDeclaration */ - || kind === 234 /* ModuleDeclaration */ - || kind === 239 /* ImportDeclaration */ - || kind === 238 /* ImportEqualsDeclaration */ - || kind === 245 /* ExportDeclaration */ - || kind === 244 /* ExportAssignment */ - || kind === 237 /* NamespaceExportDeclaration */; + return kind === 232 /* FunctionDeclaration */ + || kind === 251 /* MissingDeclaration */ + || kind === 233 /* ClassDeclaration */ + || kind === 234 /* InterfaceDeclaration */ + || kind === 235 /* TypeAliasDeclaration */ + || kind === 236 /* EnumDeclaration */ + || kind === 237 /* ModuleDeclaration */ + || kind === 242 /* ImportDeclaration */ + || kind === 241 /* ImportEqualsDeclaration */ + || kind === 248 /* ExportDeclaration */ + || kind === 247 /* ExportAssignment */ + || kind === 240 /* NamespaceExportDeclaration */; } function isStatementKindButNotDeclarationKind(kind) { - return kind === 219 /* BreakStatement */ - || kind === 218 /* ContinueStatement */ - || kind === 226 /* DebuggerStatement */ - || kind === 213 /* DoStatement */ - || kind === 211 /* ExpressionStatement */ - || kind === 210 /* EmptyStatement */ - || kind === 216 /* ForInStatement */ - || kind === 217 /* ForOfStatement */ - || kind === 215 /* ForStatement */ - || kind === 212 /* IfStatement */ - || kind === 223 /* LabeledStatement */ - || kind === 220 /* ReturnStatement */ - || kind === 222 /* SwitchStatement */ - || kind === 224 /* ThrowStatement */ - || kind === 225 /* TryStatement */ - || kind === 209 /* VariableStatement */ - || kind === 214 /* WhileStatement */ - || kind === 221 /* WithStatement */ - || kind === 291 /* NotEmittedStatement */ - || kind === 295 /* EndOfDeclarationMarker */ - || kind === 294 /* MergeDeclarationMarker */; + return kind === 222 /* BreakStatement */ + || kind === 221 /* ContinueStatement */ + || kind === 229 /* DebuggerStatement */ + || kind === 216 /* DoStatement */ + || kind === 214 /* ExpressionStatement */ + || kind === 213 /* EmptyStatement */ + || kind === 219 /* ForInStatement */ + || kind === 220 /* ForOfStatement */ + || kind === 218 /* ForStatement */ + || kind === 215 /* IfStatement */ + || kind === 226 /* LabeledStatement */ + || kind === 223 /* ReturnStatement */ + || kind === 225 /* SwitchStatement */ + || kind === 227 /* ThrowStatement */ + || kind === 228 /* TryStatement */ + || kind === 212 /* VariableStatement */ + || kind === 217 /* WhileStatement */ + || kind === 224 /* WithStatement */ + || kind === 294 /* NotEmittedStatement */ + || kind === 298 /* EndOfDeclarationMarker */ + || kind === 297 /* MergeDeclarationMarker */; } /* @internal */ function isDeclaration(node) { - if (node.kind === 146 /* TypeParameter */) { - return node.parent.kind !== 287 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); + if (node.kind === 147 /* TypeParameter */) { + return node.parent.kind !== 290 /* JSDocTemplateTag */ || ts.isInJavaScriptFile(node); } return isDeclarationKind(node.kind); } @@ -13094,10 +13812,10 @@ var ts; } ts.isStatement = isStatement; function isBlockStatement(node) { - if (node.kind !== 208 /* Block */) + if (node.kind !== 211 /* Block */) return false; if (node.parent !== undefined) { - if (node.parent.kind === 225 /* TryStatement */ || node.parent.kind === 264 /* CatchClause */) { + if (node.parent.kind === 228 /* TryStatement */ || node.parent.kind === 267 /* CatchClause */) { return false; } } @@ -13107,8 +13825,8 @@ var ts; /* @internal */ function isModuleReference(node) { var kind = node.kind; - return kind === 249 /* ExternalModuleReference */ - || kind === 144 /* QualifiedName */ + return kind === 252 /* ExternalModuleReference */ + || kind === 145 /* QualifiedName */ || kind === 71 /* Identifier */; } ts.isModuleReference = isModuleReference; @@ -13118,70 +13836,70 @@ var ts; var kind = node.kind; return kind === 99 /* ThisKeyword */ || kind === 71 /* Identifier */ - || kind === 180 /* PropertyAccessExpression */; + || kind === 183 /* PropertyAccessExpression */; } ts.isJsxTagNameExpression = isJsxTagNameExpression; /* @internal */ function isJsxChild(node) { var kind = node.kind; - return kind === 250 /* JsxElement */ - || kind === 260 /* JsxExpression */ - || kind === 251 /* JsxSelfClosingElement */ + return kind === 253 /* JsxElement */ + || kind === 263 /* JsxExpression */ + || kind === 254 /* JsxSelfClosingElement */ || kind === 10 /* JsxText */ - || kind === 254 /* JsxFragment */; + || kind === 257 /* JsxFragment */; } ts.isJsxChild = isJsxChild; /* @internal */ function isJsxAttributeLike(node) { var kind = node.kind; - return kind === 257 /* JsxAttribute */ - || kind === 259 /* JsxSpreadAttribute */; + return kind === 260 /* JsxAttribute */ + || kind === 262 /* JsxSpreadAttribute */; } ts.isJsxAttributeLike = isJsxAttributeLike; /* @internal */ function isStringLiteralOrJsxExpression(node) { var kind = node.kind; return kind === 9 /* StringLiteral */ - || kind === 260 /* JsxExpression */; + || kind === 263 /* JsxExpression */; } ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression; function isJsxOpeningLikeElement(node) { var kind = node.kind; - return kind === 252 /* JsxOpeningElement */ - || kind === 251 /* JsxSelfClosingElement */; + return kind === 255 /* JsxOpeningElement */ + || kind === 254 /* JsxSelfClosingElement */; } ts.isJsxOpeningLikeElement = isJsxOpeningLikeElement; // Clauses function isCaseOrDefaultClause(node) { var kind = node.kind; - return kind === 261 /* CaseClause */ - || kind === 262 /* DefaultClause */; + return kind === 264 /* CaseClause */ + || kind === 265 /* DefaultClause */; } ts.isCaseOrDefaultClause = isCaseOrDefaultClause; // JSDoc /** True if node is of some JSDoc syntax kind. */ /* @internal */ function isJSDocNode(node) { - return node.kind >= 271 /* FirstJSDocNode */ && node.kind <= 289 /* LastJSDocNode */; + return node.kind >= 274 /* FirstJSDocNode */ && node.kind <= 292 /* LastJSDocNode */; } ts.isJSDocNode = isJSDocNode; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node) { - return node.kind === 279 /* JSDocComment */ || isJSDocTag(node); + return node.kind === 282 /* JSDocComment */ || isJSDocTag(node) || ts.isJSDocTypeLiteral(node); } ts.isJSDocCommentContainingNode = isJSDocCommentContainingNode; // TODO: determine what this does before making it public. /* @internal */ function isJSDocTag(node) { - return node.kind >= 281 /* FirstJSDocTagNode */ && node.kind <= 289 /* LastJSDocTagNode */; + return node.kind >= 284 /* FirstJSDocTagNode */ && node.kind <= 292 /* LastJSDocTagNode */; } ts.isJSDocTag = isJSDocTag; function isSetAccessor(node) { - return node.kind === 155 /* SetAccessor */; + return node.kind === 156 /* SetAccessor */; } ts.isSetAccessor = isSetAccessor; function isGetAccessor(node) { - return node.kind === 154 /* GetAccessor */; + return node.kind === 155 /* GetAccessor */; } ts.isGetAccessor = isGetAccessor; /** True if has jsdoc nodes attached to it. */ @@ -13210,19 +13928,28 @@ var ts; ts.hasOnlyExpressionInitializer = hasOnlyExpressionInitializer; function isObjectLiteralElement(node) { switch (node.kind) { - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; default: return false; } } ts.isObjectLiteralElement = isObjectLiteralElement; + /* @internal */ + function isTypeReferenceType(node) { + return node.kind === 161 /* TypeReference */ || node.kind === 205 /* ExpressionWithTypeArguments */; + } + ts.isTypeReferenceType = isTypeReferenceType; + function isStringLiteralLike(node) { + return node.kind === 9 /* StringLiteral */ || node.kind === 13 /* NoSubstitutionTemplateLiteral */; + } + ts.isStringLiteralLike = isStringLiteralLike; })(ts || (ts = {})); /// /// @@ -13245,7 +13972,7 @@ var ts; var SourceFileConstructor; // tslint:enable variable-name function createNode(kind, pos, end) { - if (kind === 269 /* SourceFile */) { + if (kind === 272 /* SourceFile */) { return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, pos, end); } else if (kind === 71 /* Identifier */) { @@ -13290,28 +14017,28 @@ var ts; * that they appear in the source code. The language service depends on this property to locate nodes by position. */ function forEachChild(node, cbNode, cbNodes) { - if (!node || node.kind <= 143 /* LastToken */) { + if (!node || node.kind <= 144 /* LastToken */) { return; } switch (node.kind) { - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.right); - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.constraint) || visitNode(cbNode, node.default) || visitNode(cbNode, node.expression); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.equalsToken) || visitNode(cbNode, node.objectAssignmentInitializer); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return visitNode(cbNode, node.expression); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || @@ -13319,7 +14046,7 @@ var ts; visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || @@ -13327,51 +14054,51 @@ var ts; visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.initializer); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.exclamationToken) || visitNode(cbNode, node.type) || visitNode(cbNode, node.initializer); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.asteriskToken) || @@ -13382,291 +14109,298 @@ var ts; visitNode(cbNode, node.type) || visitNode(cbNode, node.equalsGreaterThanToken) || visitNode(cbNode, node.body); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return visitNode(cbNode, node.typeName) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return visitNode(cbNode, node.parameterName) || visitNode(cbNode, node.type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return visitNode(cbNode, node.exprName); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return visitNodes(cbNode, cbNodes, node.members); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return visitNode(cbNode, node.elementType); - case 166 /* TupleType */: + case 167 /* TupleType */: return visitNodes(cbNode, cbNodes, node.elementTypes); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return visitNodes(cbNode, cbNodes, node.types); - case 169 /* ParenthesizedType */: - case 171 /* TypeOperator */: + case 170 /* ConditionalType */: + return visitNode(cbNode, node.checkType) || + visitNode(cbNode, node.extendsType) || + visitNode(cbNode, node.trueType) || + visitNode(cbNode, node.falseType); + case 171 /* InferType */: + return visitNode(cbNode, node.typeParameter); + case 172 /* ParenthesizedType */: + case 174 /* TypeOperator */: return visitNode(cbNode, node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return visitNode(cbNode, node.objectType) || visitNode(cbNode, node.indexType); - case 173 /* MappedType */: + case 176 /* MappedType */: return visitNode(cbNode, node.readonlyToken) || visitNode(cbNode, node.typeParameter) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.type); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return visitNode(cbNode, node.literal); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return visitNodes(cbNode, cbNodes, node.elements); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitNodes(cbNode, cbNodes, node.properties); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.name); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.argumentExpression); - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments) || visitNodes(cbNode, cbNodes, node.arguments); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitNode(cbNode, node.tag) || visitNode(cbNode, node.template); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return visitNode(cbNode, node.type) || visitNode(cbNode, node.expression); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitNode(cbNode, node.expression); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return visitNode(cbNode, node.expression); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return visitNode(cbNode, node.expression); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitNode(cbNode, node.expression); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return visitNode(cbNode, node.operand); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitNode(cbNode, node.asteriskToken) || visitNode(cbNode, node.expression); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitNode(cbNode, node.expression); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return visitNode(cbNode, node.operand); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitNode(cbNode, node.left) || visitNode(cbNode, node.operatorToken) || visitNode(cbNode, node.right); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.type); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return visitNode(cbNode, node.expression); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitNode(cbNode, node.name); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitNode(cbNode, node.condition) || visitNode(cbNode, node.questionToken) || visitNode(cbNode, node.whenTrue) || visitNode(cbNode, node.colonToken) || visitNode(cbNode, node.whenFalse); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitNode(cbNode, node.expression); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return visitNodes(cbNode, cbNodes, node.statements); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return visitNodes(cbNode, cbNodes, node.statements) || visitNode(cbNode, node.endOfFileToken); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.declarationList); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitNodes(cbNode, cbNodes, node.declarations); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitNode(cbNode, node.expression); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.thenStatement) || visitNode(cbNode, node.elseStatement); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitNode(cbNode, node.statement) || visitNode(cbNode, node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.condition) || visitNode(cbNode, node.incrementor) || visitNode(cbNode, node.statement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitNode(cbNode, node.awaitModifier) || visitNode(cbNode, node.initializer) || visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return visitNode(cbNode, node.label); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitNode(cbNode, node.expression); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.statement); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.caseBlock); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitNodes(cbNode, cbNodes, node.clauses); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.statements); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitNodes(cbNode, cbNodes, node.statements); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitNode(cbNode, node.label) || visitNode(cbNode, node.statement); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return visitNode(cbNode, node.expression); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitNode(cbNode, node.tryBlock) || visitNode(cbNode, node.catchClause) || visitNode(cbNode, node.finallyBlock); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitNode(cbNode, node.variableDeclaration) || visitNode(cbNode, node.block); - case 148 /* Decorator */: + case 149 /* Decorator */: return visitNode(cbNode, node.expression); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.heritageClauses) || visitNodes(cbNode, cbNodes, node.members); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.typeParameters) || visitNode(cbNode, node.type); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNodes(cbNode, cbNodes, node.members); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.body); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.name) || visitNode(cbNode, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.importClause) || visitNode(cbNode, node.moduleSpecifier); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.namedBindings); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return visitNode(cbNode, node.name); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return visitNode(cbNode, node.name); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return visitNodes(cbNode, cbNodes, node.elements); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.exportClause) || visitNode(cbNode, node.moduleSpecifier); - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return visitNode(cbNode, node.propertyName) || visitNode(cbNode, node.name); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitNodes(cbNode, cbNodes, node.decorators) || visitNodes(cbNode, cbNodes, node.modifiers) || visitNode(cbNode, node.expression); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitNode(cbNode, node.head) || visitNodes(cbNode, cbNodes, node.templateSpans); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return visitNode(cbNode, node.expression) || visitNode(cbNode, node.literal); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitNode(cbNode, node.expression); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return visitNodes(cbNode, cbNodes, node.types); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return visitNode(cbNode, node.expression) || visitNodes(cbNode, cbNodes, node.typeArguments); - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return visitNode(cbNode, node.expression); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return visitNodes(cbNode, cbNodes, node.decorators); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return visitNodes(cbNode, cbNodes, node.elements); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitNode(cbNode, node.openingElement) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingElement); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitNode(cbNode, node.openingFragment) || visitNodes(cbNode, cbNodes, node.children) || visitNode(cbNode, node.closingFragment); - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: return visitNode(cbNode, node.tagName) || visitNode(cbNode, node.attributes); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return visitNodes(cbNode, cbNodes, node.properties); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return visitNode(cbNode, node.name) || visitNode(cbNode, node.initializer); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return visitNode(cbNode, node.expression); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitNode(cbNode, node.dotDotDotToken) || visitNode(cbNode, node.expression); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return visitNode(cbNode, node.tagName); - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return visitNode(cbNode, node.type); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return visitNode(cbNode, node.type); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return visitNode(cbNode, node.type); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return visitNode(cbNode, node.type); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return visitNodes(cbNode, cbNodes, node.parameters) || visitNode(cbNode, node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return visitNode(cbNode, node.type); - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: return visitNodes(cbNode, cbNodes, node.tags); - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: if (node.isNameFirst) { return visitNode(cbNode, node.name) || visitNode(cbNode, node.typeExpression); @@ -13675,17 +14409,17 @@ var ts; return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.name); } - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: return visitNode(cbNode, node.typeExpression); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return visitNode(cbNode, node.typeExpression); - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return visitNode(cbNode, node.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return visitNodes(cbNode, cbNodes, node.typeParameters); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: if (node.typeExpression && - node.typeExpression.kind === 271 /* JSDocTypeExpression */) { + node.typeExpression.kind === 274 /* JSDocTypeExpression */) { return visitNode(cbNode, node.typeExpression) || visitNode(cbNode, node.fullName); } @@ -13693,7 +14427,7 @@ var ts; return visitNode(cbNode, node.fullName) || visitNode(cbNode, node.typeExpression); } - case 280 /* JSDocTypeLiteral */: + case 283 /* JSDocTypeLiteral */: if (node.jsDocPropertyTags) { for (var _i = 0, _a = node.jsDocPropertyTags; _i < _a.length; _i++) { var tag = _a[_i]; @@ -13701,7 +14435,7 @@ var ts; } } return; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return visitNode(cbNode, node.expression); } } @@ -13899,7 +14633,7 @@ var ts; else if (token() === 17 /* OpenBraceToken */ || lookAhead(function () { return token() === 9 /* StringLiteral */; })) { result.jsonObject = parseObjectLiteralExpression(); - sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.Unexpected_token); + sourceFile.endOfFileToken = parseExpectedToken(1 /* EndOfFileToken */, ts.Diagnostics.Unexpected_token); } else { parseExpected(17 /* OpenBraceToken */); @@ -13962,7 +14696,9 @@ var ts; sourceFile.flags = contextFlags; // Prime the scanner. nextToken(); - processReferenceComments(sourceFile); + // A member of ReadonlyArray isn't assignable to a member of T[] (and prevents a direct cast) - but this is where we set up those members so they can be readonly in the future + processCommentPragmas(sourceFile, sourceText); + processPragmasIntoFields(sourceFile, reportPragmaDiagnostic); sourceFile.statements = parseList(0 /* SourceElements */, parseStatement); ts.Debug.assert(token() === 1 /* EndOfFileToken */); sourceFile.endOfFileToken = addJSDocComment(parseTokenNode()); @@ -13975,6 +14711,9 @@ var ts; fixupParentReferences(sourceFile); } return sourceFile; + function reportPragmaDiagnostic(pos, end, diagnostic) { + parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, pos, end, diagnostic)); + } } function addJSDocComment(node) { var comments = ts.getJSDocCommentRanges(node, sourceFile.text); @@ -14019,7 +14758,7 @@ var ts; function createSourceFile(fileName, languageVersion, scriptKind, isDeclarationFile) { // code from createNode is inlined here so createNode won't have to deal with special case of creating source files // this is quite rare comparing to other nodes and createNode should be as fast as possible - var sourceFile = new SourceFileConstructor(269 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); + var sourceFile = new SourceFileConstructor(272 /* SourceFile */, /*pos*/ 0, /* end */ sourceText.length); nodeCount++; sourceFile.text = sourceText; sourceFile.bindDiagnostics = []; @@ -14265,9 +15004,9 @@ var ts; } return undefined; } - function parseExpectedToken(t, reportAtCurrentPosition, diagnosticMessage, arg0) { + function parseExpectedToken(t, diagnosticMessage, arg0) { return parseOptionalToken(t) || - createMissingNode(t, reportAtCurrentPosition, diagnosticMessage, arg0); + createMissingNode(t, /*reportAtCurrentPosition*/ false, diagnosticMessage || ts.Diagnostics._0_expected, arg0 || ts.tokenToString(t)); } function parseTokenNode() { var node = createNode(token()); @@ -14403,7 +15142,7 @@ var ts; // PropertyName [Yield]: // LiteralPropertyName // ComputedPropertyName[?Yield] - var node = createNode(145 /* ComputedPropertyName */); + var node = createNode(146 /* ComputedPropertyName */); parseExpected(21 /* OpenBracketToken */); // We parse any expression (including a comma expression). But the grammar // says that only an assignment expression is allowed, so the grammar checker @@ -14579,6 +15318,10 @@ var ts; nextToken(); return isStartOfExpression(); } + function nextTokenIsStartOfType() { + nextToken(); + return isStartOfType(); + } // True if positioned at a list terminator function isListTerminator(kind) { if (token() === 1 /* EndOfFileToken */) { @@ -14810,14 +15553,14 @@ var ts; function isReusableClassMember(node) { if (node) { switch (node.kind) { - case 153 /* Constructor */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 150 /* PropertyDeclaration */: - case 207 /* SemicolonClassElement */: + case 154 /* Constructor */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 210 /* SemicolonClassElement */: return true; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // Method declarations are not necessarily reusable. An object-literal // may have a method calls "constructor(...)" and we must reparse that // into an actual .ConstructorDeclaration. @@ -14832,8 +15575,8 @@ var ts; function isReusableSwitchClause(node) { if (node) { switch (node.kind) { - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: return true; } } @@ -14842,58 +15585,58 @@ var ts; function isReusableStatement(node) { if (node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 209 /* VariableStatement */: - case 208 /* Block */: - case 212 /* IfStatement */: - case 211 /* ExpressionStatement */: - case 224 /* ThrowStatement */: - case 220 /* ReturnStatement */: - case 222 /* SwitchStatement */: - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 210 /* EmptyStatement */: - case 225 /* TryStatement */: - case 223 /* LabeledStatement */: - case 213 /* DoStatement */: - case 226 /* DebuggerStatement */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 212 /* VariableStatement */: + case 211 /* Block */: + case 215 /* IfStatement */: + case 214 /* ExpressionStatement */: + case 227 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 225 /* SwitchStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 213 /* EmptyStatement */: + case 228 /* TryStatement */: + case 226 /* LabeledStatement */: + case 216 /* DoStatement */: + case 229 /* DebuggerStatement */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: return true; } } return false; } function isReusableEnumMember(node) { - return node.kind === 268 /* EnumMember */; + return node.kind === 271 /* EnumMember */; } function isReusableTypeMember(node) { if (node) { switch (node.kind) { - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 149 /* PropertySignature */: - case 156 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 150 /* PropertySignature */: + case 157 /* CallSignature */: return true; } } return false; } function isReusableVariableDeclaration(node) { - if (node.kind !== 227 /* VariableDeclaration */) { + if (node.kind !== 230 /* VariableDeclaration */) { return false; } // Very subtle incremental parsing bug. Consider the following code: @@ -14914,7 +15657,7 @@ var ts; return variableDeclarator.initializer === undefined; } function isReusableParameter(node) { - if (node.kind !== 147 /* Parameter */) { + if (node.kind !== 148 /* Parameter */) { return false; } // See the comment in isReusableVariableDeclaration for why we do this. @@ -15043,7 +15786,7 @@ var ts; return entity; } function createQualifiedName(entity, name) { - var node = createNode(144 /* QualifiedName */, entity.pos); + var node = createNode(145 /* QualifiedName */, entity.pos); node.left = entity; node.right = name; return finishNode(node); @@ -15080,7 +15823,7 @@ var ts; return allowIdentifierNames ? parseIdentifierName() : parseIdentifier(); } function parseTemplateExpression() { - var template = createNode(197 /* TemplateExpression */); + var template = createNode(200 /* TemplateExpression */); template.head = parseTemplateHead(); ts.Debug.assert(template.head.kind === 14 /* TemplateHead */, "Template head has wrong token kind"); var list = []; @@ -15092,7 +15835,7 @@ var ts; return finishNode(template); } function parseTemplateSpan() { - var span = createNode(206 /* TemplateSpan */); + var span = createNode(209 /* TemplateSpan */); span.expression = allowInAnd(parseExpression); var literal; if (token() === 18 /* CloseBraceToken */) { @@ -15100,7 +15843,7 @@ var ts; literal = parseTemplateMiddleOrTemplateTail(); } else { - literal = parseExpectedToken(16 /* TemplateTail */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); + literal = parseExpectedToken(16 /* TemplateTail */, ts.Diagnostics._0_expected, ts.tokenToString(18 /* CloseBraceToken */)); } span.literal = literal; return finishNode(span); @@ -15143,7 +15886,7 @@ var ts; } // TYPES function parseTypeReference() { - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected); if (!scanner.hasPrecedingLineBreak() && token() === 27 /* LessThanToken */) { node.typeArguments = parseBracketedList(19 /* TypeArguments */, parseType, 27 /* LessThanToken */, 29 /* GreaterThanToken */); @@ -15152,18 +15895,18 @@ var ts; } function parseThisTypePredicate(lhs) { nextToken(); - var node = createNode(159 /* TypePredicate */, lhs.pos); + var node = createNode(160 /* TypePredicate */, lhs.pos); node.parameterName = lhs; node.type = parseType(); return finishNode(node); } function parseThisTypeNode() { - var node = createNode(170 /* ThisType */); + var node = createNode(173 /* ThisType */); nextToken(); return finishNode(node); } function parseJSDocAllType() { - var result = createNode(272 /* JSDocAllType */); + var result = createNode(275 /* JSDocAllType */); nextToken(); return finishNode(result); } @@ -15186,28 +15929,28 @@ var ts; token() === 29 /* GreaterThanToken */ || token() === 58 /* EqualsToken */ || token() === 49 /* BarToken */) { - var result = createNode(273 /* JSDocUnknownType */, pos); + var result = createNode(276 /* JSDocUnknownType */, pos); return finishNode(result); } else { - var result = createNode(274 /* JSDocNullableType */, pos); + var result = createNode(277 /* JSDocNullableType */, pos); result.type = parseType(); return finishNode(result); } } function parseJSDocFunctionType() { if (lookAhead(nextTokenIsOpenParen)) { - var result = createNodeWithJSDoc(277 /* JSDocFunctionType */); + var result = createNodeWithJSDoc(280 /* JSDocFunctionType */); nextToken(); fillSignature(56 /* ColonToken */, 4 /* Type */ | 32 /* JSDoc */, result); return finishNode(result); } - var node = createNode(160 /* TypeReference */); + var node = createNode(161 /* TypeReference */); node.typeName = parseIdentifierName(); return finishNode(node); } function parseJSDocParameter() { - var parameter = createNode(147 /* Parameter */); + var parameter = createNode(148 /* Parameter */); if (token() === 99 /* ThisKeyword */ || token() === 94 /* NewKeyword */) { parameter.name = parseIdentifierName(); parseExpected(56 /* ColonToken */); @@ -15222,13 +15965,13 @@ var ts; return finishNode(result); } function parseTypeQuery() { - var node = createNode(163 /* TypeQuery */); + var node = createNode(164 /* TypeQuery */); parseExpected(103 /* TypeOfKeyword */); node.exprName = parseEntityName(/*allowReservedWords*/ true); return finishNode(node); } function parseTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); if (parseOptional(85 /* ExtendsKeyword */)) { // It's not uncommon for people to write improper constraints to a generic. If the @@ -15273,7 +16016,7 @@ var ts; isStartOfType(/*inStartOfParameter*/ true); } function parseParameter() { - var node = createNodeWithJSDoc(147 /* Parameter */); + var node = createNodeWithJSDoc(148 /* Parameter */); if (token() === 99 /* ThisKeyword */) { node.name = createIdentifier(/*isIdentifier*/ true); node.type = parseParameterType(); @@ -15372,7 +16115,7 @@ var ts; } function parseSignatureMember(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 157 /* ConstructSignature */) { + if (kind === 158 /* ConstructSignature */) { parseExpected(94 /* NewKeyword */); } fillSignature(56 /* ColonToken */, 4 /* Type */, node); @@ -15433,7 +16176,7 @@ var ts; return token() === 56 /* ColonToken */ || token() === 26 /* CommaToken */ || token() === 22 /* CloseBracketToken */; } function parseIndexSignatureDeclaration(node) { - node.kind = 158 /* IndexSignature */; + node.kind = 159 /* IndexSignature */; node.parameters = parseBracketedList(16 /* Parameters */, parseParameter, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); node.type = parseTypeAnnotation(); parseTypeMemberSemicolon(); @@ -15443,13 +16186,13 @@ var ts; node.name = parsePropertyName(); node.questionToken = parseOptionalToken(55 /* QuestionToken */); if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - node.kind = 151 /* MethodSignature */; + node.kind = 152 /* MethodSignature */; // Method signatures don't exist in expression contexts. So they have neither // [Yield] nor [Await] fillSignature(56 /* ColonToken */, 4 /* Type */, node); } else { - node.kind = 149 /* PropertySignature */; + node.kind = 150 /* PropertySignature */; node.type = parseTypeAnnotation(); if (token() === 58 /* EqualsToken */) { // Although type literal properties cannot not have initializers, we attempt @@ -15495,10 +16238,10 @@ var ts; } function parseTypeMember() { if (token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */) { - return parseSignatureMember(156 /* CallSignature */); + return parseSignatureMember(157 /* CallSignature */); } if (token() === 94 /* NewKeyword */ && lookAhead(nextTokenIsOpenParenOrLessThan)) { - return parseSignatureMember(157 /* ConstructSignature */); + return parseSignatureMember(158 /* ConstructSignature */); } var node = createNodeWithJSDoc(0 /* Unknown */); node.modifiers = parseModifiers(); @@ -15512,7 +16255,7 @@ var ts; return token() === 19 /* OpenParenToken */ || token() === 27 /* LessThanToken */; } function parseTypeLiteral() { - var node = createNode(164 /* TypeLiteral */); + var node = createNode(165 /* TypeLiteral */); node.members = parseObjectTypeMembers(); return finishNode(node); } @@ -15529,38 +16272,51 @@ var ts; } function isStartOfMappedType() { nextToken(); - if (token() === 131 /* ReadonlyKeyword */) { + if (token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + return nextToken() === 132 /* ReadonlyKeyword */; + } + if (token() === 132 /* ReadonlyKeyword */) { nextToken(); } return token() === 21 /* OpenBracketToken */ && nextTokenIsIdentifier() && nextToken() === 92 /* InKeyword */; } function parseMappedTypeParameter() { - var node = createNode(146 /* TypeParameter */); + var node = createNode(147 /* TypeParameter */); node.name = parseIdentifier(); parseExpected(92 /* InKeyword */); node.constraint = parseType(); return finishNode(node); } function parseMappedType() { - var node = createNode(173 /* MappedType */); + var node = createNode(176 /* MappedType */); parseExpected(17 /* OpenBraceToken */); - node.readonlyToken = parseOptionalToken(131 /* ReadonlyKeyword */); + if (token() === 132 /* ReadonlyKeyword */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.readonlyToken = parseTokenNode(); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + parseExpectedToken(132 /* ReadonlyKeyword */); + } + } parseExpected(21 /* OpenBracketToken */); node.typeParameter = parseMappedTypeParameter(); parseExpected(22 /* CloseBracketToken */); - node.questionToken = parseOptionalToken(55 /* QuestionToken */); + if (token() === 55 /* QuestionToken */ || token() === 37 /* PlusToken */ || token() === 38 /* MinusToken */) { + node.questionToken = parseTokenNode(); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + parseExpectedToken(55 /* QuestionToken */); + } + } node.type = parseTypeAnnotation(); parseSemicolon(); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseTupleType() { - var node = createNode(166 /* TupleType */); + var node = createNode(167 /* TupleType */); node.elementTypes = parseBracketedList(20 /* TupleElementTypes */, parseType, 21 /* OpenBracketToken */, 22 /* CloseBracketToken */); return finishNode(node); } function parseParenthesizedType() { - var node = createNode(169 /* ParenthesizedType */); + var node = createNode(172 /* ParenthesizedType */); parseExpected(19 /* OpenParenToken */); node.type = parseType(); parseExpected(20 /* CloseParenToken */); @@ -15568,7 +16324,7 @@ var ts; } function parseFunctionOrConstructorType(kind) { var node = createNodeWithJSDoc(kind); - if (kind === 162 /* ConstructorType */) { + if (kind === 163 /* ConstructorType */) { parseExpected(94 /* NewKeyword */); } fillSignature(36 /* EqualsGreaterThanToken */, 4 /* Type */, node); @@ -15579,10 +16335,10 @@ var ts; return token() === 23 /* DotToken */ ? undefined : node; } function parseLiteralTypeNode(negative) { - var node = createNode(174 /* LiteralType */); + var node = createNode(177 /* LiteralType */); var unaryMinusExpression; if (negative) { - unaryMinusExpression = createNode(193 /* PrefixUnaryExpression */); + unaryMinusExpression = createNode(196 /* PrefixUnaryExpression */); unaryMinusExpression.operator = 38 /* MinusToken */; nextToken(); } @@ -15603,13 +16359,13 @@ var ts; function parseNonArrayType() { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 137 /* SymbolKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 138 /* SymbolKeyword */: case 122 /* BooleanKeyword */: - case 139 /* UndefinedKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: + case 140 /* UndefinedKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: // If these are followed by a dot, then parse these out as a dotted type reference instead. return tryParse(parseKeywordAndNoDot) || parseTypeReference(); case 39 /* AsteriskToken */: @@ -15619,7 +16375,7 @@ var ts; case 89 /* FunctionKeyword */: return parseJSDocFunctionType(); case 51 /* ExclamationToken */: - return parseJSDocNodeWithType(275 /* JSDocNonNullableType */); + return parseJSDocNodeWithType(278 /* JSDocNonNullableType */); case 13 /* NoSubstitutionTemplateLiteral */: case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -15633,7 +16389,7 @@ var ts; return parseTokenNode(); case 99 /* ThisKeyword */: { var thisKeyword = parseThisTypeNode(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { return parseThisTypePredicate(thisKeyword); } else { @@ -15655,17 +16411,17 @@ var ts; function isStartOfType(inStartOfParameter) { switch (token()) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 140 /* UniqueKeyword */: + case 138 /* SymbolKeyword */: + case 141 /* UniqueKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: case 99 /* ThisKeyword */: case 103 /* TypeOfKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: case 17 /* OpenBraceToken */: case 21 /* OpenBracketToken */: case 27 /* LessThanToken */: @@ -15676,11 +16432,12 @@ var ts; case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: case 39 /* AsteriskToken */: case 55 /* QuestionToken */: case 51 /* ExclamationToken */: case 24 /* DotDotDotToken */: + case 126 /* InferKeyword */: return true; case 38 /* MinusToken */: return !inStartOfParameter && lookAhead(nextTokenIsNumericLiteral); @@ -15705,25 +16462,29 @@ var ts; if (!(contextFlags & 1048576 /* JSDoc */)) { return type; } - type = createJSDocPostfixType(276 /* JSDocOptionalType */, type); + type = createJSDocPostfixType(279 /* JSDocOptionalType */, type); break; case 51 /* ExclamationToken */: - type = createJSDocPostfixType(275 /* JSDocNonNullableType */, type); + type = createJSDocPostfixType(278 /* JSDocNonNullableType */, type); break; case 55 /* QuestionToken */: - type = createJSDocPostfixType(274 /* JSDocNullableType */, type); + // If not in JSDoc and next token is start of a type we have a conditional type + if (!(contextFlags & 1048576 /* JSDoc */) && lookAhead(nextTokenIsStartOfType)) { + return type; + } + type = createJSDocPostfixType(277 /* JSDocNullableType */, type); break; case 21 /* OpenBracketToken */: parseExpected(21 /* OpenBracketToken */); if (isStartOfType()) { - var node = createNode(172 /* IndexedAccessType */, type.pos); + var node = createNode(175 /* IndexedAccessType */, type.pos); node.objectType = type; node.indexType = parseType(); parseExpected(22 /* CloseBracketToken */); type = finishNode(node); } else { - var node = createNode(165 /* ArrayType */, type.pos); + var node = createNode(166 /* ArrayType */, type.pos); node.elementType = type; parseExpected(22 /* CloseBracketToken */); type = finishNode(node); @@ -15742,20 +16503,30 @@ var ts; return finishNode(postfix); } function parseTypeOperator(operator) { - var node = createNode(171 /* TypeOperator */); + var node = createNode(174 /* TypeOperator */); parseExpected(operator); node.operator = operator; node.type = parseTypeOperatorOrHigher(); return finishNode(node); } + function parseInferType() { + var node = createNode(171 /* InferType */); + parseExpected(126 /* InferKeyword */); + var typeParameter = createNode(147 /* TypeParameter */); + typeParameter.name = parseIdentifier(); + node.typeParameter = finishNode(typeParameter); + return finishNode(node); + } function parseTypeOperatorOrHigher() { var operator = token(); switch (operator) { - case 127 /* KeyOfKeyword */: - case 140 /* UniqueKeyword */: + case 128 /* KeyOfKeyword */: + case 141 /* UniqueKeyword */: return parseTypeOperator(operator); + case 126 /* InferKeyword */: + return parseInferType(); case 24 /* DotDotDotToken */: { - var result = createNode(278 /* JSDocVariadicType */); + var result = createNode(281 /* JSDocVariadicType */); nextToken(); result.type = parsePostfixTypeOrHigher(); return finishNode(result); @@ -15778,10 +16549,10 @@ var ts; return type; } function parseIntersectionTypeOrHigher() { - return parseUnionOrIntersectionType(168 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); + return parseUnionOrIntersectionType(169 /* IntersectionType */, parseTypeOperatorOrHigher, 48 /* AmpersandToken */); } function parseUnionTypeOrHigher() { - return parseUnionOrIntersectionType(167 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); + return parseUnionOrIntersectionType(168 /* UnionType */, parseIntersectionTypeOrHigher, 49 /* BarToken */); } function isStartOfFunctionType() { if (token() === 27 /* LessThanToken */) { @@ -15838,7 +16609,7 @@ var ts; var typePredicateVariable = isIdentifier() && tryParse(parseTypePredicatePrefix); var type = parseType(); if (typePredicateVariable) { - var node = createNode(159 /* TypePredicate */, typePredicateVariable.pos); + var node = createNode(160 /* TypePredicate */, typePredicateVariable.pos); node.parameterName = typePredicateVariable; node.type = type; return finishNode(node); @@ -15849,7 +16620,7 @@ var ts; } function parseTypePredicatePrefix() { var id = parseIdentifier(); - if (token() === 126 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { + if (token() === 127 /* IsKeyword */ && !scanner.hasPrecedingLineBreak()) { nextToken(); return id; } @@ -15859,14 +16630,26 @@ var ts; // apply to 'type' contexts. So we disable these parameters here before moving on. return doOutsideOfContext(20480 /* TypeExcludesFlags */, parseTypeWorker); } - function parseTypeWorker() { + function parseTypeWorker(noConditionalTypes) { if (isStartOfFunctionType()) { - return parseFunctionOrConstructorType(161 /* FunctionType */); + return parseFunctionOrConstructorType(162 /* FunctionType */); } if (token() === 94 /* NewKeyword */) { - return parseFunctionOrConstructorType(162 /* ConstructorType */); + return parseFunctionOrConstructorType(163 /* ConstructorType */); } - return parseUnionTypeOrHigher(); + var type = parseUnionTypeOrHigher(); + if (!noConditionalTypes && !scanner.hasPrecedingLineBreak() && parseOptional(85 /* ExtendsKeyword */)) { + var node = createNode(170 /* ConditionalType */, type.pos); + node.checkType = type; + // The type following 'extends' is not permitted to be another conditional type + node.extendsType = parseTypeWorker(/*noConditionalTypes*/ true); + parseExpected(55 /* QuestionToken */); + node.trueType = parseTypeWorker(); + parseExpected(56 /* ColonToken */); + node.falseType = parseTypeWorker(); + return finishNode(node); + } + return type; } function parseTypeAnnotation() { return parseOptional(56 /* ColonToken */) ? parseType() : undefined; @@ -16049,7 +16832,7 @@ var ts; return !scanner.hasPrecedingLineBreak() && isIdentifier(); } function parseYieldExpression() { - var node = createNode(198 /* YieldExpression */); + var node = createNode(201 /* YieldExpression */); // YieldExpression[In] : // yield // yield [no LineTerminator here] [Lexical goal InputElementRegExp]AssignmentExpression[?In, Yield] @@ -16071,17 +16854,17 @@ var ts; ts.Debug.assert(token() === 36 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>"); var node; if (asyncModifier) { - node = createNode(188 /* ArrowFunction */, asyncModifier.pos); + node = createNode(191 /* ArrowFunction */, asyncModifier.pos); node.modifiers = asyncModifier; } else { - node = createNode(188 /* ArrowFunction */, identifier.pos); + node = createNode(191 /* ArrowFunction */, identifier.pos); } - var parameter = createNode(147 /* Parameter */, identifier.pos); + var parameter = createNode(148 /* Parameter */, identifier.pos); parameter.name = identifier; finishNode(parameter); node.parameters = createNodeArray([parameter], parameter.pos, parameter.end); - node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + node.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); node.body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier); return addJSDocComment(finishNode(node)); } @@ -16106,7 +16889,7 @@ var ts; // If we have an arrow, then try to parse the body. Even if not, try to parse if we // have an opening brace, just in case we're in an error state. var lastToken = token(); - arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, "=>"); + arrowFunction.equalsGreaterThanToken = parseExpectedToken(36 /* EqualsGreaterThanToken */); arrowFunction.body = (lastToken === 36 /* EqualsGreaterThanToken */ || lastToken === 17 /* OpenBraceToken */) ? parseArrowFunctionExpressionBody(isAsync) : parseIdentifier(); @@ -16273,7 +17056,7 @@ var ts; return 0 /* False */; } function parseParenthesizedArrowFunctionExpressionHead(allowAmbiguity) { - var node = createNodeWithJSDoc(188 /* ArrowFunction */); + var node = createNodeWithJSDoc(191 /* ArrowFunction */); node.modifiers = parseModifiersForArrowFunction(); var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; // Arrow functions are never generators. @@ -16339,11 +17122,11 @@ var ts; } // Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and // we do not that for the 'whenFalse' part. - var node = createNode(196 /* ConditionalExpression */, leftOperand.pos); + var node = createNode(199 /* ConditionalExpression */, leftOperand.pos); node.condition = leftOperand; node.questionToken = questionToken; node.whenTrue = doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher); - node.colonToken = parseExpectedToken(56 /* ColonToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); + node.colonToken = parseExpectedToken(56 /* ColonToken */); node.whenFalse = ts.nodeIsPresent(node.colonToken) ? parseAssignmentExpressionOrHigher() : createMissingNode(71 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(56 /* ColonToken */)); @@ -16354,7 +17137,7 @@ var ts; return parseBinaryExpressionRest(precedence, leftOperand); } function isInOrOfKeyword(t) { - return t === 92 /* InKeyword */ || t === 143 /* OfKeyword */; + return t === 92 /* InKeyword */ || t === 144 /* OfKeyword */; } function parseBinaryExpressionRest(precedence, leftOperand) { while (true) { @@ -16462,39 +17245,39 @@ var ts; return -1; } function makeBinaryExpression(left, operatorToken, right) { - var node = createNode(195 /* BinaryExpression */, left.pos); + var node = createNode(198 /* BinaryExpression */, left.pos); node.left = left; node.operatorToken = operatorToken; node.right = right; return finishNode(node); } function makeAsExpression(left, right) { - var node = createNode(203 /* AsExpression */, left.pos); + var node = createNode(206 /* AsExpression */, left.pos); node.expression = left; node.type = right; return finishNode(node); } function parsePrefixUnaryExpression() { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseSimpleUnaryExpression(); return finishNode(node); } function parseDeleteExpression() { - var node = createNode(189 /* DeleteExpression */); + var node = createNode(192 /* DeleteExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseTypeOfExpression() { - var node = createNode(190 /* TypeOfExpression */); + var node = createNode(193 /* TypeOfExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); } function parseVoidExpression() { - var node = createNode(191 /* VoidExpression */); + var node = createNode(194 /* VoidExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16510,7 +17293,7 @@ var ts; return false; } function parseAwaitExpression() { - var node = createNode(192 /* AwaitExpression */); + var node = createNode(195 /* AwaitExpression */); nextToken(); node.expression = parseSimpleUnaryExpression(); return finishNode(node); @@ -16553,7 +17336,7 @@ var ts; var simpleUnaryExpression = parseSimpleUnaryExpression(); if (token() === 40 /* AsteriskAsteriskToken */) { var start = ts.skipTrivia(sourceText, simpleUnaryExpression.pos); - if (simpleUnaryExpression.kind === 185 /* TypeAssertionExpression */) { + if (simpleUnaryExpression.kind === 188 /* TypeAssertionExpression */) { parseErrorAtPosition(start, simpleUnaryExpression.end - start, ts.Diagnostics.A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses); } else { @@ -16650,7 +17433,7 @@ var ts; */ function parseUpdateExpression() { if (token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) { - var node = createNode(193 /* PrefixUnaryExpression */); + var node = createNode(196 /* PrefixUnaryExpression */); node.operator = token(); nextToken(); node.operand = parseLeftHandSideExpressionOrHigher(); @@ -16663,7 +17446,7 @@ var ts; var expression = parseLeftHandSideExpressionOrHigher(); ts.Debug.assert(ts.isLeftHandSideExpression(expression)); if ((token() === 43 /* PlusPlusToken */ || token() === 44 /* MinusMinusToken */) && !scanner.hasPrecedingLineBreak()) { - var node = createNode(194 /* PostfixUnaryExpression */, expression.pos); + var node = createNode(197 /* PostfixUnaryExpression */, expression.pos); node.operand = expression; node.operator = token(); nextToken(); @@ -16778,9 +17561,9 @@ var ts; } // If we have seen "super" it must be followed by '(' or '.'. // If it wasn't then just try to parse out a '.' and report an error. - var node = createNode(180 /* PropertyAccessExpression */, expression.pos); + var node = createNode(183 /* PropertyAccessExpression */, expression.pos); node.expression = expression; - parseExpectedToken(23 /* DotToken */, /*reportAtCurrentPosition*/ false, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); + parseExpectedToken(23 /* DotToken */, ts.Diagnostics.super_must_be_followed_by_an_argument_list_or_member_access); node.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); return finishNode(node); } @@ -16803,8 +17586,8 @@ var ts; function parseJsxElementOrSelfClosingElementOrFragment(inExpressionContext) { var opening = parseJsxOpeningOrSelfClosingElementOrOpeningFragment(inExpressionContext); var result; - if (opening.kind === 252 /* JsxOpeningElement */) { - var node = createNode(250 /* JsxElement */, opening.pos); + if (opening.kind === 255 /* JsxOpeningElement */) { + var node = createNode(253 /* JsxElement */, opening.pos); node.openingElement = opening; node.children = parseJsxChildren(node.openingElement); node.closingElement = parseJsxClosingElement(inExpressionContext); @@ -16813,15 +17596,15 @@ var ts; } result = finishNode(node); } - else if (opening.kind === 255 /* JsxOpeningFragment */) { - var node = createNode(254 /* JsxFragment */, opening.pos); + else if (opening.kind === 258 /* JsxOpeningFragment */) { + var node = createNode(257 /* JsxFragment */, opening.pos); node.openingFragment = opening; node.children = parseJsxChildren(node.openingFragment); node.closingFragment = parseJsxClosingFragment(inExpressionContext); result = finishNode(node); } else { - ts.Debug.assert(opening.kind === 251 /* JsxSelfClosingElement */); + ts.Debug.assert(opening.kind === 254 /* JsxSelfClosingElement */); // Nothing else to do for self-closing elements result = opening; } @@ -16836,7 +17619,7 @@ var ts; var invalidElement = tryParse(function () { return parseJsxElementOrSelfClosingElementOrFragment(/*inExpressionContext*/ true); }); if (invalidElement) { parseErrorAtCurrentToken(ts.Diagnostics.JSX_expressions_must_have_one_parent_element); - var badNode = createNode(195 /* BinaryExpression */, result.pos); + var badNode = createNode(198 /* BinaryExpression */, result.pos); badNode.end = invalidElement.end; badNode.left = result; badNode.right = invalidElement; @@ -16900,7 +17683,7 @@ var ts; return createNodeArray(list, listPos); } function parseJsxAttributes() { - var jsxAttributes = createNode(258 /* JsxAttributes */); + var jsxAttributes = createNode(261 /* JsxAttributes */); jsxAttributes.properties = parseList(13 /* JsxAttributes */, parseJsxAttribute); return finishNode(jsxAttributes); } @@ -16908,8 +17691,9 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(27 /* LessThanToken */); if (token() === 29 /* GreaterThanToken */) { - parseExpected(29 /* GreaterThanToken */); - var node_1 = createNode(255 /* JsxOpeningFragment */, fullStart); + // See below for explanation of scanJsxText + var node_1 = createNode(258 /* JsxOpeningFragment */, fullStart); + scanJsxText(); return finishNode(node_1); } var tagName = parseJsxElementName(); @@ -16919,7 +17703,7 @@ var ts; // Closing tag, so scan the immediately-following text with the JSX scanning instead // of regular scanning to avoid treating illegal characters (e.g. '#') as immediate // scanning errors - node = createNode(252 /* JsxOpeningElement */, fullStart); + node = createNode(255 /* JsxOpeningElement */, fullStart); scanJsxText(); } else { @@ -16931,7 +17715,7 @@ var ts; parseExpected(29 /* GreaterThanToken */, /*diagnostic*/ undefined, /*shouldAdvance*/ false); scanJsxText(); } - node = createNode(251 /* JsxSelfClosingElement */, fullStart); + node = createNode(254 /* JsxSelfClosingElement */, fullStart); } node.tagName = tagName; node.attributes = attributes; @@ -16947,7 +17731,7 @@ var ts; var expression = token() === 99 /* ThisKeyword */ ? parseTokenNode() : parseIdentifierName(); while (parseOptional(23 /* DotToken */)) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -16955,8 +17739,10 @@ var ts; return expression; } function parseJsxExpression(inExpressionContext) { - var node = createNode(260 /* JsxExpression */); - parseExpected(17 /* OpenBraceToken */); + var node = createNode(263 /* JsxExpression */); + if (!parseExpected(17 /* OpenBraceToken */)) { + return undefined; + } if (token() !== 18 /* CloseBraceToken */) { node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); @@ -16975,7 +17761,7 @@ var ts; return parseJsxSpreadAttribute(); } scanJsxIdentifier(); - var node = createNode(257 /* JsxAttribute */); + var node = createNode(260 /* JsxAttribute */); node.name = parseIdentifierName(); if (token() === 58 /* EqualsToken */) { switch (scanJsxAttributeValue()) { @@ -16990,7 +17776,7 @@ var ts; return finishNode(node); } function parseJsxSpreadAttribute() { - var node = createNode(259 /* JsxSpreadAttribute */); + var node = createNode(262 /* JsxSpreadAttribute */); parseExpected(17 /* OpenBraceToken */); parseExpected(24 /* DotDotDotToken */); node.expression = parseExpression(); @@ -16998,7 +17784,7 @@ var ts; return finishNode(node); } function parseJsxClosingElement(inExpressionContext) { - var node = createNode(253 /* JsxClosingElement */); + var node = createNode(256 /* JsxClosingElement */); parseExpected(28 /* LessThanSlashToken */); node.tagName = parseJsxElementName(); if (inExpressionContext) { @@ -17011,7 +17797,7 @@ var ts; return finishNode(node); } function parseJsxClosingFragment(inExpressionContext) { - var node = createNode(256 /* JsxClosingFragment */); + var node = createNode(259 /* JsxClosingFragment */); parseExpected(28 /* LessThanSlashToken */); if (ts.tokenIsIdentifierOrKeyword(token())) { var unexpectedTagName = parseJsxElementName(); @@ -17027,7 +17813,7 @@ var ts; return finishNode(node); } function parseTypeAssertion() { - var node = createNode(185 /* TypeAssertionExpression */); + var node = createNode(188 /* TypeAssertionExpression */); parseExpected(27 /* LessThanToken */); node.type = parseType(); parseExpected(29 /* GreaterThanToken */); @@ -17038,7 +17824,7 @@ var ts; while (true) { var dotToken = parseOptionalToken(23 /* DotToken */); if (dotToken) { - var propertyAccess = createNode(180 /* PropertyAccessExpression */, expression.pos); + var propertyAccess = createNode(183 /* PropertyAccessExpression */, expression.pos); propertyAccess.expression = expression; propertyAccess.name = parseRightSideOfDot(/*allowIdentifierNames*/ true); expression = finishNode(propertyAccess); @@ -17046,14 +17832,14 @@ var ts; } if (token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { nextToken(); - var nonNullExpression = createNode(204 /* NonNullExpression */, expression.pos); + var nonNullExpression = createNode(207 /* NonNullExpression */, expression.pos); nonNullExpression.expression = expression; expression = finishNode(nonNullExpression); continue; } // when in the [Decorator] context, we do not parse ElementAccess as it could be part of a ComputedPropertyName if (!inDecoratorContext() && parseOptional(21 /* OpenBracketToken */)) { - var indexedAccess = createNode(181 /* ElementAccessExpression */, expression.pos); + var indexedAccess = createNode(184 /* ElementAccessExpression */, expression.pos); indexedAccess.expression = expression; // It's not uncommon for a user to write: "new Type[]". // Check for that common pattern and report a better error message. @@ -17069,7 +17855,7 @@ var ts; continue; } if (token() === 13 /* NoSubstitutionTemplateLiteral */ || token() === 14 /* TemplateHead */) { - var tagExpression = createNode(184 /* TaggedTemplateExpression */, expression.pos); + var tagExpression = createNode(187 /* TaggedTemplateExpression */, expression.pos); tagExpression.tag = expression; tagExpression.template = token() === 13 /* NoSubstitutionTemplateLiteral */ ? parseLiteralNode() @@ -17092,7 +17878,7 @@ var ts; if (!typeArguments) { return expression; } - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.typeArguments = typeArguments; callExpr.arguments = parseArgumentList(); @@ -17100,7 +17886,7 @@ var ts; continue; } else if (token() === 19 /* OpenParenToken */) { - var callExpr = createNode(182 /* CallExpression */, expression.pos); + var callExpr = createNode(185 /* CallExpression */, expression.pos); callExpr.expression = expression; callExpr.arguments = parseArgumentList(); expression = finishNode(callExpr); @@ -17151,7 +17937,7 @@ var ts; case 48 /* AmpersandToken */: // foo & case 49 /* BarToken */: // foo | case 18 /* CloseBraceToken */: // foo } - case 1 /* EndOfFileToken */:// foo + case 1 /* EndOfFileToken */: // foo // these cases can't legally follow a type arg list. However, they're not legal // expressions either. The user is probably in the middle of a generic type. So // treat it as such. @@ -17210,28 +17996,28 @@ var ts; return parseIdentifier(ts.Diagnostics.Expression_expected); } function parseParenthesizedExpression() { - var node = createNodeWithJSDoc(186 /* ParenthesizedExpression */); + var node = createNodeWithJSDoc(189 /* ParenthesizedExpression */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); return finishNode(node); } function parseSpreadElement() { - var node = createNode(199 /* SpreadElement */); + var node = createNode(202 /* SpreadElement */); parseExpected(24 /* DotDotDotToken */); node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } function parseArgumentOrArrayLiteralElement() { return token() === 24 /* DotDotDotToken */ ? parseSpreadElement() : - token() === 26 /* CommaToken */ ? createNode(201 /* OmittedExpression */) : + token() === 26 /* CommaToken */ ? createNode(204 /* OmittedExpression */) : parseAssignmentExpressionOrHigher(); } function parseArgumentExpression() { return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement); } function parseArrayLiteralExpression() { - var node = createNode(178 /* ArrayLiteralExpression */); + var node = createNode(181 /* ArrayLiteralExpression */); parseExpected(21 /* OpenBracketToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17243,17 +18029,17 @@ var ts; function parseObjectLiteralElement() { var node = createNodeWithJSDoc(0 /* Unknown */); if (parseOptionalToken(24 /* DotDotDotToken */)) { - node.kind = 267 /* SpreadAssignment */; + node.kind = 270 /* SpreadAssignment */; node.expression = parseAssignmentExpressionOrHigher(); return finishNode(node); } node.decorators = parseDecorators(); node.modifiers = parseModifiers(); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } var asteriskToken = parseOptionalToken(39 /* AsteriskToken */); var tokenIsIdentifier = isIdentifier(); @@ -17270,7 +18056,7 @@ var ts; // this is necessary because ObjectLiteral productions are also used to cover grammar for ObjectAssignmentPattern var isShorthandPropertyAssignment = tokenIsIdentifier && (token() === 26 /* CommaToken */ || token() === 18 /* CloseBraceToken */ || token() === 58 /* EqualsToken */); if (isShorthandPropertyAssignment) { - node.kind = 266 /* ShorthandPropertyAssignment */; + node.kind = 269 /* ShorthandPropertyAssignment */; var equalsToken = parseOptionalToken(58 /* EqualsToken */); if (equalsToken) { node.equalsToken = equalsToken; @@ -17278,14 +18064,14 @@ var ts; } } else { - node.kind = 265 /* PropertyAssignment */; + node.kind = 268 /* PropertyAssignment */; parseExpected(56 /* ColonToken */); node.initializer = allowInAnd(parseAssignmentExpressionOrHigher); } return finishNode(node); } function parseObjectLiteralExpression() { - var node = createNode(179 /* ObjectLiteralExpression */); + var node = createNode(182 /* ObjectLiteralExpression */); parseExpected(17 /* OpenBraceToken */); if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17304,7 +18090,7 @@ var ts; if (saveDecoratorContext) { setDecoratorContext(/*val*/ false); } - var node = createNodeWithJSDoc(187 /* FunctionExpression */); + var node = createNodeWithJSDoc(190 /* FunctionExpression */); node.modifiers = parseModifiers(); parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); @@ -17329,12 +18115,12 @@ var ts; var fullStart = scanner.getStartPos(); parseExpected(94 /* NewKeyword */); if (parseOptional(23 /* DotToken */)) { - var node_2 = createNode(205 /* MetaProperty */, fullStart); + var node_2 = createNode(208 /* MetaProperty */, fullStart); node_2.keywordToken = 94 /* NewKeyword */; node_2.name = parseIdentifierName(); return finishNode(node_2); } - var node = createNode(183 /* NewExpression */, fullStart); + var node = createNode(186 /* NewExpression */, fullStart); node.expression = parseMemberExpressionOrHigher(); node.typeArguments = tryParse(parseTypeArgumentsInExpression); if (node.typeArguments || token() === 19 /* OpenParenToken */) { @@ -17344,7 +18130,7 @@ var ts; } // STATEMENTS function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) { - var node = createNode(208 /* Block */); + var node = createNode(211 /* Block */); if (parseExpected(17 /* OpenBraceToken */, diagnosticMessage) || ignoreMissingOpenBrace) { if (scanner.hasPrecedingLineBreak()) { node.multiLine = true; @@ -17377,12 +18163,12 @@ var ts; return block; } function parseEmptyStatement() { - var node = createNode(210 /* EmptyStatement */); + var node = createNode(213 /* EmptyStatement */); parseExpected(25 /* SemicolonToken */); return finishNode(node); } function parseIfStatement() { - var node = createNode(212 /* IfStatement */); + var node = createNode(215 /* IfStatement */); parseExpected(90 /* IfKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17392,7 +18178,7 @@ var ts; return finishNode(node); } function parseDoStatement() { - var node = createNode(213 /* DoStatement */); + var node = createNode(216 /* DoStatement */); parseExpected(81 /* DoKeyword */); node.statement = parseStatement(); parseExpected(106 /* WhileKeyword */); @@ -17407,7 +18193,7 @@ var ts; return finishNode(node); } function parseWhileStatement() { - var node = createNode(214 /* WhileStatement */); + var node = createNode(217 /* WhileStatement */); parseExpected(106 /* WhileKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17420,7 +18206,7 @@ var ts; parseExpected(88 /* ForKeyword */); var awaitToken = parseOptionalToken(121 /* AwaitKeyword */); parseExpected(19 /* OpenParenToken */); - var initializer = undefined; + var initializer; if (token() !== 25 /* SemicolonToken */) { if (token() === 104 /* VarKeyword */ || token() === 110 /* LetKeyword */ || token() === 76 /* ConstKeyword */) { initializer = parseVariableDeclarationList(/*inForStatementInitializer*/ true); @@ -17430,8 +18216,8 @@ var ts; } } var forOrForInOrForOfStatement; - if (awaitToken ? parseExpected(143 /* OfKeyword */) : parseOptional(143 /* OfKeyword */)) { - var forOfStatement = createNode(217 /* ForOfStatement */, pos); + if (awaitToken ? parseExpected(144 /* OfKeyword */) : parseOptional(144 /* OfKeyword */)) { + var forOfStatement = createNode(220 /* ForOfStatement */, pos); forOfStatement.awaitModifier = awaitToken; forOfStatement.initializer = initializer; forOfStatement.expression = allowInAnd(parseAssignmentExpressionOrHigher); @@ -17439,14 +18225,14 @@ var ts; forOrForInOrForOfStatement = forOfStatement; } else if (parseOptional(92 /* InKeyword */)) { - var forInStatement = createNode(216 /* ForInStatement */, pos); + var forInStatement = createNode(219 /* ForInStatement */, pos); forInStatement.initializer = initializer; forInStatement.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); forOrForInOrForOfStatement = forInStatement; } else { - var forStatement = createNode(215 /* ForStatement */, pos); + var forStatement = createNode(218 /* ForStatement */, pos); forStatement.initializer = initializer; parseExpected(25 /* SemicolonToken */); if (token() !== 25 /* SemicolonToken */ && token() !== 20 /* CloseParenToken */) { @@ -17464,7 +18250,7 @@ var ts; } function parseBreakOrContinueStatement(kind) { var node = createNode(kind); - parseExpected(kind === 219 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); + parseExpected(kind === 222 /* BreakStatement */ ? 72 /* BreakKeyword */ : 77 /* ContinueKeyword */); if (!canParseSemicolon()) { node.label = parseIdentifier(); } @@ -17472,7 +18258,7 @@ var ts; return finishNode(node); } function parseReturnStatement() { - var node = createNode(220 /* ReturnStatement */); + var node = createNode(223 /* ReturnStatement */); parseExpected(96 /* ReturnKeyword */); if (!canParseSemicolon()) { node.expression = allowInAnd(parseExpression); @@ -17481,7 +18267,7 @@ var ts; return finishNode(node); } function parseWithStatement() { - var node = createNode(221 /* WithStatement */); + var node = createNode(224 /* WithStatement */); parseExpected(107 /* WithKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); @@ -17490,7 +18276,7 @@ var ts; return finishNode(node); } function parseCaseClause() { - var node = createNode(261 /* CaseClause */); + var node = createNode(264 /* CaseClause */); parseExpected(73 /* CaseKeyword */); node.expression = allowInAnd(parseExpression); parseExpected(56 /* ColonToken */); @@ -17498,7 +18284,7 @@ var ts; return finishNode(node); } function parseDefaultClause() { - var node = createNode(262 /* DefaultClause */); + var node = createNode(265 /* DefaultClause */); parseExpected(79 /* DefaultKeyword */); parseExpected(56 /* ColonToken */); node.statements = parseList(3 /* SwitchClauseStatements */, parseStatement); @@ -17508,12 +18294,12 @@ var ts; return token() === 73 /* CaseKeyword */ ? parseCaseClause() : parseDefaultClause(); } function parseSwitchStatement() { - var node = createNode(222 /* SwitchStatement */); + var node = createNode(225 /* SwitchStatement */); parseExpected(98 /* SwitchKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = allowInAnd(parseExpression); parseExpected(20 /* CloseParenToken */); - var caseBlock = createNode(236 /* CaseBlock */); + var caseBlock = createNode(239 /* CaseBlock */); parseExpected(17 /* OpenBraceToken */); caseBlock.clauses = parseList(2 /* SwitchClauses */, parseCaseOrDefaultClause); parseExpected(18 /* CloseBraceToken */); @@ -17528,7 +18314,7 @@ var ts; // directly as that might consume an expression on the following line. // We just return 'undefined' in that case. The actual error will be reported in the // grammar walker. - var node = createNode(224 /* ThrowStatement */); + var node = createNode(227 /* ThrowStatement */); parseExpected(100 /* ThrowKeyword */); node.expression = scanner.hasPrecedingLineBreak() ? undefined : allowInAnd(parseExpression); parseSemicolon(); @@ -17536,7 +18322,7 @@ var ts; } // TODO: Review for error recovery function parseTryStatement() { - var node = createNode(225 /* TryStatement */); + var node = createNode(228 /* TryStatement */); parseExpected(102 /* TryKeyword */); node.tryBlock = parseBlock(/*ignoreMissingOpenBrace*/ false); node.catchClause = token() === 74 /* CatchKeyword */ ? parseCatchClause() : undefined; @@ -17549,7 +18335,7 @@ var ts; return finishNode(node); } function parseCatchClause() { - var result = createNode(264 /* CatchClause */); + var result = createNode(267 /* CatchClause */); parseExpected(74 /* CatchKeyword */); if (parseOptional(19 /* OpenParenToken */)) { result.variableDeclaration = parseVariableDeclaration(); @@ -17563,7 +18349,7 @@ var ts; return finishNode(result); } function parseDebuggerStatement() { - var node = createNode(226 /* DebuggerStatement */); + var node = createNode(229 /* DebuggerStatement */); parseExpected(78 /* DebuggerKeyword */); parseSemicolon(); return finishNode(node); @@ -17575,12 +18361,12 @@ var ts; var node = createNodeWithJSDoc(0 /* Unknown */); var expression = allowInAnd(parseExpression); if (expression.kind === 71 /* Identifier */ && parseOptional(56 /* ColonToken */)) { - node.kind = 223 /* LabeledStatement */; + node.kind = 226 /* LabeledStatement */; node.label = expression; node.statement = parseStatement(); } else { - node.kind = 211 /* ExpressionStatement */; + node.kind = 214 /* ExpressionStatement */; node.expression = expression; parseSemicolon(); } @@ -17634,10 +18420,10 @@ var ts; // // could be legal, it would add complexity for very little gain. case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return nextTokenIsIdentifierOnSameLine(); - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return nextTokenIsIdentifierOrStringLiteralOnSameLine(); case 117 /* AbstractKeyword */: case 120 /* AsyncKeyword */: @@ -17645,14 +18431,14 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 114 /* PublicKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: nextToken(); // ASI takes effect for this modifier. if (scanner.hasPrecedingLineBreak()) { return false; } continue; - case 142 /* GlobalKeyword */: + case 143 /* GlobalKeyword */: nextToken(); return token() === 17 /* OpenBraceToken */ || token() === 71 /* Identifier */ || token() === 84 /* ExportKeyword */; case 91 /* ImportKeyword */: @@ -17713,17 +18499,17 @@ var ts; case 120 /* AsyncKeyword */: case 124 /* DeclareKeyword */: case 109 /* InterfaceKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: - case 138 /* TypeKeyword */: - case 142 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 143 /* GlobalKeyword */: // When these don't start a declaration, they're an identifier in an expression statement return true; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // When these don't start a declaration, they may be the start of a class member if an identifier // immediately follows. Otherwise they're an identifier in an expression statement. return isStartOfDeclaration() || !lookAhead(nextTokenIsIdentifierOrKeywordOnSameLine); @@ -17747,16 +18533,16 @@ var ts; case 17 /* OpenBraceToken */: return parseBlock(/*ignoreMissingOpenBrace*/ false); case 104 /* VarKeyword */: - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); case 110 /* LetKeyword */: if (isLetDeclaration()) { - return parseVariableStatement(createNodeWithJSDoc(227 /* VariableDeclaration */)); + return parseVariableStatement(createNodeWithJSDoc(230 /* VariableDeclaration */)); } break; case 89 /* FunctionKeyword */: - return parseFunctionDeclaration(createNodeWithJSDoc(229 /* FunctionDeclaration */)); + return parseFunctionDeclaration(createNodeWithJSDoc(232 /* FunctionDeclaration */)); case 75 /* ClassKeyword */: - return parseClassDeclaration(createNodeWithJSDoc(230 /* ClassDeclaration */)); + return parseClassDeclaration(createNodeWithJSDoc(233 /* ClassDeclaration */)); case 90 /* IfKeyword */: return parseIfStatement(); case 81 /* DoKeyword */: @@ -17766,9 +18552,9 @@ var ts; case 88 /* ForKeyword */: return parseForOrForInOrForOfStatement(); case 77 /* ContinueKeyword */: - return parseBreakOrContinueStatement(218 /* ContinueStatement */); + return parseBreakOrContinueStatement(221 /* ContinueStatement */); case 72 /* BreakKeyword */: - return parseBreakOrContinueStatement(219 /* BreakStatement */); + return parseBreakOrContinueStatement(222 /* BreakStatement */); case 96 /* ReturnKeyword */: return parseReturnStatement(); case 107 /* WithKeyword */: @@ -17788,9 +18574,9 @@ var ts; return parseDeclaration(); case 120 /* AsyncKeyword */: case 109 /* InterfaceKeyword */: - case 138 /* TypeKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 139 /* TypeKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: case 83 /* EnumKeyword */: @@ -17801,8 +18587,8 @@ var ts; case 114 /* PublicKeyword */: case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: - case 142 /* GlobalKeyword */: + case 132 /* ReadonlyKeyword */: + case 143 /* GlobalKeyword */: if (isStartOfDeclaration()) { return parseDeclaration(); } @@ -17840,13 +18626,13 @@ var ts; return parseClassDeclaration(node); case 109 /* InterfaceKeyword */: return parseInterfaceDeclaration(node); - case 138 /* TypeKeyword */: + case 139 /* TypeKeyword */: return parseTypeAliasDeclaration(node); case 83 /* EnumKeyword */: return parseEnumDeclaration(node); - case 142 /* GlobalKeyword */: - case 128 /* ModuleKeyword */: - case 129 /* NamespaceKeyword */: + case 143 /* GlobalKeyword */: + case 129 /* ModuleKeyword */: + case 130 /* NamespaceKeyword */: return parseModuleDeclaration(node); case 91 /* ImportKeyword */: return parseImportDeclarationOrImportEqualsDeclaration(node); @@ -17865,7 +18651,7 @@ var ts; if (node.decorators || node.modifiers) { // We reached this point because we encountered decorators and/or modifiers and assumed a declaration // would follow. For recovery and error reporting purposes, return an incomplete declaration. - var missing = createMissingNode(248 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); + var missing = createMissingNode(251 /* MissingDeclaration */, /*reportAtCurrentPosition*/ true, ts.Diagnostics.Declaration_expected); missing.pos = node.pos; missing.decorators = node.decorators; missing.modifiers = node.modifiers; @@ -17887,16 +18673,16 @@ var ts; // DECLARATIONS function parseArrayBindingElement() { if (token() === 26 /* CommaToken */) { - return createNode(201 /* OmittedExpression */); + return createNode(204 /* OmittedExpression */); } - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); node.name = parseIdentifierOrPattern(); node.initializer = parseInitializer(); return finishNode(node); } function parseObjectBindingElement() { - var node = createNode(177 /* BindingElement */); + var node = createNode(180 /* BindingElement */); node.dotDotDotToken = parseOptionalToken(24 /* DotDotDotToken */); var tokenIsIdentifier = isIdentifier(); var propertyName = parsePropertyName(); @@ -17912,14 +18698,14 @@ var ts; return finishNode(node); } function parseObjectBindingPattern() { - var node = createNode(175 /* ObjectBindingPattern */); + var node = createNode(178 /* ObjectBindingPattern */); parseExpected(17 /* OpenBraceToken */); node.elements = parseDelimitedList(9 /* ObjectBindingElements */, parseObjectBindingElement); parseExpected(18 /* CloseBraceToken */); return finishNode(node); } function parseArrayBindingPattern() { - var node = createNode(176 /* ArrayBindingPattern */); + var node = createNode(179 /* ArrayBindingPattern */); parseExpected(21 /* OpenBracketToken */); node.elements = parseDelimitedList(10 /* ArrayBindingElements */, parseArrayBindingElement); parseExpected(22 /* CloseBracketToken */); @@ -17941,7 +18727,7 @@ var ts; return parseVariableDeclaration(/*allowExclamation*/ true); } function parseVariableDeclaration(allowExclamation) { - var node = createNode(227 /* VariableDeclaration */); + var node = createNode(230 /* VariableDeclaration */); node.name = parseIdentifierOrPattern(); if (allowExclamation && node.name.kind === 71 /* Identifier */ && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { @@ -17954,7 +18740,7 @@ var ts; return finishNode(node); } function parseVariableDeclarationList(inForStatementInitializer) { - var node = createNode(228 /* VariableDeclarationList */); + var node = createNode(231 /* VariableDeclarationList */); switch (token()) { case 104 /* VarKeyword */: break; @@ -17977,7 +18763,7 @@ var ts; // So we need to look ahead to determine if 'of' should be treated as a keyword in // this context. // The checker will then give an error that there is an empty declaration list. - if (token() === 143 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { + if (token() === 144 /* OfKeyword */ && lookAhead(canFollowContextualOfKeyword)) { node.declarations = createMissingList(); } else { @@ -17992,13 +18778,13 @@ var ts; return nextTokenIsIdentifier() && nextToken() === 20 /* CloseParenToken */; } function parseVariableStatement(node) { - node.kind = 209 /* VariableStatement */; + node.kind = 212 /* VariableStatement */; node.declarationList = parseVariableDeclarationList(/*inForStatementInitializer*/ false); parseSemicolon(); return finishNode(node); } function parseFunctionDeclaration(node) { - node.kind = 229 /* FunctionDeclaration */; + node.kind = 232 /* FunctionDeclaration */; parseExpected(89 /* FunctionKeyword */); node.asteriskToken = parseOptionalToken(39 /* AsteriskToken */); node.name = ts.hasModifier(node, 512 /* Default */) ? parseOptionalIdentifier() : parseIdentifier(); @@ -18009,14 +18795,14 @@ var ts; return finishNode(node); } function parseConstructorDeclaration(node) { - node.kind = 153 /* Constructor */; + node.kind = 154 /* Constructor */; parseExpected(123 /* ConstructorKeyword */); fillSignature(56 /* ColonToken */, 0 /* None */, node); node.body = parseFunctionBlockOrSemicolon(0 /* None */, ts.Diagnostics.or_expected); return finishNode(node); } function parseMethodDeclaration(node, asteriskToken, diagnosticMessage) { - node.kind = 152 /* MethodDeclaration */; + node.kind = 153 /* MethodDeclaration */; node.asteriskToken = asteriskToken; var isGenerator = asteriskToken ? 1 /* Yield */ : 0 /* None */; var isAsync = ts.hasModifier(node, 256 /* Async */) ? 2 /* Await */ : 0 /* None */; @@ -18025,7 +18811,7 @@ var ts; return finishNode(node); } function parsePropertyDeclaration(node) { - node.kind = 150 /* PropertyDeclaration */; + node.kind = 151 /* PropertyDeclaration */; if (!node.questionToken && token() === 51 /* ExclamationToken */ && !scanner.hasPrecedingLineBreak()) { node.exclamationToken = parseTokenNode(); } @@ -18069,7 +18855,7 @@ var ts; case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: case 115 /* StaticKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; default: return false; @@ -18110,7 +18896,7 @@ var ts; // If we were able to get any potential identifier... if (idToken !== undefined) { // If we have a non-keyword identifier, or if we have an accessor, then it's safe to parse. - if (!ts.isKeyword(idToken) || idToken === 135 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { + if (!ts.isKeyword(idToken) || idToken === 136 /* SetKeyword */ || idToken === 125 /* GetKeyword */) { return true; } // If it *is* a keyword, but not an accessor, check a little farther along @@ -18121,7 +18907,7 @@ var ts; case 51 /* ExclamationToken */: // Non-null assertion on property name case 56 /* ColonToken */: // Type Annotation for declaration case 58 /* EqualsToken */: // Initializer for declaration - case 55 /* QuestionToken */:// Not valid, but permitted so that it gets caught later on. + case 55 /* QuestionToken */: // Not valid, but permitted so that it gets caught later on. return true; default: // Covers @@ -18142,7 +18928,7 @@ var ts; if (!parseOptional(57 /* AtToken */)) { break; } - var decorator = createNode(148 /* Decorator */, decoratorStart); + var decorator = createNode(149 /* Decorator */, decoratorStart); decorator.expression = doInDecoratorContext(parseLeftHandSideExpressionOrHigher); finishNode(decorator); (list || (list = [])).push(decorator); @@ -18192,7 +18978,7 @@ var ts; } function parseClassElement() { if (token() === 25 /* SemicolonToken */) { - var result = createNode(207 /* SemicolonClassElement */); + var result = createNode(210 /* SemicolonClassElement */); nextToken(); return finishNode(result); } @@ -18200,10 +18986,10 @@ var ts; node.decorators = parseDecorators(); node.modifiers = parseModifiers(/*permitInvalidConstAsModifier*/ true); if (parseContextualModifier(125 /* GetKeyword */)) { - return parseAccessorDeclaration(node, 154 /* GetAccessor */); + return parseAccessorDeclaration(node, 155 /* GetAccessor */); } - if (parseContextualModifier(135 /* SetKeyword */)) { - return parseAccessorDeclaration(node, 155 /* SetAccessor */); + if (parseContextualModifier(136 /* SetKeyword */)) { + return parseAccessorDeclaration(node, 156 /* SetAccessor */); } if (token() === 123 /* ConstructorKeyword */) { return parseConstructorDeclaration(node); @@ -18229,10 +19015,10 @@ var ts; ts.Debug.fail("Should not have attempted to parse class member declaration."); } function parseClassExpression() { - return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 200 /* ClassExpression */); + return parseClassDeclarationOrExpression(createNodeWithJSDoc(0 /* Unknown */), 203 /* ClassExpression */); } function parseClassDeclaration(node) { - return parseClassDeclarationOrExpression(node, 230 /* ClassDeclaration */); + return parseClassDeclarationOrExpression(node, 233 /* ClassDeclaration */); } function parseClassDeclarationOrExpression(node, kind) { node.kind = kind; @@ -18275,7 +19061,7 @@ var ts; function parseHeritageClause() { var tok = token(); if (tok === 85 /* ExtendsKeyword */ || tok === 108 /* ImplementsKeyword */) { - var node = createNode(263 /* HeritageClause */); + var node = createNode(266 /* HeritageClause */); node.token = tok; nextToken(); node.types = parseDelimitedList(7 /* HeritageClauseElement */, parseExpressionWithTypeArguments); @@ -18284,7 +19070,7 @@ var ts; return undefined; } function parseExpressionWithTypeArguments() { - var node = createNode(202 /* ExpressionWithTypeArguments */); + var node = createNode(205 /* ExpressionWithTypeArguments */); node.expression = parseLeftHandSideExpressionOrHigher(); node.typeArguments = tryParseTypeArguments(); return finishNode(node); @@ -18301,7 +19087,7 @@ var ts; return parseList(5 /* ClassMembers */, parseClassElement); } function parseInterfaceDeclaration(node) { - node.kind = 231 /* InterfaceDeclaration */; + node.kind = 234 /* InterfaceDeclaration */; parseExpected(109 /* InterfaceKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); @@ -18310,8 +19096,8 @@ var ts; return finishNode(node); } function parseTypeAliasDeclaration(node) { - node.kind = 232 /* TypeAliasDeclaration */; - parseExpected(138 /* TypeKeyword */); + node.kind = 235 /* TypeAliasDeclaration */; + parseExpected(139 /* TypeKeyword */); node.name = parseIdentifier(); node.typeParameters = parseTypeParameters(); parseExpected(58 /* EqualsToken */); @@ -18324,13 +19110,13 @@ var ts; // ConstantEnumMemberSection, which starts at the beginning of an enum declaration // or any time an integer literal initializer is encountered. function parseEnumMember() { - var node = createNodeWithJSDoc(268 /* EnumMember */); + var node = createNodeWithJSDoc(271 /* EnumMember */); node.name = parsePropertyName(); node.initializer = allowInAnd(parseInitializer); return finishNode(node); } function parseEnumDeclaration(node) { - node.kind = 233 /* EnumDeclaration */; + node.kind = 236 /* EnumDeclaration */; parseExpected(83 /* EnumKeyword */); node.name = parseIdentifier(); if (parseExpected(17 /* OpenBraceToken */)) { @@ -18343,7 +19129,7 @@ var ts; return finishNode(node); } function parseModuleBlock() { - var node = createNode(235 /* ModuleBlock */); + var node = createNode(238 /* ModuleBlock */); if (parseExpected(17 /* OpenBraceToken */)) { node.statements = parseList(1 /* BlockStatements */, parseStatement); parseExpected(18 /* CloseBraceToken */); @@ -18354,7 +19140,7 @@ var ts; return finishNode(node); } function parseModuleOrNamespaceDeclaration(node, flags) { - node.kind = 234 /* ModuleDeclaration */; + node.kind = 237 /* ModuleDeclaration */; // If we are parsing a dotted namespace name, we want to // propagate the 'Namespace' flag across the names if set. var namespaceFlag = flags & 16 /* Namespace */; @@ -18366,8 +19152,8 @@ var ts; return finishNode(node); } function parseAmbientExternalModuleDeclaration(node) { - node.kind = 234 /* ModuleDeclaration */; - if (token() === 142 /* GlobalKeyword */) { + node.kind = 237 /* ModuleDeclaration */; + if (token() === 143 /* GlobalKeyword */) { // parse 'global' as name of global scope augmentation node.name = parseIdentifier(); node.flags |= 512 /* GlobalAugmentation */; @@ -18386,15 +19172,15 @@ var ts; } function parseModuleDeclaration(node) { var flags = 0; - if (token() === 142 /* GlobalKeyword */) { + if (token() === 143 /* GlobalKeyword */) { // global augmentation return parseAmbientExternalModuleDeclaration(node); } - else if (parseOptional(129 /* NamespaceKeyword */)) { + else if (parseOptional(130 /* NamespaceKeyword */)) { flags |= 16 /* Namespace */; } else { - parseExpected(128 /* ModuleKeyword */); + parseExpected(129 /* ModuleKeyword */); if (token() === 9 /* StringLiteral */) { return parseAmbientExternalModuleDeclaration(node); } @@ -18402,7 +19188,7 @@ var ts; return parseModuleOrNamespaceDeclaration(node, flags); } function isExternalModuleReference() { - return token() === 132 /* RequireKeyword */ && + return token() === 133 /* RequireKeyword */ && lookAhead(nextTokenIsOpenParen); } function nextTokenIsOpenParen() { @@ -18412,9 +19198,9 @@ var ts; return nextToken() === 41 /* SlashToken */; } function parseNamespaceExportDeclaration(node) { - node.kind = 237 /* NamespaceExportDeclaration */; + node.kind = 240 /* NamespaceExportDeclaration */; parseExpected(118 /* AsKeyword */); - parseExpected(129 /* NamespaceKeyword */); + parseExpected(130 /* NamespaceKeyword */); node.name = parseIdentifier(); parseSemicolon(); return finishNode(node); @@ -18425,27 +19211,27 @@ var ts; var identifier; if (isIdentifier()) { identifier = parseIdentifier(); - if (token() !== 26 /* CommaToken */ && token() !== 141 /* FromKeyword */) { + if (token() !== 26 /* CommaToken */ && token() !== 142 /* FromKeyword */) { return parseImportEqualsDeclaration(node, identifier); } } // Import statement - node.kind = 239 /* ImportDeclaration */; + node.kind = 242 /* ImportDeclaration */; // ImportDeclaration: // import ImportClause from ModuleSpecifier ; // import ModuleSpecifier; if (identifier || // import id token() === 39 /* AsteriskToken */ || // import * - token() === 17 /* OpenBraceToken */) { + token() === 17 /* OpenBraceToken */) { // import { node.importClause = parseImportClause(identifier, afterImportPos); - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); } node.moduleSpecifier = parseModuleSpecifier(); parseSemicolon(); return finishNode(node); } function parseImportEqualsDeclaration(node, identifier) { - node.kind = 238 /* ImportEqualsDeclaration */; + node.kind = 241 /* ImportEqualsDeclaration */; node.name = identifier; parseExpected(58 /* EqualsToken */); node.moduleReference = parseModuleReference(); @@ -18459,7 +19245,7 @@ var ts; // NamedImports // ImportedDefaultBinding, NameSpaceImport // ImportedDefaultBinding, NamedImports - var importClause = createNode(240 /* ImportClause */, fullStart); + var importClause = createNode(243 /* ImportClause */, fullStart); if (identifier) { // ImportedDefaultBinding: // ImportedBinding @@ -18469,7 +19255,7 @@ var ts; // parse namespace or named imports if (!importClause.name || parseOptional(26 /* CommaToken */)) { - importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(242 /* NamedImports */); + importClause.namedBindings = token() === 39 /* AsteriskToken */ ? parseNamespaceImport() : parseNamedImportsOrExports(245 /* NamedImports */); } return finishNode(importClause); } @@ -18479,8 +19265,8 @@ var ts; : parseEntityName(/*allowReservedWords*/ false); } function parseExternalModuleReference() { - var node = createNode(249 /* ExternalModuleReference */); - parseExpected(132 /* RequireKeyword */); + var node = createNode(252 /* ExternalModuleReference */); + parseExpected(133 /* RequireKeyword */); parseExpected(19 /* OpenParenToken */); node.expression = parseModuleSpecifier(); parseExpected(20 /* CloseParenToken */); @@ -18502,7 +19288,7 @@ var ts; function parseNamespaceImport() { // NameSpaceImport: // * as ImportedBinding - var namespaceImport = createNode(241 /* NamespaceImport */); + var namespaceImport = createNode(244 /* NamespaceImport */); parseExpected(39 /* AsteriskToken */); parseExpected(118 /* AsKeyword */); namespaceImport.name = parseIdentifier(); @@ -18517,14 +19303,14 @@ var ts; // ImportsList: // ImportSpecifier // ImportsList, ImportSpecifier - node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 242 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); + node.elements = parseBracketedList(22 /* ImportOrExportSpecifiers */, kind === 245 /* NamedImports */ ? parseImportSpecifier : parseExportSpecifier, 17 /* OpenBraceToken */, 18 /* CloseBraceToken */); return finishNode(node); } function parseExportSpecifier() { - return parseImportOrExportSpecifier(247 /* ExportSpecifier */); + return parseImportOrExportSpecifier(250 /* ExportSpecifier */); } function parseImportSpecifier() { - return parseImportOrExportSpecifier(243 /* ImportSpecifier */); + return parseImportOrExportSpecifier(246 /* ImportSpecifier */); } function parseImportOrExportSpecifier(kind) { var node = createNode(kind); @@ -18549,25 +19335,25 @@ var ts; else { node.name = identifierName; } - if (kind === 243 /* ImportSpecifier */ && checkIdentifierIsKeyword) { + if (kind === 246 /* ImportSpecifier */ && checkIdentifierIsKeyword) { // Report error identifier expected parseErrorAtPosition(checkIdentifierStart, checkIdentifierEnd - checkIdentifierStart, ts.Diagnostics.Identifier_expected); } return finishNode(node); } function parseExportDeclaration(node) { - node.kind = 245 /* ExportDeclaration */; + node.kind = 248 /* ExportDeclaration */; if (parseOptional(39 /* AsteriskToken */)) { - parseExpected(141 /* FromKeyword */); + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } else { - node.exportClause = parseNamedImportsOrExports(246 /* NamedExports */); + node.exportClause = parseNamedImportsOrExports(249 /* NamedExports */); // It is not uncommon to accidentally omit the 'from' keyword. Additionally, in editing scenarios, // the 'from' keyword can be parsed as a named export when the export clause is unterminated (i.e. `export { from "moduleName";`) // If we don't have a 'from' keyword, see if we have a string literal such that ASI won't take effect. - if (token() === 141 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { - parseExpected(141 /* FromKeyword */); + if (token() === 142 /* FromKeyword */ || (token() === 9 /* StringLiteral */ && !scanner.hasPrecedingLineBreak())) { + parseExpected(142 /* FromKeyword */); node.moduleSpecifier = parseModuleSpecifier(); } } @@ -18575,7 +19361,7 @@ var ts; return finishNode(node); } function parseExportAssignment(node) { - node.kind = 244 /* ExportAssignment */; + node.kind = 247 /* ExportAssignment */; if (parseOptional(58 /* EqualsToken */)) { node.isExportEquals = true; } @@ -18586,94 +19372,13 @@ var ts; parseSemicolon(); return finishNode(node); } - function processReferenceComments(sourceFile) { - var triviaScanner = ts.createScanner(sourceFile.languageVersion, /*skipTrivia*/ false, 0 /* Standard */, sourceText); - var referencedFiles = []; - var typeReferenceDirectives = []; - var amdDependencies = []; - var amdModuleName; - var checkJsDirective = undefined; - // Keep scanning all the leading trivia in the file until we get to something that - // isn't trivia. Any single line comment will be analyzed to see if it is a - // reference comment. - while (true) { - var kind = triviaScanner.scan(); - if (kind !== 2 /* SingleLineCommentTrivia */) { - if (ts.isTrivia(kind)) { - continue; - } - else { - break; - } - } - var range = { - kind: triviaScanner.getToken(), - pos: triviaScanner.getTokenPos(), - end: triviaScanner.getTextPos(), - }; - var comment = sourceText.substring(range.pos, range.end); - var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, range); - if (referencePathMatchResult) { - var fileReference = referencePathMatchResult.fileReference; - sourceFile.hasNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - var diagnosticMessage = referencePathMatchResult.diagnosticMessage; - if (fileReference) { - if (referencePathMatchResult.isTypeReferenceDirective) { - typeReferenceDirectives.push(fileReference); - } - else { - referencedFiles.push(fileReference); - } - } - if (diagnosticMessage) { - parseDiagnostics.push(ts.createFileDiagnostic(sourceFile, range.pos, range.end - range.pos, diagnosticMessage)); - } - } - else { - var amdModuleNameRegEx = /^\/\/\/\s* context.checkJsDirective.pos) { + context.checkJsDirective = { + enabled: key === "ts-check", + end: entry.range.end, + pos: entry.range.pos + }; + } + }); + break; + } + case "jsx": return; // Accessed directly + default: ts.Debug.fail("Unhandled pragma kind"); // Can this be made into an assertNever in the future? + } + }); + } + ts.processPragmasIntoFields = processPragmasIntoFields; + var namedArgRegExCache = ts.createMap(); + function getNamedArgRegEx(name) { + if (namedArgRegExCache.has(name)) { + return namedArgRegExCache.get(name); + } + var result = new RegExp("(\\s" + name + "\\s*=\\s*)('|\")(.+?)\\2", "im"); + namedArgRegExCache.set(name, result); + return result; + } + var tripleSlashXMLCommentStartRegEx = /^\/\/\/\s*<(\S+)\s.*?\/>/im; + var singleLinePragmaRegEx = /^\/\/\/?\s*@(\S+)\s*(.*)\s*$/im; + function extractPragmas(pragmas, range, text) { + var tripleSlash = tripleSlashXMLCommentStartRegEx.exec(text); + if (tripleSlash) { + var name = tripleSlash[1].toLowerCase(); // Technically unsafe cast, but we do it so the below check to make it safe typechecks + var pragma = ts.commentPragmas[name]; + if (!pragma || !(pragma.kind & 1 /* TripleSlashXML */)) { + return; + } + if (pragma.args) { + var argument = {}; + for (var _i = 0, _a = pragma.args; _i < _a.length; _i++) { + var arg = _a[_i]; + var matcher = getNamedArgRegEx(arg.name); + var matchResult = matcher.exec(text); + if (!matchResult && !arg.optional) { + return; // Missing required argument, don't parse + } + else if (matchResult) { + if (arg.captureSpan) { + var startPos = range.pos + matchResult.index + matchResult[1].length + matchResult[2].length; + argument[arg.name] = { + value: matchResult[3], + pos: startPos, + end: startPos + matchResult[3].length + }; + } + else { + argument[arg.name] = matchResult[3]; + } + } + } + pragmas.push({ name: name, args: { arguments: argument, range: range } }); + } + else { + pragmas.push({ name: name, args: { arguments: {}, range: range } }); + } + return; + } + var singleLine = singleLinePragmaRegEx.exec(text); + if (singleLine) { + return addPragmaForMatch(pragmas, range, 2 /* SingleLine */, singleLine); + } + var multiLinePragmaRegEx = /\s*@(\S+)\s*(.*)\s*$/gim; // Defined inline since it uses the "g" flag, which keeps a persistent index (for iterating) + var multiLineMatch; + while (multiLineMatch = multiLinePragmaRegEx.exec(text)) { + addPragmaForMatch(pragmas, range, 4 /* MultiLine */, multiLineMatch); + } + } + function addPragmaForMatch(pragmas, range, kind, match) { + if (!match) + return; + var name = match[1].toLowerCase(); // Technically unsafe cast, but we do it so they below check to make it safe typechecks + var pragma = ts.commentPragmas[name]; + if (!pragma || !(pragma.kind & kind)) { + return; + } + var args = match[2]; // Split on spaces and match up positionally with definition + var argument = getNamedPragmaArguments(pragma, args); + if (argument === "fail") + return; // Missing required argument, fail to parse it + pragmas.push({ name: name, args: { arguments: argument, range: range } }); + return; + } + function getNamedPragmaArguments(pragma, text) { + if (!text) + return {}; + if (!pragma.args) + return {}; + var args = text.split(/\s+/); + var argMap = {}; + for (var i = 0; i < pragma.args.length; i++) { + var argument = pragma.args[i]; + if (!args[i] && !argument.optional) { + return "fail"; + } + if (argument.captureSpan) { + return ts.Debug.fail("Capture spans not yet implemented for non-xml pragmas"); + } + argMap[argument.name] = args[i]; + } + return argMap; + } })(ts || (ts = {})); /// /// @@ -19899,24 +20807,24 @@ var ts; // A module is uninstantiated if it contains only switch (node.kind) { // 1. interface declarations, type alias declarations - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return 0 /* NonInstantiated */; // 2. const enum declarations - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (ts.isConst(node)) { return 2 /* ConstEnumOnly */; } break; // 3. non-exported import declarations - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: if (!(ts.hasModifier(node, 1 /* Export */))) { return 0 /* NonInstantiated */; } break; // 4. other uninstantiated module declarations. - case 235 /* ModuleBlock */: { + case 238 /* ModuleBlock */: { var state_1 = 0 /* NonInstantiated */; ts.forEachChild(node, function (n) { var childState = getModuleInstanceStateWorker(n); @@ -19938,7 +20846,7 @@ var ts; }); return state_1; } - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return getModuleInstanceState(node); case 71 /* Identifier */: // Only jsdoc typedef definition can exist in jsdoc namespace, and it should @@ -20085,10 +20993,10 @@ var ts; if (symbolFlags & 6240 /* HasMembers */ && !symbol.members) { symbol.members = ts.createSymbolTable(); } - if (symbolFlags & 107455 /* Value */) { + if (symbolFlags & 67216319 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || - (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 234 /* ModuleDeclaration */)) { + (valueDeclaration.kind !== node.kind && valueDeclaration.kind === 237 /* ModuleDeclaration */)) { // other kinds of value declarations take precedence over modules symbol.valueDeclaration = node; } @@ -20097,7 +21005,7 @@ var ts; // Should not be called on a declaration with a computed property name, // unless it is a well known Symbol. function getDeclarationName(node) { - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { return node.isExportEquals ? "export=" /* ExportEquals */ : "default" /* Default */; } var name = ts.getNameOfDeclaration(node); @@ -20106,7 +21014,7 @@ var ts; var moduleName = ts.getTextOfIdentifierOrLiteral(name); return (ts.isGlobalScopeAugmentation(node) ? "__global" : "\"" + moduleName + "\""); } - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { var nameExpression = name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -20115,47 +21023,47 @@ var ts; ts.Debug.assert(ts.isWellKnownSymbolSyntactically(nameExpression)); return ts.getPropertyNameForKnownSymbolName(ts.idText(nameExpression.name)); } - return ts.getEscapedTextOfIdentifierOrLiteral(name); + return ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "__constructor" /* Constructor */; - case 161 /* FunctionType */: - case 156 /* CallSignature */: + case 162 /* FunctionType */: + case 157 /* CallSignature */: return "__call" /* Call */; - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: return "__new" /* New */; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "__index" /* Index */; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return "__export" /* ExportStar */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) === 2 /* ModuleExports */) { // module.exports = ... return "export=" /* ExportEquals */; } ts.Debug.fail("Unknown binary declaration kind"); break; - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: return (ts.hasModifier(node, 512 /* Default */) ? "default" /* Default */ : undefined); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return (ts.isJSDocConstructSignature(node) ? "__new" /* New */ : "__call" /* Call */); - case 147 /* Parameter */: + case 148 /* Parameter */: // Parameters with names are handled at the top of this function. Parameters // without names can only come from JSDocFunctionTypes. - ts.Debug.assert(node.parent.kind === 277 /* JSDocFunctionType */); + ts.Debug.assert(node.parent.kind === 280 /* JSDocFunctionType */, "Impossible parameter parent kind", function () { return "parent is: " + (ts.SyntaxKind ? ts.SyntaxKind[node.parent.kind] : node.parent.kind) + ", expected JSDocFunctionType"; }); var functionType = node.parent; var index = functionType.parameters.indexOf(node); return "arg" + index; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: var name_2 = ts.getNameOfJSDocTypedef(node); return typeof name_2 !== "undefined" ? name_2.escapedText : undefined; } } function getDisplayName(node) { - return node.name ? ts.declarationNameToString(node.name) : ts.unescapeLeadingUnderscores(getDeclarationName(node)); + return ts.isNamedDeclaration(node) ? ts.declarationNameToString(node.name) : ts.unescapeLeadingUnderscores(getDeclarationName(node)); } /** * Declares a Symbol for the node and adds it to symbols. Reports errors for conflicting identifier names. @@ -20218,7 +21126,7 @@ var ts; symbolTable.set(name, symbol = createSymbol(0 /* None */, name)); } else { - if (node.name) { + if (ts.isNamedDeclaration(node)) { node.name.parent = node; } // Report errors every position with duplicate declaration @@ -20226,6 +21134,9 @@ var ts; var message_1 = symbol.flags & 2 /* BlockScopedVariable */ ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + if (symbol.flags & 384 /* Enum */ || includes & 384 /* Enum */) { + message_1 = ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations; + } if (symbol.declarations && symbol.declarations.length) { // If the current node is a default export of some sort, then check if // there are any other default exports that we need to error on. @@ -20239,7 +21150,7 @@ var ts; // 1. multiple export default of class declaration or function declaration by checking NodeFlags.Default // 2. multiple export default of export assignment. This one doesn't have NodeFlags.Default on (as export default doesn't considered as modifiers) if (symbol.declarations && symbol.declarations.length && - (isDefaultExport || (node.kind === 244 /* ExportAssignment */ && !node.isExportEquals))) { + (isDefaultExport || (node.kind === 247 /* ExportAssignment */ && !node.isExportEquals))) { message_1 = ts.Diagnostics.A_module_cannot_have_multiple_default_exports; } } @@ -20253,13 +21164,18 @@ var ts; } } addDeclarationToSymbol(symbol, node, includes); - symbol.parent = parent; + if (symbol.parent) { + ts.Debug.assert(symbol.parent === parent, "Existing symbol parent should match new one"); + } + else { + symbol.parent = parent; + } return symbol; } function declareModuleMember(node, symbolFlags, symbolExcludes) { var hasExportModifier = ts.getCombinedModifierFlags(node) & 1 /* Export */; if (symbolFlags & 2097152 /* Alias */) { - if (node.kind === 247 /* ExportSpecifier */ || (node.kind === 238 /* ImportEqualsDeclaration */ && hasExportModifier)) { + if (node.kind === 250 /* ExportSpecifier */ || (node.kind === 241 /* ImportEqualsDeclaration */ && hasExportModifier)) { return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); } else { @@ -20281,14 +21197,11 @@ var ts; // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - if (node.kind === 288 /* JSDocTypedefTag */) + if (node.kind === 291 /* JSDocTypedefTag */) ts.Debug.assert(ts.isInJavaScriptFile(node)); // We shouldn't add symbols for JSDoc nodes if not in a JS file. - var isJSDocTypedefInJSDocNamespace = node.kind === 288 /* JSDocTypedefTag */ && - node.name && - node.name.kind === 71 /* Identifier */ && - node.name.isInJSDocNamespace; + var isJSDocTypedefInJSDocNamespace = ts.isJSDocTypedefTag(node) && node.name && node.name.kind === 71 /* Identifier */ && node.name.isInJSDocNamespace; if ((!ts.isAmbientModule(node) && (hasExportModifier || container.flags & 32 /* ExportContext */)) || isJSDocTypedefInJSDocNamespace) { - var exportKind = symbolFlags & 107455 /* Value */ ? 1048576 /* ExportValue */ : 0; + var exportKind = symbolFlags & 67216319 /* Value */ ? 1048576 /* ExportValue */ : 0; var local = declareSymbol(container.locals, /*parent*/ undefined, node, exportKind, symbolExcludes); local.exportSymbol = declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); node.localSymbol = local; @@ -20354,7 +21267,7 @@ var ts; } // We create a return control flow graph for IIFEs and constructors. For constructors // we use the return control flow graph in strict property intialization checks. - currentReturnTarget = isIIFE || node.kind === 153 /* Constructor */ ? createBranchLabel() : undefined; + currentReturnTarget = isIIFE || node.kind === 154 /* Constructor */ ? createBranchLabel() : undefined; currentBreakTarget = undefined; currentContinueTarget = undefined; activeLabels = undefined; @@ -20367,13 +21280,13 @@ var ts; if (hasExplicitReturn) node.flags |= 256 /* HasExplicitReturn */; } - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { node.flags |= emitFlags; } if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); currentFlow = finishFlowLabel(currentReturnTarget); - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { node.returnFlowNode = currentFlow; } } @@ -20460,70 +21373,70 @@ var ts; return; } switch (node.kind) { - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: bindWhileStatement(node); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: bindDoStatement(node); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: bindForStatement(node); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: bindForInOrForOfStatement(node); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: bindIfStatement(node); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: bindReturnOrThrow(node); break; - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: bindBreakOrContinueStatement(node); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: bindTryStatement(node); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: bindSwitchStatement(node); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: bindCaseBlock(node); break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: bindCaseClause(node); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: bindLabeledStatement(node); break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: bindPrefixUnaryExpressionFlow(node); break; - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: bindPostfixUnaryExpressionFlow(node); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: bindBinaryExpressionFlow(node); break; - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: bindDeleteExpressionFlow(node); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: bindConditionalExpressionFlow(node); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: bindVariableDeclarationFlow(node); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: bindCallExpressionFlow(node); break; - case 279 /* JSDocComment */: + case 282 /* JSDocComment */: bindJSDocComment(node); break; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: bindJSDocTypedefTag(node); break; default: @@ -20535,15 +21448,15 @@ var ts; switch (expr.kind) { case 71 /* Identifier */: case 99 /* ThisKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return isNarrowableReference(expr); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return hasNarrowableArgument(expr); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowingExpression(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isNarrowingBinaryExpression(expr); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 51 /* ExclamationToken */ && isNarrowingExpression(expr.operand); } return false; @@ -20552,7 +21465,7 @@ var ts; return expr.kind === 71 /* Identifier */ || expr.kind === 99 /* ThisKeyword */ || expr.kind === 97 /* SuperKeyword */ || - expr.kind === 180 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); + expr.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression); } function hasNarrowableArgument(expr) { if (expr.arguments) { @@ -20563,17 +21476,17 @@ var ts; } } } - if (expr.expression.kind === 180 /* PropertyAccessExpression */ && + if (expr.expression.kind === 183 /* PropertyAccessExpression */ && isNarrowableReference(expr.expression.expression)) { return true; } return false; } function isNarrowingTypeofOperands(expr1, expr2) { - return expr1.kind === 190 /* TypeOfExpression */ && isNarrowableOperand(expr1.expression) && (expr2.kind === 9 /* StringLiteral */ || expr2.kind === 13 /* NoSubstitutionTemplateLiteral */); + return ts.isTypeOfExpression(expr1) && isNarrowableOperand(expr1.expression) && ts.isStringLiteralLike(expr2); } function isNarrowableInOperands(left, right) { - return (left.kind === 9 /* StringLiteral */ || left.kind === 13 /* NoSubstitutionTemplateLiteral */) && isNarrowingExpression(right); + return ts.isStringLiteralLike(left) && isNarrowingExpression(right); } function isNarrowingBinaryExpression(expr) { switch (expr.operatorToken.kind) { @@ -20596,9 +21509,9 @@ var ts; } function isNarrowableOperand(expr) { switch (expr.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isNarrowableOperand(expr.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (expr.operatorToken.kind) { case 58 /* EqualsToken */: return isNarrowableOperand(expr.left); @@ -20676,33 +21589,33 @@ var ts; function isStatementCondition(node) { var parent = node.parent; switch (parent.kind) { - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: return parent.expression === node; - case 215 /* ForStatement */: - case 196 /* ConditionalExpression */: + case 218 /* ForStatement */: + case 199 /* ConditionalExpression */: return parent.condition === node; } return false; } function isLogicalExpression(node) { while (true) { - if (node.kind === 186 /* ParenthesizedExpression */) { + if (node.kind === 189 /* ParenthesizedExpression */) { node = node.expression; } - else if (node.kind === 193 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { + else if (node.kind === 196 /* PrefixUnaryExpression */ && node.operator === 51 /* ExclamationToken */) { node = node.operand; } else { - return node.kind === 195 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || + return node.kind === 198 /* BinaryExpression */ && (node.operatorToken.kind === 53 /* AmpersandAmpersandToken */ || node.operatorToken.kind === 54 /* BarBarToken */); } } } function isTopLevelLogicalExpression(node) { - while (node.parent.kind === 186 /* ParenthesizedExpression */ || - node.parent.kind === 193 /* PrefixUnaryExpression */ && + while (node.parent.kind === 189 /* ParenthesizedExpression */ || + node.parent.kind === 196 /* PrefixUnaryExpression */ && node.parent.operator === 51 /* ExclamationToken */) { node = node.parent; } @@ -20744,7 +21657,7 @@ var ts; } function bindDoStatement(node) { var preDoLabel = createLoopLabel(); - var enclosingLabeledStatement = node.parent.kind === 223 /* LabeledStatement */ + var enclosingLabeledStatement = node.parent.kind === 226 /* LabeledStatement */ ? ts.lastOrUndefined(activeLabels) : undefined; // if do statement is wrapped in labeled statement then target labels for break/continue with or without @@ -20778,13 +21691,13 @@ var ts; var postLoopLabel = createBranchLabel(); addAntecedent(preLoopLabel, currentFlow); currentFlow = preLoopLabel; - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { bind(node.awaitModifier); } bind(node.expression); addAntecedent(postLoopLabel, currentFlow); bind(node.initializer); - if (node.initializer.kind !== 228 /* VariableDeclarationList */) { + if (node.initializer.kind !== 231 /* VariableDeclarationList */) { bindAssignmentTargetFlow(node.initializer); } bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel); @@ -20806,7 +21719,7 @@ var ts; } function bindReturnOrThrow(node) { bind(node.expression); - if (node.kind === 220 /* ReturnStatement */) { + if (node.kind === 223 /* ReturnStatement */) { hasExplicitReturn = true; if (currentReturnTarget) { addAntecedent(currentReturnTarget, currentFlow); @@ -20826,7 +21739,7 @@ var ts; return undefined; } function bindBreakOrContinueFlow(node, breakTarget, continueTarget) { - var flowLabel = node.kind === 219 /* BreakStatement */ ? breakTarget : continueTarget; + var flowLabel = node.kind === 222 /* BreakStatement */ ? breakTarget : continueTarget; if (flowLabel) { addAntecedent(flowLabel, currentFlow); currentFlow = unreachableFlow; @@ -20922,7 +21835,7 @@ var ts; preSwitchCaseFlow = currentFlow; bind(node.caseBlock); addAntecedent(postSwitchLabel, currentFlow); - var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 262 /* DefaultClause */; }); + var hasDefault = ts.forEach(node.caseBlock.clauses, function (c) { return c.kind === 265 /* DefaultClause */; }); // We mark a switch statement as possibly exhaustive if it has no default clause and if all // case clauses have unreachable end points (e.g. they all return). node.possiblyExhaustive = !hasDefault && !postSwitchLabel.antecedents; @@ -20989,14 +21902,14 @@ var ts; if (!activeLabel.referenced && !options.allowUnusedLabels) { file.bindDiagnostics.push(createDiagnosticForNode(node.label, ts.Diagnostics.Unused_label)); } - if (!node.statement || node.statement.kind !== 213 /* DoStatement */) { + if (!node.statement || node.statement.kind !== 216 /* DoStatement */) { // do statement sets current flow inside bindDoStatement addAntecedent(postStatementLabel, currentFlow); currentFlow = finishFlowLabel(postStatementLabel); } } function bindDestructuringTargetFlow(node) { - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */) { bindAssignmentTargetFlow(node.left); } else { @@ -21007,10 +21920,10 @@ var ts; if (isNarrowableReference(node)) { currentFlow = createFlowAssignment(currentFlow, node); } - else if (node.kind === 178 /* ArrayLiteralExpression */) { + else if (node.kind === 181 /* ArrayLiteralExpression */) { for (var _i = 0, _a = node.elements; _i < _a.length; _i++) { var e = _a[_i]; - if (e.kind === 199 /* SpreadElement */) { + if (e.kind === 202 /* SpreadElement */) { bindAssignmentTargetFlow(e.expression); } else { @@ -21018,16 +21931,16 @@ var ts; } } } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { for (var _b = 0, _c = node.properties; _b < _c.length; _b++) { var p = _c[_b]; - if (p.kind === 265 /* PropertyAssignment */) { + if (p.kind === 268 /* PropertyAssignment */) { bindDestructuringTargetFlow(p.initializer); } - else if (p.kind === 266 /* ShorthandPropertyAssignment */) { + else if (p.kind === 269 /* ShorthandPropertyAssignment */) { bindAssignmentTargetFlow(p.name); } - else if (p.kind === 267 /* SpreadAssignment */) { + else if (p.kind === 270 /* SpreadAssignment */) { bindAssignmentTargetFlow(p.expression); } } @@ -21083,7 +21996,7 @@ var ts; bindEachChild(node); if (ts.isAssignmentOperator(operator) && !ts.isAssignmentTarget(node)) { bindAssignmentTargetFlow(node.left); - if (operator === 58 /* EqualsToken */ && node.left.kind === 181 /* ElementAccessExpression */) { + if (operator === 58 /* EqualsToken */ && node.left.kind === 184 /* ElementAccessExpression */) { var elementAccess = node.left; if (isNarrowableOperand(elementAccess.expression)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21094,7 +22007,7 @@ var ts; } function bindDeleteExpressionFlow(node) { bindEachChild(node); - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { bindAssignmentTargetFlow(node.expression); } } @@ -21133,7 +22046,7 @@ var ts; } function bindJSDocComment(node) { ts.forEachChild(node, function (n) { - if (n.kind !== 288 /* JSDocTypedefTag */) { + if (n.kind !== 291 /* JSDocTypedefTag */) { bind(n); } }); @@ -21154,10 +22067,10 @@ var ts; // an immediately invoked function expression (IIFE). Initialize the flowNode property to // the current control flow (which includes evaluation of the IIFE arguments). var expr = node.expression; - while (expr.kind === 186 /* ParenthesizedExpression */) { + while (expr.kind === 189 /* ParenthesizedExpression */) { expr = expr.expression; } - if (expr.kind === 187 /* FunctionExpression */ || expr.kind === 188 /* ArrowFunction */) { + if (expr.kind === 190 /* FunctionExpression */ || expr.kind === 191 /* ArrowFunction */) { bindEach(node.typeArguments); bindEach(node.arguments); bind(node.expression); @@ -21165,7 +22078,7 @@ var ts; else { bindEachChild(node); } - if (node.expression.kind === 180 /* PropertyAccessExpression */) { + if (node.expression.kind === 183 /* PropertyAccessExpression */) { var propertyAccess = node.expression; if (isNarrowableOperand(propertyAccess.expression) && ts.isPushOrUnshiftIdentifier(propertyAccess.name)) { currentFlow = createFlowArrayMutation(currentFlow, node); @@ -21174,53 +22087,53 @@ var ts; } function getContainerFlags(node) { switch (node.kind) { - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 258 /* JsxAttributes */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 261 /* JsxAttributes */: return 1 /* IsContainer */; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return 1 /* IsContainer */ | 64 /* IsInterface */; - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: return 1 /* IsContainer */ | 32 /* HasLocals */; - case 269 /* SourceFile */: + case 272 /* SourceFile */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: if (ts.isObjectLiteralOrClassExpressionMethod(node)) { return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethod */; } // falls through - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 156 /* CallSignature */: - case 277 /* JSDocFunctionType */: - case 161 /* FunctionType */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 162 /* ConstructorType */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 157 /* CallSignature */: + case 280 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 163 /* ConstructorType */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 16 /* IsFunctionExpression */; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return 4 /* IsControlFlowContainer */; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return node.initializer ? 4 /* IsControlFlowContainer */ : 0; - case 264 /* CatchClause */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 236 /* CaseBlock */: + case 267 /* CatchClause */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 239 /* CaseBlock */: return 2 /* IsBlockScopedContainer */; - case 208 /* Block */: + case 211 /* Block */: // do not treat blocks directly inside a function as a block-scoped-container. // Locals that reside in this block should go to the function locals. Otherwise 'x' // would not appear to be a redeclaration of a block scoped local in the following @@ -21253,42 +22166,42 @@ var ts; // members are declared (for example, a member of a class will go into a specific // symbol table depending on if it is static or not). We defer to specialized // handlers to take care of declaring these child members. - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return declareModuleMember(node, symbolFlags, symbolExcludes); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return declareSourceFileMember(node, symbolFlags, symbolExcludes); - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: return declareClassMember(node, symbolFlags, symbolExcludes); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return declareSymbol(container.symbol.exports, container.symbol, node, symbolFlags, symbolExcludes); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 179 /* ObjectLiteralExpression */: - case 231 /* InterfaceDeclaration */: - case 258 /* JsxAttributes */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 182 /* ObjectLiteralExpression */: + case 234 /* InterfaceDeclaration */: + case 261 /* JsxAttributes */: // Interface/Object-types always have their children added to the 'members' of // their container. They are only accessible through an instance of their // container, and are never in scope otherwise (even inside the body of the // object / type / interface declaring them). An exception is type parameters, // which are in scope without qualification (similar to 'locals'). return declareSymbol(container.symbol.members, container.symbol, node, symbolFlags, symbolExcludes); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: - case 232 /* TypeAliasDeclaration */: - case 173 /* MappedType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: + case 235 /* TypeAliasDeclaration */: + case 176 /* MappedType */: // All the children of these container types are never visible through another // symbol (i.e. through another symbol's 'exports' or 'members'). Instead, // they're only accessed 'lexically' (i.e. from code that exists underneath @@ -21309,11 +22222,11 @@ var ts; : declareSymbol(file.locals, /*parent*/ undefined, node, symbolFlags, symbolExcludes); } function hasExportDeclarations(node) { - var body = node.kind === 269 /* SourceFile */ ? node : node.body; - if (body && (body.kind === 269 /* SourceFile */ || body.kind === 235 /* ModuleBlock */)) { + var body = node.kind === 272 /* SourceFile */ ? node : node.body; + if (body && (body.kind === 272 /* SourceFile */ || body.kind === 238 /* ModuleBlock */)) { for (var _i = 0, _a = body.statements; _i < _a.length; _i++) { var stat = _a[_i]; - if (stat.kind === 245 /* ExportDeclaration */ || stat.kind === 244 /* ExportAssignment */) { + if (stat.kind === 248 /* ExportDeclaration */ || stat.kind === 247 /* ExportAssignment */) { return true; } } @@ -21336,7 +22249,7 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { errorOnFirstToken(node, ts.Diagnostics.export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible); } - if (ts.isExternalModuleAugmentation(node)) { + if (ts.isModuleAugmentationExternal(node)) { declareModuleSymbol(node); } else { @@ -21350,10 +22263,8 @@ var ts; errorOnFirstToken(node.name, ts.Diagnostics.Pattern_0_can_have_at_most_one_Asterisk_character, text); } } - var symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 106639 /* ValueModuleExcludes */); - if (pattern) { - (file.patternAmbientModules || (file.patternAmbientModules = [])).push({ pattern: pattern, symbol: symbol }); - } + var symbol = declareSymbolAndAddToSymbolTable(node, 512 /* ValueModule */, 67215503 /* ValueModuleExcludes */); + file.patternAmbientModules = ts.append(file.patternAmbientModules, pattern && { pattern: pattern, symbol: symbol }); } } else { @@ -21372,7 +22283,7 @@ var ts; function declareModuleSymbol(node) { var state = getModuleInstanceState(node); var instantiated = state !== 0 /* NonInstantiated */; - declareSymbolAndAddToSymbolTable(node, instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, instantiated ? 106639 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */); + declareSymbolAndAddToSymbolTable(node, instantiated ? 512 /* ValueModule */ : 1024 /* NamespaceModule */, instantiated ? 67215503 /* ValueModuleExcludes */ : 0 /* NamespaceModuleExcludes */); return state; } function bindFunctionOrConstructorType(node) { @@ -21399,7 +22310,7 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { + if (prop.kind === 270 /* SpreadAssignment */ || prop.name.kind !== 71 /* Identifier */) { continue; } var identifier = prop.name; @@ -21411,7 +22322,7 @@ var ts; // c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true. // d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields - var currentKind = prop.kind === 265 /* PropertyAssignment */ || prop.kind === 266 /* ShorthandPropertyAssignment */ || prop.kind === 152 /* MethodDeclaration */ + var currentKind = prop.kind === 268 /* PropertyAssignment */ || prop.kind === 269 /* ShorthandPropertyAssignment */ || prop.kind === 153 /* MethodDeclaration */ ? 1 /* Property */ : 2 /* Accessor */; var existingKind = seen.get(identifier.escapedText); @@ -21442,10 +22353,10 @@ var ts; } function bindBlockScopedDeclaration(node, symbolFlags, symbolExcludes) { switch (blockScopeContainer.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: declareModuleMember(node, symbolFlags, symbolExcludes); break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(container)) { declareModuleMember(node, symbolFlags, symbolExcludes); break; @@ -21460,7 +22371,7 @@ var ts; } } function bindBlockScopedVariableDeclaration(node) { - bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 107455 /* BlockScopedVariableExcludes */); + bindBlockScopedDeclaration(node, 2 /* BlockScopedVariable */, 67216319 /* BlockScopedVariableExcludes */); } // The binder visits every node in the syntax tree so it is a convenient place to perform a single localized // check for reserved words used as identifiers in strict mode code. @@ -21555,8 +22466,8 @@ var ts; function checkStrictModeFunctionDeclaration(node) { if (languageVersion < 2 /* ES2015 */) { // Report error if function is not top level function declaration - if (blockScopeContainer.kind !== 269 /* SourceFile */ && - blockScopeContainer.kind !== 234 /* ModuleDeclaration */ && + if (blockScopeContainer.kind !== 272 /* SourceFile */ && + blockScopeContainer.kind !== 237 /* ModuleDeclaration */ && !ts.isFunctionLike(blockScopeContainer)) { // We check first if the name is inside class declaration or class expression; if so give explicit message // otherwise report generic error message. @@ -21630,7 +22541,7 @@ var ts; // the current 'container' node when it changes. This helps us know which symbol table // a local should go into for example. Since terminal nodes are known not to have // children, as an optimization we don't process those. - if (node.kind > 143 /* LastToken */) { + if (node.kind > 144 /* LastToken */) { var saveParent = parent; parent = node; var containerFlags = getContainerFlags(node); @@ -21658,7 +22569,7 @@ var ts; } for (var _b = 0, _c = jsDoc.tags; _b < _c.length; _b++) { var tag = _c[_b]; - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { var savedParent = parent; parent = jsDoc; bind(tag); @@ -21683,7 +22594,7 @@ var ts; } /// Should be called only on prologue directives (isPrologueDirective(node) should be true) function isUseStrictPrologueDirective(node) { - var nodeText = ts.getTextOfNodeFromSourceText(file.text, node.expression); + var nodeText = ts.getSourceTextOfNodeFromSourceFile(file, node.expression); // Note: the node text must be exactly "use strict" or 'use strict'. It is not ok for the // string to contain unicode escapes (as per ES5). return nodeText === '"use strict"' || nodeText === "'use strict'"; @@ -21697,19 +22608,19 @@ var ts; // current "blockScopeContainer" needs to be set to its immediate namespace parent. if (node.isInJSDocNamespace) { var parentNode = node.parent; - while (parentNode && parentNode.kind !== 288 /* JSDocTypedefTag */) { + while (parentNode && parentNode.kind !== 291 /* JSDocTypedefTag */) { parentNode = parentNode.parent; } - bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); + bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 67901928 /* TypeAliasExcludes */); break; } // falls through case 99 /* ThisKeyword */: - if (currentFlow && (ts.isExpression(node) || parent.kind === 266 /* ShorthandPropertyAssignment */)) { + if (currentFlow && (ts.isExpression(node) || parent.kind === 269 /* ShorthandPropertyAssignment */)) { node.flowNode = currentFlow; } return checkStrictModeIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: if (currentFlow && isNarrowableReference(node)) { node.flowNode = currentFlow; } @@ -21717,7 +22628,7 @@ var ts; bindSpecialPropertyDeclaration(node); } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var specialKind = ts.getSpecialPropertyAssignmentKind(node); switch (specialKind) { case 1 /* ExportsProperty */: @@ -21727,13 +22638,16 @@ var ts; bindModuleExportsAssignment(node); break; case 3 /* PrototypeProperty */: - bindPrototypePropertyAssignment(node); + bindPrototypePropertyAssignment(node.left, node); + break; + case 6 /* Prototype */: + bindPrototypeAssignment(node); break; case 4 /* ThisProperty */: bindThisPropertyAssignment(node); break; case 5 /* Property */: - bindStaticPropertyAssignment(node); + bindSpecialPropertyAssignment(node); break; case 0 /* None */: // Nothing to do @@ -21742,135 +22656,135 @@ var ts; ts.Debug.fail("Unknown special property assignment kind"); } return checkStrictModeBinaryExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return checkStrictModeCatchClause(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkStrictModeDeleteExpression(node); case 8 /* NumericLiteral */: return checkStrictModeNumericLiteral(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkStrictModePostfixUnaryExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkStrictModePrefixUnaryExpression(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkStrictModeWithStatement(node); - case 170 /* ThisType */: + case 173 /* ThisType */: seenThisKeyword = true; return; - case 159 /* TypePredicate */: - return checkTypePredicate(node); - case 146 /* TypeParameter */: - return declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 530920 /* TypeParameterExcludes */); - case 147 /* Parameter */: + case 160 /* TypePredicate */: + break; // Binding the children will handle everything + case 147 /* TypeParameter */: + return bindTypeParameter(node); + case 148 /* Parameter */: return bindParameter(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return bindVariableDeclarationOrBindingElement(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: node.flowNode = currentFlow; return bindVariableDeclarationOrBindingElement(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return bindPropertyWorker(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return bindPropertyOrMethodOrAccessor(node, 4 /* Property */, 0 /* PropertyExcludes */); - case 268 /* EnumMember */: - return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 900095 /* EnumMemberExcludes */); - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: + case 271 /* EnumMember */: + return bindPropertyOrMethodOrAccessor(node, 8 /* EnumMember */, 68008959 /* EnumMemberExcludes */); + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: return declareSymbolAndAddToSymbolTable(node, 131072 /* Signature */, 0 /* None */); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // If this is an ObjectLiteralExpression method, then it sits in the same space // as other properties in the object literal. So we use SymbolFlags.PropertyExcludes // so that it will conflict with any other object literal members with the same // name. - return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 99263 /* MethodExcludes */); - case 229 /* FunctionDeclaration */: + return bindPropertyOrMethodOrAccessor(node, 8192 /* Method */ | (node.questionToken ? 16777216 /* Optional */ : 0 /* None */), ts.isObjectLiteralMethod(node) ? 0 /* PropertyExcludes */ : 67208127 /* MethodExcludes */); + case 232 /* FunctionDeclaration */: return bindFunctionDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return declareSymbolAndAddToSymbolTable(node, 16384 /* Constructor */, /*symbolExcludes:*/ 0 /* None */); - case 154 /* GetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 41919 /* GetAccessorExcludes */); - case 155 /* SetAccessor */: - return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 74687 /* SetAccessorExcludes */); - case 161 /* FunctionType */: - case 277 /* JSDocFunctionType */: - case 162 /* ConstructorType */: + case 155 /* GetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 32768 /* GetAccessor */, 67150783 /* GetAccessorExcludes */); + case 156 /* SetAccessor */: + return bindPropertyOrMethodOrAccessor(node, 65536 /* SetAccessor */, 67183551 /* SetAccessorExcludes */); + case 162 /* FunctionType */: + case 280 /* JSDocFunctionType */: + case 163 /* ConstructorType */: return bindFunctionOrConstructorType(node); - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 173 /* MappedType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 176 /* MappedType */: return bindAnonymousTypeWorker(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return bindObjectLiteralExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return bindFunctionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (ts.isInJavaScriptFile(node)) { bindCallExpression(node); } break; // Members of classes, interfaces, and modules - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: // All classes are automatically in strict mode in ES6. inStrictMode = true; return bindClassLikeDeclaration(node); - case 231 /* InterfaceDeclaration */: - return bindBlockScopedDeclaration(node, 64 /* Interface */, 792968 /* InterfaceExcludes */); - case 232 /* TypeAliasDeclaration */: - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); - case 233 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + return bindBlockScopedDeclaration(node, 64 /* Interface */, 67901832 /* InterfaceExcludes */); + case 235 /* TypeAliasDeclaration */: + return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 67901928 /* TypeAliasExcludes */); + case 236 /* EnumDeclaration */: return bindEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return bindModuleDeclaration(node); // Jsx-attributes - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return bindJsxAttributes(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */); // Imports and exports - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return declareSymbolAndAddToSymbolTable(node, 2097152 /* Alias */, 2097152 /* AliasExcludes */); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return bindNamespaceExportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return bindImportClause(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return bindExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return bindExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: updateStrictModeStatementList(node.statements); return bindSourceFileIfExternalModule(); - case 208 /* Block */: + case 211 /* Block */: if (!ts.isFunctionLike(node.parent)) { return; } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return updateStrictModeStatementList(node.statements); - case 284 /* JSDocParameterTag */: - if (node.parent.kind !== 280 /* JSDocTypeLiteral */) { + case 287 /* JSDocParameterTag */: + if (node.parent.kind !== 283 /* JSDocTypeLiteral */) { break; } // falls through - case 289 /* JSDocPropertyTag */: + case 292 /* JSDocPropertyTag */: var propTag = node; - var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 276 /* JSDocOptionalType */ ? + var flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 279 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */; return declareSymbolAndAddToSymbolTable(propTag, flags, 0 /* PropertyExcludes */); - case 288 /* JSDocTypedefTag */: { + case 291 /* JSDocTypedefTag */: { var fullName = node.fullName; if (!fullName || fullName.kind === 71 /* Identifier */) { - return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 793064 /* TypeAliasExcludes */); + return bindBlockScopedDeclaration(node, 524288 /* TypeAlias */, 67901928 /* TypeAliasExcludes */); } break; } @@ -21882,16 +22796,6 @@ var ts; function bindAnonymousTypeWorker(node) { return bindAnonymousDeclaration(node, 2048 /* TypeLiteral */, "__type" /* Type */); } - function checkTypePredicate(node) { - var parameterName = node.parameterName, type = node.type; - if (parameterName && parameterName.kind === 71 /* Identifier */) { - checkStrictModeIdentifier(parameterName); - } - if (parameterName && parameterName.kind === 170 /* ThisType */) { - seenThisKeyword = true; - } - bind(type); - } function bindSourceFileIfExternalModule() { setExportContextFlag(file); if (ts.isExternalModule(file)) { @@ -21907,7 +22811,7 @@ var ts; bindAnonymousDeclaration(node, 2097152 /* Alias */, getDeclarationName(node)); } else { - var flags = node.kind === 244 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) + var flags = node.kind === 247 /* ExportAssignment */ && ts.exportAssignmentIsAlias(node) // An export default clause with an EntityNameExpression exports all meanings of that identifier ? 2097152 /* Alias */ // An export default clause with any other expression exports a value @@ -21921,7 +22825,7 @@ var ts; if (node.modifiers && node.modifiers.length) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Modifiers_cannot_appear_here)); } - if (node.parent.kind !== 269 /* SourceFile */) { + if (node.parent.kind !== 272 /* SourceFile */) { file.bindDiagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.Global_module_exports_may_only_appear_at_top_level)); return; } @@ -21966,7 +22870,18 @@ var ts; // When we create a property via 'exports.foo = bar', the 'exports.foo' property access // expression is the declaration setCommonJsModuleIndicator(node); - declareSymbol(file.symbol.exports, file.symbol, node.left, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); + var lhs = node.left; + var symbol = forEachIdentifierInEntityName(lhs.expression, function (id, original) { + if (!original) { + return undefined; + } + var s = ts.getJSInitializerSymbol(original); + addDeclarationToSymbol(s, id, 1536 /* Module */ | 67108864 /* JSContainer */); + return s; + }); + if (symbol) { + declareSymbol(symbol.exports, symbol, lhs, 4 /* Property */ | 1048576 /* ExportValue */, 0 /* None */); + } } function bindModuleExportsAssignment(node) { // A common practice in node modules is to set 'export = module.exports = {}', this ensures that 'exports' @@ -21987,18 +22902,18 @@ var ts; ts.Debug.assert(ts.isInJavaScriptFile(node)); var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); switch (container.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Declare a 'member' if the container is an ES5 class or ES6 constructor container.symbol.members = container.symbol.members || ts.createSymbolTable(); // It's acceptable for multiple 'this' assignments of the same identifier to occur declareSymbol(container.symbol.members, container.symbol, node, 4 /* Property */, 0 /* PropertyExcludes */ & ~4 /* Property */); break; - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // this.foo assignment in a JavaScript class // Bind this property to the containing class var containingClass = container.parent; @@ -22008,93 +22923,122 @@ var ts; } } function bindSpecialPropertyDeclaration(node) { - ts.Debug.assert(ts.isInJavaScriptFile(node)); if (node.expression.kind === 99 /* ThisKeyword */) { bindThisPropertyAssignment(node); } - else if ((node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */) && - node.parent.parent.kind === 269 /* SourceFile */) { - bindStaticPropertyAssignment(node); + else if (ts.isEntityNameExpression(node) && node.parent.parent.kind === 272 /* SourceFile */) { + if (ts.isPropertyAccessExpression(node.expression) && node.expression.name.escapedText === "prototype") { + bindPrototypePropertyAssignment(node, node.parent); + } + else { + bindStaticPropertyAssignment(node); + } } } - function bindPrototypePropertyAssignment(node) { - // We saw a node of the form 'x.prototype.y = z'. Declare a 'member' y on x if x is a function or class, or not declared. - // Look up the function in the local scope, since prototype assignments should - // follow the function declaration - var leftSideOfAssignment = node.left; - var classPrototype = leftSideOfAssignment.expression; - var constructorFunction = classPrototype.expression; - // Fix up parent pointers since we're going to use these nodes before we bind into them - leftSideOfAssignment.parent = node; - constructorFunction.parent = classPrototype; - classPrototype.parent = leftSideOfAssignment; - bindPropertyAssignment(constructorFunction.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ true); + /** For `x.prototype = { p, ... }`, declare members p,... if `x` is function/class/{}, or not declared. */ + function bindPrototypeAssignment(node) { + node.left.parent = node; + node.right.parent = node; + var lhs = node.left; + bindPropertyAssignment(lhs, lhs, /*isPrototypeProperty*/ false); } /** - * For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function or class, or not declared. + * For `x.prototype.y = z`, declare a member `y` on `x` if `x` is a function or class, or not declared. + * Note that jsdoc preceding an ExpressionStatement like `x.prototype.y;` is also treated as a declaration. + */ + function bindPrototypePropertyAssignment(lhs, parent) { + // Look up the function in the local scope, since prototype assignments should + // follow the function declaration + var classPrototype = lhs.expression; + var constructorFunction = classPrototype.expression; + // Fix up parent pointers since we're going to use these nodes before we bind into them + lhs.parent = parent; + constructorFunction.parent = classPrototype; + classPrototype.parent = lhs; + bindPropertyAssignment(constructorFunction, lhs, /*isPrototypeProperty*/ true); + } + function bindSpecialPropertyAssignment(node) { + var lhs = node.left; + // Fix up parent pointers since we're going to use these nodes before we bind into them + node.left.parent = node; + node.right.parent = node; + if (ts.isIdentifier(lhs.expression) && container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, lhs.expression)) { + // This can be an alias for the 'exports' or 'module.exports' names, e.g. + // var util = module.exports; + // util.property = function ... + bindExportsPropertyAssignment(node); + } + else { + bindStaticPropertyAssignment(lhs); + } + } + /** + * For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function (or IIFE) or class or {}, or not declared. * Also works for expression statements preceded by JSDoc, like / ** @type number * / x.y; */ function bindStaticPropertyAssignment(node) { - // Look up the function in the local scope, since static assignments should - // follow the function declaration - var leftSideOfAssignment = node.kind === 180 /* PropertyAccessExpression */ ? node : node.left; - var target = leftSideOfAssignment.expression; - if (ts.isIdentifier(target)) { - // Fix up parent pointers since we're going to use these nodes before we bind into them - target.parent = leftSideOfAssignment; - if (node.kind === 195 /* BinaryExpression */) { - leftSideOfAssignment.parent = node; - } - if (container === file && isNameOfExportsOrModuleExportsAliasDeclaration(file, target)) { - // This can be an alias for the 'exports' or 'module.exports' names, e.g. - // var util = module.exports; - // util.property = function ... - bindExportsPropertyAssignment(node); - } - else { - bindPropertyAssignment(target.escapedText, leftSideOfAssignment, /*isPrototypeProperty*/ false); - } - } + node.expression.parent = node; + bindPropertyAssignment(node.expression, node, /*isPrototypeProperty*/ false); } - function lookupSymbolForName(name) { - return lookupSymbolForNameWorker(container, name); - } - function bindPropertyAssignment(functionName, propertyAccess, isPrototypeProperty) { - var symbol = lookupSymbolForName(functionName); - var targetSymbol = symbol && ts.isDeclarationOfFunctionOrClassExpression(symbol) ? - symbol.valueDeclaration.initializer.symbol : - symbol; - ts.Debug.assert(propertyAccess.parent.kind === 195 /* BinaryExpression */ || propertyAccess.parent.kind === 211 /* ExpressionStatement */); - var isLegalPosition; - if (propertyAccess.parent.kind === 195 /* BinaryExpression */) { - var initializerKind = propertyAccess.parent.right.kind; - isLegalPosition = (initializerKind === 200 /* ClassExpression */ || initializerKind === 187 /* FunctionExpression */) && - propertyAccess.parent.parent.parent.kind === 269 /* SourceFile */; + function bindPropertyAssignment(name, propertyAccess, isPrototypeProperty) { + var symbol = ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(name)); + var isToplevelNamespaceableInitializer; + if (ts.isBinaryExpression(propertyAccess.parent)) { + var isPrototypeAssignment = ts.isPropertyAccessExpression(propertyAccess.parent.left) && propertyAccess.parent.left.name.escapedText === "prototype"; + isToplevelNamespaceableInitializer = propertyAccess.parent.parent.parent.kind === 272 /* SourceFile */ && + !!ts.getJavascriptInitializer(propertyAccess.parent.right, isPrototypeAssignment); } else { - isLegalPosition = propertyAccess.parent.parent.kind === 269 /* SourceFile */; + isToplevelNamespaceableInitializer = propertyAccess.parent.parent.kind === 272 /* SourceFile */; } - if (!isPrototypeProperty && (!targetSymbol || !(targetSymbol.flags & 1920 /* Namespace */)) && isLegalPosition) { - ts.Debug.assert(ts.isIdentifier(propertyAccess.expression)); - var identifier = propertyAccess.expression; - var flags = 1536 /* Module */ | 67108864 /* JSContainer */; - var excludeFlags = 106639 /* ValueModuleExcludes */ & ~67108864 /* JSContainer */; - if (targetSymbol) { - addDeclarationToSymbol(symbol, identifier, flags); - } - else { - targetSymbol = declareSymbol(container.locals, /*parent*/ undefined, identifier, flags, excludeFlags); - } + if (!isPrototypeProperty && (!symbol || !(symbol.flags & 1920 /* Namespace */)) && isToplevelNamespaceableInitializer) { + // make symbols or add declarations for intermediate containers + var flags_1 = 1536 /* Module */ | 67108864 /* JSContainer */; + var excludeFlags_1 = 67215503 /* ValueModuleExcludes */ & ~67108864 /* JSContainer */; + forEachIdentifierInEntityName(propertyAccess.expression, function (id, original) { + if (original) { + // Note: add declaration to original symbol, not the special-syntax's symbol, so that namespaces work for type lookup + addDeclarationToSymbol(original, id, flags_1); + return original; + } + else { + return symbol = declareSymbol(symbol ? symbol.exports : container.locals, symbol, id, flags_1, excludeFlags_1); + } + }); } - if (!targetSymbol || !(targetSymbol.flags & (16 /* Function */ | 32 /* Class */ | 1024 /* NamespaceModule */))) { + if (!symbol || !(symbol.flags & (16 /* Function */ | 32 /* Class */ | 1024 /* NamespaceModule */ | 4096 /* ObjectLiteral */))) { return; } // Set up the members collection if it doesn't exist already var symbolTable = isPrototypeProperty ? - (targetSymbol.members || (targetSymbol.members = ts.createSymbolTable())) : - (targetSymbol.exports || (targetSymbol.exports = ts.createSymbolTable())); + (symbol.members || (symbol.members = ts.createSymbolTable())) : + (symbol.exports || (symbol.exports = ts.createSymbolTable())); // Declare the method/property - declareSymbol(symbolTable, targetSymbol, propertyAccess, 4 /* Property */, 0 /* PropertyExcludes */); + var symbolFlags = 4 /* Property */ | (isToplevelNamespaceableInitializer ? 67108864 /* JSContainer */ : 0); + var symbolExcludes = 0 /* PropertyExcludes */ & ~(isToplevelNamespaceableInitializer ? 67108864 /* JSContainer */ : 0); + declareSymbol(symbolTable, symbol, propertyAccess, symbolFlags, symbolExcludes); + } + function lookupSymbolForPropertyAccess(node) { + if (ts.isIdentifier(node)) { + return lookupSymbolForNameWorker(container, node.escapedText); + } + else { + var symbol = ts.getJSInitializerSymbol(lookupSymbolForPropertyAccess(node.expression)); + return symbol && symbol.exports && symbol.exports.get(node.name.escapedText); + } + } + function forEachIdentifierInEntityName(e, action) { + if (isExportsOrModuleExportsOrAlias(file, e)) { + return file.symbol; + } + else if (ts.isIdentifier(e)) { + return action(e, lookupSymbolForPropertyAccess(e)); + } + else { + var s = ts.getJSInitializerSymbol(forEachIdentifierInEntityName(e.expression, action)); + ts.Debug.assert(!!s && !!s.exports); + return action(e.name, s.exports.get(e.name.escapedText)); + } } function bindCallExpression(node) { // We're only inspecting call expressions to detect CommonJS modules, so we can skip @@ -22104,8 +23048,8 @@ var ts; } } function bindClassLikeDeclaration(node) { - if (node.kind === 230 /* ClassDeclaration */) { - bindBlockScopedDeclaration(node, 32 /* Class */, 899519 /* ClassExcludes */); + if (node.kind === 233 /* ClassDeclaration */) { + bindBlockScopedDeclaration(node, 32 /* Class */, 68008383 /* ClassExcludes */); } else { var bindingName = node.name ? node.name.escapedText : "__class" /* Class */; @@ -22138,8 +23082,8 @@ var ts; } function bindEnumDeclaration(node) { return ts.isConst(node) - ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 899967 /* ConstEnumExcludes */) - : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 899327 /* RegularEnumExcludes */); + ? bindBlockScopedDeclaration(node, 128 /* ConstEnum */, 68008831 /* ConstEnumExcludes */) + : bindBlockScopedDeclaration(node, 256 /* RegularEnum */, 68008191 /* RegularEnumExcludes */); } function bindVariableDeclarationOrBindingElement(node) { if (inStrictMode) { @@ -22159,10 +23103,10 @@ var ts; // function foo([a,a]) {} // Duplicate Identifier error // function bar(a,a) {} // Duplicate Identifier error, parameter declaration in this case is handled in bindParameter // // which correctly set excluded symbols - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 67216319 /* ParameterExcludes */); } else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107454 /* FunctionScopedVariableExcludes */); + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 67216318 /* FunctionScopedVariableExcludes */); } } } @@ -22176,7 +23120,7 @@ var ts; bindAnonymousDeclaration(node, 1 /* FunctionScopedVariable */, "__" + node.parent.parameters.indexOf(node)); } else { - declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 107455 /* ParameterExcludes */); + declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 67216319 /* ParameterExcludes */); } // If this is a property-parameter, then also declare the property symbol into the // containing class. @@ -22194,10 +23138,10 @@ var ts; checkStrictModeFunctionName(node); if (inStrictMode) { checkStrictModeFunctionDeclaration(node); - bindBlockScopedDeclaration(node, 16 /* Function */, 106927 /* FunctionExcludes */); + bindBlockScopedDeclaration(node, 16 /* Function */, 67215791 /* FunctionExcludes */); } else { - declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 106927 /* FunctionExcludes */); + declareSymbolAndAddToSymbolTable(node, 16 /* Function */, 67215791 /* FunctionExcludes */); } } function bindFunctionExpression(node) { @@ -22224,6 +23168,33 @@ var ts; ? bindAnonymousDeclaration(node, symbolFlags, "__computed" /* Computed */) : declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes); } + function getInferTypeContainer(node) { + while (node) { + var parent_2 = node.parent; + if (parent_2 && parent_2.kind === 170 /* ConditionalType */ && parent_2.extendsType === node) { + return parent_2; + } + node = parent_2; + } + return undefined; + } + function bindTypeParameter(node) { + if (node.parent.kind === 171 /* InferType */) { + var container_1 = getInferTypeContainer(node.parent); + if (container_1) { + if (!container_1.locals) { + container_1.locals = ts.createSymbolTable(); + } + declareSymbol(container_1.locals, /*parent*/ undefined, node, 262144 /* TypeParameter */, 67639784 /* TypeParameterExcludes */); + } + else { + bindAnonymousDeclaration(node, 262144 /* TypeParameter */, getDeclarationName(node)); + } + } + else { + declareSymbolAndAddToSymbolTable(node, 262144 /* TypeParameter */, 67639784 /* TypeParameterExcludes */); + } + } // reachability checks function shouldReportErrorOnModuleDeclaration(node) { var instanceState = getModuleInstanceState(node); @@ -22236,13 +23207,13 @@ var ts; if (currentFlow === unreachableFlow) { var reportError = // report error on all statements except empty ones - (ts.isStatementButNotDeclaration(node) && node.kind !== 210 /* EmptyStatement */) || + (ts.isStatementButNotDeclaration(node) && node.kind !== 213 /* EmptyStatement */) || // report error on class declarations - node.kind === 230 /* ClassDeclaration */ || + node.kind === 233 /* ClassDeclaration */ || // report error on instantiated modules or const-enums only modules if preserveConstEnums is set - (node.kind === 234 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || + (node.kind === 237 /* ModuleDeclaration */ && shouldReportErrorOnModuleDeclaration(node)) || // report error on regular enums and const enums if preserveConstEnums is set - (node.kind === 233 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); + (node.kind === 236 /* EnumDeclaration */ && (!ts.isConstEnumDeclaration(node) || options.preserveConstEnums)); if (reportError) { currentFlow = reportedUnreachableFlow; // unreachable code is reported if @@ -22256,7 +23227,7 @@ var ts; // On the other side we do want to report errors on non-initialized 'lets' because of TDZ var reportUnreachableCode = !options.allowUnreachableCode && !(node.flags & 2097152 /* Ambient */) && - (node.kind !== 209 /* VariableStatement */ || + (node.kind !== 212 /* VariableStatement */ || ts.getCombinedNodeFlags(node.declarationList) & 3 /* BlockScoped */ || ts.forEach(node.declarationList.declarations, function (d) { return d.initializer; })); if (reportUnreachableCode) { @@ -22281,7 +23252,7 @@ var ts; } function isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node) { return isExportsOrModuleExportsOrAlias(sourceFile, node) || - (ts.isAssignmentExpression(node, /*excludeCompoundAssignements*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); + (ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true) && (isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.left) || isExportsOrModuleExportsOrAliasOrAssignment(sourceFile, node.right))); } function lookupSymbolForNameWorker(container, name) { var local = container.locals && container.locals.get(name); @@ -22299,58 +23270,58 @@ var ts; function computeTransformFlagsForNode(node, subtreeFlags) { var kind = node.kind; switch (kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return computeCallExpression(node, subtreeFlags); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return computeNewExpression(node, subtreeFlags); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return computeModuleDeclaration(node, subtreeFlags); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return computeParenthesizedExpression(node, subtreeFlags); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return computeBinaryExpression(node, subtreeFlags); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return computeExpressionStatement(node, subtreeFlags); - case 147 /* Parameter */: + case 148 /* Parameter */: return computeParameter(node, subtreeFlags); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return computeArrowFunction(node, subtreeFlags); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return computeFunctionExpression(node, subtreeFlags); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return computeFunctionDeclaration(node, subtreeFlags); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return computeVariableDeclaration(node, subtreeFlags); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return computeVariableDeclarationList(node, subtreeFlags); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return computeVariableStatement(node, subtreeFlags); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return computeLabeledStatement(node, subtreeFlags); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return computeClassDeclaration(node, subtreeFlags); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return computeClassExpression(node, subtreeFlags); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return computeHeritageClause(node, subtreeFlags); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return computeCatchClause(node, subtreeFlags); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return computeExpressionWithTypeArguments(node, subtreeFlags); - case 153 /* Constructor */: + case 154 /* Constructor */: return computeConstructor(node, subtreeFlags); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return computePropertyDeclaration(node, subtreeFlags); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return computeMethod(node, subtreeFlags); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return computeAccessor(node, subtreeFlags); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return computeImportEquals(node, subtreeFlags); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return computePropertyAccess(node, subtreeFlags); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return computeElementAccess(node, subtreeFlags); default: return computeOther(node, kind, subtreeFlags); @@ -22402,12 +23373,12 @@ var ts; var transformFlags = subtreeFlags; var operatorTokenKind = node.operatorToken.kind; var leftKind = node.left.kind; - if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 179 /* ObjectLiteralExpression */) { + if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 182 /* ObjectLiteralExpression */) { // Destructuring object assignments with are ES2015 syntax // and possibly ESNext if they contain rest transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } - else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 178 /* ArrayLiteralExpression */) { + else if (operatorTokenKind === 58 /* EqualsToken */ && leftKind === 181 /* ArrayLiteralExpression */) { // Destructuring assignments are ES2015 syntax. transformFlags |= 192 /* AssertES2015 */ | 3072 /* AssertDestructuringAssignment */; } @@ -22456,8 +23427,8 @@ var ts; // If the node is synthesized, it means the emitter put the parentheses there, // not the user. If we didn't want them, the emitter would not have put them // there. - if (expressionKind === 203 /* AsExpression */ - || expressionKind === 185 /* TypeAssertionExpression */) { + if (expressionKind === 206 /* AsExpression */ + || expressionKind === 188 /* TypeAssertionExpression */) { transformFlags |= 3 /* AssertTypeScript */; } // If the expression of a ParenthesizedExpression is a destructuring assignment, @@ -22834,13 +23805,13 @@ var ts; var excludeFlags = 939525441 /* NodeExcludes */; switch (kind) { case 120 /* AsyncKeyword */: - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: // async/await is ES2017 syntax, but may be ESNext syntax (for async generators) transformFlags |= 8 /* AssertESNext */ | 16 /* AssertES2017 */; break; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 292 /* PartiallyEmittedExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; excludeFlags = 536872257 /* OuterExpressionExcludes */; @@ -22851,25 +23822,25 @@ var ts; case 117 /* AbstractKeyword */: case 124 /* DeclareKeyword */: case 76 /* ConstKeyword */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 204 /* NonNullExpression */: - case 131 /* ReadonlyKeyword */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 207 /* NonNullExpression */: + case 132 /* ReadonlyKeyword */: // These nodes are TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */; break; - case 250 /* JsxElement */: - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: case 10 /* JsxText */: - case 253 /* JsxClosingElement */: - case 254 /* JsxFragment */: - case 255 /* JsxOpeningFragment */: - case 256 /* JsxClosingFragment */: - case 257 /* JsxAttribute */: - case 258 /* JsxAttributes */: - case 259 /* JsxSpreadAttribute */: - case 260 /* JsxExpression */: + case 256 /* JsxClosingElement */: + case 257 /* JsxFragment */: + case 258 /* JsxOpeningFragment */: + case 259 /* JsxClosingFragment */: + case 260 /* JsxAttribute */: + case 261 /* JsxAttributes */: + case 262 /* JsxSpreadAttribute */: + case 263 /* JsxExpression */: // These nodes are Jsx syntax. transformFlags |= 4 /* AssertJsx */; break; @@ -22877,11 +23848,11 @@ var ts; case 14 /* TemplateHead */: case 15 /* TemplateMiddle */: case 16 /* TemplateTail */: - case 197 /* TemplateExpression */: - case 184 /* TaggedTemplateExpression */: - case 266 /* ShorthandPropertyAssignment */: + case 200 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 269 /* ShorthandPropertyAssignment */: case 115 /* StaticKeyword */: - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: // These nodes are ES6 syntax. transformFlags |= 192 /* AssertES2015 */; break; @@ -22895,56 +23866,58 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // This node is either ES2015 syntax or ES2017 syntax (if it is a for-await-of). if (node.awaitModifier) { transformFlags |= 8 /* AssertESNext */; } transformFlags |= 192 /* AssertES2015 */; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: // This node is either ES2015 syntax (in a generator) or ES2017 syntax (in an async // generator). transformFlags |= 8 /* AssertESNext */ | 192 /* AssertES2015 */ | 16777216 /* ContainsYield */; break; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 134 /* ObjectKeyword */: - case 136 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 135 /* ObjectKeyword */: + case 137 /* StringKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 159 /* TypePredicate */: - case 160 /* TypeReference */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 163 /* TypeQuery */: - case 164 /* TypeLiteral */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: - case 237 /* NamespaceExportDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 160 /* TypePredicate */: + case 161 /* TypeReference */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 164 /* TypeQuery */: + case 165 /* TypeLiteral */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 171 /* InferType */: + case 172 /* ParenthesizedType */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: + case 240 /* NamespaceExportDeclaration */: // Types and signatures are TypeScript syntax, and exclude all other facts. transformFlags = 3 /* AssertTypeScript */; excludeFlags = -3 /* TypeExcludes */; break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: // Even though computed property names are ES6, we don't treat them as such. // This is so that they can flow through PropertyName transforms unaffected. // Instead, we mark the container as ES6, so that it can properly handle the transform. @@ -22961,10 +23934,10 @@ var ts; transformFlags |= 65536 /* ContainsLexicalThisInComputedPropertyName */; } break; - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: transformFlags |= 192 /* AssertES2015 */ | 524288 /* ContainsSpread */; break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectSpread */; break; case 97 /* SuperKeyword */: @@ -22976,28 +23949,28 @@ var ts; // Mark this node and its ancestors as containing a lexical `this` keyword. transformFlags |= 16384 /* ContainsLexicalThis */; break; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; if (subtreeFlags & 524288 /* ContainsRest */) { transformFlags |= 8 /* AssertESNext */ | 1048576 /* ContainsObjectRest */; } excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: transformFlags |= 192 /* AssertES2015 */ | 8388608 /* ContainsBindingPattern */; excludeFlags = 940049729 /* BindingPatternExcludes */; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: transformFlags |= 192 /* AssertES2015 */; if (node.dotDotDotToken) { transformFlags |= 524288 /* ContainsRest */; } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // This node is TypeScript syntax, and marks its container as also being TypeScript syntax. transformFlags |= 3 /* AssertTypeScript */ | 4096 /* ContainsDecorators */; break; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: excludeFlags = 942740801 /* ObjectLiteralExcludes */; if (subtreeFlags & 2097152 /* ContainsComputedPropertyName */) { // If an ObjectLiteralExpression contains a ComputedPropertyName, then it @@ -23015,8 +23988,8 @@ var ts; transformFlags |= 8 /* AssertESNext */; } break; - case 178 /* ArrayLiteralExpression */: - case 183 /* NewExpression */: + case 181 /* ArrayLiteralExpression */: + case 186 /* NewExpression */: excludeFlags = 940049729 /* ArrayLiteralOrCallOrNewExcludes */; if (subtreeFlags & 524288 /* ContainsSpread */) { // If the this node contains a SpreadExpression, then it is an ES6 @@ -23024,23 +23997,23 @@ var ts; transformFlags |= 192 /* AssertES2015 */; } break; - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: // A loop containing a block scoped binding *may* need to be transformed from ES6. if (subtreeFlags & 4194304 /* ContainsBlockScopedBinding */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (subtreeFlags & 32768 /* ContainsCapturedLexicalThis */) { transformFlags |= 192 /* AssertES2015 */; } break; - case 220 /* ReturnStatement */: - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 223 /* ReturnStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: transformFlags |= 33554432 /* ContainsHoistedDeclarationOrCompletion */; break; } @@ -23056,66 +24029,66 @@ var ts; */ /* @internal */ function getTransformFlagsSubtreeExclusions(kind) { - if (kind >= 159 /* FirstTypeNode */ && kind <= 174 /* LastTypeNode */) { + if (kind >= 160 /* FirstTypeNode */ && kind <= 177 /* LastTypeNode */) { return -3 /* TypeExcludes */; } switch (kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 178 /* ArrayLiteralExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 181 /* ArrayLiteralExpression */: return 940049729 /* ArrayLiteralOrCallOrNewExcludes */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return 977327425 /* ModuleExcludes */; - case 147 /* Parameter */: + case 148 /* Parameter */: return 939525441 /* ParameterExcludes */; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return 1003902273 /* ArrowFunctionExcludes */; - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: return 1003935041 /* FunctionExcludes */; - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return 948962625 /* VariableDeclarationListExcludes */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return 942011713 /* ClassExcludes */; - case 153 /* Constructor */: + case 154 /* Constructor */: return 1003668801 /* ConstructorExcludes */; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return 1003668801 /* MethodOrAccessorExcludes */; case 119 /* AnyKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: - case 136 /* StringKeyword */: - case 134 /* ObjectKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 135 /* ObjectKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 146 /* TypeParameter */: - case 149 /* PropertySignature */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 147 /* TypeParameter */: + case 150 /* PropertySignature */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return -3 /* TypeExcludes */; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return 942740801 /* ObjectLiteralExcludes */; - case 264 /* CatchClause */: + case 267 /* CatchClause */: return 940574017 /* CatchClauseExcludes */; - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return 940049729 /* BindingPatternExcludes */; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 292 /* PartiallyEmittedExpression */: - case 186 /* ParenthesizedExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 295 /* PartiallyEmittedExpression */: + case 189 /* ParenthesizedExpression */: case 97 /* SuperKeyword */: return 536872257 /* OuterExpressionExcludes */; - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return 671089985 /* PropertyAccessExcludes */; default: return 939525441 /* NodeExcludes */; @@ -23290,7 +24263,7 @@ var ts; // (their type resolved directly to the member deeply referenced) // So to get the intervening symbols, we need to check if there's a type // query node on any of the symbol's declarations and get symbols there - if (d.type && d.type.kind === 163 /* TypeQuery */) { + if (d.type && d.type.kind === 164 /* TypeQuery */) { var query = d.type; var entity = getResolvedSymbol(getFirstIdentifier(query.exprName)); visitSymbol(entity); @@ -23546,8 +24519,11 @@ var ts; } ts.getAutomaticTypeDirectiveNames = getAutomaticTypeDirectiveNames; function createModuleResolutionCache(currentDirectory, getCanonicalFileName) { - var directoryToModuleNameMap = ts.createMap(); - var moduleNameToDirectoryMap = ts.createMap(); + return createModuleResolutionCacheWithMaps(ts.createMap(), ts.createMap(), currentDirectory, getCanonicalFileName); + } + ts.createModuleResolutionCache = createModuleResolutionCache; + /*@internal*/ + function createModuleResolutionCacheWithMaps(directoryToModuleNameMap, moduleNameToDirectoryMap, currentDirectory, getCanonicalFileName) { return { getOrCreateCacheForDirectory: getOrCreateCacheForDirectory, getOrCreateCacheForModuleName: getOrCreateCacheForModuleName }; function getOrCreateCacheForDirectory(directoryName) { var path = ts.toPath(directoryName, currentDirectory, getCanonicalFileName); @@ -23631,7 +24607,7 @@ var ts; } } } - ts.createModuleResolutionCache = createModuleResolutionCache; + ts.createModuleResolutionCacheWithMaps = createModuleResolutionCacheWithMaps; function resolveModuleName(moduleName, containingFile, compilerOptions, host, cache) { var traceEnabled = isTraceEnabled(compilerOptions, host); if (traceEnabled) { @@ -23642,7 +24618,7 @@ var ts; var result = perFolderCache && perFolderCache.get(moduleName); if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } } else { @@ -23832,7 +24808,7 @@ var ts; trace(state.host, ts.Diagnostics.baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1, state.compilerOptions.baseUrl, moduleName); } // string is for exact match - var matchedPattern = undefined; + var matchedPattern; if (state.compilerOptions.paths) { if (state.traceEnabled) { trace(state.host, ts.Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName); @@ -24108,7 +25084,7 @@ var ts; var packageJsonPath = pathToPackageJson(nodeModuleDirectory); if (directoryExists && host.fileExists(packageJsonPath)) { var packageJsonContent = readJson(packageJsonPath, host); - if (subModuleName === "") { + if (subModuleName === "") { // looking up the root - need to handle types/typings/main redirects for subModuleName var path = tryReadPackageJsonFields(/*readTypes*/ true, packageJsonContent, nodeModuleDirectory, state); if (typeof path === "string") { subModuleName = addExtensionAndIndex(path.substring(nodeModuleDirectory.length + 1)); @@ -24204,7 +25180,7 @@ var ts; } else { var _a = getPackageName(moduleName), packageName = _a.packageName, rest = _a.rest; - if (rest !== "") { + if (rest !== "") { // If "rest" is empty, we just did this search above. var packageRootPath = ts.combinePaths(nodeModulesFolder, packageName); // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId. packageId = getPackageJsonInfo(packageRootPath, rest, failedLookupLocations, !nodeModulesFolderExists, state).packageId; @@ -24234,7 +25210,7 @@ var ts; var perModuleNameCache = cache && cache.getOrCreateCacheForModuleName(moduleName); return ts.forEachAncestorDirectory(ts.normalizeSlashes(directory), function (ancestorDirectory) { if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") { - var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, ancestorDirectory, state.traceEnabled, state.host, failedLookupLocations); if (resolutionFromCache) { return resolutionFromCache; } @@ -24281,6 +25257,7 @@ var ts; return "@types/" + getMangledNameForScopedPackage(packageName); } ts.getTypesPackageName = getTypesPackageName; + /* @internal */ function getMangledNameForScopedPackage(packageName) { if (ts.startsWith(packageName, "@")) { var replaceSlash = packageName.replace(ts.directorySeparator, mangledScopedPackageSeparator); @@ -24290,6 +25267,7 @@ var ts; } return packageName; } + ts.getMangledNameForScopedPackage = getMangledNameForScopedPackage; /* @internal */ function getPackageNameFromAtTypesDirectory(mangledName) { var withoutAtTypePrefix = ts.removePrefix(mangledName, "@types/"); @@ -24306,12 +25284,13 @@ var ts; typesPackageName; } ts.getUnmangledNameForScopedPackage = getUnmangledNameForScopedPackage; - function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host) { + function tryFindNonRelativeModuleNameInCache(cache, moduleName, containingDirectory, traceEnabled, host, failedLookupLocations) { var result = cache && cache.get(containingDirectory); if (result) { if (traceEnabled) { - trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache, moduleName); + trace(host, ts.Diagnostics.Resolution_for_module_0_was_found_in_cache_from_location_1, moduleName, containingDirectory); } + failedLookupLocations.push.apply(failedLookupLocations, result.failedLookupLocations); return { value: result.resolvedModule && { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId } }; } } @@ -24332,7 +25311,7 @@ var ts; if (!ts.isExternalModuleNameRelative(moduleName)) { // Climb up parent directories looking for a module. var resolved_3 = ts.forEachAncestorDirectory(containingDirectory, function (directory) { - var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host); + var resolutionFromCache = tryFindNonRelativeModuleNameInCache(perModuleNameCache, moduleName, directory, traceEnabled, host, failedLookupLocations); if (resolutionFromCache) { return resolutionFromCache; } @@ -24560,6 +25539,14 @@ var ts; node = ts.getParseTreeNode(node, ts.isExpression); return node ? getContextualType(node) : undefined; }, + getContextualTypeForArgumentAtIndex: function (node, argIndex) { + node = ts.getParseTreeNode(node, ts.isCallLikeExpression); + return node && getContextualTypeForArgumentAtIndex(node, argIndex); + }, + getContextualTypeForJsxAttribute: function (node) { + node = ts.getParseTreeNode(node, ts.isJsxAttributeLike); + return node && getContextualTypeForJsxAttribute(node); + }, isContextSensitive: isContextSensitive, getFullyQualifiedName: getFullyQualifiedName, getResolvedSignature: function (node, candidatesOutArray, theArgumentCount) { @@ -24609,7 +25596,7 @@ var ts; node = ts.getParseTreeNode(node, ts.isJsxOpeningLikeElement); return node ? getAllAttributesTypeFromJsxOpeningLikeElement(node) : undefined; }, - getJsxIntrinsicTagNames: getJsxIntrinsicTagNames, + getJsxIntrinsicTagNamesAt: getJsxIntrinsicTagNamesAt, isOptionalParameter: function (node) { node = ts.getParseTreeNode(node, ts.isParameter); return node ? isOptionalParameter(node) : false; @@ -24648,7 +25635,7 @@ var ts; resolveName: function (name, location, meaning, excludeGlobals) { return resolveName(location, ts.escapeLeadingUnderscores(name), meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false, excludeGlobals); }, - getJsxNamespace: function () { return ts.unescapeLeadingUnderscores(getJsxNamespace()); }, + getJsxNamespace: function (n) { return ts.unescapeLeadingUnderscores(getJsxNamespace(n)); }, getAccessibleSymbolChain: getAccessibleSymbolChain, getTypePredicateOfSignature: getTypePredicateOfSignature, resolveExternalModuleSymbol: resolveExternalModuleSymbol, @@ -24656,6 +25643,11 @@ var ts; node = ts.getParseTreeNode(node); return node && tryGetThisTypeAt(node); }, + getTypeArgumentConstraint: function (node) { + node = ts.getParseTreeNode(node, ts.isTypeNode); + return node && getTypeArgumentConstraint(node); + }, + getSuggestionDiagnostics: function (file) { return suggestionDiagnostics.get(file.fileName) || ts.emptyArray; }, }; var tupleTypes = []; var unionTypes = ts.createMap(); @@ -24668,11 +25660,12 @@ var ts; var resolvingSymbol = createSymbol(0, "__resolving__" /* Resolving */); var anyType = createIntrinsicType(1 /* Any */, "any"); var autoType = createIntrinsicType(1 /* Any */, "any"); + var wildcardType = createIntrinsicType(1 /* Any */, "any"); var unknownType = createIntrinsicType(1 /* Any */, "unknown"); var undefinedType = createIntrinsicType(4096 /* Undefined */, "undefined"); - var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 4194304 /* ContainsWideningType */, "undefined"); + var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(4096 /* Undefined */ | 16777216 /* ContainsWideningType */, "undefined"); var nullType = createIntrinsicType(8192 /* Null */, "null"); - var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 4194304 /* ContainsWideningType */, "null"); + var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(8192 /* Null */ | 16777216 /* ContainsWideningType */, "null"); var stringType = createIntrinsicType(2 /* String */, "string"); var numberType = createIntrinsicType(4 /* Number */, "number"); var trueType = createIntrinsicType(128 /* BooleanLiteral */, "true"); @@ -24683,7 +25676,7 @@ var ts; var neverType = createIntrinsicType(16384 /* Never */, "never"); var silentNeverType = createIntrinsicType(16384 /* Never */, "never"); var implicitNeverType = createIntrinsicType(16384 /* Never */, "never"); - var nonPrimitiveType = createIntrinsicType(33554432 /* NonPrimitive */, "object"); + var nonPrimitiveType = createIntrinsicType(134217728 /* NonPrimitive */, "object"); var emptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); emptyTypeLiteralSymbol.members = ts.createSymbolTable(); @@ -24693,7 +25686,7 @@ var ts; var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); // The anyFunctionType contains the anyFunctionType by definition. The flag is further propagated // in getPropagatingFlagsOfTypes, and it is checked in inferFromTypes. - anyFunctionType.flags |= 16777216 /* ContainsAnyFunctionType */; + anyFunctionType.flags |= 67108864 /* ContainsAnyFunctionType */; var noConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var circularConstraintType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); var resolvingDefaultType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, undefined, undefined); @@ -24729,6 +25722,7 @@ var ts; var anyArrayType; var autoArrayType; var anyReadonlyArrayType; + var deferredGlobalNonNullableTypeAlias; // The library files are only loaded when the feature is used. // This allows users to just specify library files they want to used through --lib // and they will not get an error from not having unrelated library files @@ -24745,9 +25739,6 @@ var ts; var deferredGlobalAsyncIteratorType; var deferredGlobalAsyncIterableIteratorType; var deferredGlobalTemplateStringsArrayType; - var deferredJsxElementClassType; - var deferredJsxElementType; - var deferredJsxStatelessElementType; var deferredNodes; var deferredUnusedIdentifierNodes; var flowLoopStart = 0; @@ -24774,6 +25765,19 @@ var ts; var potentialNewTargetCollisions = []; var awaitedTypeStack = []; var diagnostics = ts.createDiagnosticCollection(); + // Suggestion diagnostics must have a file. Keyed by source file name. + var suggestionDiagnostics = ts.createMultiMap(); + function addSuggestionDiagnostic(diag) { + suggestionDiagnostics.add(diag.file.fileName, __assign({}, diag, { category: ts.DiagnosticCategory.Suggestion })); + } + function addErrorOrSuggestionDiagnostic(isError, diag) { + if (isError) { + diagnostics.add(diag); + } + else { + addSuggestionDiagnostic(diag); + } + } var TypeFacts; (function (TypeFacts) { TypeFacts[TypeFacts["None"] = 0] = "None"; @@ -24799,8 +25803,7 @@ var ts; TypeFacts[TypeFacts["NEUndefinedOrNull"] = 524288] = "NEUndefinedOrNull"; TypeFacts[TypeFacts["Truthy"] = 1048576] = "Truthy"; TypeFacts[TypeFacts["Falsy"] = 2097152] = "Falsy"; - TypeFacts[TypeFacts["Discriminatable"] = 4194304] = "Discriminatable"; - TypeFacts[TypeFacts["All"] = 8388607] = "All"; + TypeFacts[TypeFacts["All"] = 4194303] = "All"; // The following members encode facts about particular kinds of types for use in the getTypeFacts function. // The presence of a particular fact means that the given test is true for some (and possibly all) values // of that kind of type. @@ -24830,10 +25833,10 @@ var ts; TypeFacts[TypeFacts["TrueFacts"] = 4193668] = "TrueFacts"; TypeFacts[TypeFacts["SymbolStrictFacts"] = 1981320] = "SymbolStrictFacts"; TypeFacts[TypeFacts["SymbolFacts"] = 4193160] = "SymbolFacts"; - TypeFacts[TypeFacts["ObjectStrictFacts"] = 6166480] = "ObjectStrictFacts"; - TypeFacts[TypeFacts["ObjectFacts"] = 8378320] = "ObjectFacts"; - TypeFacts[TypeFacts["FunctionStrictFacts"] = 6164448] = "FunctionStrictFacts"; - TypeFacts[TypeFacts["FunctionFacts"] = 8376288] = "FunctionFacts"; + TypeFacts[TypeFacts["ObjectStrictFacts"] = 1972176] = "ObjectStrictFacts"; + TypeFacts[TypeFacts["ObjectFacts"] = 4184016] = "ObjectFacts"; + TypeFacts[TypeFacts["FunctionStrictFacts"] = 1970144] = "FunctionStrictFacts"; + TypeFacts[TypeFacts["FunctionFacts"] = 4181984] = "FunctionFacts"; TypeFacts[TypeFacts["UndefinedFacts"] = 2457472] = "UndefinedFacts"; TypeFacts[TypeFacts["NullFacts"] = 2340752] = "NullFacts"; })(TypeFacts || (TypeFacts = {})); @@ -24865,14 +25868,9 @@ var ts; var typeofType = createTypeofType(); var _jsxNamespace; var _jsxFactoryEntity; - var _jsxElementPropertiesName; - var _hasComputedJsxElementPropertiesName = false; - var _jsxElementChildrenPropertyName; - var _hasComputedJsxElementChildrenPropertyName = false; - /** Things we lazy load from the JSX namespace */ - var jsxTypes = ts.createUnderscoreEscapedMap(); var subtypeRelation = ts.createMap(); var assignableRelation = ts.createMap(); + var definitelyAssignableRelation = ts.createMap(); var comparableRelation = ts.createMap(); var identityRelation = ts.createMap(); var enumRelation = ts.createMap(); @@ -24899,8 +25897,10 @@ var ts; })(CallbackCheck || (CallbackCheck = {})); var MappedTypeModifiers; (function (MappedTypeModifiers) { - MappedTypeModifiers[MappedTypeModifiers["Readonly"] = 1] = "Readonly"; - MappedTypeModifiers[MappedTypeModifiers["Optional"] = 2] = "Optional"; + MappedTypeModifiers[MappedTypeModifiers["IncludeReadonly"] = 1] = "IncludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeReadonly"] = 2] = "ExcludeReadonly"; + MappedTypeModifiers[MappedTypeModifiers["IncludeOptional"] = 4] = "IncludeOptional"; + MappedTypeModifiers[MappedTypeModifiers["ExcludeOptional"] = 8] = "ExcludeOptional"; })(MappedTypeModifiers || (MappedTypeModifiers = {})); var ExpandingFlags; (function (ExpandingFlags) { @@ -24909,6 +25909,22 @@ var ts; ExpandingFlags[ExpandingFlags["Target"] = 2] = "Target"; ExpandingFlags[ExpandingFlags["Both"] = 3] = "Both"; })(ExpandingFlags || (ExpandingFlags = {})); + var TypeIncludes; + (function (TypeIncludes) { + TypeIncludes[TypeIncludes["Any"] = 1] = "Any"; + TypeIncludes[TypeIncludes["Undefined"] = 2] = "Undefined"; + TypeIncludes[TypeIncludes["Null"] = 4] = "Null"; + TypeIncludes[TypeIncludes["Never"] = 8] = "Never"; + TypeIncludes[TypeIncludes["NonWideningType"] = 16] = "NonWideningType"; + TypeIncludes[TypeIncludes["String"] = 32] = "String"; + TypeIncludes[TypeIncludes["Number"] = 64] = "Number"; + TypeIncludes[TypeIncludes["ESSymbol"] = 128] = "ESSymbol"; + TypeIncludes[TypeIncludes["LiteralOrUniqueESSymbol"] = 256] = "LiteralOrUniqueESSymbol"; + TypeIncludes[TypeIncludes["ObjectType"] = 512] = "ObjectType"; + TypeIncludes[TypeIncludes["EmptyObject"] = 1024] = "EmptyObject"; + TypeIncludes[TypeIncludes["Union"] = 2048] = "Union"; + TypeIncludes[TypeIncludes["Wildcard"] = 4096] = "Wildcard"; + })(TypeIncludes || (TypeIncludes = {})); var MembersOrExportsResolutionKind; (function (MembersOrExportsResolutionKind) { MembersOrExportsResolutionKind["resolvedExports"] = "resolvedExports"; @@ -25055,7 +26071,23 @@ var ts; }; } } - function getJsxNamespace() { + function getJsxNamespace(location) { + if (location) { + var file = ts.getSourceFileOfNode(location); + if (file) { + if (file.localJsxNamespace) { + return file.localJsxNamespace; + } + var jsxPragma = file.pragmas.get("jsx"); + if (jsxPragma) { + var chosenpragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma; + file.localJsxFactory = ts.parseIsolatedEntityName(chosenpragma.arguments.factory, languageVersion); + if (file.localJsxFactory) { + return file.localJsxNamespace = getFirstIdentifier(file.localJsxFactory).escapedText; + } + } + } + } if (!_jsxNamespace) { _jsxNamespace = "React"; if (compilerOptions.jsxFactory) { @@ -25094,35 +26126,35 @@ var ts; function getExcludedSymbolFlags(flags) { var result = 0; if (flags & 2 /* BlockScopedVariable */) - result |= 107455 /* BlockScopedVariableExcludes */; + result |= 67216319 /* BlockScopedVariableExcludes */; if (flags & 1 /* FunctionScopedVariable */) - result |= 107454 /* FunctionScopedVariableExcludes */; + result |= 67216318 /* FunctionScopedVariableExcludes */; if (flags & 4 /* Property */) result |= 0 /* PropertyExcludes */; if (flags & 8 /* EnumMember */) - result |= 900095 /* EnumMemberExcludes */; + result |= 68008959 /* EnumMemberExcludes */; if (flags & 16 /* Function */) - result |= 106927 /* FunctionExcludes */; + result |= 67215791 /* FunctionExcludes */; if (flags & 32 /* Class */) - result |= 899519 /* ClassExcludes */; + result |= 68008383 /* ClassExcludes */; if (flags & 64 /* Interface */) - result |= 792968 /* InterfaceExcludes */; + result |= 67901832 /* InterfaceExcludes */; if (flags & 256 /* RegularEnum */) - result |= 899327 /* RegularEnumExcludes */; + result |= 68008191 /* RegularEnumExcludes */; if (flags & 128 /* ConstEnum */) - result |= 899967 /* ConstEnumExcludes */; + result |= 68008831 /* ConstEnumExcludes */; if (flags & 512 /* ValueModule */) - result |= 106639 /* ValueModuleExcludes */; + result |= 67215503 /* ValueModuleExcludes */; if (flags & 8192 /* Method */) - result |= 99263 /* MethodExcludes */; + result |= 67208127 /* MethodExcludes */; if (flags & 32768 /* GetAccessor */) - result |= 41919 /* GetAccessorExcludes */; + result |= 67150783 /* GetAccessorExcludes */; if (flags & 65536 /* SetAccessor */) - result |= 74687 /* SetAccessorExcludes */; + result |= 67183551 /* SetAccessorExcludes */; if (flags & 262144 /* TypeParameter */) - result |= 530920 /* TypeParameterExcludes */; + result |= 67639784 /* TypeParameterExcludes */; if (flags & 524288 /* TypeAlias */) - result |= 793064 /* TypeAliasExcludes */; + result |= 67901928 /* TypeAliasExcludes */; if (flags & 2097152 /* Alias */) result |= 2097152 /* AliasExcludes */; return result; @@ -25151,7 +26183,7 @@ var ts; } function mergeSymbol(target, source) { if (!(target.flags & getExcludedSymbolFlags(source.flags)) || - source.flags & 67108864 /* JSContainer */ || target.flags & 67108864 /* JSContainer */) { + (source.flags | target.flags) & 67108864 /* JSContainer */) { // Javascript static-property-assignment declarations always merge, even though they are also values if (source.flags & 512 /* ValueModule */ && target.flags & 512 /* ValueModule */ && target.constEnumOnlyModule && !source.constEnumOnlyModule) { // reset flag when merging instantiated module into value module that has only const enums @@ -25160,7 +26192,7 @@ var ts; target.flags |= source.flags; if (source.valueDeclaration && (!target.valueDeclaration || - (target.valueDeclaration.kind === 234 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 234 /* ModuleDeclaration */))) { + (target.valueDeclaration.kind === 237 /* ModuleDeclaration */ && source.valueDeclaration.kind !== 237 /* ModuleDeclaration */))) { // other kinds of value declarations take precedence over modules target.valueDeclaration = source.valueDeclaration; } @@ -25175,19 +26207,31 @@ var ts; target.exports = ts.createSymbolTable(); mergeSymbolTable(target.exports, source.exports); } + if ((source.flags | target.flags) & 67108864 /* JSContainer */) { + var sourceInitializer = ts.getJSInitializerSymbol(source); + var targetInitializer = ts.getJSInitializerSymbol(target); + if (sourceInitializer !== source || targetInitializer !== target) { + mergeSymbol(targetInitializer, sourceInitializer); + } + } recordMergedSymbol(target, source); } else if (target.flags & 1024 /* NamespaceModule */) { error(ts.getNameOfDeclaration(source.declarations[0]), ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target)); } else { - var message_2 = target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ - ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 : ts.Diagnostics.Duplicate_identifier_0; + var message_2 = target.flags & 384 /* Enum */ || source.flags & 384 /* Enum */ + ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations + : target.flags & 2 /* BlockScopedVariable */ || source.flags & 2 /* BlockScopedVariable */ + ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0 + : ts.Diagnostics.Duplicate_identifier_0; ts.forEach(source.declarations, function (node) { - error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); + var errorNode = (ts.getJavascriptInitializer(node, /*isPrototypeAssignment*/ false) ? ts.getOuterNameOfJsInitializer(node) : ts.getNameOfDeclaration(node)) || node; + error(errorNode, message_2, symbolToString(source)); }); ts.forEach(target.declarations, function (node) { - error(ts.getNameOfDeclaration(node) || node, message_2, symbolToString(source)); + var errorNode = (ts.getJavascriptInitializer(node, /*isPrototypeAssignment*/ false) ? ts.getOuterNameOfJsInitializer(node) : ts.getNameOfDeclaration(node)) || node; + error(errorNode, message_2, symbolToString(source)); }); } } @@ -25278,7 +26322,7 @@ var ts; return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 }); } function isGlobalSourceFile(node) { - return node.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); + return node.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(node); } function getSymbol(symbols, name, meaning) { if (meaning) { @@ -25308,8 +26352,8 @@ var ts; function getSymbolsOfParameterPropertyDeclaration(parameter, parameterName) { var constructorDeclaration = parameter.parent; var classDeclaration = parameter.parent.parent; - var parameterSymbol = getSymbol(constructorDeclaration.locals, parameterName, 107455 /* Value */); - var propertySymbol = getSymbol(getMembersOfSymbol(classDeclaration.symbol), parameterName, 107455 /* Value */); + var parameterSymbol = getSymbol(constructorDeclaration.locals, parameterName, 67216319 /* Value */); + var propertySymbol = getSymbol(getMembersOfSymbol(classDeclaration.symbol), parameterName, 67216319 /* Value */); if (parameterSymbol && propertySymbol) { return [parameterSymbol, propertySymbol]; } @@ -25336,17 +26380,17 @@ var ts; } if (declaration.pos <= usage.pos) { // declaration is before usage - if (declaration.kind === 177 /* BindingElement */) { + if (declaration.kind === 180 /* BindingElement */) { // still might be illegal if declaration and usage are both binding elements (eg var [a = b, b = b] = [1, 2]) - var errorBindingElement = ts.getAncestor(usage, 177 /* BindingElement */); + var errorBindingElement = ts.getAncestor(usage, 180 /* BindingElement */); if (errorBindingElement) { return ts.findAncestor(errorBindingElement, ts.isBindingElement) !== ts.findAncestor(declaration, ts.isBindingElement) || declaration.pos < errorBindingElement.pos; } // or it might be illegal if usage happens before parent variable is declared (eg var [a] = a) - return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 227 /* VariableDeclaration */), usage); + return isBlockScopedNameDeclaredBeforeUse(ts.getAncestor(declaration, 230 /* VariableDeclaration */), usage); } - else if (declaration.kind === 227 /* VariableDeclaration */) { + else if (declaration.kind === 230 /* VariableDeclaration */) { // still might be illegal if usage is in the initializer of the variable declaration (eg var a = a) return !isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage); } @@ -25360,12 +26404,12 @@ var ts; // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) - if (usage.parent.kind === 247 /* ExportSpecifier */ || (usage.parent.kind === 244 /* ExportAssignment */ && usage.parent.isExportEquals)) { + if (usage.parent.kind === 250 /* ExportSpecifier */ || (usage.parent.kind === 247 /* ExportAssignment */ && usage.parent.isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; } // When resolving symbols for exports, the `usage` location passed in can be the export site directly - if (usage.kind === 244 /* ExportAssignment */ && usage.isExportEquals) { + if (usage.kind === 247 /* ExportAssignment */ && usage.isExportEquals) { return true; } var container = ts.getEnclosingBlockScopeContainer(declaration); @@ -25373,9 +26417,9 @@ var ts; function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration, usage) { var container = ts.getEnclosingBlockScopeContainer(declaration); switch (declaration.parent.parent.kind) { - case 209 /* VariableStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 212 /* VariableStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: // variable statement/for/for-of statement case, // use site should not be inside variable declaration (initializer of declaration or binding element) if (isSameScopeDescendentOf(usage, declaration, container)) { @@ -25395,16 +26439,16 @@ var ts; return true; } var initializerOfProperty = current.parent && - current.parent.kind === 150 /* PropertyDeclaration */ && + current.parent.kind === 151 /* PropertyDeclaration */ && current.parent.initializer === current; if (initializerOfProperty) { if (ts.hasModifier(current.parent, 32 /* Static */)) { - if (declaration.kind === 152 /* MethodDeclaration */) { + if (declaration.kind === 153 /* MethodDeclaration */) { return true; } } else { - var isDeclarationInstanceProperty = declaration.kind === 150 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); + var isDeclarationInstanceProperty = declaration.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(declaration, 32 /* Static */); if (!isDeclarationInstanceProperty || ts.getContainingClass(usage) !== ts.getContainingClass(declaration)) { return true; } @@ -25428,7 +26472,7 @@ var ts; var originalLocation = location; // needed for did-you-mean error reporting, which gathers candidates starting from the original location var result; var lastLocation; - var lastNonBlockLocation; + var lastSelfReferenceLocation; var propertyWithInvalidInitializer; var errorLocation = location; var grandparent; @@ -25445,26 +26489,31 @@ var ts; // - parameters are only in the scope of function body // This restriction does not apply to JSDoc comment types because they are parented // at a higher level than type parameters would normally be - if (meaning & result.flags & 793064 /* Type */ && lastLocation.kind !== 279 /* JSDocComment */) { + if (meaning & result.flags & 67901928 /* Type */ && lastLocation.kind !== 282 /* JSDocComment */) { useResult = result.flags & 262144 /* TypeParameter */ // type parameters are visible in parameter list, return type and type parameter list ? lastLocation === location.type || - lastLocation.kind === 147 /* Parameter */ || - lastLocation.kind === 146 /* TypeParameter */ + lastLocation.kind === 148 /* Parameter */ || + lastLocation.kind === 147 /* TypeParameter */ // local types not visible outside the function body : false; } - if (meaning & 107455 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { + if (meaning & 67216319 /* Value */ && result.flags & 1 /* FunctionScopedVariable */) { // parameters are visible only inside function body, parameter list and return type // technically for parameter list case here we might mix parameters and variables declared in function, // however it is detected separately when checking initializers of parameters // to make sure that they reference no variables declared after them. useResult = - lastLocation.kind === 147 /* Parameter */ || + lastLocation.kind === 148 /* Parameter */ || (lastLocation === location.type && - result.valueDeclaration.kind === 147 /* Parameter */); + result.valueDeclaration.kind === 148 /* Parameter */); } } + else if (location.kind === 170 /* ConditionalType */) { + // A type parameter declared using 'infer T' in a conditional type is visible only in + // the true branch of the conditional type. + useResult = lastLocation === location.trueType; + } if (useResult) { break loop; } @@ -25474,14 +26523,14 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) break; isInExternalModule = true; // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var moduleExports = getSymbolOfNode(location).exports; - if (location.kind === 269 /* SourceFile */ || ts.isAmbientModule(location)) { + if (location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location)) { // It's an external module. First see if the module has an export default and if the local // name of that export default matches. if (result = moduleExports.get("default" /* Default */)) { @@ -25505,7 +26554,7 @@ var ts; var moduleExport = moduleExports.get(name); if (moduleExport && moduleExport.flags === 2097152 /* Alias */ && - ts.getDeclarationOfKind(moduleExport, 247 /* ExportSpecifier */)) { + ts.getDeclarationOfKind(moduleExport, 250 /* ExportSpecifier */)) { break; } } @@ -25513,13 +26562,13 @@ var ts; break loop; } break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (result = lookup(getSymbolOfNode(location).exports, name, meaning & 8 /* EnumMember */)) { break loop; } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: // TypeScript 1.0 spec (April 2014): 8.4.1 // Initializer expressions for instance member variables are evaluated in the scope // of the class constructor body but are not permitted to reference parameters or @@ -25529,17 +26578,17 @@ var ts; if (ts.isClassLike(location.parent) && !ts.hasModifier(location, 32 /* Static */)) { var ctor = findConstructorDeclaration(location.parent); if (ctor && ctor.locals) { - if (lookup(ctor.locals, name, meaning & 107455 /* Value */)) { + if (lookup(ctor.locals, name, meaning & 67216319 /* Value */)) { // Remember the property node, it will be used later to report appropriate error propertyWithInvalidInitializer = location; } } } break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 793064 /* Type */)) { + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + if (result = lookup(getMembersOfSymbol(getSymbolOfNode(location)), name, meaning & 67901928 /* Type */)) { if (!isTypeParameterSymbolDeclaredInContainer(result, location)) { // ignore type parameters not declared in this container result = undefined; @@ -25554,7 +26603,7 @@ var ts; } break loop; } - if (location.kind === 200 /* ClassExpression */ && meaning & 32 /* Class */) { + if (location.kind === 203 /* ClassExpression */ && meaning & 32 /* Class */) { var className = location.name; if (className && name === className.escapedText) { result = location.symbol; @@ -25562,11 +26611,11 @@ var ts; } } break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // The type parameters of a class are not in scope in the base class expression. if (lastLocation === location.expression && location.parent.token === 85 /* ExtendsKeyword */) { var container = location.parent.parent; - if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 793064 /* Type */))) { + if (ts.isClassLike(container) && (result = lookup(getSymbolOfNode(container).members, name, meaning & 67901928 /* Type */))) { if (nameNotFoundMessage) { error(errorLocation, ts.Diagnostics.Base_class_expressions_cannot_reference_class_type_parameters); } @@ -25582,29 +26631,29 @@ var ts; // [foo()]() { } // <-- Reference to T from class's own computed property // } // - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: grandparent = location.parent.parent; - if (ts.isClassLike(grandparent) || grandparent.kind === 231 /* InterfaceDeclaration */) { + if (ts.isClassLike(grandparent) || grandparent.kind === 234 /* InterfaceDeclaration */) { // A reference to this grandparent's type parameters would be an error - if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 793064 /* Type */)) { + if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 67901928 /* Type */)) { error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type); return undefined; } } break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: if (meaning & 3 /* Variable */ && name === "arguments") { result = argumentsSymbol; break loop; @@ -25617,7 +26666,7 @@ var ts; } } break; - case 148 /* Decorator */: + case 149 /* Decorator */: // Decorators are resolved at the class declaration. Resolving at the parameter // or member would result in looking up locals in the method. // @@ -25626,7 +26675,7 @@ var ts; // method(@y x, y) {} // <-- decorator y should be resolved at the class declaration, not the parameter. // } // - if (location.parent && location.parent.kind === 147 /* Parameter */) { + if (location.parent && location.parent.kind === 148 /* Parameter */) { location = location.parent; } // @@ -25640,21 +26689,21 @@ var ts; } break; } - if (isNonBlockLocation(location)) { - lastNonBlockLocation = location; + if (isSelfReferenceLocation(location)) { + lastSelfReferenceLocation = location; } lastLocation = location; location = location.parent; } // We just climbed up parents looking for the name, meaning that we started in a descendant node of `lastLocation`. - // If `result === lastNonBlockLocation.symbol`, that means that we are somewhere inside `lastNonBlockLocation` looking up a name, and resolving to `lastLocation` itself. + // If `result === lastSelfReferenceLocation.symbol`, that means that we are somewhere inside `lastSelfReferenceLocation` looking up a name, and resolving to `lastLocation` itself. // That means that this is a self-reference of `lastLocation`, and shouldn't count this when considering whether `lastLocation` is used. - if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && result !== lastNonBlockLocation.symbol) { - result.isReferenced = true; + if (isUse && result && nameNotFoundMessage && noUnusedIdentifiers && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) { + result.isReferenced |= meaning; } if (!result) { if (lastLocation) { - ts.Debug.assert(lastLocation.kind === 269 /* SourceFile */); + ts.Debug.assert(lastLocation.kind === 272 /* SourceFile */); if (lastLocation.commonJsModuleIndicator && name === "exports") { return lastLocation.symbol; } @@ -25708,34 +26757,33 @@ var ts; // we want to check for block-scoped if (errorLocation && (meaning & 2 /* BlockScopedVariable */ || - ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 107455 /* Value */) === 107455 /* Value */))) { + ((meaning & 32 /* Class */ || meaning & 384 /* Enum */) && (meaning & 67216319 /* Value */) === 67216319 /* Value */))) { var exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result); if (exportOrLocalSymbol.flags & 2 /* BlockScopedVariable */ || exportOrLocalSymbol.flags & 32 /* Class */ || exportOrLocalSymbol.flags & 384 /* Enum */) { checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation); } } // If we're in an external module, we can't reference value symbols created from UMD export declarations - if (result && isInExternalModule && (meaning & 107455 /* Value */) === 107455 /* Value */) { + if (result && isInExternalModule && (meaning & 67216319 /* Value */) === 67216319 /* Value */) { var decls = result.declarations; - if (decls && decls.length === 1 && decls[0].kind === 237 /* NamespaceExportDeclaration */) { + if (decls && decls.length === 1 && decls[0].kind === 240 /* NamespaceExportDeclaration */) { error(errorLocation, ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead, ts.unescapeLeadingUnderscores(name)); } } } return result; } - function isNonBlockLocation(_a) { - var kind = _a.kind; - switch (kind) { - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 222 /* SwitchStatement */: - case 236 /* CaseBlock */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - return false; - default: + function isSelfReferenceLocation(node) { + switch (node.kind) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 237 /* ModuleDeclaration */: // For `namespace N { N; }` return true; + default: + return false; } } function diagnosticName(nameArg) { @@ -25744,14 +26792,14 @@ var ts; function isTypeParameterSymbolDeclaredInContainer(symbol, container) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - if (decl.kind === 146 /* TypeParameter */ && decl.parent === container) { + if (decl.kind === 147 /* TypeParameter */ && decl.parent === container) { return true; } } return false; } function checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) { - if ((errorLocation.kind === 71 /* Identifier */ && (isTypeReferenceIdentifier(errorLocation)) || isInTypeQuery(errorLocation))) { + if (!ts.isIdentifier(errorLocation) || errorLocation.escapedText !== name || isTypeReferenceIdentifier(errorLocation) || isInTypeQuery(errorLocation)) { return false; } var container = ts.getThisContainer(errorLocation, /*includeArrowFunctions*/ true); @@ -25797,9 +26845,9 @@ var ts; function getEntityNameForExtendingInterface(node) { switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.parent ? getEntityNameForExtendingInterface(node.parent) : undefined; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: if (ts.isEntityNameExpression(node.expression)) { return node.expression; } @@ -25809,8 +26857,9 @@ var ts; } } function checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) { - if (meaning === 1920 /* Namespace */) { - var symbol = resolveSymbol(resolveName(errorLocation, name, 793064 /* Type */ & ~1920 /* Namespace */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJavaScriptFile(errorLocation) ? 67216319 /* Value */ : 0); + if (meaning === namespaceMeaning) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 67901928 /* Type */ & ~namespaceMeaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); var parent = errorLocation.parent; if (symbol) { if (ts.isQualifiedName(parent)) { @@ -25829,12 +26878,12 @@ var ts; return false; } function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) { - if (meaning & (107455 /* Value */ & ~1024 /* NamespaceModule */)) { + if (meaning & (67216319 /* Value */ & ~1024 /* NamespaceModule */)) { if (name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never") { error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name)); return true; } - var symbol = resolveSymbol(resolveName(errorLocation, name, 793064 /* Type */ & ~107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + var symbol = resolveSymbol(resolveName(errorLocation, name, 67901928 /* Type */ & ~67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol && !(symbol.flags & 1024 /* NamespaceModule */)) { error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here, ts.unescapeLeadingUnderscores(name)); return true; @@ -25843,15 +26892,15 @@ var ts; return false; } function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) { - if (meaning & (107455 /* Value */ & ~1024 /* NamespaceModule */ & ~793064 /* Type */)) { - var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + if (meaning & (67216319 /* Value */ & ~1024 /* NamespaceModule */ & ~67901928 /* Type */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 /* NamespaceModule */ & ~67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol) { error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, ts.unescapeLeadingUnderscores(name)); return true; } } - else if (meaning & (793064 /* Type */ & ~1024 /* NamespaceModule */ & ~107455 /* Value */)) { - var symbol = resolveSymbol(resolveName(errorLocation, name, (512 /* ValueModule */ | 1024 /* NamespaceModule */) & ~793064 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); + else if (meaning & (67901928 /* Type */ & ~1024 /* NamespaceModule */ & ~67216319 /* Value */)) { + var symbol = resolveSymbol(resolveName(errorLocation, name, (512 /* ValueModule */ | 1024 /* NamespaceModule */) & ~67901928 /* Type */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)); if (symbol) { error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, ts.unescapeLeadingUnderscores(name)); return true; @@ -25862,7 +26911,7 @@ var ts; function checkResolvedBlockScopedVariable(result, errorLocation) { ts.Debug.assert(!!(result.flags & 2 /* BlockScopedVariable */ || result.flags & 32 /* Class */ || result.flags & 384 /* Enum */)); // Block-scoped variables cannot be used before their definition - var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 233 /* EnumDeclaration */) ? d : undefined; }); + var declaration = ts.forEach(result.declarations, function (d) { return ts.isBlockOrCatchScoped(d) || ts.isClassLike(d) || (d.kind === 236 /* EnumDeclaration */) ? d : undefined; }); ts.Debug.assert(declaration !== undefined, "Declaration to checkResolvedBlockScopedVariable is undefined"); if (!(declaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(declaration, errorLocation)) { if (result.flags & 2 /* BlockScopedVariable */) { @@ -25885,13 +26934,13 @@ var ts; } function getAnyImportSyntax(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return node; - case 240 /* ImportClause */: + case 243 /* ImportClause */: return node.parent; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return node.parent.parent; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return node.parent.parent.parent; default: return undefined; @@ -25901,7 +26950,7 @@ var ts; return ts.find(symbol.declarations, ts.isAliasSymbolDeclaration); } function getTargetOfImportEqualsDeclaration(node, dontResolveAlias) { - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { return resolveExternalModuleSymbol(resolveExternalModuleName(node, ts.getExternalModuleImportEqualsDeclarationExpression(node))); } return getSymbolOfPartOfRightHandSideOfImportEquals(node.moduleReference, dontResolveAlias); @@ -25989,7 +27038,7 @@ var ts; if (valueSymbol === unknownSymbol && typeSymbol === unknownSymbol) { return unknownSymbol; } - if (valueSymbol.flags & (793064 /* Type */ | 1920 /* Namespace */)) { + if (valueSymbol.flags & (67901928 /* Type */ | 1920 /* Namespace */)) { return valueSymbol; } var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName); @@ -26044,7 +27093,15 @@ var ts; combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) : symbolFromModule || symbolFromVariable; if (!symbol) { - error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, getFullyQualifiedName(moduleSymbol), ts.declarationNameToString(name)); + var moduleName = getFullyQualifiedName(moduleSymbol); + var declarationName = ts.declarationNameToString(name); + var suggestion = getSuggestionForNonexistentModule(name, targetSymbol); + if (suggestion !== undefined) { + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestion); + } + else { + error(name, ts.Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); + } } return symbol; } @@ -26062,23 +27119,23 @@ var ts; resolveEntityName(node.propertyName || node.name, meaning, /*ignoreErrors*/ false, dontResolveAlias); } function getTargetOfExportAssignment(node, dontResolveAlias) { - return resolveEntityName(node.expression, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); + return resolveEntityName(node.expression, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } function getTargetOfAliasDeclaration(node, dontRecursivelyResolve) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return getTargetOfImportEqualsDeclaration(node, dontRecursivelyResolve); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return getTargetOfImportClause(node, dontRecursivelyResolve); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return getTargetOfNamespaceImport(node, dontRecursivelyResolve); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return getTargetOfImportSpecifier(node, dontRecursivelyResolve); - case 247 /* ExportSpecifier */: - return getTargetOfExportSpecifier(node, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); - case 244 /* ExportAssignment */: + case 250 /* ExportSpecifier */: + return getTargetOfExportSpecifier(node, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, dontRecursivelyResolve); + case 247 /* ExportAssignment */: return getTargetOfExportAssignment(node, dontRecursivelyResolve); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return getTargetOfNamespaceExportDeclaration(node, dontRecursivelyResolve); } } @@ -26086,7 +27143,7 @@ var ts; * Indicates that a symbol is an alias that does not merge with a local declaration. */ function isNonLocalAlias(symbol, excludes) { - if (excludes === void 0) { excludes = 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */; } + if (excludes === void 0) { excludes = 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */; } return symbol && (symbol.flags & (2097152 /* Alias */ | excludes)) === 2097152 /* Alias */; } function resolveSymbol(symbol, dontResolveAlias) { @@ -26118,7 +27175,7 @@ var ts; var target = resolveAlias(symbol); if (target) { var markAlias = target === unknownSymbol || - ((target.flags & 107455 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target)); + ((target.flags & 67216319 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target)); if (markAlias) { markAliasSymbolAsReferenced(symbol); } @@ -26133,11 +27190,11 @@ var ts; links.referenced = true; var node = getDeclarationOfAliasSymbol(symbol); ts.Debug.assert(!!node); - if (node.kind === 244 /* ExportAssignment */) { + if (node.kind === 247 /* ExportAssignment */) { // export default checkExpressionCached(node.expression); } - else if (node.kind === 247 /* ExportSpecifier */) { + else if (node.kind === 250 /* ExportSpecifier */) { // export { } or export { as foo } checkExpressionCached(node.propertyName || node.name); } @@ -26159,14 +27216,14 @@ var ts; entityName = entityName.parent; } // Check for case 1 and 3 in the above example - if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 144 /* QualifiedName */) { + if (entityName.kind === 71 /* Identifier */ || entityName.parent.kind === 145 /* QualifiedName */) { return resolveEntityName(entityName, 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } else { // Case 2 in above example // entityName.kind could be a QualifiedName or a Missing identifier - ts.Debug.assert(entityName.parent.kind === 238 /* ImportEqualsDeclaration */); - return resolveEntityName(entityName, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); + ts.Debug.assert(entityName.parent.kind === 241 /* ImportEqualsDeclaration */); + return resolveEntityName(entityName, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, /*ignoreErrors*/ false, dontResolveAlias); } } function getFullyQualifiedName(symbol) { @@ -26179,40 +27236,43 @@ var ts; if (ts.nodeIsMissing(name)) { return undefined; } + var namespaceMeaning = 1920 /* Namespace */ | (ts.isInJavaScriptFile(name) ? meaning & 67216319 /* Value */ : 0); var symbol; if (name.kind === 71 /* Identifier */) { - var message = meaning === 1920 /* Namespace */ ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; + var message = meaning === namespaceMeaning ? ts.Diagnostics.Cannot_find_namespace_0 : ts.Diagnostics.Cannot_find_name_0; symbol = resolveName(location || name, name.escapedText, meaning, ignoreErrors ? undefined : message, name, /*isUse*/ true); if (!symbol) { return undefined; } } - else if (name.kind === 144 /* QualifiedName */ || name.kind === 180 /* PropertyAccessExpression */) { - var left = void 0; - if (name.kind === 144 /* QualifiedName */) { - left = name.left; - } - else if (name.kind === 180 /* PropertyAccessExpression */ && - (name.expression.kind === 186 /* ParenthesizedExpression */ || ts.isEntityNameExpression(name.expression))) { - left = name.expression; - } - else { - // If the expression in property-access expression is not entity-name or parenthsizedExpression (e.g. it is a call expression), it won't be able to successfully resolve the name. - // This is the case when we are trying to do any language service operation in heritage clauses. By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression - // will attempt to checkPropertyAccessExpression to resolve symbol. - // i.e class C extends foo()./*do language service operation here*/B {} - return undefined; - } - var right = name.kind === 144 /* QualifiedName */ ? name.right : name.name; - var namespace = resolveEntityName(left, 1920 /* Namespace */, ignoreErrors, /*dontResolveAlias*/ false, location); + else if (name.kind === 145 /* QualifiedName */ || name.kind === 183 /* PropertyAccessExpression */) { + var left = name.kind === 145 /* QualifiedName */ ? name.left : name.expression; + var right = name.kind === 145 /* QualifiedName */ ? name.right : name.name; + var namespace = resolveEntityName(left, namespaceMeaning, ignoreErrors, /*dontResolveAlias*/ false, location); if (!namespace || ts.nodeIsMissing(right)) { return undefined; } else if (namespace === unknownSymbol) { return namespace; } - if (ts.isInJavaScriptFile(name) && ts.isDeclarationOfFunctionOrClassExpression(namespace)) { - namespace = getSymbolOfNode(namespace.valueDeclaration.initializer); + if (ts.isInJavaScriptFile(name)) { + var initializer = ts.getDeclaredJavascriptInitializer(namespace.valueDeclaration) || ts.getAssignedJavascriptInitializer(namespace.valueDeclaration); + if (initializer) { + namespace = getSymbolOfNode(initializer); + } + if (namespace.valueDeclaration && + ts.isVariableDeclaration(namespace.valueDeclaration) && + namespace.valueDeclaration.initializer && + isCommonJsRequire(namespace.valueDeclaration.initializer)) { + var moduleName = namespace.valueDeclaration.initializer.arguments[0]; + var moduleSym = resolveExternalModuleName(moduleName, moduleName); + if (moduleSym) { + var resolvedModuleSymbol = resolveExternalModuleSymbol(moduleSym); + if (resolvedModuleSymbol) { + namespace = resolvedModuleSymbol; + } + } + } } symbol = getSymbol(getExportsOfSymbol(namespace), right.escapedText, meaning); if (!symbol) { @@ -26222,15 +27282,6 @@ var ts; return undefined; } } - else if (name.kind === 186 /* ParenthesizedExpression */) { - // If the expression in parenthesizedExpression is not an entity-name (e.g. it is a call expression), it won't be able to successfully resolve the name. - // This is the case when we are trying to do any language service operation in heritage clauses. - // By return undefined, the getSymbolOfEntityNameOrPropertyAccessExpression will attempt to checkPropertyAccessExpression to resolve symbol. - // i.e class C extends foo()./*do language service operation here*/B {} - return ts.isEntityNameExpression(name.expression) ? - resolveEntityName(name.expression, meaning, ignoreErrors, dontResolveAlias, location) : - undefined; - } else { ts.Debug.assertNever(name, "Unknown entity name kind."); } @@ -26242,11 +27293,9 @@ var ts; } function resolveExternalModuleNameWorker(location, moduleReferenceExpression, moduleNotFoundError, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } - if (moduleReferenceExpression.kind !== 9 /* StringLiteral */ && moduleReferenceExpression.kind !== 13 /* NoSubstitutionTemplateLiteral */) { - return; - } - var moduleReferenceLiteral = moduleReferenceExpression; - return resolveExternalModule(location, moduleReferenceLiteral.text, moduleNotFoundError, moduleReferenceLiteral, isForAugmentation); + return ts.isStringLiteralLike(moduleReferenceExpression) + ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) + : undefined; } function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation) { if (isForAugmentation === void 0) { isForAugmentation = false; } @@ -26267,6 +27316,9 @@ var ts; var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName); if (sourceFile) { if (sourceFile.symbol) { + if (resolvedModule.isExternalLibraryImport && !ts.extensionIsTypeScript(resolvedModule.extension)) { + addSuggestionDiagnostic(createModuleImplicitlyAnyDiagnostic(errorNode, resolvedModule, moduleReference)); + } // merged symbol is module declaration symbol combined with all augmentations return getMergedSymbol(sourceFile.symbol); } @@ -26288,10 +27340,8 @@ var ts; var diag = ts.Diagnostics.Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented; error(errorNode, diag, moduleReference, resolvedModule.resolvedFileName); } - else if (noImplicitAny && moduleNotFoundError) { - var errorInfo = resolvedModule.packageId && ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, resolvedModule.packageId.name); - errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedModule.resolvedFileName); - diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(errorNode, errorInfo)); + else { + addErrorOrSuggestionDiagnostic(noImplicitAny && !!moduleNotFoundError, createModuleImplicitlyAnyDiagnostic(errorNode, resolvedModule, moduleReference)); } // Failed imports and untyped modules are both treated in an untyped manner; only difference is whether we give a diagnostic first. return undefined; @@ -26314,6 +27364,12 @@ var ts; } return undefined; } + function createModuleImplicitlyAnyDiagnostic(errorNode, _a, moduleReference) { + var packageId = _a.packageId, resolvedFileName = _a.resolvedFileName; + var errorInfo = packageId && ts.chainDiagnosticMessages( + /*details*/ undefined, ts.Diagnostics.Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0, ts.getMangledNameForScopedPackage(packageId.name)); + return ts.createDiagnosticForNodeFromMessageChain(errorNode, ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type, moduleReference, resolvedFileName)); + } // An external module with an 'export =' declaration resolves to the target of the 'export =' declaration, // and an external module with no 'export =' declaration resolves to the module itself. function resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) { @@ -26489,13 +27545,13 @@ var ts; : symbol; } function symbolIsValue(symbol) { - return !!(symbol.flags & 107455 /* Value */ || symbol.flags & 2097152 /* Alias */ && resolveAlias(symbol).flags & 107455 /* Value */); + return !!(symbol.flags & 67216319 /* Value */ || symbol.flags & 2097152 /* Alias */ && resolveAlias(symbol).flags & 67216319 /* Value */); } function findConstructorDeclaration(node) { var members = node.members; for (var _i = 0, members_2 = members; _i < members_2.length; _i++) { var member = members_2[_i]; - if (member.kind === 153 /* Constructor */ && ts.nodeIsPresent(member.body)) { + if (member.kind === 154 /* Constructor */ && ts.nodeIsPresent(member.body)) { return member; } } @@ -26573,12 +27629,12 @@ var ts; } } switch (location.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (!ts.isExternalOrCommonJsModule(location)) { break; } // falls through - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (result = callback(getSymbolOfNode(location).exports)) { return result; } @@ -26589,13 +27645,21 @@ var ts; } function getQualifiedLeftMeaning(rightMeaning) { // If we are looking in value space, the parent meaning is value, other wise it is namespace - return rightMeaning === 107455 /* Value */ ? 107455 /* Value */ : 1920 /* Namespace */; + return rightMeaning === 67216319 /* Value */ ? 67216319 /* Value */ : 1920 /* Namespace */; } - function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing) { + function getAccessibleSymbolChain(symbol, enclosingDeclaration, meaning, useOnlyExternalAliasing, visitedSymbolTablesMap) { + if (visitedSymbolTablesMap === void 0) { visitedSymbolTablesMap = ts.createMap(); } if (!(symbol && !isPropertyOrMethodDeclarationSymbol(symbol))) { return undefined; } - var visitedSymbolTables = []; + var id = "" + getSymbolId(symbol); + var visitedSymbolTables; + if (visitedSymbolTablesMap.has(id)) { + visitedSymbolTables = visitedSymbolTablesMap.get(id); + } + else { + visitedSymbolTablesMap.set(id, visitedSymbolTables = []); + } return forEachSymbolTableInScope(enclosingDeclaration, getAccessibleSymbolChainFromSymbolTable); /** * @param {ignoreQualification} boolean Set when a symbol is being looked for through the exports of another symbol (meaning we have a route to qualify it already) @@ -26612,7 +27676,7 @@ var ts; // If the symbol is equivalent and doesn't need further qualification, this symbol is accessible return !needsQualification(symbolFromSymbolTable, enclosingDeclaration, meaning) || // If symbol needs qualification, make sure that parent is accessible, if it is then this symbol is accessible too - !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing); + !!getAccessibleSymbolChain(symbolFromSymbolTable.parent, enclosingDeclaration, getQualifiedLeftMeaning(meaning), useOnlyExternalAliasing, visitedSymbolTablesMap); } function isAccessible(symbolFromSymbolTable, resolvedAliasSymbol, ignoreQualification) { return symbol === (resolvedAliasSymbol || symbolFromSymbolTable) && @@ -26622,9 +27686,6 @@ var ts; !ts.some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) && (ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning)); } - function isUMDExportSymbol(symbol) { - return symbol && symbol.declarations && symbol.declarations[0] && ts.isNamespaceExportDeclaration(symbol.declarations[0]); - } function trySymbolTable(symbols, ignoreQualification) { // If symbol is directly available by its name in the symbol table if (isAccessible(symbols.get(symbol.escapedName), /*resolvedAliasSymbol*/ undefined, ignoreQualification)) { @@ -26633,8 +27694,9 @@ var ts; // Check if symbol is any of the alias return ts.forEachEntry(symbols, function (symbolFromSymbolTable) { if (symbolFromSymbolTable.flags & 2097152 /* Alias */ - && symbolFromSymbolTable.escapedName !== "export=" - && !(isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) + && symbolFromSymbolTable.escapedName !== "export=" /* ExportEquals */ + && symbolFromSymbolTable.escapedName !== "default" /* Default */ + && !(ts.isUMDExportSymbol(symbolFromSymbolTable) && enclosingDeclaration && ts.isExternalModule(ts.getSourceFileOfNode(enclosingDeclaration))) // If `!useOnlyExternalAliasing`, we can use any type of alias to get the name && (!useOnlyExternalAliasing || ts.some(symbolFromSymbolTable.declarations, ts.isExternalModuleImportEqualsDeclaration))) { var resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable); @@ -26667,7 +27729,7 @@ var ts; return true; } // Qualify if the symbol from symbol table has same meaning as expected - symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 247 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; + symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 /* Alias */ && !ts.getDeclarationOfKind(symbolFromSymbolTable, 250 /* ExportSpecifier */)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable; if (symbolFromSymbolTable.flags & meaning) { qualify = true; return true; @@ -26682,10 +27744,10 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: continue; default: return false; @@ -26696,11 +27758,11 @@ var ts; return false; } function isTypeSymbolAccessible(typeSymbol, enclosingDeclaration) { - var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 793064 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 67901928 /* Type */, /*shouldComputeAliasesToMakeVisible*/ false); return access.accessibility === 0 /* Accessible */; } function isValueSymbolAccessible(typeSymbol, enclosingDeclaration) { - var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 107455 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false); + var access = isSymbolAccessible(typeSymbol, enclosingDeclaration, 67216319 /* Value */, /*shouldComputeAliasesToMakeVisible*/ false); return access.accessibility === 0 /* Accessible */; } /** @@ -26771,7 +27833,7 @@ var ts; } } function hasExternalModuleSymbol(declaration) { - return ts.isAmbientModule(declaration) || (declaration.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); + return ts.isAmbientModule(declaration) || (declaration.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(declaration)); } function hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) { var aliasesToMakeVisible; @@ -26805,21 +27867,21 @@ var ts; function isEntityNameVisible(entityName, enclosingDeclaration) { // get symbol of the first identifier of the entityName var meaning; - if (entityName.parent.kind === 163 /* TypeQuery */ || + if (entityName.parent.kind === 164 /* TypeQuery */ || ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent) || - entityName.parent.kind === 145 /* ComputedPropertyName */) { + entityName.parent.kind === 146 /* ComputedPropertyName */) { // Typeof value - meaning = 107455 /* Value */ | 1048576 /* ExportValue */; + meaning = 67216319 /* Value */ | 1048576 /* ExportValue */; } - else if (entityName.kind === 144 /* QualifiedName */ || entityName.kind === 180 /* PropertyAccessExpression */ || - entityName.parent.kind === 238 /* ImportEqualsDeclaration */) { + else if (entityName.kind === 145 /* QualifiedName */ || entityName.kind === 183 /* PropertyAccessExpression */ || + entityName.parent.kind === 241 /* ImportEqualsDeclaration */) { // Left identifier from type reference or TypeAlias // Entity name of the import declaration meaning = 1920 /* Namespace */; } else { // Type Reference or TypeAlias entity = Identifier - meaning = 793064 /* Type */; + meaning = 67901928 /* Type */; } var firstIdentifier = getFirstIdentifier(entityName); var symbol = resolveName(enclosingDeclaration, firstIdentifier.escapedText, meaning, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); @@ -26857,10 +27919,10 @@ var ts; function signatureToStringWorker(writer) { var sigOutput; if (flags & 262144 /* WriteArrowStyleSignature */) { - sigOutput = kind === 1 /* Construct */ ? 162 /* ConstructorType */ : 161 /* FunctionType */; + sigOutput = kind === 1 /* Construct */ ? 163 /* ConstructorType */ : 162 /* FunctionType */; } else { - sigOutput = kind === 1 /* Construct */ ? 157 /* ConstructSignature */ : 156 /* CallSignature */; + sigOutput = kind === 1 /* Construct */ ? 158 /* ConstructSignature */ : 157 /* CallSignature */; } var sig = nodeBuilder.signatureToSignatureDeclaration(signature, sigOutput, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */ | 512 /* WriteTypeParametersInQualifiedName */); var printer = ts.createPrinter({ removeComments: true, omitTrailingSemicolon: true }); @@ -26870,6 +27932,7 @@ var ts; } } function typeToString(type, enclosingDeclaration, flags, writer) { + if (flags === void 0) { flags = 1048576 /* AllowUniqueESSymbolType */; } if (writer === void 0) { writer = ts.createTextWriter(""); } var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 3112960 /* IgnoreErrors */, writer); ts.Debug.assert(typeNode !== undefined, "should always get typenode"); @@ -26952,7 +28015,8 @@ var ts; flags: flags, tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: ts.noop }, encounteredError: false, - symbolStack: undefined + symbolStack: undefined, + inferTypeParameters: undefined }; } function typeToTypeNodeHelper(type, context) { @@ -26966,22 +28030,22 @@ var ts; return ts.createKeywordTypeNode(119 /* AnyKeyword */); } if (type.flags & 2 /* String */) { - return ts.createKeywordTypeNode(136 /* StringKeyword */); + return ts.createKeywordTypeNode(137 /* StringKeyword */); } if (type.flags & 4 /* Number */) { - return ts.createKeywordTypeNode(133 /* NumberKeyword */); + return ts.createKeywordTypeNode(134 /* NumberKeyword */); } if (type.flags & 8 /* Boolean */) { return ts.createKeywordTypeNode(122 /* BooleanKeyword */); } if (type.flags & 256 /* EnumLiteral */ && !(type.flags & 131072 /* Union */)) { var parentSymbol = getParentOfSymbol(type.symbol); - var parentName = symbolToName(parentSymbol, context, 793064 /* Type */, /*expectsIdentifier*/ false); + var parentName = symbolToName(parentSymbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false); var enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type ? parentName : ts.createQualifiedName(parentName, ts.symbolName(type.symbol)); return ts.createTypeReferenceNode(enumLiteralName, /*typeArguments*/ undefined); } if (type.flags & 272 /* EnumLike */) { - var name = symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ false); + var name = symbolToName(type.symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false); return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } if (type.flags & (32 /* StringLiteral */)) { @@ -26995,29 +28059,32 @@ var ts; } if (type.flags & 1024 /* UniqueESSymbol */) { if (!(context.flags & 1048576 /* AllowUniqueESSymbolType */)) { + if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration)) { + return ts.createTypeQueryNode(symbolToName(type.symbol, context, 67216319 /* Value */, /*expectsIdentifier*/ false)); + } if (context.tracker.reportInaccessibleUniqueSymbolError) { context.tracker.reportInaccessibleUniqueSymbolError(); } } - return ts.createTypeOperatorNode(140 /* UniqueKeyword */, ts.createKeywordTypeNode(137 /* SymbolKeyword */)); + return ts.createTypeOperatorNode(141 /* UniqueKeyword */, ts.createKeywordTypeNode(138 /* SymbolKeyword */)); } if (type.flags & 2048 /* Void */) { return ts.createKeywordTypeNode(105 /* VoidKeyword */); } if (type.flags & 4096 /* Undefined */) { - return ts.createKeywordTypeNode(139 /* UndefinedKeyword */); + return ts.createKeywordTypeNode(140 /* UndefinedKeyword */); } if (type.flags & 8192 /* Null */) { return ts.createKeywordTypeNode(95 /* NullKeyword */); } if (type.flags & 16384 /* Never */) { - return ts.createKeywordTypeNode(130 /* NeverKeyword */); + return ts.createKeywordTypeNode(131 /* NeverKeyword */); } if (type.flags & 512 /* ESSymbol */) { - return ts.createKeywordTypeNode(137 /* SymbolKeyword */); + return ts.createKeywordTypeNode(138 /* SymbolKeyword */); } - if (type.flags & 33554432 /* NonPrimitive */) { - return ts.createKeywordTypeNode(134 /* ObjectKeyword */); + if (type.flags & 134217728 /* NonPrimitive */) { + return ts.createKeywordTypeNode(135 /* ObjectKeyword */); } if (type.flags & 32768 /* TypeParameter */ && type.isThisType) { if (context.flags & 4194304 /* InObjectTypeLiteral */) { @@ -27036,7 +28103,10 @@ var ts; return typeReferenceToTypeNode(type); } if (type.flags & 32768 /* TypeParameter */ || objectFlags & 3 /* ClassOrInterface */) { - var name = type.symbol ? symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier("?"); + if (type.flags & 32768 /* TypeParameter */ && ts.contains(context.inferTypeParameters, type)) { + return ts.createInferTypeNode(ts.createTypeParameterDeclaration(getNameOfSymbolAsWritten(type.symbol))); + } + var name = type.symbol ? symbolToName(type.symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier("?"); // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return ts.createTypeReferenceNode(name, /*typeArguments*/ undefined); } @@ -27049,7 +28119,7 @@ var ts; var types = type.flags & 131072 /* Union */ ? formatUnionTypes(type.types) : type.types; var typeNodes = mapToTypeNodes(types, context); if (typeNodes && typeNodes.length > 0) { - var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 167 /* UnionType */ : 168 /* IntersectionType */, typeNodes); + var unionOrIntersectionTypeNode = ts.createUnionOrIntersectionTypeNode(type.flags & 131072 /* Union */ ? 168 /* UnionType */ : 169 /* IntersectionType */, typeNodes); return unionOrIntersectionTypeNode; } else { @@ -27074,11 +28144,24 @@ var ts; var indexTypeNode = typeToTypeNodeHelper(type.indexType, context); return ts.createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } + if (type.flags & 2097152 /* Conditional */) { + var checkTypeNode = typeToTypeNodeHelper(type.checkType, context); + var saveInferTypeParameters = context.inferTypeParameters; + context.inferTypeParameters = type.root.inferTypeParameters; + var extendsTypeNode = typeToTypeNodeHelper(type.extendsType, context); + context.inferTypeParameters = saveInferTypeParameters; + var trueTypeNode = typeToTypeNodeHelper(getTrueTypeFromConditionalType(type), context); + var falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context); + return ts.createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); + } + if (type.flags & 4194304 /* Substitution */) { + return typeToTypeNodeHelper(type.typeVariable, context); + } ts.Debug.fail("Should be unreachable."); function createMappedTypeNodeFromType(type) { ts.Debug.assert(!!(type.flags & 65536 /* Object */)); - var readonlyToken = type.declaration && type.declaration.readonlyToken ? ts.createToken(131 /* ReadonlyKeyword */) : undefined; - var questionToken = type.declaration && type.declaration.questionToken ? ts.createToken(55 /* QuestionToken */) : undefined; + var readonlyToken = type.declaration.readonlyToken ? ts.createToken(type.declaration.readonlyToken.kind) : undefined; + var questionToken = type.declaration.questionToken ? ts.createToken(type.declaration.questionToken.kind) : undefined; var typeParameterNode = typeParameterToDeclaration(getTypeParameterFromMappedType(type), context, getConstraintTypeFromMappedType(type)); var templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); var mappedTypeNode = ts.createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); @@ -27088,17 +28171,17 @@ var ts; var symbol = type.symbol; if (symbol) { // Always use 'typeof T' for type of class, enum, and module objects - if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 200 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || + if (symbol.flags & 32 /* Class */ && !getBaseTypeVariableOfClass(symbol) && !(symbol.valueDeclaration.kind === 203 /* ClassExpression */ && context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */) || symbol.flags & (384 /* Enum */ | 512 /* ValueModule */) || shouldWriteTypeOfFunctionSymbol()) { - return createTypeQueryNodeFromSymbol(symbol, 107455 /* Value */); + return createTypeQueryNodeFromSymbol(symbol, 67216319 /* Value */); } else if (ts.contains(context.symbolStack, symbol)) { // If type is an anonymous type literal in a type alias declaration, use type alias name var typeAlias = getTypeAliasForTypeLiteral(type); if (typeAlias) { // The specified symbol flags need to be reinterpreted as type flags - var entityName = symbolToName(typeAlias, context, 793064 /* Type */, /*expectsIdentifier*/ false); + var entityName = symbolToName(typeAlias, context, 67901928 /* Type */, /*expectsIdentifier*/ false); return ts.createTypeReferenceNode(entityName, /*typeArguments*/ undefined); } else { @@ -27133,7 +28216,7 @@ var ts; var isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol ts.forEach(symbol.declarations, function (declaration) { - return declaration.parent.kind === 269 /* SourceFile */ || declaration.parent.kind === 235 /* ModuleBlock */; + return declaration.parent.kind === 272 /* SourceFile */ || declaration.parent.kind === 238 /* ModuleBlock */; })); if (isStaticMethodSymbol || isNonLocalFunctionSymbol) { // typeof is allowed only for static/non local functions @@ -27153,12 +28236,12 @@ var ts; } if (resolved.callSignatures.length === 1 && !resolved.constructSignatures.length) { var signature = resolved.callSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 161 /* FunctionType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* FunctionType */, context); return signatureNode; } if (resolved.constructSignatures.length === 1 && !resolved.callSignatures.length) { var signature = resolved.constructSignatures[0]; - var signatureNode = signatureToSignatureDeclarationHelper(signature, 162 /* ConstructorType */, context); + var signatureNode = signatureToSignatureDeclarationHelper(signature, 163 /* ConstructorType */, context); return signatureNode; } } @@ -27175,7 +28258,7 @@ var ts; } function symbolToTypeReferenceName(symbol) { // Unnamed function expressions and arrow functions have reserved names that we don't want to display - var entityName = symbol.flags & 32 /* Class */ || !isReservedMemberName(symbol.escapedName) ? symbolToName(symbol, context, 793064 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier(""); + var entityName = symbol.flags & 32 /* Class */ || !isReservedMemberName(symbol.escapedName) ? symbolToName(symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ false) : ts.createIdentifier(""); return entityName; } function typeReferenceToTypeNode(type) { @@ -27203,7 +28286,7 @@ var ts; } else if (context.flags & 2048 /* WriteClassExpressionAsTypeLiteral */ && type.symbol.valueDeclaration && - type.symbol.valueDeclaration.kind === 200 /* ClassExpression */) { + type.symbol.valueDeclaration.kind === 203 /* ClassExpression */) { return createAnonymousTypeNode(type); } else { @@ -27237,7 +28320,7 @@ var ts; } } } - var entityName = undefined; + var entityName = void 0; var nameIdentifier = symbolToTypeReferenceName(type.symbol); if (qualifiedName) { ts.Debug.assert(!qualifiedName.right); @@ -27277,11 +28360,11 @@ var ts; var typeElements = []; for (var _i = 0, _a = resolvedType.callSignatures; _i < _a.length; _i++) { var signature = _a[_i]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 156 /* CallSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* CallSignature */, context)); } for (var _b = 0, _c = resolvedType.constructSignatures; _b < _c.length; _b++) { var signature = _c[_b]; - typeElements.push(signatureToSignatureDeclarationHelper(signature, 157 /* ConstructSignature */, context)); + typeElements.push(signatureToSignatureDeclarationHelper(signature, 158 /* ConstructSignature */, context)); } if (resolvedType.stringIndexInfo) { var indexInfo = resolvedType.objectFlags & 2048 /* ReverseMapped */ ? @@ -27306,32 +28389,36 @@ var ts; context.tracker.reportPrivateInBaseOfClassExpression(ts.unescapeLeadingUnderscores(propertySymbol.escapedName)); } } - var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ ? anyType : getTypeOfSymbol(propertySymbol); + var propertyType = ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */ && context.flags & 33554432 /* InReverseMappedType */ ? + anyType : getTypeOfSymbol(propertySymbol); var saveEnclosingDeclaration = context.enclosingDeclaration; context.enclosingDeclaration = undefined; if (ts.getCheckFlags(propertySymbol) & 1024 /* Late */) { var decl = ts.firstOrUndefined(propertySymbol.declarations); - var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 107455 /* Value */); + var name = hasLateBindableName(decl) && resolveEntityName(decl.name.expression, 67216319 /* Value */); if (name && context.tracker.trackSymbol) { - context.tracker.trackSymbol(name, saveEnclosingDeclaration, 107455 /* Value */); + context.tracker.trackSymbol(name, saveEnclosingDeclaration, 67216319 /* Value */); } } - var propertyName = symbolToName(propertySymbol, context, 107455 /* Value */, /*expectsIdentifier*/ true); + var propertyName = symbolToName(propertySymbol, context, 67216319 /* Value */, /*expectsIdentifier*/ true); context.enclosingDeclaration = saveEnclosingDeclaration; var optionalToken = propertySymbol.flags & 16777216 /* Optional */ ? ts.createToken(55 /* QuestionToken */) : undefined; if (propertySymbol.flags & (16 /* Function */ | 8192 /* Method */) && !getPropertiesOfObjectType(propertyType).length) { var signatures = getSignaturesOfType(propertyType, 0 /* Call */); for (var _e = 0, signatures_1 = signatures; _e < signatures_1.length; _e++) { var signature = signatures_1[_e]; - var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 151 /* MethodSignature */, context); + var methodDeclaration = signatureToSignatureDeclarationHelper(signature, 152 /* MethodSignature */, context); methodDeclaration.name = propertyName; methodDeclaration.questionToken = optionalToken; typeElements.push(methodDeclaration); } } else { + var savedFlags = context.flags; + context.flags |= !!(ts.getCheckFlags(propertySymbol) & 2048 /* ReverseMapped */) ? 33554432 /* InReverseMappedType */ : 0; var propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : ts.createKeywordTypeNode(119 /* AnyKeyword */); - var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined; + context.flags = savedFlags; + var modifiers = isReadonlySymbol(propertySymbol) ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined; var propertySignature = ts.createPropertySignature(modifiers, propertyName, optionalToken, propertyTypeNode, /*initializer*/ undefined); typeElements.push(propertySignature); @@ -27355,7 +28442,7 @@ var ts; } function indexInfoToIndexSignatureDeclarationHelper(indexInfo, kind, context) { var name = ts.getNameFromIndexInfo(indexInfo) || "x"; - var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 136 /* StringKeyword */ : 133 /* NumberKeyword */); + var indexerTypeNode = ts.createKeywordTypeNode(kind === 0 /* String */ ? 137 /* StringKeyword */ : 134 /* NumberKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -27367,7 +28454,7 @@ var ts; context.encounteredError = true; } return ts.createIndexSignature( - /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(131 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); + /*decorators*/ undefined, indexInfo.isReadonly ? [ts.createToken(132 /* ReadonlyKeyword */)] : undefined, [indexingParameter], typeNode); } function signatureToSignatureDeclarationHelper(signature, kind, context) { var typeParameters; @@ -27410,7 +28497,7 @@ var ts; if (constraint === void 0) { constraint = getConstraintFromTypeParameter(type); } var savedContextFlags = context.flags; context.flags &= ~512 /* WriteTypeParametersInQualifiedName */; // Avoids potential infinite loop when building for a claimspace with a generic - var name = symbolToName(type.symbol, context, 793064 /* Type */, /*expectsIdentifier*/ true); + var name = symbolToName(type.symbol, context, 67901928 /* Type */, /*expectsIdentifier*/ true); var constraintNode = constraint && typeToTypeNodeHelper(constraint, context); var defaultParameter = getDefaultFromTypeParameter(type); var defaultParameterNode = defaultParameter && typeToTypeNodeHelper(defaultParameter, context); @@ -27418,7 +28505,7 @@ var ts; return ts.createTypeParameterDeclaration(name, constraintNode, defaultParameterNode); } function symbolToParameterDeclaration(parameterSymbol, context) { - var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 147 /* Parameter */); + var parameterDeclaration = ts.getDeclarationOfKind(parameterSymbol, 148 /* Parameter */); ts.Debug.assert(!!parameterDeclaration || isTransientSymbol(parameterSymbol) && !!parameterSymbol.isRestParameter); var parameterType = getTypeOfSymbol(parameterSymbol); if (parameterDeclaration && isRequiredInitializedParameter(parameterDeclaration)) { @@ -27444,7 +28531,7 @@ var ts; function elideInitializerAndSetEmitFlags(node) { var visited = ts.visitEachChild(node, elideInitializerAndSetEmitFlags, ts.nullTransformationContext, /*nodesVisitor*/ undefined, elideInitializerAndSetEmitFlags); var clone = ts.nodeIsSynthesized(visited) ? visited : ts.getSynthesizedClone(visited); - if (clone.kind === 177 /* BindingElement */) { + if (clone.kind === 180 /* BindingElement */) { clone.initializer = undefined; } return ts.setEmitFlags(clone, 1 /* SingleLine */ | 16777216 /* NoAsciiEscaping */); @@ -27632,8 +28719,8 @@ var ts; } function getTypeAliasForTypeLiteral(type) { if (type.symbol && type.symbol.flags & 2048 /* TypeLiteral */) { - var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 169 /* ParenthesizedType */; }); - if (node.kind === 232 /* TypeAliasDeclaration */) { + var node = ts.findAncestor(type.symbol.declarations[0].parent, function (n) { return n.kind !== 172 /* ParenthesizedType */; }); + if (node.kind === 235 /* TypeAliasDeclaration */) { return getSymbolOfNode(node); } } @@ -27641,14 +28728,14 @@ var ts; } function isTopLevelInExternalModuleAugmentation(node) { return node && node.parent && - node.parent.kind === 235 /* ModuleBlock */ && + node.parent.kind === 238 /* ModuleBlock */ && ts.isExternalModuleAugmentation(node.parent.parent); } function literalTypeToString(type) { return type.flags & 32 /* StringLiteral */ ? '"' + ts.escapeString(type.value) + '"' : "" + type.value; } function isDefaultBindingContext(location) { - return location.kind === 269 /* SourceFile */ || ts.isAmbientModule(location); + return location.kind === 272 /* SourceFile */ || ts.isAmbientModule(location); } /** * Gets a human-readable name for a symbol. @@ -27673,22 +28760,22 @@ var ts; if (name) { return ts.declarationNameToString(name); } - if (declaration.parent && declaration.parent.kind === 227 /* VariableDeclaration */) { + if (declaration.parent && declaration.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(declaration.parent.name); } if (context && !context.encounteredError && !(context.flags & 131072 /* AllowAnonymousIdentifier */)) { context.encounteredError = true; } switch (declaration.kind) { - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return "(Anonymous class)"; - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return "(Anonymous function)"; } } - if (symbol.syntheticLiteralTypeOrigin) { - var stringValue = symbol.syntheticLiteralTypeOrigin.value; + if (symbol.nameType && symbol.nameType.flags & 32 /* StringLiteral */) { + var stringValue = symbol.nameType.value; if (!ts.isIdentifierText(stringValue, compilerOptions.target)) { return "\"" + ts.escapeString(stringValue, 34 /* doubleQuote */) + "\""; } @@ -27706,22 +28793,22 @@ var ts; return false; function determineIfDeclarationIsVisible() { switch (node.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: return isDeclarationVisible(node.parent.parent); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: if (ts.isBindingPattern(node.name) && !node.name.elements.length) { // If the binding pattern is empty, this variable declaration is not visible return false; } // falls through - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 229 /* FunctionDeclaration */: - case 233 /* EnumDeclaration */: - case 238 /* ImportEqualsDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 232 /* FunctionDeclaration */: + case 236 /* EnumDeclaration */: + case 241 /* ImportEqualsDeclaration */: // external module augmentation is always visible if (ts.isExternalModuleAugmentation(node)) { return true; @@ -27729,53 +28816,53 @@ var ts; var parent = getDeclarationContainer(node); // If the node is not exported or it is not ambient module element (except import declaration) if (!(ts.getCombinedModifierFlags(node) & 1 /* Export */) && - !(node.kind !== 238 /* ImportEqualsDeclaration */ && parent.kind !== 269 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { + !(node.kind !== 241 /* ImportEqualsDeclaration */ && parent.kind !== 272 /* SourceFile */ && parent.flags & 2097152 /* Ambient */)) { return isGlobalSourceFile(parent); } // Exported members/ambient module elements (exception import declaration) are visible if parent is visible return isDeclarationVisible(parent); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 8 /* Private */ | 16 /* Protected */)) { // Private/protected properties/methods are not visible return false; } // Public properties/methods are visible if its parents are visible, so: // falls through - case 153 /* Constructor */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: - case 147 /* Parameter */: - case 235 /* ModuleBlock */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 160 /* TypeReference */: - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: + case 148 /* Parameter */: + case 238 /* ModuleBlock */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 161 /* TypeReference */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 172 /* ParenthesizedType */: return isDeclarationVisible(node.parent); // Default binding, import specifier and namespace import is visible // only on demand so by default it is not visible - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: return false; // Type parameters are always visible - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: // Source file and namespace export are always visible - case 269 /* SourceFile */: - case 237 /* NamespaceExportDeclaration */: + case 272 /* SourceFile */: + case 240 /* NamespaceExportDeclaration */: return true; // Export assignments do not create name bindings outside the module - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return false; default: return false; @@ -27784,11 +28871,11 @@ var ts; } function collectLinkedAliases(node, setVisibility) { var exportSymbol; - if (node.parent && node.parent.kind === 244 /* ExportAssignment */) { - exportSymbol = resolveName(node, node.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); + if (node.parent && node.parent.kind === 247 /* ExportAssignment */) { + exportSymbol = resolveName(node, node.escapedText, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, node, /*isUse*/ false); } - else if (node.parent.kind === 247 /* ExportSpecifier */) { - exportSymbol = getTargetOfExportSpecifier(node.parent, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); + else if (node.parent.kind === 250 /* ExportSpecifier */) { + exportSymbol = getTargetOfExportSpecifier(node.parent, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } var result; if (exportSymbol) { @@ -27809,7 +28896,7 @@ var ts; // Add the referenced top container visible var internalModuleReference = declaration.moduleReference; var firstIdentifier = getFirstIdentifier(internalModuleReference); - var importSymbol = resolveName(declaration, firstIdentifier.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */, undefined, undefined, /*isUse*/ false); + var importSymbol = resolveName(declaration, firstIdentifier.escapedText, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */, undefined, undefined, /*isUse*/ false); if (importSymbol) { buildVisibleNodeList(importSymbol.declarations); } @@ -27883,12 +28970,12 @@ var ts; function getDeclarationContainer(node) { node = ts.findAncestor(ts.getRootDeclaration(node), function (node) { switch (node.kind) { - case 227 /* VariableDeclaration */: - case 228 /* VariableDeclarationList */: - case 243 /* ImportSpecifier */: - case 242 /* NamedImports */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 230 /* VariableDeclaration */: + case 231 /* VariableDeclarationList */: + case 246 /* ImportSpecifier */: + case 245 /* NamedImports */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: return false; default: return true; @@ -27919,7 +29006,7 @@ var ts; return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, /*includeOptionality*/ false); } function isComputedNonLiteralName(name) { - return name.kind === 145 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); + return name.kind === 146 /* ComputedPropertyName */ && !ts.isStringOrNumericLiteral(name.expression); } function getRestType(source, properties, symbol) { source = filterType(source, function (t) { return !(t.flags & 12288 /* Nullable */); }); @@ -27966,7 +29053,7 @@ var ts; return parentType; } var type; - if (pattern.kind === 175 /* ObjectBindingPattern */) { + if (pattern.kind === 178 /* ObjectBindingPattern */) { if (declaration.dotDotDotToken) { if (!isValidSpreadType(parentType)) { error(declaration, ts.Diagnostics.Rest_types_may_only_be_created_from_object_types); @@ -27996,7 +29083,7 @@ var ts; parentType = getNonNullableType(parentType); } var propType = getTypeOfPropertyOfType(parentType, text); - var declaredType = propType && getApparentTypeForLocation(propType, declaration.name); + var declaredType = propType && getConstraintForLocation(propType, declaration.name); type = declaredType && getFlowTypeOfReference(declaration, declaredType) || isNumericLiteralName(text) && getIndexTypeOfType(parentType, 1 /* Number */) || getIndexTypeOfType(parentType, 0 /* String */); @@ -28054,7 +29141,7 @@ var ts; } function isEmptyArrayLiteral(node) { var expr = ts.skipParentheses(node); - return expr.kind === 178 /* ArrayLiteralExpression */ && expr.elements.length === 0; + return expr.kind === 181 /* ArrayLiteralExpression */ && expr.elements.length === 0; } function addOptionality(type, optional) { if (optional === void 0) { optional = true; } @@ -28064,11 +29151,11 @@ var ts; function getTypeForVariableLikeDeclaration(declaration, includeOptionality) { // A variable declared in a for..in statement is of type string, or of type keyof T when the // right hand expression is of a type parameter type. - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 216 /* ForInStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 219 /* ForInStatement */) { var indexType = getIndexType(checkNonNullExpression(declaration.parent.parent.expression)); return indexType.flags & (32768 /* TypeParameter */ | 524288 /* Index */) ? indexType : stringType; } - if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 217 /* ForOfStatement */) { + if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 220 /* ForOfStatement */) { // checkRightHandSideOfForOf will return undefined if the for-of expression type was // missing properties/signatures required to get its iteratedType (like // [Symbol.iterator] or next). This may be because we accessed properties from anyType, @@ -28079,14 +29166,23 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { return getTypeForBindingElement(declaration); } - var isOptional = !ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken && includeOptionality; + var isOptional = false; + if (includeOptionality) { + if (ts.isInJavaScriptFile(declaration) && ts.isParameter(declaration)) { + var parameterTags = ts.getJSDocParameterTags(declaration); + isOptional = !!(parameterTags && parameterTags.length > 0 && ts.find(parameterTags, function (tag) { return tag.isBracketed; })); + } + if (!ts.isBindingElement(declaration) && !ts.isVariableDeclaration(declaration) && !!declaration.questionToken) { + isOptional = true; + } + } // Use type from type annotation if one is present var declaredType = tryGetTypeFromEffectiveTypeNode(declaration); if (declaredType) { return addOptionality(declaredType, isOptional); } if ((noImplicitAny || ts.isInJavaScriptFile(declaration)) && - declaration.kind === 227 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && + declaration.kind === 230 /* VariableDeclaration */ && !ts.isBindingPattern(declaration.name) && !(ts.getCombinedModifierFlags(declaration) & 1 /* Export */) && !(declaration.flags & 2097152 /* Ambient */)) { // If --noImplicitAny is on or the declaration is in a Javascript file, // use control flow tracked 'any' type for non-ambient, non-exported var or let variables with no @@ -28100,11 +29196,11 @@ var ts; return autoArrayType; } } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var func = declaration.parent; // For a parameter of a set accessor, use the type of the get accessor if one is present - if (func.kind === 155 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { - var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 154 /* GetAccessor */); + if (func.kind === 156 /* SetAccessor */ && !hasNonBindableDynamicName(func)) { + var getter = ts.getDeclarationOfKind(getSymbolOfNode(declaration.parent), 155 /* GetAccessor */); if (getter) { var getterSignature = getSignatureFromDeclaration(getter); var thisParameter = getAccessorThisParameter(func); @@ -28146,20 +29242,25 @@ var ts; return undefined; } function getWidenedTypeFromJSSpecialPropertyDeclarations(symbol) { + // function/class/{} assignments are fresh declarations, not property assignments, so only add prototype assignments + var specialDeclaration = ts.getAssignedJavascriptInitializer(symbol.valueDeclaration); + if (specialDeclaration) { + return getWidenedLiteralType(checkExpressionCached(specialDeclaration)); + } var types = []; var definedInConstructor = false; var definedInMethod = false; var jsDocType; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - var expression = declaration.kind === 195 /* BinaryExpression */ ? declaration : - declaration.kind === 180 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 195 /* BinaryExpression */) : + var expression = declaration.kind === 198 /* BinaryExpression */ ? declaration : + declaration.kind === 183 /* PropertyAccessExpression */ ? ts.getAncestor(declaration, 198 /* BinaryExpression */) : undefined; if (!expression) { return unknownType; } if (ts.isPropertyAccessExpression(expression.left) && expression.left.expression.kind === 99 /* ThisKeyword */) { - if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 153 /* Constructor */) { + if (ts.getThisContainer(expression, /*includeArrowFunctions*/ false).kind === 154 /* Constructor */) { definedInConstructor = true; } else { @@ -28258,7 +29359,7 @@ var ts; // parameter with no type annotation or initializer, the type implied by the binding pattern becomes the type of // the parameter. function getTypeFromBindingPattern(pattern, includePatternInType, reportErrors) { - return pattern.kind === 175 /* ObjectBindingPattern */ + return pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors) : getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors); } @@ -28295,7 +29396,7 @@ var ts; } function declarationBelongsToPrivateAmbientMember(declaration) { var root = ts.getRootDeclaration(declaration); - var memberDeclaration = root.kind === 147 /* Parameter */ ? root.parent : root; + var memberDeclaration = root.kind === 148 /* Parameter */ ? root.parent : root; return isPrivateWithinAmbient(memberDeclaration); } function tryGetTypeFromEffectiveTypeNode(declaration) { @@ -28317,7 +29418,7 @@ var ts; return links.type = anyType; } // Handle export default expressions - if (declaration.kind === 244 /* ExportAssignment */) { + if (declaration.kind === 247 /* ExportAssignment */) { return links.type = checkExpression(declaration.expression); } if (ts.isInJavaScriptFile(declaration) && ts.isJSDocPropertyLikeTag(declaration) && declaration.typeExpression) { @@ -28333,8 +29434,8 @@ var ts; // * exports.p = expr // * this.p = expr // * className.prototype.method = expr - if (declaration.kind === 195 /* BinaryExpression */ || - declaration.kind === 180 /* PropertyAccessExpression */ && declaration.parent.kind === 195 /* BinaryExpression */) { + if (declaration.kind === 198 /* BinaryExpression */ || + declaration.kind === 183 /* PropertyAccessExpression */ && declaration.parent.kind === 198 /* BinaryExpression */) { type = getWidenedTypeFromJSSpecialPropertyDeclarations(symbol); } else if (ts.isJSDocPropertyTag(declaration) @@ -28368,7 +29469,7 @@ var ts; type = getWidenedTypeForVariableLikeDeclaration(declaration, /*reportErrors*/ true); } else { - ts.Debug.fail("Unhandled declaration kind! " + ts.SyntaxKind[declaration.kind]); + ts.Debug.fail("Unhandled declaration kind! " + ts.Debug.showSyntaxKind(declaration)); } if (!popTypeResolution()) { type = reportCircularityError(symbol); @@ -28379,7 +29480,7 @@ var ts; } function getAnnotatedAccessorType(accessor) { if (accessor) { - if (accessor.kind === 154 /* GetAccessor */) { + if (accessor.kind === 155 /* GetAccessor */) { var getterTypeAnnotation = ts.getEffectiveReturnTypeNode(accessor); return getterTypeAnnotation && getTypeFromTypeNode(getterTypeAnnotation); } @@ -28400,8 +29501,8 @@ var ts; function getTypeOfAccessors(symbol) { var links = getSymbolLinks(symbol); if (!links.type) { - var getter = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); - var setter = ts.getDeclarationOfKind(symbol, 155 /* SetAccessor */); + var getter = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); + var setter = ts.getDeclarationOfKind(symbol, 156 /* SetAccessor */); if (getter && ts.isInJavaScriptFile(getter)) { var jsDocType = getTypeForDeclarationFromJSDocComment(getter); if (jsDocType) { @@ -28428,6 +29529,7 @@ var ts; if (getter && getter.body) { type = getReturnTypeFromBody(getter); } + // Otherwise, fall back to 'any'. else { if (noImplicitAny) { if (setter) { @@ -28445,7 +29547,7 @@ var ts; if (!popTypeResolution()) { type = anyType; if (noImplicitAny) { - var getter_1 = ts.getDeclarationOfKind(symbol, 154 /* GetAccessor */); + var getter_1 = ts.getDeclarationOfKind(symbol, 155 /* GetAccessor */); error(getter_1, ts.Diagnostics._0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions, symbolToString(symbol)); } } @@ -28492,7 +29594,7 @@ var ts; // type symbol, call getDeclaredTypeOfSymbol. // This check is important because without it, a call to getTypeOfSymbol could end // up recursively calling getTypeOfAlias, causing a stack overflow. - links.type = targetSymbol.flags & 107455 /* Value */ + links.type = targetSymbol.flags & 67216319 /* Value */ ? getTypeOfSymbol(targetSymbol) : unknownType; } @@ -28596,29 +29698,33 @@ var ts; return undefined; } switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 151 /* MethodSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 277 /* JSDocFunctionType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 232 /* TypeAliasDeclaration */: - case 287 /* JSDocTemplateTag */: - case 173 /* MappedType */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 152 /* MethodSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 280 /* JSDocFunctionType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 235 /* TypeAliasDeclaration */: + case 290 /* JSDocTemplateTag */: + case 176 /* MappedType */: + case 170 /* ConditionalType */: var outerTypeParameters = getOuterTypeParameters(node, includeThisTypes); - if (node.kind === 173 /* MappedType */) { + if (node.kind === 176 /* MappedType */) { return ts.append(outerTypeParameters, getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter))); } + else if (node.kind === 170 /* ConditionalType */) { + return ts.concatenate(outerTypeParameters, getInferTypeParameters(node)); + } var outerAndOwnTypeParameters = appendTypeParameters(outerTypeParameters, ts.getEffectiveTypeParameterDeclarations(node) || ts.emptyArray); var thisType = includeThisTypes && - (node.kind === 230 /* ClassDeclaration */ || node.kind === 200 /* ClassExpression */ || node.kind === 231 /* InterfaceDeclaration */) && + (node.kind === 233 /* ClassDeclaration */ || node.kind === 203 /* ClassExpression */ || node.kind === 234 /* InterfaceDeclaration */) && getDeclaredTypeOfClassOrInterface(getSymbolOfNode(node)).thisType; return thisType ? ts.append(outerAndOwnTypeParameters, thisType) : outerAndOwnTypeParameters; } @@ -28626,7 +29732,7 @@ var ts; } // The outer type parameters are those defined by enclosing generic classes, methods, or functions. function getOuterTypeParametersOfClassOrInterface(symbol) { - var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var declaration = symbol.flags & 32 /* Class */ ? symbol.valueDeclaration : ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); return getOuterTypeParameters(declaration); } // The local type parameters are the combined set of type parameters from all declarations of the class, @@ -28635,8 +29741,8 @@ var ts; var result; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var node = _a[_i]; - if (node.kind === 231 /* InterfaceDeclaration */ || node.kind === 230 /* ClassDeclaration */ || - node.kind === 200 /* ClassExpression */ || node.kind === 232 /* TypeAliasDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */ || node.kind === 233 /* ClassDeclaration */ || + node.kind === 203 /* ClassExpression */ || node.kind === 235 /* TypeAliasDeclaration */) { var declaration = node; if (declaration.typeParameters) { result = appendTypeParameters(result, declaration.typeParameters); @@ -28816,14 +29922,14 @@ var ts; // A valid base type is `any`, any non-generic object type or intersection of non-generic // object types. function isValidBaseType(type) { - return type.flags & (65536 /* Object */ | 33554432 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || + return type.flags & (65536 /* Object */ | 134217728 /* NonPrimitive */ | 1 /* Any */) && !isGenericMappedType(type) || type.flags & 262144 /* Intersection */ && !ts.forEach(type.types, function (t) { return !isValidBaseType(t); }); } function resolveBaseTypesOfInterface(type) { type.resolvedBaseTypes = type.resolvedBaseTypes || ts.emptyArray; for (var _i = 0, _a = type.symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { + if (declaration.kind === 234 /* InterfaceDeclaration */ && ts.getInterfaceBaseTypeNodes(declaration)) { for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) { var node = _c[_b]; var baseType = getTypeFromTypeNode(node); @@ -28859,7 +29965,7 @@ var ts; function isThislessInterface(symbol) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 231 /* InterfaceDeclaration */) { + if (declaration.kind === 234 /* InterfaceDeclaration */) { if (declaration.flags & 64 /* ContainsThis */) { return false; } @@ -28868,7 +29974,7 @@ var ts; for (var _b = 0, baseTypeNodes_1 = baseTypeNodes; _b < baseTypeNodes_1.length; _b++) { var node = baseTypeNodes_1[_b]; if (ts.isEntityNameExpression(node.expression)) { - var baseSymbol = resolveEntityName(node.expression, 793064 /* Type */, /*ignoreErrors*/ true); + var baseSymbol = resolveEntityName(node.expression, 67901928 /* Type */, /*ignoreErrors*/ true); if (!baseSymbol || !(baseSymbol.flags & 64 /* Interface */) || getDeclaredTypeOfClassOrInterface(baseSymbol).thisType) { return false; } @@ -28917,9 +30023,9 @@ var ts; return unknownType; } var declaration = ts.find(symbol.declarations, function (d) { - return d.kind === 288 /* JSDocTypedefTag */ || d.kind === 232 /* TypeAliasDeclaration */; + return d.kind === 291 /* JSDocTypedefTag */ || d.kind === 235 /* TypeAliasDeclaration */; }); - var typeNode = declaration.kind === 288 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; + var typeNode = declaration.kind === 291 /* JSDocTypedefTag */ ? declaration.typeExpression : declaration.type; // If typeNode is missing, we will error in checkJSDocTypedefTag. var type = typeNode ? getTypeFromTypeNode(typeNode) : unknownType; if (popTypeResolution()) { @@ -28949,7 +30055,7 @@ var ts; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: return true; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; case 71 /* Identifier */: @@ -28966,7 +30072,7 @@ var ts; var hasNonLiteralMember = false; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; if (member.initializer && member.initializer.kind === 9 /* StringLiteral */) { @@ -28993,7 +30099,7 @@ var ts; var memberTypeList = []; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (declaration.kind === 233 /* EnumDeclaration */) { + if (declaration.kind === 236 /* EnumDeclaration */) { for (var _b = 0, _c = declaration.members; _b < _c.length; _b++) { var member = _c[_b]; var memberType = getLiteralType(getEnumMemberValue(member), enumCount, getSymbolOfNode(member)); @@ -29073,20 +30179,20 @@ var ts; function isThislessType(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: - case 134 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 177 /* LiteralType */: return true; - case 165 /* ArrayType */: + case 166 /* ArrayType */: return isThislessType(node.elementType); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return !node.typeArguments || node.typeArguments.every(isThislessType); } return false; @@ -29110,7 +30216,7 @@ var ts; */ function isThislessFunctionLikeDeclaration(node) { var returnType = ts.getEffectiveReturnTypeNode(node); - return (node.kind === 153 /* Constructor */ || (returnType && isThislessType(returnType))) && + return (node.kind === 154 /* Constructor */ || (returnType && isThislessType(returnType))) && node.parameters.every(isThislessVariableLikeDeclaration) && (!node.typeParameters || node.typeParameters.every(isThislessTypeParameter)); } @@ -29126,12 +30232,12 @@ var ts; var declaration = symbol.declarations[0]; if (declaration) { switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return isThislessVariableLikeDeclaration(declaration); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: return isThislessFunctionLikeDeclaration(declaration); } } @@ -29232,7 +30338,7 @@ var ts; else { symbol.declarations.push(member); } - if (symbolFlags & 107455 /* Value */) { + if (symbolFlags & 67216319 /* Value */) { var valueDeclaration = symbol.valueDeclaration; if (!valueDeclaration || valueDeclaration.kind !== member.kind) { symbol.valueDeclaration = member; @@ -29295,8 +30401,18 @@ var ts; error(decl.name || decl, ts.Diagnostics.Duplicate_declaration_0, name_3); lateSymbol = createSymbol(0 /* None */, memberName, 1024 /* Late */); } + var symbolLinks_1 = getSymbolLinks(lateSymbol); + if (!symbolLinks_1.nameType) { + // Retain link to name type so that it can be reused later + symbolLinks_1.nameType = type; + } addDeclarationToLateBoundSymbol(lateSymbol, decl, symbolFlags); - lateSymbol.parent = parent; + if (lateSymbol.parent) { + ts.Debug.assert(lateSymbol.parent === parent, "Existing symbol parent should match new one"); + } + else { + lateSymbol.parent = parent; + } return links.resolvedSymbol = lateSymbol; } } @@ -29444,6 +30560,8 @@ var ts; sig.minArgumentCount = minArgumentCount; sig.hasRestParameter = hasRestParameter; sig.hasLiteralTypes = hasLiteralTypes; + sig.target = undefined; + sig.mapper = undefined; return sig; } function cloneSignature(sig) { @@ -29496,7 +30614,7 @@ var ts; } return [signature]; } - var result = undefined; + var result; for (var i = 0; i < signatureLists.length; i++) { // Allow matching non-generic signatures to have excess parameters and different return types var match = i === listIndex ? signature : findMatchingSignature(signatureLists[i], signature, /*partialMatch*/ true, /*ignoreThisTypes*/ true, /*ignoreReturnTypes*/ true); @@ -29513,7 +30631,7 @@ var ts; // type is the union of the constituent return types. function getUnionSignatures(types, kind) { var signatureLists = ts.map(types, function (t) { return getSignaturesOfType(t, kind); }); - var result = undefined; + var result; for (var i = 0; i < signatureLists.length; i++) { for (var _i = 0, _a = signatureLists[i]; _i < _a.length; _i++) { var signature = _a[_i]; @@ -29644,7 +30762,7 @@ var ts; else { // Combinations of function, class, enum and module var members = emptySymbols; - var stringIndexInfo = undefined; + var stringIndexInfo = void 0; if (symbol.exports) { members = getExportsOfSymbol(symbol); } @@ -29682,8 +30800,9 @@ var ts; } function resolveReverseMappedTypeMembers(type) { var indexInfo = getIndexInfoOfType(type.source, 0 /* String */); - var readonlyMask = type.mappedType.declaration.readonlyToken ? false : true; - var optionalMask = type.mappedType.declaration.questionToken ? 0 : 16777216 /* Optional */; + var modifiers = getMappedTypeModifiers(type.mappedType); + var readonlyMask = modifiers & 1 /* IncludeReadonly */ ? false : true; + var optionalMask = modifiers & 4 /* IncludeOptional */ ? 0 : 16777216 /* Optional */; var stringIndexInfo = indexInfo && createIndexInfo(inferReverseMappedType(indexInfo.type, type.mappedType), readonlyMask && indexInfo.isReadonly); var members = ts.createSymbolTable(); for (var _i = 0, _a = getPropertiesOfType(type.source); _i < _a.length; _i++) { @@ -29707,13 +30826,12 @@ var ts; // and T as the template type. var typeParameter = getTypeParameterFromMappedType(type); var constraintType = getConstraintTypeFromMappedType(type); - var templateType = getTemplateTypeFromMappedType(type); + var templateType = getTemplateTypeFromMappedType(type.target || type); var modifiersType = getApparentType(getModifiersTypeFromMappedType(type)); // The 'T' in 'keyof T' - var templateReadonly = !!type.declaration.readonlyToken; - var templateOptional = !!type.declaration.questionToken; + var templateModifiers = getMappedTypeModifiers(type); var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // We have a { [P in keyof T]: X } for (var _i = 0, _a = getPropertiesOfType(modifiersType); _i < _a.length; _i++) { var propertySymbol = _a[_i]; @@ -29727,7 +30845,7 @@ var ts; // First, if the constraint type is a type parameter, obtain the base constraint. Then, // if the key type is a 'keyof X', obtain 'keyof C' where C is the base constraint of X. // Finally, iterate over the constituents of the resulting iteration type. - var keyType = constraintType.flags & 1081344 /* TypeVariable */ ? getApparentType(constraintType) : constraintType; + var keyType = constraintType.flags & 7372800 /* InstantiableNonPrimitive */ ? getApparentType(constraintType) : constraintType; var iterationType = keyType.flags & 524288 /* Index */ ? getIndexType(getApparentType(keyType.type)) : keyType; forEachType(iterationType, addMemberForKeyType); } @@ -29743,27 +30861,33 @@ var ts; // Create a mapper from T to the current iteration type constituent. Then, if the // mapped type is itself an instantiated type, combine the iteration mapper with the // instantiation mapper. - var iterationMapper = createTypeMapper([typeParameter], [t]); - var templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper; + var templateMapper = combineTypeMappers(type.mapper, createTypeMapper([typeParameter], [t])); var propType = instantiateType(templateType, templateMapper); // If the current iteration type constituent is a string literal type, create a property. // Otherwise, for type string create a string index signature. if (t.flags & 32 /* StringLiteral */) { - var propName = ts.escapeLeadingUnderscores(t.value); + var propName = getLateBoundNameFromType(t); var modifiersProp = getPropertyOfType(modifiersType, propName); - var isOptional = templateOptional || !!(modifiersProp && modifiersProp.flags & 16777216 /* Optional */); - var checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? 8 /* Readonly */ : 0; - var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, checkFlags); - prop.type = propType; + var isOptional = !!(templateModifiers & 4 /* IncludeOptional */ || + !(templateModifiers & 8 /* ExcludeOptional */) && modifiersProp && modifiersProp.flags & 16777216 /* Optional */); + var isReadonly = !!(templateModifiers & 1 /* IncludeReadonly */ || + !(templateModifiers & 2 /* ExcludeReadonly */) && modifiersProp && isReadonlySymbol(modifiersProp)); + var prop = createSymbol(4 /* Property */ | (isOptional ? 16777216 /* Optional */ : 0), propName, isReadonly ? 8 /* Readonly */ : 0); + // When creating an optional property in strictNullChecks mode, if 'undefined' isn't assignable to the + // type, we include 'undefined' in the type. Similarly, when creating a non-optional property in strictNullChecks + // mode, if the underlying property is optional we remove 'undefined' from the type. + prop.type = strictNullChecks && isOptional && !isTypeAssignableTo(undefinedType, propType) ? getOptionalType(propType) : + strictNullChecks && !isOptional && modifiersProp && modifiersProp.flags & 16777216 /* Optional */ ? getTypeWithFacts(propType, 131072 /* NEUndefined */) : + propType; if (propertySymbol) { prop.syntheticOrigin = propertySymbol; prop.declarations = propertySymbol.declarations; } - prop.syntheticLiteralTypeOrigin = t; + prop.nameType = t; members.set(propName, prop); } else if (t.flags & (1 /* Any */ | 2 /* String */)) { - stringIndexInfo = createIndexInfo(propType, templateReadonly); + stringIndexInfo = createIndexInfo(propType, !!(templateModifiers & 1 /* IncludeReadonly */)); } } } @@ -29778,14 +30902,14 @@ var ts; function getTemplateTypeFromMappedType(type) { return type.templateType || (type.templateType = type.declaration.type ? - instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!type.declaration.questionToken), type.mapper || identityMapper) : + instantiateType(addOptionality(getTypeFromTypeNode(type.declaration.type), !!(getMappedTypeModifiers(type) & 4 /* IncludeOptional */)), type.mapper || identityMapper) : unknownType); } function getModifiersTypeFromMappedType(type) { if (!type.modifiersType) { var constraintDeclaration = type.declaration.typeParameter.constraint; - if (constraintDeclaration.kind === 171 /* TypeOperator */ && - constraintDeclaration.operator === 127 /* KeyOfKeyword */) { + if (constraintDeclaration.kind === 174 /* TypeOperator */ && + constraintDeclaration.operator === 128 /* KeyOfKeyword */) { // If the constraint declaration is a 'keyof T' node, the modifiers type is T. We check // AST nodes here because, when T is a non-generic type, the logic below eagerly resolves // 'keyof T' to a literal union type and we can't recover T from that type. @@ -29804,16 +30928,21 @@ var ts; return type.modifiersType; } function getMappedTypeModifiers(type) { - return (type.declaration.readonlyToken ? 1 /* Readonly */ : 0) | - (type.declaration.questionToken ? 2 /* Optional */ : 0); + var declaration = type.declaration; + return (declaration.readonlyToken ? declaration.readonlyToken.kind === 38 /* MinusToken */ ? 2 /* ExcludeReadonly */ : 1 /* IncludeReadonly */ : 0) | + (declaration.questionToken ? declaration.questionToken.kind === 38 /* MinusToken */ ? 8 /* ExcludeOptional */ : 4 /* IncludeOptional */ : 0); } - function getCombinedMappedTypeModifiers(type) { + function getMappedTypeOptionality(type) { + var modifiers = getMappedTypeModifiers(type); + return modifiers & 8 /* ExcludeOptional */ ? -1 : modifiers & 4 /* IncludeOptional */ ? 1 : 0; + } + function getCombinedMappedTypeOptionality(type) { + var optionality = getMappedTypeOptionality(type); var modifiersType = getModifiersTypeFromMappedType(type); - return getMappedTypeModifiers(type) | - (isGenericMappedType(modifiersType) ? getMappedTypeModifiers(modifiersType) : 0); + return optionality || (isGenericMappedType(modifiersType) ? getMappedTypeOptionality(modifiersType) : 0); } function isPartialMappedType(type) { - return ts.getObjectFlags(type) & 32 /* Mapped */ && !!type.declaration.questionToken; + return !!(ts.getObjectFlags(type) & 32 /* Mapped */ && getMappedTypeModifiers(type) & 4 /* IncludeOptional */); } function isGenericMappedType(type) { return ts.getObjectFlags(type) & 32 /* Mapped */ && isGenericIndexType(getConstraintTypeFromMappedType(type)); @@ -29906,7 +31035,10 @@ var ts; for (var _a = 0, _b = getAugmentedPropertiesOfType(memberType); _a < _b.length; _a++) { var escapedName = _b[_a].escapedName; if (!props.has(escapedName)) { - props.set(escapedName, createUnionOrIntersectionProperty(unionType, escapedName)); + var prop = createUnionOrIntersectionProperty(unionType, escapedName); + // May be undefined if the property is private + if (prop) + props.set(escapedName, prop); } } } @@ -29915,7 +31047,8 @@ var ts; function getConstraintOfType(type) { return type.flags & 32768 /* TypeParameter */ ? getConstraintOfTypeParameter(type) : type.flags & 1048576 /* IndexedAccess */ ? getConstraintOfIndexedAccess(type) : - getBaseConstraintOfType(type); + type.flags & 2097152 /* Conditional */ ? getConstraintOfConditionalType(type) : + getBaseConstraintOfType(type); } function getConstraintOfTypeParameter(typeParameter) { return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined; @@ -29934,17 +31067,48 @@ var ts; } return baseObjectType || baseIndexType ? getIndexedAccessType(baseObjectType || type.objectType, baseIndexType || type.indexType) : undefined; } - function getBaseConstraintOfType(type) { - if (type.flags & (1081344 /* TypeVariable */ | 393216 /* UnionOrIntersection */)) { + function getDefaultConstraintOfConditionalType(type) { + return getUnionType([getTrueTypeFromConditionalType(type), getFalseTypeFromConditionalType(type)]); + } + function getConstraintOfDistributiveConditionalType(type) { + // Check if we have a conditional type of the form 'T extends U ? X : Y', where T is a constrained + // type parameter. If so, create an instantiation of the conditional type where T is replaced + // with its constraint. We do this because if the constraint is a union type it will be distributed + // over the conditional type and possibly reduced. For example, 'T extends undefined ? never : T' + // removes 'undefined' from T. + if (type.root.isDistributive) { + var constraint = getConstraintOfType(type.checkType); + if (constraint) { + var mapper = createTypeMapper([type.root.checkType], [constraint]); + return getConditionalTypeInstantiation(type, combineTypeMappers(mapper, type.mapper)); + } + } + return undefined; + } + function getConstraintOfConditionalType(type) { + return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type); + } + function getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type) { + if (type.flags & (7372800 /* InstantiableNonPrimitive */ | 393216 /* UnionOrIntersection */)) { var constraint = getResolvedBaseConstraint(type); if (constraint !== noConstraintType && constraint !== circularConstraintType) { return constraint; } } - else if (type.flags & 524288 /* Index */) { + } + function getBaseConstraintOfType(type) { + var constraint = getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type); + if (!constraint && type.flags & 524288 /* Index */) { return stringType; } - return undefined; + return constraint; + } + /** + * This is similar to `getBaseConstraintOfType` except it returns the input type if there's no base constraint, instead of `undefined` + * It also doesn't map indexes to `string`, as where this is used this would be unneeded (and likely undesirable) + */ + function getBaseConstraintOrType(type) { + return getBaseConstraintOfType(type) || type; } function hasNonCircularBaseConstraint(type) { return getResolvedBaseConstraint(type) !== circularConstraintType; @@ -30007,6 +31171,13 @@ var ts; var baseIndexedAccess = baseObjectType && baseIndexType ? getIndexedAccessType(baseObjectType, baseIndexType) : undefined; return baseIndexedAccess && baseIndexedAccess !== unknownType ? getBaseConstraint(baseIndexedAccess) : undefined; } + if (t.flags & 2097152 /* Conditional */) { + var constraint = getConstraintOfConditionalType(t); + return constraint && getBaseConstraint(constraint); + } + if (t.flags & 4194304 /* Substitution */) { + return getBaseConstraint(t.substitute); + } if (isGenericMappedType(t)) { return emptyObjectType; } @@ -30065,13 +31236,13 @@ var ts; * type itself. Note that the apparent type of a union type is the union type itself. */ function getApparentType(type) { - var t = type.flags & 1081344 /* TypeVariable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; + var t = type.flags & 7897088 /* Instantiable */ ? getBaseConstraintOfType(type) || emptyObjectType : type; return t.flags & 262144 /* Intersection */ ? getApparentTypeOfIntersectionType(t) : t.flags & 524322 /* StringLike */ ? globalStringType : t.flags & 84 /* NumberLike */ ? globalNumberType : t.flags & 136 /* BooleanLike */ ? globalBooleanType : t.flags & 1536 /* ESSymbolLike */ ? getGlobalESSymbolType(/*reportErrors*/ languageVersion >= 2 /* ES2015 */) : - t.flags & 33554432 /* NonPrimitive */ ? emptyObjectType : + t.flags & 134217728 /* NonPrimitive */ ? emptyObjectType : t; } function createUnionOrIntersectionProperty(containingType, name) { @@ -30113,7 +31284,7 @@ var ts; } var propTypes = []; var declarations = []; - var commonType = undefined; + var commonType; for (var _b = 0, props_1 = props; _b < props_1.length; _b++) { var prop = props_1[_b]; if (prop.declarations) { @@ -30254,7 +31425,7 @@ var ts; } function isJSDocOptionalParameter(node) { if (ts.isInJavaScriptFile(node)) { - if (node.type && node.type.kind === 276 /* JSDocOptionalType */) { + if (node.type && node.type.kind === 279 /* JSDocOptionalType */) { return true; } var paramTags = ts.getJSDocParameterTags(node); @@ -30265,7 +31436,7 @@ var ts; return true; } if (paramTag.typeExpression) { - return paramTag.typeExpression.type.kind === 276 /* JSDocOptionalType */; + return paramTag.typeExpression.type.kind === 279 /* JSDocOptionalType */; } } } @@ -30284,9 +31455,8 @@ var ts; return true; } if (node.initializer) { - var signatureDeclaration = node.parent; - var signature = getSignatureFromDeclaration(signatureDeclaration); - var parameterIndex = signatureDeclaration.parameters.indexOf(node); + var signature = getSignatureFromDeclaration(node.parent); + var parameterIndex = node.parent.parameters.indexOf(node); ts.Debug.assert(parameterIndex >= 0); return parameterIndex >= signature.minArgumentCount; } @@ -30371,7 +31541,7 @@ var ts; var parameters = []; var hasLiteralTypes = false; var minArgumentCount = 0; - var thisParameter = undefined; + var thisParameter = void 0; var hasThisParameter = void 0; var iife = ts.getImmediatelyInvokedFunctionExpression(declaration); var isJSConstructSignature = ts.isJSDocConstructSignature(declaration); @@ -30384,7 +31554,7 @@ var ts; var paramSymbol = param.symbol; // Include parameter symbol instead of property symbol in the signature if (paramSymbol && !!(paramSymbol.flags & 4 /* Property */) && !ts.isBindingPattern(param.name)) { - var resolvedSymbol = resolveName(param, paramSymbol.escapedName, 107455 /* Value */, undefined, undefined, /*isUse*/ false); + var resolvedSymbol = resolveName(param, paramSymbol.escapedName, 67216319 /* Value */, undefined, undefined, /*isUse*/ false); paramSymbol = resolvedSymbol; } if (i === 0 && paramSymbol.escapedName === "this") { @@ -30394,7 +31564,7 @@ var ts; else { parameters.push(paramSymbol); } - if (param.type && param.type.kind === 174 /* LiteralType */) { + if (param.type && param.type.kind === 177 /* LiteralType */) { hasLiteralTypes = true; } // Record a new minimum argument count if this is not an optional parameter @@ -30407,16 +31577,16 @@ var ts; } } // If only one accessor includes a this-type annotation, the other behaves as if it had the same type annotation - if ((declaration.kind === 154 /* GetAccessor */ || declaration.kind === 155 /* SetAccessor */) && + if ((declaration.kind === 155 /* GetAccessor */ || declaration.kind === 156 /* SetAccessor */) && !hasNonBindableDynamicName(declaration) && (!hasThisParameter || !thisParameter)) { - var otherKind = declaration.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = declaration.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var other = ts.getDeclarationOfKind(getSymbolOfNode(declaration), otherKind); if (other) { thisParameter = getAnnotatedAccessorThisParameter(other); } } - var classType = declaration.kind === 153 /* Constructor */ ? + var classType = declaration.kind === 154 /* Constructor */ ? getDeclaredTypeOfClassOrInterface(getMergedSymbol(declaration.parent.symbol)) : undefined; var typeParameters = classType ? classType.localTypeParameters : getTypeParametersFromDeclaration(declaration); @@ -30426,18 +31596,21 @@ var ts; } return links.resolvedSignature; } + /** + * A JS function gets a synthetic rest parameter if it references `arguments` AND: + * 1. It has no parameters but at least one `@param` with a type that starts with `...` + * OR + * 2. It has at least one parameter, and the last parameter has a matching `@param` with a type that starts with `...` + */ function maybeAddJsSyntheticRestParameter(declaration, parameters) { - // JS functions get a free rest parameter if: - // a) The last parameter has `...` preceding its type - // b) It references `arguments` somewhere + if (!containsArgumentsReference(declaration)) { + return false; + } var lastParam = ts.lastOrUndefined(declaration.parameters); - var lastParamTags = lastParam && ts.getJSDocParameterTags(lastParam); + var lastParamTags = lastParam ? ts.getJSDocParameterTags(lastParam) : ts.getJSDocTags(declaration).filter(ts.isJSDocParameterTag); var lastParamVariadicType = ts.firstDefined(lastParamTags, function (p) { return p.typeExpression && ts.isJSDocVariadicType(p.typeExpression.type) ? p.typeExpression.type : undefined; }); - if (!lastParamVariadicType && !containsArgumentsReference(declaration)) { - return false; - } var syntheticArgsSymbol = createSymbol(3 /* Variable */, "args"); syntheticArgsSymbol.type = lastParamVariadicType ? createArrayType(getTypeFromTypeNode(lastParamVariadicType.type)) : anyArrayType; syntheticArgsSymbol.isRestParameter = true; @@ -30461,8 +31634,8 @@ var ts; } // TypeScript 1.0 spec (April 2014): // If only one accessor includes a type annotation, the other behaves as if it had the same type annotation. - if (declaration.kind === 154 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { - var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 155 /* SetAccessor */); + if (declaration.kind === 155 /* GetAccessor */ && !hasNonBindableDynamicName(declaration)) { + var setter = ts.getDeclarationOfKind(getSymbolOfNode(declaration), 156 /* SetAccessor */); return getAnnotatedAccessorType(setter); } if (ts.nodeIsMissing(declaration.body)) { @@ -30486,11 +31659,11 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node.escapedText === "arguments" && ts.isExpressionNode(node); - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return node.name.kind === 145 /* ComputedPropertyName */ + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return node.name.kind === 146 /* ComputedPropertyName */ && traverse(node.name); default: return !ts.nodeStartsNewLexicalEnvironment(node) && !ts.isPartOfTypeNode(node) && ts.forEachChild(node, traverse); @@ -30504,20 +31677,20 @@ var ts; for (var i = 0; i < symbol.declarations.length; i++) { var node = symbol.declarations[i]; switch (node.kind) { - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 280 /* JSDocFunctionType */: // Don't include signature if node is the implementation of an overloaded function. A node is considered // an implementation node if it has a body and the previous node is of the same kind and immediately // precedes the implementation node (i.e. has the same parent and ends where the implementation starts). @@ -30561,7 +31734,7 @@ var ts; } else { var declaration = signature.declaration; - signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 159 /* TypePredicate */ ? + signature.resolvedTypePredicate = declaration && declaration.type && declaration.type.kind === 160 /* TypePredicate */ ? createTypePredicateFromTypePredicateNode(declaration.type) : noTypePredicate; } @@ -30624,7 +31797,10 @@ var ts; return instantiation; } function createSignatureInstantiation(signature, typeArguments) { - return instantiateSignature(signature, createTypeMapper(signature.typeParameters, typeArguments), /*eraseTypeParameters*/ true); + return instantiateSignature(signature, createSignatureTypeMapper(signature, typeArguments), /*eraseTypeParameters*/ true); + } + function createSignatureTypeMapper(signature, typeArguments) { + return createTypeMapper(signature.typeParameters, typeArguments); } function getErasedSignature(signature) { return signature.typeParameters ? @@ -30664,7 +31840,7 @@ var ts; // object type literal or interface (using the new keyword). Each way of declaring a constructor // will result in a different declaration kind. if (!signature.isolatedSignatureType) { - var isConstructor = signature.declaration.kind === 153 /* Constructor */ || signature.declaration.kind === 157 /* ConstructSignature */; + var isConstructor = signature.declaration.kind === 154 /* Constructor */ || signature.declaration.kind === 158 /* ConstructSignature */; var type = createObjectType(16 /* Anonymous */); type.members = emptySymbols; type.properties = ts.emptyArray; @@ -30678,7 +31854,7 @@ var ts; return symbol.members.get("__index" /* Index */); } function getIndexDeclarationOfSymbol(symbol, kind) { - var syntaxKind = kind === 1 /* Number */ ? 133 /* NumberKeyword */ : 136 /* StringKeyword */; + var syntaxKind = kind === 1 /* Number */ ? 134 /* NumberKeyword */ : 137 /* StringKeyword */; var indexSymbol = getIndexSymbol(symbol); if (indexSymbol) { for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) { @@ -30705,7 +31881,43 @@ var ts; return undefined; } function getConstraintDeclaration(type) { - return type.symbol && ts.getDeclarationOfKind(type.symbol, 146 /* TypeParameter */).constraint; + return type.symbol && ts.getDeclarationOfKind(type.symbol, 147 /* TypeParameter */).constraint; + } + function getInferredTypeParameterConstraint(typeParameter) { + var inferences; + if (typeParameter.symbol) { + for (var _i = 0, _a = typeParameter.symbol.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + // When an 'infer T' declaration is immediately contained in a type reference node + // (such as 'Foo'), T's constraint is inferred from the constraint of the + // corresponding type parameter in 'Foo'. When multiple 'infer T' declarations are + // present, we form an intersection of the inferred constraint types. + if (declaration.parent.kind === 171 /* InferType */ && declaration.parent.parent.kind === 161 /* TypeReference */) { + var typeReference = declaration.parent.parent; + var typeParameters = getTypeParametersForTypeReference(typeReference); + if (typeParameters) { + var index = typeReference.typeArguments.indexOf(declaration.parent); + if (index < typeParameters.length) { + var declaredConstraint = getConstraintOfTypeParameter(typeParameters[index]); + if (declaredConstraint) { + // Type parameter constraints can reference other type parameters so + // constraints need to be instantiated. If instantiation produces the + // type parameter itself, we discard that inference. For example, in + // type Foo = [T, U]; + // type Bar = T extends Foo ? Foo : T; + // the instantiated constraint for U is X, so we discard that inference. + var mapper = createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReference, typeParameters)); + var constraint = instantiateType(declaredConstraint, mapper); + if (constraint !== typeParameter) { + inferences = ts.append(inferences, constraint); + } + } + } + } + } + } + } + return inferences && getIntersectionType(inferences); } function getConstraintFromTypeParameter(typeParameter) { if (!typeParameter.constraint) { @@ -30715,13 +31927,14 @@ var ts; } else { var constraintDeclaration = getConstraintDeclaration(typeParameter); - typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : noConstraintType; + typeParameter.constraint = constraintDeclaration ? getTypeFromTypeNode(constraintDeclaration) : + getInferredTypeParameterConstraint(typeParameter) || noConstraintType; } } return typeParameter.constraint === noConstraintType ? undefined : typeParameter.constraint; } function getParentSymbolOfTypeParameter(typeParameter) { - return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 146 /* TypeParameter */).parent); + return getSymbolOfNode(ts.getDeclarationOfKind(typeParameter.symbol, 147 /* TypeParameter */).parent); } function getTypeListId(types) { var result = ""; @@ -30758,7 +31971,7 @@ var ts; result |= type.flags; } } - return result & 29360128 /* PropagatingFlags */; + return result & 117440512 /* PropagatingFlags */; } function createTypeReference(target, typeArguments) { var id = getTypeListId(typeArguments); @@ -30795,7 +32008,7 @@ var ts; var isJs = ts.isInJavaScriptFile(node); var isJsImplicitAny = !noImplicitAny && isJs; if (!isJsImplicitAny && (numTypeArguments < minTypeArgumentCount || numTypeArguments > typeParameters.length)) { - var missingAugmentsTag = isJs && node.parent.kind !== 282 /* JSDocAugmentsTag */; + var missingAugmentsTag = isJs && node.parent.kind !== 285 /* JSDocAugmentsTag */; var diag = minTypeArgumentCount === typeParameters.length ? missingAugmentsTag ? ts.Diagnostics.Expected_0_type_arguments_provide_these_with_an_extends_tag @@ -30816,11 +32029,7 @@ var ts; var typeArguments = ts.concatenate(type.outerTypeParameters, fillMissingTypeArguments(typeArgs, typeParameters, minTypeArgumentCount, isJs)); return createTypeReference(type, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeAliasInstantiation(symbol, typeArguments) { var type = getDeclaredTypeOfSymbol(symbol); @@ -30852,23 +32061,20 @@ var ts; } return getTypeAliasInstantiation(symbol, typeArguments); } - if (node.typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return type; + return checkNoTypeArguments(node, symbol) ? type : unknownType; } function getTypeReferenceName(node) { switch (node.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // We only support expressions that are simple qualified names. For other // expressions this produces undefined. var expr = node.expression; if (ts.isEntityNameExpression(expr)) { return expr; } + // fall through; } return undefined; } @@ -30889,28 +32095,25 @@ var ts; } // Get type from reference to named type that cannot be generic (enum or type parameter) var res = tryGetDeclaredTypeOfSymbol(symbol); - if (res !== undefined) { - if (typeArguments) { - error(node, ts.Diagnostics.Type_0_is_not_generic, symbolToString(symbol)); - return unknownType; - } - return res; + if (res) { + return checkNoTypeArguments(node, symbol) ? + res.flags & 32768 /* TypeParameter */ ? getConstrainedTypeVariable(res, node) : res : + unknownType; } - if (!(symbol.flags & 107455 /* Value */ && isJSDocTypeReference(node))) { + if (!(symbol.flags & 67216319 /* Value */ && isJSDocTypeReference(node))) { return unknownType; } // A jsdoc TypeReference may have resolved to a value (as opposed to a type). If // the symbol is a constructor function, return the inferred class type; otherwise, // the type of this reference is just the type of the value we resolved to. + var assignedType = getAssignedClassType(symbol); var valueType = getTypeOfSymbol(symbol); - if (valueType.symbol && !isInferredClassType(valueType)) { - var referenceType = getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments); - if (referenceType) { - return referenceType; - } + var referenceType = valueType.symbol && !isInferredClassType(valueType) && getTypeReferenceTypeWorker(node, valueType.symbol, typeArguments); + if (referenceType || assignedType) { + return referenceType && assignedType ? getIntersectionType([assignedType, referenceType]) : referenceType || assignedType; } // Resolve the type reference as a Type for the purpose of reporting errors. - resolveTypeReferenceName(getTypeReferenceName(node), 793064 /* Type */); + resolveTypeReferenceName(getTypeReferenceName(node), 67901928 /* Type */); return valueType; } function getTypeReferenceTypeWorker(node, symbol, typeArguments) { @@ -30926,42 +32129,88 @@ var ts; return getInferredClassType(symbol); } } + function getSubstitutionType(typeVariable, substitute) { + var result = createType(4194304 /* Substitution */); + result.typeVariable = typeVariable; + result.substitute = substitute; + return result; + } + function isUnaryTupleTypeNode(node) { + return node.kind === 167 /* TupleType */ && node.elementTypes.length === 1; + } + function getImpliedConstraint(typeVariable, checkNode, extendsNode) { + return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(typeVariable, checkNode.elementTypes[0], extendsNode.elementTypes[0]) : + getActualTypeVariable(getTypeFromTypeNode(checkNode)) === typeVariable ? getTypeFromTypeNode(extendsNode) : + undefined; + } + function getConstrainedTypeVariable(typeVariable, node) { + var constraints; + while (ts.isPartOfTypeNode(node)) { + var parent = node.parent; + if (parent.kind === 170 /* ConditionalType */ && node === parent.trueType) { + var constraint = getImpliedConstraint(typeVariable, parent.checkType, parent.extendsType); + if (constraint) { + constraints = ts.append(constraints, constraint); + } + } + node = parent; + } + return constraints ? getSubstitutionType(typeVariable, getIntersectionType(ts.append(constraints, typeVariable))) : typeVariable; + } function isJSDocTypeReference(node) { - return node.flags & 1048576 /* JSDoc */ && node.kind === 160 /* TypeReference */; + return node.flags & 1048576 /* JSDoc */ && node.kind === 161 /* TypeReference */; + } + function checkNoTypeArguments(node, symbol) { + if (node.typeArguments) { + error(node, ts.Diagnostics.Type_0_is_not_generic, symbol ? symbolToString(symbol) : ts.declarationNameToString(node.typeName)); + return false; + } + return true; } function getIntendedTypeFromJSDocTypeReference(node) { if (ts.isIdentifier(node.typeName)) { - if (node.typeName.escapedText === "Object") { - if (ts.isJSDocIndexSignature(node)) { - var indexed = getTypeFromTypeNode(node.typeArguments[0]); - var target = getTypeFromTypeNode(node.typeArguments[1]); - var index = createIndexInfo(target, /*isReadonly*/ false); - return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); - } - return anyType; - } + var typeArgs = node.typeArguments; switch (node.typeName.escapedText) { case "String": + checkNoTypeArguments(node); return stringType; case "Number": + checkNoTypeArguments(node); return numberType; case "Boolean": + checkNoTypeArguments(node); return booleanType; case "Void": + checkNoTypeArguments(node); return voidType; case "Undefined": + checkNoTypeArguments(node); return undefinedType; case "Null": + checkNoTypeArguments(node); return nullType; case "Function": case "function": + checkNoTypeArguments(node); return globalFunctionType; case "Array": case "array": - return !node.typeArguments || !node.typeArguments.length ? anyArrayType : undefined; + return !typeArgs || !typeArgs.length ? anyArrayType : undefined; case "Promise": case "promise": - return !node.typeArguments || !node.typeArguments.length ? createPromiseType(anyType) : undefined; + return !typeArgs || !typeArgs.length ? createPromiseType(anyType) : undefined; + case "Object": + if (typeArgs && typeArgs.length === 2) { + if (ts.isJSDocIndexSignature(node)) { + var indexed = getTypeFromTypeNode(typeArgs[0]); + var target = getTypeFromTypeNode(typeArgs[1]); + var index = createIndexInfo(target, /*isReadonly*/ false); + return createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, indexed === stringType && index, indexed === numberType && index); + } + return anyType; + } + checkNoTypeArguments(node); + return anyType; } } } @@ -30974,17 +32223,17 @@ var ts; if (!links.resolvedType) { var symbol = void 0; var type = void 0; - var meaning = 793064 /* Type */; + var meaning = 67901928 /* Type */; if (isJSDocTypeReference(node)) { type = getIntendedTypeFromJSDocTypeReference(node); - meaning |= 107455 /* Value */; + meaning |= 67216319 /* Value */; } if (!type) { symbol = resolveTypeReferenceName(getTypeReferenceName(node), meaning); type = getTypeReferenceType(node, symbol); } // Cache both the resolved symbol and the resolved type. The resolved symbol is needed in when we check the - // type reference in checkTypeReferenceOrExpressionWithTypeArguments. + // type reference in checkTypeReferenceNode. links.resolvedSymbol = symbol; links.resolvedType = type; } @@ -31010,9 +32259,9 @@ var ts; for (var _i = 0, declarations_3 = declarations; _i < declarations_3.length; _i++) { var declaration = declarations_3[_i]; switch (declaration.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: return declaration; } } @@ -31032,10 +32281,10 @@ var ts; return type; } function getGlobalValueSymbol(name, reportErrors) { - return getGlobalSymbol(name, 107455 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); + return getGlobalSymbol(name, 67216319 /* Value */, reportErrors ? ts.Diagnostics.Cannot_find_global_value_0 : undefined); } function getGlobalTypeSymbol(name, reportErrors) { - return getGlobalSymbol(name, 793064 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); + return getGlobalSymbol(name, 67901928 /* Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); } function getGlobalSymbol(name, meaning, diagnostic) { // Don't track references for global symbols anyway, so value if `isReference` is arbitrary @@ -31086,18 +32335,9 @@ var ts; } function getGlobalTypeOrUndefined(name, arity) { if (arity === void 0) { arity = 0; } - var symbol = getGlobalSymbol(name, 793064 /* Type */, /*diagnostic*/ undefined); + var symbol = getGlobalSymbol(name, 67901928 /* Type */, /*diagnostic*/ undefined); return symbol && getTypeOfGlobalSymbol(symbol, arity); } - /** - * Returns a type that is inside a namespace at the global scope, e.g. - * getExportedTypeFromNamespace('JSX', 'Element') returns the JSX.Element type - */ - function getExportedTypeFromNamespace(namespace, name) { - var namespaceSymbol = getGlobalSymbol(namespace, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); - var typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, 793064 /* Type */); - return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); - } /** * Instantiates a global type that is generic with some element type, and returns that instantiation. */ @@ -31196,27 +32436,29 @@ var ts; return true; } combined |= t.flags; - if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 33554432 /* NonPrimitive */)) { + if (combined & 12288 /* Nullable */ && combined & (65536 /* Object */ | 134217728 /* NonPrimitive */)) { return true; } } return false; } - function addTypeToUnion(typeSet, type) { + function addTypeToUnion(typeSet, includes, type) { var flags = type.flags; if (flags & 131072 /* Union */) { - addTypesToUnion(typeSet, type.types); + includes = addTypesToUnion(typeSet, includes, type.types); } else if (flags & 1 /* Any */) { - typeSet.containsAny = true; + includes |= 1 /* Any */; + if (type === wildcardType) + includes |= 4096 /* Wildcard */; } else if (!strictNullChecks && flags & 12288 /* Nullable */) { if (flags & 4096 /* Undefined */) - typeSet.containsUndefined = true; + includes |= 2 /* Undefined */; if (flags & 8192 /* Null */) - typeSet.containsNull = true; - if (!(flags & 4194304 /* ContainsWideningType */)) - typeSet.containsNonWideningType = true; + includes |= 4 /* Null */; + if (!(flags & 16777216 /* ContainsWideningType */)) + includes |= 16 /* NonWideningType */; } else if (!(flags & 16384 /* Never */ || flags & 262144 /* Intersection */ && isEmptyIntersectionType(type))) { // We ignore 'never' types in unions. Likewise, we ignore intersections of unit types as they are @@ -31224,13 +32466,13 @@ var ts; // intersections of unit types into 'never' upon construction, but deferring the reduction makes it // easier to reason about their origin. if (flags & 2 /* String */) - typeSet.containsString = true; + includes |= 32 /* String */; if (flags & 4 /* Number */) - typeSet.containsNumber = true; + includes |= 64 /* Number */; if (flags & 512 /* ESSymbol */) - typeSet.containsESSymbol = true; + includes |= 128 /* ESSymbol */; if (flags & 1120 /* StringOrNumberLiteralOrUnique */) - typeSet.containsLiteralOrUniqueESSymbol = true; + includes |= 256 /* LiteralOrUniqueESSymbol */; var len = typeSet.length; var index = len && type.id > typeSet[len - 1].id ? ~len : ts.binarySearch(typeSet, type, getTypeId, ts.compareValues); if (index < 0) { @@ -31240,14 +32482,16 @@ var ts; } } } + return includes; } // Add the given types to the given type set. Order is preserved, duplicates are removed, // and nested types of the given kind are flattened into the set. - function addTypesToUnion(typeSet, types) { + function addTypesToUnion(typeSet, includes, types) { for (var _i = 0, types_6 = types; _i < types_6.length; _i++) { var type = types_6[_i]; - addTypeToUnion(typeSet, type); + includes = addTypeToUnion(typeSet, includes, type); } + return includes; } function containsIdenticalType(types, type) { for (var _i = 0, types_7 = types; _i < types_7.length; _i++) { @@ -31295,15 +32539,15 @@ var ts; } } } - function removeRedundantLiteralTypes(types) { + function removeRedundantLiteralTypes(types, includes) { var i = types.length; while (i > 0) { i--; var t = types[i]; - var remove = t.flags & 32 /* StringLiteral */ && types.containsString || - t.flags & 64 /* NumberLiteral */ && types.containsNumber || - t.flags & 1024 /* UniqueESSymbol */ && types.containsESSymbol || - t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 2097152 /* FreshLiteral */ && containsType(types, t.regularType); + var remove = t.flags & 32 /* StringLiteral */ && includes & 32 /* String */ || + t.flags & 64 /* NumberLiteral */ && includes & 64 /* Number */ || + t.flags & 1024 /* UniqueESSymbol */ && includes & 128 /* ESSymbol */ || + t.flags & 96 /* StringOrNumberLiteral */ && t.flags & 8388608 /* FreshLiteral */ && containsType(types, t.regularType); if (remove) { ts.orderedRemoveItemAt(types, i); } @@ -31325,14 +32569,14 @@ var ts; return types[0]; } var typeSet = []; - addTypesToUnion(typeSet, types); - if (typeSet.containsAny) { - return anyType; + var includes = addTypesToUnion(typeSet, 0, types); + if (includes & 1 /* Any */) { + return includes & 4096 /* Wildcard */ ? wildcardType : anyType; } switch (unionReduction) { case 1 /* Literal */: - if (typeSet.containsLiteralOrUniqueESSymbol) { - removeRedundantLiteralTypes(typeSet); + if (includes & 256 /* LiteralOrUniqueESSymbol */) { + removeRedundantLiteralTypes(typeSet, includes); } break; case 2 /* Subtype */: @@ -31340,8 +32584,8 @@ var ts; break; } if (typeSet.length === 0) { - return typeSet.containsNull ? typeSet.containsNonWideningType ? nullType : nullWideningType : - typeSet.containsUndefined ? typeSet.containsNonWideningType ? undefinedType : undefinedWideningType : + return includes & 4 /* Null */ ? includes & 16 /* NonWideningType */ ? nullType : nullWideningType : + includes & 2 /* Undefined */ ? includes & 16 /* NonWideningType */ ? undefinedType : undefinedWideningType : neverType; } return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments); @@ -31413,39 +32657,44 @@ var ts; } return links.resolvedType; } - function addTypeToIntersection(typeSet, type) { - if (type.flags & 262144 /* Intersection */) { - addTypesToIntersection(typeSet, type.types); + function addTypeToIntersection(typeSet, includes, type) { + var flags = type.flags; + if (flags & 262144 /* Intersection */) { + includes = addTypesToIntersection(typeSet, includes, type.types); } - else if (type.flags & 1 /* Any */) { - typeSet.containsAny = true; + else if (flags & 1 /* Any */) { + includes |= 1 /* Any */; + if (type === wildcardType) + includes |= 4096 /* Wildcard */; } - else if (type.flags & 16384 /* Never */) { - typeSet.containsNever = true; + else if (flags & 16384 /* Never */) { + includes |= 8 /* Never */; } else if (ts.getObjectFlags(type) & 16 /* Anonymous */ && isEmptyObjectType(type)) { - typeSet.containsEmptyObject = true; + includes |= 1024 /* EmptyObject */; } - else if ((strictNullChecks || !(type.flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { - if (type.flags & 65536 /* Object */) { - typeSet.containsObjectType = true; + else if ((strictNullChecks || !(flags & 12288 /* Nullable */)) && !ts.contains(typeSet, type)) { + if (flags & 65536 /* Object */) { + includes |= 512 /* ObjectType */; } - if (type.flags & 131072 /* Union */ && typeSet.unionIndex === undefined) { - typeSet.unionIndex = typeSet.length; + if (flags & 131072 /* Union */) { + includes |= 2048 /* Union */; } - if (!(type.flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && + if (!(flags & 65536 /* Object */ && type.objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */) && containsIdenticalType(typeSet, type))) { typeSet.push(type); } } + return includes; } // Add the given types to the given type set. Order is preserved, freshness is removed from literal // types, duplicates are removed, and nested types of the given kind are flattened into the set. - function addTypesToIntersection(typeSet, types) { + function addTypesToIntersection(typeSet, includes, types) { for (var _i = 0, types_8 = types; _i < types_8.length; _i++) { var type = types_8[_i]; - addTypeToIntersection(typeSet, getRegularTypeOfLiteralType(type)); + includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type)); } + return includes; } // We normalize combinations of intersection and union types based on the distributive property of the '&' // operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection @@ -31462,25 +32711,25 @@ var ts; return emptyObjectType; } var typeSet = []; - addTypesToIntersection(typeSet, types); - if (typeSet.containsNever) { + var includes = addTypesToIntersection(typeSet, 0, types); + if (includes & 8 /* Never */) { return neverType; } - if (typeSet.containsAny) { - return anyType; + if (includes & 1 /* Any */) { + return includes & 4096 /* Wildcard */ ? wildcardType : anyType; } - if (typeSet.containsEmptyObject && !typeSet.containsObjectType) { + if (includes & 1024 /* EmptyObject */ && !(includes & 512 /* ObjectType */)) { typeSet.push(emptyObjectType); } if (typeSet.length === 1) { return typeSet[0]; } - var unionIndex = typeSet.unionIndex; - if (unionIndex !== undefined) { + if (includes & 2048 /* Union */) { // We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of // the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain. - var unionType = typeSet[unionIndex]; - return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); + var unionIndex_1 = ts.findIndex(typeSet, function (t) { return (t.flags & 131072 /* Union */) !== 0; }); + var unionType = typeSet[unionIndex_1]; + return getUnionType(ts.map(unionType.types, function (t) { return getIntersectionType(ts.replaceElement(typeSet, unionIndex_1, t)); }), 1 /* Literal */, aliasSymbol, aliasTypeArguments); } var id = getTypeListId(typeSet); var type = intersectionTypes.get(id); @@ -31509,18 +32758,30 @@ var ts; return type.resolvedIndexType; } function getLiteralTypeFromPropertyName(prop) { - return ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.isKnownSymbol(prop) ? - neverType : - getLiteralType(ts.symbolName(prop)); + var links = getSymbolLinks(getLateBoundSymbol(prop)); + if (!links.nameType) { + if (links.target && links.target !== unknownSymbol && links.target !== resolvingSymbol) { + ts.Debug.assert(links.target.escapedName === prop.escapedName || links.target.escapedName === "__computed" /* Computed */, "Target symbol and symbol do not have the same name"); + links.nameType = getLiteralTypeFromPropertyName(links.target); + } + else { + links.nameType = ts.getDeclarationModifierFlagsFromSymbol(prop) & 24 /* NonPublicAccessibilityModifier */ || ts.isKnownSymbol(prop) ? + neverType : + getLiteralType(ts.symbolName(prop)); + } + } + return links.nameType; } function getLiteralTypeFromPropertyNames(type) { return getUnionType(ts.map(getPropertiesOfType(type), getLiteralTypeFromPropertyName)); } function getIndexType(type) { - return maybeTypeOfKind(type, 1081344 /* TypeVariable */) ? getIndexTypeForGenericType(type) : - ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : - type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : - getLiteralTypeFromPropertyNames(type); + return type.flags & 262144 /* Intersection */ ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t); })) : + maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */) ? getIndexTypeForGenericType(type) : + ts.getObjectFlags(type) & 32 /* Mapped */ ? getConstraintTypeFromMappedType(type) : + type === wildcardType ? wildcardType : + type.flags & 1 /* Any */ || getIndexInfoOfType(type, 0 /* String */) ? stringType : + getLiteralTypeFromPropertyNames(type); } function getIndexTypeOrString(type) { var indexType = getIndexType(type); @@ -31530,11 +32791,11 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedType) { switch (node.operator) { - case 127 /* KeyOfKeyword */: + case 128 /* KeyOfKeyword */: links.resolvedType = getIndexType(getTypeFromTypeNode(node.type)); break; - case 140 /* UniqueKeyword */: - links.resolvedType = node.type.kind === 137 /* SymbolKeyword */ + case 141 /* UniqueKeyword */: + links.resolvedType = node.type.kind === 138 /* SymbolKeyword */ ? getESSymbolLikeTypeForNode(ts.walkUpParenthesizedTypes(node.parent)) : unknownType; break; @@ -31549,7 +32810,7 @@ var ts; return type; } function getPropertyTypeForIndexType(objectType, indexType, accessNode, cacheSymbol) { - var accessExpression = accessNode && accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode : undefined; + var accessExpression = accessNode && accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode : undefined; var propName = isTypeUsableAsLateBoundName(indexType) ? getLateBoundNameFromType(indexType) : accessExpression && checkThatExpressionIsProperSymbolReference(accessExpression.argumentExpression, indexType, /*reportError*/ false) ? ts.getPropertyNameForKnownSymbolName(ts.idText(accessExpression.argumentExpression.name)) : @@ -31572,7 +32833,7 @@ var ts; } if (!(indexType.flags & 12288 /* Nullable */) && isTypeAssignableToKind(indexType, 524322 /* StringLike */ | 84 /* NumberLike */ | 1536 /* ESSymbolLike */)) { if (isTypeAny(objectType)) { - return anyType; + return objectType; } var indexInfo = isTypeAssignableToKind(indexType, 84 /* NumberLike */) && getIndexInfoOfType(objectType, 1 /* Number */) || getIndexInfoOfType(objectType, 0 /* String */) || @@ -31596,7 +32857,7 @@ var ts; } } if (accessNode) { - var indexNode = accessNode.kind === 181 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; + var indexNode = accessNode.kind === 184 /* ElementAccessExpression */ ? accessNode.argumentExpression : accessNode.indexType; if (indexType.flags & (32 /* StringLiteral */ | 64 /* NumberLiteral */)) { error(indexNode, ts.Diagnostics.Property_0_does_not_exist_on_type_1, "" + indexType.value, typeToString(objectType)); } @@ -31611,15 +32872,10 @@ var ts; return anyType; } function isGenericObjectType(type) { - return type.flags & 1081344 /* TypeVariable */ ? true : - ts.getObjectFlags(type) & 32 /* Mapped */ ? isGenericIndexType(getConstraintTypeFromMappedType(type)) : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericObjectType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 536870912 /* GenericMappedType */); } function isGenericIndexType(type) { - return type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) ? true : - type.flags & 393216 /* UnionOrIntersection */ ? ts.forEach(type.types, isGenericIndexType) : - false; + return maybeTypeOfKind(type, 7372800 /* InstantiableNonPrimitive */ | 524288 /* Index */); } // Return true if the given type is a non-generic object type with a string index signature and no // other members. @@ -31686,17 +32942,19 @@ var ts; } function substituteIndexedMappedType(objectType, type) { var mapper = createTypeMapper([getTypeParameterFromMappedType(objectType)], [type.indexType]); - var objectTypeMapper = objectType.mapper; - var templateMapper = objectTypeMapper ? combineTypeMappers(objectTypeMapper, mapper) : mapper; + var templateMapper = combineTypeMappers(objectType.mapper, mapper); return instantiateType(getTemplateTypeFromMappedType(objectType), templateMapper); } function getIndexedAccessType(objectType, indexType, accessNode) { + if (objectType === wildcardType || indexType === wildcardType) { + return wildcardType; + } // If the index type is generic, or if the object type is generic and doesn't originate in an expression, // we are performing a higher-order index access where we cannot meaningfully access the properties of the // object type. Note that for a generic T and a non-generic K, we eagerly resolve T[K] if it originates in // an expression. This is to preserve backwards compatibility. For example, an element access 'this["foo"]' // has always been resolved eagerly using the constraint type of 'this' at the given location. - if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 181 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { + if (isGenericIndexType(indexType) || !(accessNode && accessNode.kind === 184 /* ElementAccessExpression */) && isGenericObjectType(objectType)) { if (objectType.flags & 1 /* Any */) { return objectType; } @@ -31729,7 +32987,13 @@ var ts; function getTypeFromIndexedAccessTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { - links.resolvedType = getIndexedAccessType(getTypeFromTypeNode(node.objectType), getTypeFromTypeNode(node.indexType), node); + var objectType = getTypeFromTypeNode(node.objectType); + var indexType = getTypeFromTypeNode(node.indexType); + var resolved = getIndexedAccessType(objectType, indexType, node); + links.resolvedType = resolved.flags & 1048576 /* IndexedAccess */ && + resolved.objectType === objectType && + resolved.indexType === indexType ? + getConstrainedTypeVariable(resolved, node) : resolved; } return links.resolvedType; } @@ -31747,6 +33011,112 @@ var ts; } return links.resolvedType; } + function getActualTypeVariable(type) { + return type.flags & 4194304 /* Substitution */ ? type.typeVariable : type; + } + function getConditionalType(root, mapper) { + var checkType = instantiateType(root.checkType, mapper); + var extendsType = instantiateType(root.extendsType, mapper); + if (checkType === wildcardType || extendsType === wildcardType) { + return wildcardType; + } + // If this is a distributive conditional type and the check type is generic we need to defer + // resolution of the conditional type such that a later instantiation will properly distribute + // over union types. + if (!root.isDistributive || !maybeTypeOfKind(checkType, 7897088 /* Instantiable */)) { + var combinedMapper = void 0; + if (root.inferTypeParameters) { + var context = createInferenceContext(root.inferTypeParameters, /*signature*/ undefined, 0 /* None */); + // We don't want inferences from constraints as they may cause us to eagerly resolve the + // conditional type instead of deferring resolution. Also, we always want strict function + // types rules (i.e. proper contravariance) for inferences. + inferTypes(context.inferences, checkType, extendsType, 32 /* NoConstraints */ | 64 /* AlwaysStrict */); + combinedMapper = combineTypeMappers(mapper, context); + } + // Return union of trueType and falseType for 'any' since it matches anything + if (checkType.flags & 1 /* Any */) { + return getUnionType([instantiateType(root.trueType, combinedMapper || mapper), instantiateType(root.falseType, mapper)]); + } + // Instantiate the extends type including inferences for 'infer T' type parameters + var inferredExtendsType = combinedMapper ? instantiateType(root.extendsType, combinedMapper) : extendsType; + // Return falseType for a definitely false extends check. We check an instantations of the two + // types with type parameters mapped to the wildcard type, the most permissive instantiations + // possible (the wildcard type is assignable to and from all types). If those are not related, + // then no instatiations will be and we can just return the false branch type. + if (!isTypeAssignableTo(getWildcardInstantiation(checkType), getWildcardInstantiation(inferredExtendsType))) { + return instantiateType(root.falseType, mapper); + } + // Return trueType for a definitely true extends check. The definitely assignable relation excludes + // type variable constraints from consideration. Without the definitely assignable relation, the type + // type Foo = T extends { x: string } ? string : number + // would immediately resolve to 'string' instead of being deferred. + if (checkTypeRelatedTo(checkType, inferredExtendsType, definitelyAssignableRelation, /*errorNode*/ undefined)) { + return instantiateType(root.trueType, combinedMapper || mapper); + } + } + // Return a deferred type for a check that is neither definitely true nor definitely false + var erasedCheckType = getActualTypeVariable(checkType); + var result = createType(2097152 /* Conditional */); + result.root = root; + result.checkType = erasedCheckType; + result.extendsType = extendsType; + result.mapper = mapper; + result.aliasSymbol = root.aliasSymbol; + result.aliasTypeArguments = instantiateTypes(root.aliasTypeArguments, mapper); + return result; + } + function getTrueTypeFromConditionalType(type) { + return type.resolvedTrueType || (type.resolvedTrueType = instantiateType(type.root.trueType, type.mapper)); + } + function getFalseTypeFromConditionalType(type) { + return type.resolvedFalseType || (type.resolvedFalseType = instantiateType(type.root.falseType, type.mapper)); + } + function getInferTypeParameters(node) { + var result; + if (node.locals) { + node.locals.forEach(function (symbol) { + if (symbol.flags & 262144 /* TypeParameter */) { + result = ts.append(result, getDeclaredTypeOfSymbol(symbol)); + } + }); + } + return result; + } + function getTypeFromConditionalTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + var checkType = getTypeFromTypeNode(node.checkType); + var aliasTypeArguments = getAliasTypeArgumentsForTypeNode(node); + var allOuterTypeParameters = getOuterTypeParameters(node, /*includeThisTypes*/ true); + var outerTypeParameters = aliasTypeArguments ? allOuterTypeParameters : ts.filter(allOuterTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, node); }); + var root = { + node: node, + checkType: checkType, + extendsType: getTypeFromTypeNode(node.extendsType), + trueType: getTypeFromTypeNode(node.trueType), + falseType: getTypeFromTypeNode(node.falseType), + isDistributive: !!(checkType.flags & 32768 /* TypeParameter */), + inferTypeParameters: getInferTypeParameters(node), + outerTypeParameters: outerTypeParameters, + instantiations: undefined, + aliasSymbol: getAliasSymbolForTypeNode(node), + aliasTypeArguments: aliasTypeArguments + }; + links.resolvedType = getConditionalType(root, /*mapper*/ undefined); + if (outerTypeParameters) { + root.instantiations = ts.createMap(); + root.instantiations.set(getTypeListId(outerTypeParameters), links.resolvedType); + } + } + return links.resolvedType; + } + function getTypeFromInferTypeNode(node) { + var links = getNodeLinks(node); + if (!links.resolvedType) { + links.resolvedType = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node.typeParameter)); + } + return links.resolvedType; + } function getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node) { var links = getNodeLinks(node); if (!links.resolvedType) { @@ -31768,7 +33138,7 @@ var ts; return links.resolvedType; } function getAliasSymbolForTypeNode(node) { - return node.parent.kind === 232 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; + return node.parent.kind === 235 /* TypeAliasDeclaration */ ? getSymbolOfNode(node.parent) : undefined; } function getAliasTypeArgumentsForTypeNode(node) { var symbol = getAliasSymbolForTypeNode(node); @@ -31779,7 +33149,7 @@ var ts; * this function should be called in a left folding style, with left = previous result of getSpreadType * and right = the new element to be spread. */ - function getSpreadType(left, right, symbol, propagatedFlags) { + function getSpreadType(left, right, symbol, typeFlags, objectFlags) { if (left.flags & 1 /* Any */ || right.flags & 1 /* Any */) { return anyType; } @@ -31790,12 +33160,12 @@ var ts; return left; } if (left.flags & 131072 /* Union */) { - return mapType(left, function (t) { return getSpreadType(t, right, symbol, propagatedFlags); }); + return mapType(left, function (t) { return getSpreadType(t, right, symbol, typeFlags, objectFlags); }); } if (right.flags & 131072 /* Union */) { - return mapType(right, function (t) { return getSpreadType(left, t, symbol, propagatedFlags); }); + return mapType(right, function (t) { return getSpreadType(left, t, symbol, typeFlags, objectFlags); }); } - if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */ | 33554432 /* NonPrimitive */)) { + if (right.flags & (136 /* BooleanLike */ | 84 /* NumberLike */ | 524322 /* StringLike */ | 272 /* EnumLike */ | 134217728 /* NonPrimitive */)) { return left; } var members = ts.createSymbolTable(); @@ -31848,8 +33218,8 @@ var ts; } } var spread = createAnonymousType(symbol, members, ts.emptyArray, ts.emptyArray, getNonReadonlyIndexSignature(stringIndexInfo), getNonReadonlyIndexSignature(numberIndexInfo)); - spread.flags |= propagatedFlags | 8388608 /* ContainsObjectLiteral */; - spread.objectFlags |= (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); + spread.flags |= typeFlags | 33554432 /* ContainsObjectLiteral */; + spread.objectFlags |= objectFlags | (128 /* ObjectLiteral */ | 1024 /* ContainsSpread */); return spread; } function getNonReadonlySymbol(prop) { @@ -31879,9 +33249,9 @@ var ts; return type; } function getFreshTypeOfLiteralType(type) { - if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 2097152 /* FreshLiteral */)) { + if (type.flags & 96 /* StringOrNumberLiteral */ && !(type.flags & 8388608 /* FreshLiteral */)) { if (!type.freshType) { - var freshType = createLiteralType(type.flags | 2097152 /* FreshLiteral */, type.value, type.symbol); + var freshType = createLiteralType(type.flags | 8388608 /* FreshLiteral */, type.value, type.symbol); freshType.regularType = type; type.freshType = freshType; } @@ -31890,7 +33260,7 @@ var ts; return type; } function getRegularTypeOfLiteralType(type) { - return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? type.regularType : type; + return type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? type.regularType : type; } function getLiteralType(value, enumId, symbol) { // We store all literal types in a single map with keys of the form '#NNN' and '@SSS', @@ -31929,9 +33299,9 @@ var ts; function getThisType(node) { var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); var parent = container && container.parent; - if (parent && (ts.isClassLike(parent) || parent.kind === 231 /* InterfaceDeclaration */)) { + if (parent && (ts.isClassLike(parent) || parent.kind === 234 /* InterfaceDeclaration */)) { if (!ts.hasModifier(container, 32 /* Static */) && - (container.kind !== 153 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { + (container.kind !== 154 /* Constructor */ || ts.isNodeDescendantOf(node, container.body))) { return getDeclaredTypeOfClassOrInterface(getSymbolOfNode(parent)).thisType; } } @@ -31948,73 +33318,78 @@ var ts; function getTypeFromTypeNode(node) { switch (node.kind) { case 119 /* AnyKeyword */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: return anyType; - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return stringType; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return numberType; case 122 /* BooleanKeyword */: return booleanType; - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return esSymbolType; case 105 /* VoidKeyword */: return voidType; - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: return undefinedType; case 95 /* NullKeyword */: return nullType; - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return neverType; - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return node.flags & 65536 /* JavaScriptFile */ ? anyType : nonPrimitiveType; - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: return getTypeFromThisTypeNode(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return getTypeFromLiteralTypeNode(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getTypeFromTypeReference(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return booleanType; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return getTypeFromTypeReference(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return getTypeFromTypeQueryNode(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return getTypeFromArrayTypeNode(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return getTypeFromTupleTypeNode(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return getTypeFromUnionTypeNode(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return getTypeFromIntersectionTypeNode(node); - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return getTypeFromJSDocNullableTypeNode(node); - case 169 /* ParenthesizedType */: - case 275 /* JSDocNonNullableType */: - case 276 /* JSDocOptionalType */: - case 271 /* JSDocTypeExpression */: + case 279 /* JSDocOptionalType */: + return addOptionality(getTypeFromTypeNode(node.type)); + case 172 /* ParenthesizedType */: + case 278 /* JSDocNonNullableType */: + case 274 /* JSDocTypeExpression */: return getTypeFromTypeNode(node.type); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return getTypeFromJSDocVariadicType(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 164 /* TypeLiteral */: - case 280 /* JSDocTypeLiteral */: - case 277 /* JSDocFunctionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 165 /* TypeLiteral */: + case 283 /* JSDocTypeLiteral */: + case 280 /* JSDocFunctionType */: return getTypeFromTypeLiteralOrFunctionOrConstructorTypeNode(node); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return getTypeFromTypeOperatorNode(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return getTypeFromIndexedAccessTypeNode(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return getTypeFromMappedTypeNode(node); + case 170 /* ConditionalType */: + return getTypeFromConditionalTypeNode(node); + case 171 /* InferType */: + return getTypeFromInferTypeNode(node); // This function assumes that an identifier or qualified name is a type expression // Callers should first ensure this by calling isTypeNode case 71 /* Identifier */: - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: var symbol = getSymbolAtLocation(node); return symbol && getDeclaredTypeOfSymbol(symbol); default: @@ -32023,12 +33398,18 @@ var ts; } function instantiateList(items, mapper, instantiator) { if (items && items.length) { - var result = []; - for (var _i = 0, items_1 = items; _i < items_1.length; _i++) { - var v = items_1[_i]; - result.push(instantiator(v, mapper)); + for (var i = 0; i < items.length; i++) { + var item = items[i]; + var mapped = instantiator(item, mapper); + if (item !== mapped) { + var result = i === 0 ? [] : items.slice(0, i); + result.push(mapped); + for (i++; i < items.length; i++) { + result.push(instantiator(items[i], mapper)); + } + return result; + } } - return result; } return items; } @@ -32071,19 +33452,26 @@ var ts; return function (t) { return typeParameters.indexOf(t) >= index ? emptyObjectType : t; }; } function isInferenceContext(mapper) { - return !!mapper.signature; + return !!mapper.typeParameters; } function cloneTypeMapper(mapper) { return mapper && isInferenceContext(mapper) ? - createInferenceContext(mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.compareTypes, mapper.inferences) : + createInferenceContext(mapper.typeParameters, mapper.signature, mapper.flags | 2 /* NoDefault */, mapper.compareTypes, mapper.inferences) : mapper; } function combineTypeMappers(mapper1, mapper2) { + if (!mapper1) + return mapper2; + if (!mapper2) + return mapper1; return function (t) { return instantiateType(mapper1(t), mapper2); }; } function createReplacementMapper(source, target, baseMapper) { return function (t) { return t === source ? target : baseMapper(t); }; } + function wildcardMapper(type) { + return type.flags & 32768 /* TypeParameter */ ? wildcardType : type; + } function cloneTypeParameter(typeParameter) { var result = createType(32768 /* TypeParameter */); result.symbol = typeParameter.symbol; @@ -32130,8 +33518,13 @@ var ts; return result; } function instantiateSymbol(symbol, mapper) { + var links = getSymbolLinks(symbol); + if (links.type && !maybeTypeOfKind(links.type, 65536 /* Object */ | 7897088 /* Instantiable */)) { + // If the type of the symbol is already resolved, and if that type could not possibly + // be affected by instantiation, simply return the symbol itself. + return symbol; + } if (ts.getCheckFlags(symbol) & 1 /* Instantiated */) { - var links = getSymbolLinks(symbol); // If symbol being instantiated is itself a instantiation, fetch the original target and combine the // type mappers. This ensures that original type identities are properly preserved and that aliases // always reference a non-aliases. @@ -32157,7 +33550,7 @@ var ts; var target = type.objectFlags & 64 /* Instantiated */ ? type.target : type; var symbol = target.symbol; var links = getSymbolLinks(symbol); - var typeParameters = links.typeParameters; + var typeParameters = links.outerTypeParameters; if (!typeParameters) { // The first time an anonymous type is instantiated we compute and store a list of the type // parameters that are in scope (and therefore potentially referenced). For type literals that @@ -32168,7 +33561,7 @@ var ts; typeParameters = symbol.flags & 2048 /* TypeLiteral */ && !target.aliasTypeArguments ? ts.filter(outerTypeParameters, function (tp) { return isTypeParameterPossiblyReferenced(tp, declaration_1); }) : outerTypeParameters; - links.typeParameters = typeParameters; + links.outerTypeParameters = typeParameters; if (typeParameters.length) { links.instantiations = ts.createMap(); links.instantiations.set(getTypeListId(typeParameters), target); @@ -32196,19 +33589,19 @@ var ts; // between the node and the type parameter declaration, if the node contains actual references to the // type parameter, or if the node contains type queries, we consider the type parameter possibly referenced. if (tp.symbol && tp.symbol.declarations && tp.symbol.declarations.length === 1) { - var container_1 = tp.symbol.declarations[0].parent; - if (ts.findAncestor(node, function (n) { return n.kind === 208 /* Block */ ? "quit" : n === container_1; })) { + var container_2 = tp.symbol.declarations[0].parent; + if (ts.findAncestor(node, function (n) { return n.kind === 211 /* Block */ ? "quit" : n === container_2; })) { return ts.forEachChild(node, containsReference); } } return true; function containsReference(node) { switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: return tp.isThisType; case 71 /* Identifier */: return !tp.isThisType && ts.isPartOfTypeNode(node) && getTypeFromTypeNode(node) === tp; - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return true; } return ts.forEachChild(node, containsReference); @@ -32238,7 +33631,7 @@ var ts; return instantiateAnonymousType(type, mapper); } function isMappableType(type) { - return type.flags & (1 /* Any */ | 32768 /* TypeParameter */ | 65536 /* Object */ | 262144 /* Intersection */ | 1048576 /* IndexedAccess */); + return type.flags & (1 /* Any */ | 7372800 /* InstantiableNonPrimitive */ | 65536 /* Object */ | 262144 /* Intersection */); } function instantiateAnonymousType(type, mapper) { var result = createObjectType(type.objectFlags | 64 /* Instantiated */, type.symbol); @@ -32251,8 +33644,39 @@ var ts; result.aliasTypeArguments = instantiateTypes(type.aliasTypeArguments, mapper); return result; } + function getConditionalTypeInstantiation(type, mapper) { + var root = type.root; + if (root.outerTypeParameters) { + // We are instantiating a conditional type that has one or more type parameters in scope. Apply the + // mapper to the type parameters to produce the effective list of type arguments, and compute the + // instantiation cache key from the type IDs of the type arguments. + var typeArguments = ts.map(root.outerTypeParameters, mapper); + var id = getTypeListId(typeArguments); + var result = root.instantiations.get(id); + if (!result) { + var newMapper = createTypeMapper(root.outerTypeParameters, typeArguments); + result = instantiateConditionalType(root, newMapper); + root.instantiations.set(id, result); + } + return result; + } + return type; + } + function instantiateConditionalType(root, mapper) { + // Check if we have a conditional type where the check type is a naked type parameter. If so, + // the conditional type is distributive over union types and when T is instantiated to a union + // type A | B, we produce (A extends U ? X : Y) | (B extends U ? X : Y). + if (root.isDistributive) { + var checkType_1 = root.checkType; + var instantiatedType = mapper(checkType_1); + if (checkType_1 !== instantiatedType && instantiatedType.flags & (131072 /* Union */ | 16384 /* Never */)) { + return mapType(instantiatedType, function (t) { return getConditionalType(root, createReplacementMapper(checkType_1, t, mapper)); }); + } + } + return getConditionalType(root, mapper); + } function instantiateType(type, mapper) { - if (type && mapper !== identityMapper) { + if (type && mapper && mapper !== identityMapper) { if (type.flags & 32768 /* TypeParameter */) { return mapper(type); } @@ -32268,14 +33692,20 @@ var ts; return getAnonymousTypeInstantiation(type, mapper); } if (type.objectFlags & 4 /* Reference */) { - return createTypeReference(type.target, instantiateTypes(type.typeArguments, mapper)); + var typeArguments = type.typeArguments; + var newTypeArguments = instantiateTypes(typeArguments, mapper); + return newTypeArguments !== typeArguments ? createTypeReference(type.target, newTypeArguments) : type; } } if (type.flags & 131072 /* Union */ && !(type.flags & 16382 /* Primitive */)) { - return getUnionType(instantiateTypes(type.types, mapper), 1 /* Literal */, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getUnionType(newTypes, 1 /* Literal */, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 262144 /* Intersection */) { - return getIntersectionType(instantiateTypes(type.types, mapper), type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)); + var types = type.types; + var newTypes = instantiateTypes(types, mapper); + return newTypes !== types ? getIntersectionType(newTypes, type.aliasSymbol, instantiateTypes(type.aliasTypeArguments, mapper)) : type; } if (type.flags & 524288 /* Index */) { return getIndexType(instantiateType(type.type, mapper)); @@ -32283,41 +33713,51 @@ var ts; if (type.flags & 1048576 /* IndexedAccess */) { return getIndexedAccessType(instantiateType(type.objectType, mapper), instantiateType(type.indexType, mapper)); } + if (type.flags & 2097152 /* Conditional */) { + return getConditionalTypeInstantiation(type, combineTypeMappers(type.mapper, mapper)); + } + if (type.flags & 4194304 /* Substitution */) { + return instantiateType(type.typeVariable, mapper); + } } return type; } + function getWildcardInstantiation(type) { + return type.flags & (16382 /* Primitive */ | 1 /* Any */ | 16384 /* Never */) ? type : + type.wildcardInstantiation || (type.wildcardInstantiation = instantiateType(type, wildcardMapper)); + } function instantiateIndexInfo(info, mapper) { return info && createIndexInfo(instantiateType(info.type, mapper), info.isReadonly, info.declaration); } // Returns true if the given expression contains (at any level of nesting) a function or arrow expression // that is subject to contextual typing. function isContextSensitive(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: return isContextSensitiveFunctionLikeDeclaration(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.forEach(node.properties, isContextSensitive); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.forEach(node.elements, isContextSensitive); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isContextSensitive(node.whenTrue) || isContextSensitive(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return node.operatorToken.kind === 54 /* BarBarToken */ && (isContextSensitive(node.left) || isContextSensitive(node.right)); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return isContextSensitive(node.initializer); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isContextSensitive(node.expression); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.forEach(node.properties, isContextSensitive); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: // If there is no initializer, JSX attribute has a boolean value of true which is not context sensitive. return node.initializer && isContextSensitive(node.initializer); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: // It is possible to that node.expression is undefined (e.g
) return node.expression && isContextSensitive(node.expression); } @@ -32332,7 +33772,7 @@ var ts; if (ts.forEach(node.parameters, function (p) { return !ts.getEffectiveTypeAnnotationNode(p); })) { return true; } - if (node.kind !== 188 /* ArrowFunction */) { + if (node.kind !== 191 /* ArrowFunction */) { // If the first parameter is not an explicit 'this' parameter, then the function has // an implicit 'this' parameter which is subject to contextual typing. var parameter = ts.firstOrUndefined(node.parameters); @@ -32341,7 +33781,7 @@ var ts; } } // TODO(anhans): A block should be context-sensitive if it has a context-sensitive return value. - return node.body.kind === 208 /* Block */ ? false : isContextSensitive(node.body); + return node.body.kind === 211 /* Block */ ? false : isContextSensitive(node.body); } function isContextSensitiveFunctionOrObjectLiteralMethod(func) { return (isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func); @@ -32390,7 +33830,7 @@ var ts; function isTypeDerivedFrom(source, target) { return source.flags & 131072 /* Union */ ? ts.every(source.types, function (t) { return isTypeDerivedFrom(t, target); }) : target.flags & 131072 /* Union */ ? ts.some(target.types, function (t) { return isTypeDerivedFrom(source, t); }) : - source.flags & 1081344 /* TypeVariable */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : + source.flags & 7372800 /* InstantiableNonPrimitive */ ? isTypeDerivedFrom(getBaseConstraintOfType(source) || emptyObjectType, target) : target === globalObjectType || target === globalFunctionType ? isTypeSubtypeOf(source, target) : hasBaseType(source, getTargetType(target)); } @@ -32440,8 +33880,8 @@ var ts; source = instantiateSignatureInContextOf(source, target, /*contextualMapper*/ undefined, compareTypes); } var kind = target.declaration ? target.declaration.kind : 0 /* Unknown */; - var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 152 /* MethodDeclaration */ && - kind !== 151 /* MethodSignature */ && kind !== 153 /* Constructor */; + var strictVariance = !callbackCheck && strictFunctionTypes && kind !== 153 /* MethodDeclaration */ && + kind !== 152 /* MethodSignature */ && kind !== 154 /* Constructor */; var result = -1 /* True */; var sourceThisType = getThisTypeOfSignature(source); if (sourceThisType && sourceThisType !== voidType) { @@ -32529,13 +33969,12 @@ var ts; return 0 /* False */; } if (source.kind === 1 /* Identifier */) { - var sourcePredicate = source; var targetPredicate = target; - var sourceIndex = sourcePredicate.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); + var sourceIndex = source.parameterIndex - (ts.getThisParameter(sourceDeclaration) ? 1 : 0); var targetIndex = targetPredicate.parameterIndex - (ts.getThisParameter(targetDeclaration) ? 1 : 0); if (sourceIndex !== targetIndex) { if (reportErrors) { - errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, sourcePredicate.parameterName, targetPredicate.parameterName); + errorReporter(ts.Diagnostics.Parameter_0_is_not_in_the_same_position_as_parameter_1, source.parameterName, targetPredicate.parameterName); errorReporter(ts.Diagnostics.Type_predicate_0_is_not_assignable_to_1, typePredicateToString(source), typePredicateToString(target)); } return 0 /* False */; @@ -32593,7 +34032,7 @@ var ts; } function isEmptyObjectType(type) { return type.flags & 65536 /* Object */ ? isEmptyResolvedType(resolveStructuredTypeMembers(type)) : - type.flags & 33554432 /* NonPrimitive */ ? true : + type.flags & 134217728 /* NonPrimitive */ ? true : type.flags & 131072 /* Union */ ? ts.forEach(type.types, isEmptyObjectType) : type.flags & 262144 /* Intersection */ ? !ts.forEach(type.types, function (t) { return !isEmptyObjectType(t); }) : false; @@ -32631,7 +34070,7 @@ var ts; function isSimpleTypeRelatedTo(source, target, relation, errorReporter) { var s = source.flags; var t = target.flags; - if (t & 1 /* Any */ || s & 16384 /* Never */) + if (t & 1 /* Any */ || s & 16384 /* Never */ || source === wildcardType) return true; if (t & 16384 /* Never */) return false; @@ -32665,11 +34104,11 @@ var ts; return true; if (s & 8192 /* Null */ && (!strictNullChecks || t & 8192 /* Null */)) return true; - if (s & 65536 /* Object */ && t & 33554432 /* NonPrimitive */) + if (s & 65536 /* Object */ && t & 134217728 /* NonPrimitive */) return true; if (s & 1024 /* UniqueESSymbol */ || t & 1024 /* UniqueESSymbol */) return false; - if (relation === assignableRelation || relation === comparableRelation) { + if (relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) { if (s & 1 /* Any */) return true; // Type number or any numeric literal type is assignable to any numeric enum type or any @@ -32681,10 +34120,10 @@ var ts; return false; } function isTypeRelatedTo(source, target, relation) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } if (source === target || @@ -32698,13 +34137,13 @@ var ts; return related === 1 /* Succeeded */; } } - if (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */) { + if (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */) { return checkTypeRelatedTo(source, target, relation, /*errorNode*/ undefined); } return false; } function isIgnoredJsxProperty(source, sourceProp, targetMemberType) { - return source.flags & 67108864 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); + return ts.getObjectFlags(source) & 4096 /* JsxAttributes */ && !(isUnhyphenatedJsxName(sourceProp.escapedName) || targetMemberType); } /** * Checks if 'source' is related to 'target' (e.g.: is a assignable to). @@ -32812,12 +34251,18 @@ var ts; * * Ternary.False if they are not related. */ function isRelatedTo(source, target, reportErrors, headMessage) { - if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 2097152 /* FreshLiteral */) { + if (source.flags & 96 /* StringOrNumberLiteral */ && source.flags & 8388608 /* FreshLiteral */) { source = source.regularType; } - if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 2097152 /* FreshLiteral */) { + if (target.flags & 96 /* StringOrNumberLiteral */ && target.flags & 8388608 /* FreshLiteral */) { target = target.regularType; } + if (source.flags & 4194304 /* Substitution */) { + source = relation === definitelyAssignableRelation ? source.typeVariable : source.substitute; + } + if (target.flags & 4194304 /* Substitution */) { + target = target.typeVariable; + } // both types are the same - covers 'they are the same primitive type or both are Any' or the same type parameter cases if (source === target) return -1 /* True */; @@ -32827,8 +34272,9 @@ var ts; if (relation === comparableRelation && !(target.flags & 16384 /* Never */) && isSimpleTypeRelatedTo(target, source, relation) || isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined)) return -1 /* True */; - if (isObjectLiteralType(source) && source.flags & 2097152 /* FreshLiteral */) { - if (hasExcessProperties(source, target, reportErrors)) { + if (isObjectLiteralType(source) && source.flags & 8388608 /* FreshLiteral */) { + var discriminantType = target.flags & 131072 /* Union */ ? findMatchingDiscriminantType(source, target) : undefined; + if (hasExcessProperties(source, target, discriminantType, reportErrors)) { if (reportErrors) { reportRelationError(headMessage, source, target); } @@ -32838,7 +34284,7 @@ var ts; // and intersection types are further deconstructed on the target side, we don't want to // make the check again (as it might fail for a partial target type). Therefore we obtain // the regular source type and proceed with that. - if (isUnionOrIntersectionTypeWithoutNullableConstituents(target)) { + if (isUnionOrIntersectionTypeWithoutNullableConstituents(target) && !discriminantType) { source = getRegularTypeOfObjectLiteral(source); } } @@ -32899,7 +34345,7 @@ var ts; // breaking the intersection apart. result = someTypeRelatedToType(source, target, /*reportErrors*/ false); } - if (!result && (source.flags & 2064384 /* StructuredOrTypeVariable */ || target.flags & 2064384 /* StructuredOrTypeVariable */)) { + if (!result && (source.flags & 8355840 /* StructuredOrInstantiable */ || target.flags & 8355840 /* StructuredOrInstantiable */)) { if (result = recursiveTypeRelatedTo(source, target, reportErrors)) { errorInfo = saveErrorInfo; } @@ -32919,32 +34365,55 @@ var ts; } function isIdenticalTo(source, target) { var result; - if (source.flags & 65536 /* Object */ && target.flags & 65536 /* Object */) { + var flags = source.flags & target.flags; + if (flags & 65536 /* Object */) { return recursiveTypeRelatedTo(source, target, /*reportErrors*/ false); } - if (source.flags & 131072 /* Union */ && target.flags & 131072 /* Union */ || - source.flags & 262144 /* Intersection */ && target.flags & 262144 /* Intersection */) { + if (flags & (131072 /* Union */ | 262144 /* Intersection */)) { if (result = eachTypeRelatedToSomeType(source, target)) { if (result &= eachTypeRelatedToSomeType(target, source)) { return result; } } } + if (flags & 524288 /* Index */) { + return isRelatedTo(source.type, target.type, /*reportErrors*/ false); + } + if (flags & 1048576 /* IndexedAccess */) { + if (result = isRelatedTo(source.objectType, target.objectType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.indexType, target.indexType, /*reportErrors*/ false)) { + return result; + } + } + } + if (flags & 2097152 /* Conditional */) { + if (source.root.isDistributive === target.root.isDistributive) { + if (result = isRelatedTo(source.checkType, target.checkType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(source.extendsType, target.extendsType, /*reportErrors*/ false)) { + if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), /*reportErrors*/ false)) { + if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), /*reportErrors*/ false)) { + return result; + } + } + } + } + } + } + if (flags & 4194304 /* Substitution */) { + return isRelatedTo(source.substitute, target.substitute, /*reportErrors*/ false); + } return 0 /* False */; } - function hasExcessProperties(source, target, reportErrors) { + function hasExcessProperties(source, target, discriminant, reportErrors) { if (maybeTypeOfKind(target, 65536 /* Object */) && !(ts.getObjectFlags(target) & 512 /* ObjectLiteralPatternWithComputedProperties */)) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); - if ((relation === assignableRelation || relation === comparableRelation) && + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); + if ((relation === assignableRelation || relation === definitelyAssignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target) || (!isComparingJsxAttributes && isEmptyObjectType(target)))) { return false; } - if (target.flags & 131072 /* Union */) { - var discriminantType = findMatchingDiscriminantType(source, target); - if (discriminantType) { - // check excess properties against discriminant type only, not the entire union - return hasExcessProperties(source, discriminantType, reportErrors); - } + if (discriminant) { + // check excess properties against discriminant type only, not the entire union + return hasExcessProperties(source, discriminant, /*discriminant*/ undefined, reportErrors); } var _loop_4 = function (prop) { if (!isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -33208,6 +34677,9 @@ var ts; } return result; } + function getConstraintForRelation(type) { + return relation === definitelyAssignableRelation ? undefined : getConstraintOfType(type); + } function structuredTypeRelatedTo(source, target, reportErrors) { var result; var originalErrorInfo; @@ -33215,7 +34687,7 @@ var ts; if (target.flags & 32768 /* TypeParameter */) { // A source type { [P in keyof T]: X } is related to a target type T if X is related to T[P]. if (ts.getObjectFlags(source) & 32 /* Mapped */ && getConstraintTypeFromMappedType(source) === getIndexType(target)) { - if (!source.declaration.questionToken) { + if (!(getMappedTypeModifiers(source) & 4 /* IncludeOptional */)) { var templateType = getTemplateTypeFromMappedType(source); var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source)); if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) { @@ -33233,7 +34705,7 @@ var ts; } // A type S is assignable to keyof T if S is assignable to keyof C, where C is the // constraint of T. - var constraint = getConstraintOfType(target.type); + var constraint = getConstraintForRelation(target.type); if (constraint) { if (result = isRelatedTo(source, getIndexType(constraint), reportErrors)) { return result; @@ -33242,8 +34714,8 @@ var ts; } else if (target.flags & 1048576 /* IndexedAccess */) { // A type S is related to a type T[K] if S is related to A[K], where K is string-like and - // A is the constraint of T. - var constraint = getConstraintOfIndexedAccess(target); + // A is the apparent type of T. + var constraint = getConstraintForRelation(target); if (constraint) { if (result = isRelatedTo(source, constraint, reportErrors)) { errorInfo = saveErrorInfo; @@ -33251,19 +34723,30 @@ var ts; } } } - else if (isGenericMappedType(target) && !isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { - // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. - var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); - var templateType = getTemplateTypeFromMappedType(target); - if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { - errorInfo = saveErrorInfo; - return result; + else if (isGenericMappedType(target)) { + // A source type T is related to a target type { [P in X]: T[P] } + var template = getTemplateTypeFromMappedType(target); + var modifiers = getMappedTypeModifiers(target); + if (!(modifiers & 8 /* ExcludeOptional */)) { + if (template.flags & 1048576 /* IndexedAccess */ && template.objectType === source && + template.indexType === getTypeParameterFromMappedType(target)) { + return -1 /* True */; + } + // A source type T is related to a target type { [P in keyof T]: X } if T[P] is related to X. + if (!isGenericMappedType(source) && getConstraintTypeFromMappedType(target) === getIndexType(source)) { + var indexedAccessType = getIndexedAccessType(source, getTypeParameterFromMappedType(target)); + var templateType = getTemplateTypeFromMappedType(target); + if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } } } if (source.flags & 32768 /* TypeParameter */) { - var constraint = getConstraintOfTypeParameter(source); + var constraint = getConstraintForRelation(source); // A type parameter with no constraint is not related to the non-primitive object type. - if (constraint || !(target.flags & 33554432 /* NonPrimitive */)) { + if (constraint || !(target.flags & 134217728 /* NonPrimitive */)) { if (!constraint || constraint.flags & 1 /* Any */) { constraint = emptyObjectType; } @@ -33277,8 +34760,8 @@ var ts; } else if (source.flags & 1048576 /* IndexedAccess */) { // A type S[K] is related to a type T if A[K] is related to T, where K is string-like and - // A is the constraint of S. - var constraint = getConstraintOfIndexedAccess(source); + // A is the apparent type of S. + var constraint = getConstraintForRelation(source); if (constraint) { if (result = isRelatedTo(constraint, target, reportErrors)) { errorInfo = saveErrorInfo; @@ -33295,9 +34778,39 @@ var ts; } } } + else if (source.flags & 2097152 /* Conditional */) { + if (target.flags & 2097152 /* Conditional */) { + if (isTypeIdenticalTo(source.checkType, target.checkType) && + isTypeIdenticalTo(source.extendsType, target.extendsType)) { + if (result = isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), reportErrors)) { + result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors); + } + if (result) { + errorInfo = saveErrorInfo; + return result; + } + } + } + else if (relation !== definitelyAssignableRelation) { + var distributiveConstraint = getConstraintOfDistributiveConditionalType(source); + if (distributiveConstraint) { + if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + var defaultConstraint = getDefaultConstraintOfConditionalType(source); + if (defaultConstraint) { + if (result = isRelatedTo(defaultConstraint, target, reportErrors)) { + errorInfo = saveErrorInfo; + return result; + } + } + } + } else { if (ts.getObjectFlags(source) & 4 /* Reference */ && ts.getObjectFlags(target) & 4 /* Reference */ && source.target === target.target && - !(source.flags & 134217728 /* MarkerType */ || target.flags & 134217728 /* MarkerType */)) { + !(ts.getObjectFlags(source) & 8192 /* MarkerType */ || ts.getObjectFlags(target) & 8192 /* MarkerType */)) { // We have type references to the same generic type, and the type references are not marker // type references (which are intended by be compared structurally). Obtain the variance // information for the type parameters and relate the type arguments accordingly. @@ -33379,8 +34892,7 @@ var ts; // that S and T are contra-variant whereas X and Y are co-variant. function mappedTypeRelatedTo(source, target, reportErrors) { var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : - !(getCombinedMappedTypeModifiers(source) & 2 /* Optional */) || - getCombinedMappedTypeModifiers(target) & 2 /* Optional */); + getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); if (modifiersRelated) { var result_1; if (result_1 = isRelatedTo(getConstraintTypeFromMappedType(target), getConstraintTypeFromMappedType(source), reportErrors)) { @@ -33506,7 +35018,7 @@ var ts; return false; } function hasCommonProperties(source, target) { - var isComparingJsxAttributes = !!(source.flags & 67108864 /* JsxAttributes */); + var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 4096 /* JsxAttributes */); for (var _i = 0, _a = getPropertiesOfType(source); _i < _a.length; _i++) { var prop = _a[_i]; if (isKnownProperty(target, prop.escapedName, isComparingJsxAttributes)) { @@ -33639,6 +35151,11 @@ var ts; if (isIgnoredJsxProperty(source, prop, /*targetMemberType*/ undefined)) { continue; } + // Skip over symbol-named members + var nameType = getLiteralTypeFromPropertyName(prop); + if (nameType !== undefined && !(isRelatedTo(nameType, stringType) || isRelatedTo(nameType, numberType))) { + continue; + } if (kind === 0 /* String */ || isNumericLiteralName(prop.escapedName)) { var related = isRelatedTo(getTypeOfSymbol(prop), target, reportErrors); if (!related) { @@ -33735,7 +35252,7 @@ var ts; // type, and flag the result as a marker type reference. function getMarkerTypeReference(type, source, target) { var result = createTypeReference(type, ts.map(type.typeParameters, function (t) { return t === source ? target : t; })); - result.flags |= 134217728 /* MarkerType */; + result.objectFlags |= 8192 /* MarkerType */; return result; } // Return an array containing the variance of each type parameter. The variance is effectively @@ -34083,8 +35600,8 @@ var ts; } function getWidenedLiteralType(type) { return type.flags & 256 /* EnumLiteral */ ? getBaseTypeOfEnumLiteralType(type) : - type.flags & 32 /* StringLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? stringType : - type.flags & 64 /* NumberLiteral */ && type.flags & 2097152 /* FreshLiteral */ ? numberType : + type.flags & 32 /* StringLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? stringType : + type.flags & 64 /* NumberLiteral */ && type.flags & 8388608 /* FreshLiteral */ ? numberType : type.flags & 128 /* BooleanLiteral */ ? booleanType : type.flags & 131072 /* Union */ ? getUnionType(ts.sameMap(type.types, getWidenedLiteralType)) : type; @@ -34158,8 +35675,18 @@ var ts; ts.Debug.assert(strictNullChecks); return type.flags & 4096 /* Undefined */ ? type : getUnionType([type, undefinedType]); } + function getGlobalNonNullableTypeInstantiation(type) { + if (!deferredGlobalNonNullableTypeAlias) { + deferredGlobalNonNullableTypeAlias = getGlobalSymbol("NonNullable", 524288 /* TypeAlias */, /*diagnostic*/ undefined) || unknownSymbol; + } + // Use NonNullable global type alias if available to improve quick info/declaration emit + if (deferredGlobalNonNullableTypeAlias !== unknownSymbol) { + return getTypeAliasInstantiation(deferredGlobalNonNullableTypeAlias, [type]); + } + return getTypeWithFacts(type, 524288 /* NEUndefinedOrNull */); // Type alias unavailable, fall back to non-higherorder behavior + } function getNonNullableType(type) { - return strictNullChecks ? getTypeWithFacts(type, 524288 /* NEUndefinedOrNull */) : type; + return strictNullChecks ? getGlobalNonNullableTypeInstantiation(type) : type; } /** * Return true if type was inferred from an object literal, written as an object type literal, or is the shape of a module @@ -34196,7 +35723,7 @@ var ts; * Leave signatures alone since they are not subject to the check. */ function getRegularTypeOfObjectLiteral(type) { - if (!(isObjectLiteralType(type) && type.flags & 2097152 /* FreshLiteral */)) { + if (!(isObjectLiteralType(type) && type.flags & 8388608 /* FreshLiteral */)) { return type; } var regularType = type.regularType; @@ -34206,7 +35733,7 @@ var ts; var resolved = type; var members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral); var regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.stringIndexInfo, resolved.numberIndexInfo); - regularNew.flags = resolved.flags & ~2097152 /* FreshLiteral */; + regularNew.flags = resolved.flags & ~8388608 /* FreshLiteral */; regularNew.objectFlags |= 128 /* ObjectLiteral */; type.regularType = regularNew; return regularNew; @@ -34261,6 +35788,10 @@ var ts; } var result = createSymbol(4 /* Property */ | 16777216 /* Optional */, name); result.type = undefinedType; + var associatedKeyType = getLiteralType(ts.unescapeLeadingUnderscores(name)); + if (associatedKeyType.flags & 32 /* StringLiteral */) { + result.nameType = associatedKeyType; + } undefinedProperties.set(name, result); return result; } @@ -34288,7 +35819,7 @@ var ts; return getWidenedTypeWithContext(type, /*context*/ undefined); } function getWidenedTypeWithContext(type, context) { - if (type.flags & 12582912 /* RequiresWidening */) { + if (type.flags & 50331648 /* RequiresWidening */) { if (type.flags & 12288 /* Nullable */) { return anyType; } @@ -34322,7 +35853,7 @@ var ts; */ function reportWideningErrorsInType(type) { var errorReported = false; - if (type.flags & 4194304 /* ContainsWideningType */) { + if (type.flags & 16777216 /* ContainsWideningType */) { if (type.flags & 131072 /* Union */) { if (ts.some(type.types, isEmptyObjectType)) { errorReported = true; @@ -34348,9 +35879,9 @@ var ts; for (var _d = 0, _e = getPropertiesOfObjectType(type); _d < _e.length; _d++) { var p = _e[_d]; var t = getTypeOfSymbol(p); - if (t.flags & 4194304 /* ContainsWideningType */) { + if (t.flags & 16777216 /* ContainsWideningType */) { if (!reportWideningErrorsInType(t)) { - error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, ts.symbolName(p), typeToString(getWidenedType(t))); + error(p.valueDeclaration, ts.Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t))); } errorReported = true; } @@ -34363,32 +35894,32 @@ var ts; var typeAsString = typeToString(getWidenedType(type)); var diagnostic; switch (declaration.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: diagnostic = ts.Diagnostics.Member_0_implicitly_has_an_1_type; break; - case 147 /* Parameter */: + case 148 /* Parameter */: diagnostic = declaration.dotDotDotToken ? ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type : ts.Diagnostics.Parameter_0_implicitly_has_an_1_type; break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: diagnostic = ts.Diagnostics.Binding_element_0_implicitly_has_an_1_type; break; - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: if (!declaration.name) { error(declaration, ts.Diagnostics.Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type, typeAsString); return; } diagnostic = ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type; break; - case 173 /* MappedType */: + case 176 /* MappedType */: error(declaration, ts.Diagnostics.Mapped_object_type_implicitly_has_an_any_template_type); return; default: @@ -34397,7 +35928,7 @@ var ts; error(declaration, diagnostic, ts.declarationNameToString(ts.getNameOfDeclaration(declaration)), typeAsString); } function reportErrorsFromWidening(declaration, type) { - if (produceDiagnostics && noImplicitAny && type.flags & 4194304 /* ContainsWideningType */) { + if (produceDiagnostics && noImplicitAny && type.flags & 16777216 /* ContainsWideningType */) { // Report implicit any error within type if possible, otherwise report error on declaration if (!reportWideningErrorsInType(type)) { reportImplicitAnyError(declaration, type); @@ -34424,9 +35955,10 @@ var ts; callback(getTypeAtPosition(source, i), getTypeAtPosition(target, i)); } } - function createInferenceContext(signature, flags, compareTypes, baseInferences) { - var inferences = baseInferences ? ts.map(baseInferences, cloneInferenceInfo) : ts.map(signature.typeParameters, createInferenceInfo); + function createInferenceContext(typeParameters, signature, flags, compareTypes, baseInferences) { + var inferences = baseInferences ? baseInferences.map(cloneInferenceInfo) : typeParameters.map(createInferenceInfo); var context = mapper; + context.typeParameters = typeParameters; context.signature = signature; context.inferences = inferences; context.flags = flags; @@ -34469,7 +36001,7 @@ var ts; // results for union and intersection types for performance reasons. function couldContainTypeVariables(type) { var objectFlags = ts.getObjectFlags(type); - return !!(type.flags & (1081344 /* TypeVariable */ | 524288 /* Index */) || + return !!(type.flags & 7897088 /* Instantiable */ || objectFlags & 4 /* Reference */ && ts.forEach(type.typeArguments, couldContainTypeVariables) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 2048 /* TypeLiteral */ | 32 /* Class */) || objectFlags & 32 /* Mapped */ || @@ -34528,7 +36060,7 @@ var ts; // is incomplete and we can't infer a meaningful input type. for (var _i = 0, properties_4 = properties; _i < properties_4.length; _i++) { var prop = properties_4[_i]; - if (getTypeOfSymbol(prop).flags & 16777216 /* ContainsAnyFunctionType */) { + if (getTypeOfSymbol(prop).flags & 67108864 /* ContainsAnyFunctionType */) { return undefined; } } @@ -34545,9 +36077,7 @@ var ts; var templateType = getTemplateTypeFromMappedType(target); var inference = createInferenceInfo(typeParameter); inferTypes([inference], sourceType, templateType); - return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : - inference.contraCandidates ? getCommonSubtype(inference.contraCandidates) : - emptyObjectType; + return getTypeFromInference(inference); } function getUnmatchedProperty(source, target, requireOptionalProperties) { var properties = target.flags & 262144 /* Intersection */ ? getPropertiesOfUnionOrIntersectionType(target) : getPropertiesOfObjectType(target); @@ -34562,16 +36092,32 @@ var ts; } return undefined; } + function getTypeFromInference(inference) { + return inference.candidates ? getUnionType(inference.candidates, 2 /* Subtype */) : + inference.contraCandidates ? getIntersectionType(inference.contraCandidates) : + emptyObjectType; + } function inferTypes(inferences, originalSource, originalTarget, priority) { if (priority === void 0) { priority = 0; } var symbolStack; var visited; var contravariant = false; + var propagationType; inferFromTypes(originalSource, originalTarget); function inferFromTypes(source, target) { if (!couldContainTypeVariables(target)) { return; } + if (source === wildcardType) { + // We are inferring from an 'any' type. We want to infer this type for every type parameter + // referenced in the target type, so we record it as the propagation type and infer from the + // target to itself. Then, as we find candidates we substitute the propagation type. + var savePropagationType = propagationType; + propagationType = source; + inferFromTypes(target, target); + propagationType = savePropagationType; + return; + } if (source.aliasSymbol && source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol) { // Source and target are types originating in the same generic type alias declaration. // Simply infer from source type arguments to target type arguments. @@ -34629,7 +36175,7 @@ var ts; // not contain anyFunctionType when we come back to this argument for its second round // of inference. Also, we exclude inferences for silentNeverType (which is used as a wildcard // when constructing types from type parameters that had no inference candidates). - if (source.flags & 16777216 /* ContainsAnyFunctionType */ || source === silentNeverType) { + if (source.flags & 67108864 /* ContainsAnyFunctionType */ || source === silentNeverType) { return; } var inference = getInferenceInfoForType(target); @@ -34641,14 +36187,15 @@ var ts; inference.priority = priority; } if (priority === inference.priority) { + var candidate = propagationType || source; if (contravariant) { - inference.contraCandidates = ts.append(inference.contraCandidates, source); + inference.contraCandidates = ts.append(inference.contraCandidates, candidate); } else { - inference.candidates = ts.append(inference.candidates, source); + inference.candidates = ts.append(inference.candidates, candidate); } } - if (!(priority & 4 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { + if (!(priority & 8 /* ReturnType */) && target.flags & 32768 /* TypeParameter */ && !isTypeParameterAtTopLevel(originalTarget, target)) { inference.topLevel = false; } } @@ -34678,13 +36225,22 @@ var ts; else if ((isLiteralType(source) || source.flags & 2 /* String */) && target.flags & 524288 /* Index */) { var empty = createEmptyObjectTypeFromStringLiteral(source); contravariant = !contravariant; + var savePriority = priority; + priority |= 16 /* LiteralKeyof */; inferFromTypes(empty, target.type); + priority = savePriority; contravariant = !contravariant; } else if (source.flags & 1048576 /* IndexedAccess */ && target.flags & 1048576 /* IndexedAccess */) { inferFromTypes(source.objectType, target.objectType); inferFromTypes(source.indexType, target.indexType); } + else if (source.flags & 2097152 /* Conditional */ && target.flags & 2097152 /* Conditional */) { + inferFromTypes(source.checkType, target.checkType); + inferFromTypes(source.extendsType, target.extendsType); + inferFromTypes(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target)); + inferFromTypes(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target)); + } else if (target.flags & 393216 /* UnionOrIntersection */) { var targetTypes = target.types; var typeVariableCount = 0; @@ -34719,7 +36275,9 @@ var ts; } } else { - source = getApparentType(source); + if (!(priority & 32 /* NoConstraints */ && source.flags & (262144 /* Intersection */ | 7897088 /* Instantiable */))) { + source = getApparentType(source); + } if (source.flags & (65536 /* Object */ | 262144 /* Intersection */)) { var key = source.id + "," + target.id; if (visited && visited.get(key)) { @@ -34748,7 +36306,7 @@ var ts; } } function inferFromContravariantTypes(source, target) { - if (strictFunctionTypes) { + if (strictFunctionTypes || priority & 64 /* AlwaysStrict */) { contravariant = !contravariant; inferFromTypes(source, target); contravariant = !contravariant; @@ -34787,7 +36345,7 @@ var ts; var inferredType = inferTypeForHomomorphicMappedType(source, target); if (inferredType) { var savePriority = priority; - priority |= 2 /* MappedType */; + priority |= 2 /* HomomorphicMappedType */; inferFromTypes(inferredType, inference.typeParameter); priority = savePriority; } @@ -34797,7 +36355,10 @@ var ts; if (constraintType.flags & 32768 /* TypeParameter */) { // We're inferring from some source type S to a mapped type { [P in T]: X }, where T is a type // parameter. Infer from 'keyof S' to T and infer from a union of each property type in S to X. + var savePriority = priority; + priority |= 4 /* MappedTypeConstraint */; inferFromTypes(getIndexType(source), constraintType); + priority = savePriority; inferFromTypes(getUnionType(ts.map(getPropertiesOfType(source), getTypeOfSymbol)), getTemplateTypeFromMappedType(target)); return; } @@ -34902,62 +36463,73 @@ var ts; } return candidates; } + function getContravariantInference(inference) { + return inference.priority & 28 /* PriorityImpliesCombination */ ? getIntersectionType(inference.contraCandidates) : getCommonSubtype(inference.contraCandidates); + } + function getCovariantInference(inference, context, signature) { + // Extract all object literal types and replace them with a single widened and normalized type. + var candidates = widenObjectLiteralCandidates(inference.candidates); + // We widen inferred literal types if + // all inferences were made to top-level occurrences of the type parameter, and + // the type parameter has no constraint or its constraint includes no primitive or literal types, and + // the type parameter was fixed during inference or does not occur at top-level in the return type. + var widenLiteralTypes = inference.topLevel && + !hasPrimitiveConstraint(inference.typeParameter) && + (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); + var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates; + // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if + // union types were requested or if all inferences were made from the return type position, infer a + // union type. Otherwise, infer a common supertype. + var unwidenedType = context.flags & 1 /* InferUnionTypes */ || inference.priority & 28 /* PriorityImpliesCombination */ ? + getUnionType(baseCandidates, 2 /* Subtype */) : + getCommonSupertype(baseCandidates); + return getWidenedType(unwidenedType); + } function getInferredType(context, index) { var inference = context.inferences[index]; var inferredType = inference.inferredType; if (!inferredType) { - if (inference.candidates) { - // Extract all object literal types and replace them with a single widened and normalized type. - var candidates = widenObjectLiteralCandidates(inference.candidates); - // We widen inferred literal types if - // all inferences were made to top-level ocurrences of the type parameter, and - // the type parameter has no constraint or its constraint includes no primitive or literal types, and - // the type parameter was fixed during inference or does not occur at top-level in the return type. - var signature = context.signature; - var widenLiteralTypes = inference.topLevel && - !hasPrimitiveConstraint(inference.typeParameter) && - (inference.isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), inference.typeParameter)); - var baseCandidates = widenLiteralTypes ? ts.sameMap(candidates, getWidenedLiteralType) : candidates; - // If all inferences were made from contravariant positions, infer a common subtype. Otherwise, if - // union types were requested or if all inferences were made from the return type position, infer a - // union type. Otherwise, infer a common supertype. - var unwidenedType = context.flags & 1 /* InferUnionTypes */ || inference.priority & 4 /* ReturnType */ ? - getUnionType(baseCandidates, 2 /* Subtype */) : - getCommonSupertype(baseCandidates); - inferredType = getWidenedType(unwidenedType); - // If we have inferred 'never' but have contravariant candidates. To get a more specific type we - // infer from the contravariant candidates instead. - if (inferredType.flags & 16384 /* Never */ && inference.contraCandidates) { - inferredType = getCommonSubtype(inference.contraCandidates); + var signature = context.signature; + if (signature) { + if (inference.candidates) { + inferredType = getCovariantInference(inference, context, signature); + // If we have inferred 'never' but have contravariant candidates. To get a more specific type we + // infer from the contravariant candidates instead. + if (inferredType.flags & 16384 /* Never */ && inference.contraCandidates) { + inferredType = getContravariantInference(inference); + } } - } - else if (inference.contraCandidates) { - // We only have contravariant inferences, infer the best common subtype of those - inferredType = getCommonSubtype(inference.contraCandidates); - } - else if (context.flags & 2 /* NoDefault */) { - // We use silentNeverType as the wildcard that signals no inferences. - inferredType = silentNeverType; - } - else { - // Infer either the default or the empty object type when no inferences were - // made. It is important to remember that in this case, inference still - // succeeds, meaning there is no error for not having inference candidates. An - // inference error only occurs when there are *conflicting* candidates, i.e. - // candidates with no common supertype. - var defaultType = getDefaultFromTypeParameter(inference.typeParameter); - if (defaultType) { - // Instantiate the default type. Any forward reference to a type - // parameter should be instantiated to the empty object type. - inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), context)); + else if (inference.contraCandidates) { + // We only have contravariant inferences, infer the best common subtype of those + inferredType = getContravariantInference(inference); + } + else if (context.flags & 2 /* NoDefault */) { + // We use silentNeverType as the wildcard that signals no inferences. + inferredType = silentNeverType; } else { - inferredType = getDefaultTypeArgumentType(!!(context.flags & 4 /* AnyDefault */)); + // Infer either the default or the empty object type when no inferences were + // made. It is important to remember that in this case, inference still + // succeeds, meaning there is no error for not having inference candidates. An + // inference error only occurs when there are *conflicting* candidates, i.e. + // candidates with no common supertype. + var defaultType = getDefaultFromTypeParameter(inference.typeParameter); + if (defaultType) { + // Instantiate the default type. Any forward reference to a type + // parameter should be instantiated to the empty object type. + inferredType = instantiateType(defaultType, combineTypeMappers(createBackreferenceMapper(context.signature.typeParameters, index), context)); + } + else { + inferredType = getDefaultTypeArgumentType(!!(context.flags & 4 /* AnyDefault */)); + } } } + else { + inferredType = getTypeFromInference(inference); + } inferredType = getWidenedUniqueESSymbolType(inferredType); inference.inferredType = inferredType; - var constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]); + var constraint = getConstraintOfTypeParameter(inference.typeParameter); if (constraint) { var instantiatedConstraint = instantiateType(constraint, context); if (!context.compareTypes(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) { @@ -34982,7 +36554,7 @@ var ts; var links = getNodeLinks(node); if (!links.resolvedSymbol) { links.resolvedSymbol = !ts.nodeIsMissing(node) && - resolveName(node, node.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), + resolveName(node, node.escapedText, 67216319 /* Value */ | 1048576 /* ExportValue */, ts.Diagnostics.Cannot_find_name_0, node, !ts.isWriteOnlyAccess(node), /*excludeGlobals*/ false, ts.Diagnostics.Cannot_find_name_0_Did_you_mean_1) || unknownSymbol; } return links.resolvedSymbol; @@ -34991,7 +36563,7 @@ var ts; // TypeScript 1.0 spec (April 2014): 3.6.3 // A type query consists of the keyword typeof followed by an expression. // The expression is restricted to a single identifier or a sequence of identifiers separated by periods - return !!ts.findAncestor(node, function (n) { return n.kind === 163 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 144 /* QualifiedName */ ? false : "quit"; }); + return !!ts.findAncestor(node, function (n) { return n.kind === 164 /* TypeQuery */ ? true : n.kind === 71 /* Identifier */ || n.kind === 145 /* QualifiedName */ ? false : "quit"; }); } // Return the flow cache key for a "dotted name" (i.e. a sequence of identifiers // separated by dots). The key consists of the id of the symbol referenced by the @@ -35002,18 +36574,18 @@ var ts; function getFlowCacheKey(node) { if (node.kind === 71 /* Identifier */) { var symbol = getResolvedSymbol(node); - return symbol !== unknownSymbol ? (isApparentTypePosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; + return symbol !== unknownSymbol ? (isConstraintPosition(node) ? "@" : "") + getSymbolId(symbol) : undefined; } if (node.kind === 99 /* ThisKeyword */) { return "0"; } - if (node.kind === 180 /* PropertyAccessExpression */) { + if (node.kind === 183 /* PropertyAccessExpression */) { var key = getFlowCacheKey(node.expression); return key && key + "." + ts.idText(node.name); } - if (node.kind === 177 /* BindingElement */) { + if (node.kind === 180 /* BindingElement */) { var container = node.parent.parent; - var key = container.kind === 177 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); + var key = container.kind === 180 /* BindingElement */ ? getFlowCacheKey(container) : (container.initializer && getFlowCacheKey(container.initializer)); var text = getBindingElementNameText(node); var result = key && text && (key + "." + text); return result; @@ -35021,12 +36593,12 @@ var ts; return undefined; } function getBindingElementNameText(element) { - if (element.parent.kind === 175 /* ObjectBindingPattern */) { + if (element.parent.kind === 178 /* ObjectBindingPattern */) { var name = element.propertyName || element.name; switch (name.kind) { case 71 /* Identifier */: return ts.idText(name); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.isStringOrNumericLiteral(name.expression) ? name.expression.text : undefined; case 9 /* StringLiteral */: case 8 /* NumericLiteral */: @@ -35044,26 +36616,26 @@ var ts; switch (source.kind) { case 71 /* Identifier */: return target.kind === 71 /* Identifier */ && getResolvedSymbol(source) === getResolvedSymbol(target) || - (target.kind === 227 /* VariableDeclaration */ || target.kind === 177 /* BindingElement */) && + (target.kind === 230 /* VariableDeclaration */ || target.kind === 180 /* BindingElement */) && getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(source)) === getSymbolOfNode(target); case 99 /* ThisKeyword */: return target.kind === 99 /* ThisKeyword */; case 97 /* SuperKeyword */: return target.kind === 97 /* SuperKeyword */; - case 180 /* PropertyAccessExpression */: - return target.kind === 180 /* PropertyAccessExpression */ && + case 183 /* PropertyAccessExpression */: + return target.kind === 183 /* PropertyAccessExpression */ && source.name.escapedText === target.name.escapedText && isMatchingReference(source.expression, target.expression); - case 177 /* BindingElement */: - if (target.kind !== 180 /* PropertyAccessExpression */) + case 180 /* BindingElement */: + if (target.kind !== 183 /* PropertyAccessExpression */) return false; var t = target; if (t.name.escapedText !== getBindingElementNameText(source)) return false; - if (source.parent.parent.kind === 177 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { + if (source.parent.parent.kind === 180 /* BindingElement */ && isMatchingReference(source.parent.parent, t.expression)) { return true; } - if (source.parent.parent.kind === 227 /* VariableDeclaration */) { + if (source.parent.parent.kind === 230 /* VariableDeclaration */) { var maybeId = source.parent.parent.initializer; return maybeId && isMatchingReference(maybeId, t.expression); } @@ -35071,7 +36643,7 @@ var ts; return false; } function containsMatchingReference(source, target) { - while (source.kind === 180 /* PropertyAccessExpression */) { + while (source.kind === 183 /* PropertyAccessExpression */) { source = source.expression; if (isMatchingReference(source, target)) { return true; @@ -35084,7 +36656,7 @@ var ts; // a possible discriminant if its type differs in the constituents of containing union type, and if every // choice is a unit type or a union of unit types. function containsMatchingReferenceDiscriminant(source, target) { - return target.kind === 180 /* PropertyAccessExpression */ && + return target.kind === 183 /* PropertyAccessExpression */ && containsMatchingReference(source, target.expression) && isDiscriminantProperty(getDeclaredTypeOfReference(target.expression), target.name.escapedText); } @@ -35092,7 +36664,7 @@ var ts; if (expr.kind === 71 /* Identifier */) { return getTypeOfSymbol(getResolvedSymbol(expr)); } - if (expr.kind === 180 /* PropertyAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */) { var type = getDeclaredTypeOfReference(expr.expression); return type && getTypeOfPropertyOfType(type, expr.name.escapedText); } @@ -35136,7 +36708,7 @@ var ts; } } } - if (callExpression.expression.kind === 180 /* PropertyAccessExpression */ && + if (callExpression.expression.kind === 183 /* PropertyAccessExpression */ && isOrContainsMatchingReference(reference, callExpression.expression.expression)) { return true; } @@ -35221,8 +36793,8 @@ var ts; } if (flags & 65536 /* Object */) { return isFunctionObjectType(type) ? - strictNullChecks ? 6164448 /* FunctionStrictFacts */ : 8376288 /* FunctionFacts */ : - strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; + strictNullChecks ? 1970144 /* FunctionStrictFacts */ : 4181984 /* FunctionFacts */ : + strictNullChecks ? 1972176 /* ObjectStrictFacts */ : 4184016 /* ObjectFacts */; } if (flags & (2048 /* Void */ | 4096 /* Undefined */)) { return 2457472 /* UndefinedFacts */; @@ -35233,16 +36805,16 @@ var ts; if (flags & 1536 /* ESSymbolLike */) { return strictNullChecks ? 1981320 /* SymbolStrictFacts */ : 4193160 /* SymbolFacts */; } - if (flags & 33554432 /* NonPrimitive */) { - return strictNullChecks ? 6166480 /* ObjectStrictFacts */ : 8378320 /* ObjectFacts */; + if (flags & 134217728 /* NonPrimitive */) { + return strictNullChecks ? 1972176 /* ObjectStrictFacts */ : 4184016 /* ObjectFacts */; } - if (flags & 1081344 /* TypeVariable */) { + if (flags & 7897088 /* Instantiable */) { return getTypeFacts(getBaseConstraintOfType(type) || emptyObjectType); } if (flags & 393216 /* UnionOrIntersection */) { return getTypeFactsOfTypes(type.types); } - return 8388607 /* All */; + return 4194303 /* All */; } function getTypeWithFacts(type, include) { return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; }); @@ -35270,15 +36842,15 @@ var ts; return createArrayType(checkIteratedTypeOrElementType(type, /*errorNode*/ undefined, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType); } function getAssignedTypeOfBinaryExpression(node) { - var isDestructuringDefaultAssignment = node.parent.kind === 178 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); + var isDestructuringDefaultAssignment = node.parent.kind === 181 /* ArrayLiteralExpression */ && isDestructuringAssignmentTarget(node.parent) || + node.parent.kind === 268 /* PropertyAssignment */ && isDestructuringAssignmentTarget(node.parent.parent); return isDestructuringDefaultAssignment ? getTypeWithDefault(getAssignedType(node), node.right) : getTypeOfExpression(node.right); } function isDestructuringAssignmentTarget(parent) { - return parent.parent.kind === 195 /* BinaryExpression */ && parent.parent.left === parent || - parent.parent.kind === 217 /* ForOfStatement */ && parent.parent.initializer === parent; + return parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.left === parent || + parent.parent.kind === 220 /* ForOfStatement */ && parent.parent.initializer === parent; } function getAssignedTypeOfArrayLiteralElement(node, element) { return getTypeOfDestructuredArrayElement(getAssignedType(node), node.elements.indexOf(element)); @@ -35295,21 +36867,21 @@ var ts; function getAssignedType(node) { var parent = node.parent; switch (parent.kind) { - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return stringType; - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkRightHandSideOfForOf(parent.expression, parent.awaitModifier) || unknownType; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getAssignedTypeOfBinaryExpression(parent); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return undefinedType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return getAssignedTypeOfArrayLiteralElement(parent, node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return getAssignedTypeOfSpreadExpression(parent); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return getAssignedTypeOfPropertyAssignment(parent); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getAssignedTypeOfShorthandPropertyAssignment(parent); } return unknownType; @@ -35317,7 +36889,7 @@ var ts; function getInitialTypeOfBindingElement(node) { var pattern = node.parent; var parentType = getInitialType(pattern.parent); - var type = pattern.kind === 175 /* ObjectBindingPattern */ ? + var type = pattern.kind === 178 /* ObjectBindingPattern */ ? getTypeOfDestructuredProperty(parentType, node.propertyName || node.name) : !node.dotDotDotToken ? getTypeOfDestructuredArrayElement(parentType, pattern.elements.indexOf(node)) : @@ -35335,35 +36907,35 @@ var ts; if (node.initializer) { return getTypeOfInitializer(node.initializer); } - if (node.parent.parent.kind === 216 /* ForInStatement */) { + if (node.parent.parent.kind === 219 /* ForInStatement */) { return stringType; } - if (node.parent.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.parent.kind === 220 /* ForOfStatement */) { return checkRightHandSideOfForOf(node.parent.parent.expression, node.parent.parent.awaitModifier) || unknownType; } return unknownType; } function getInitialType(node) { - return node.kind === 227 /* VariableDeclaration */ ? + return node.kind === 230 /* VariableDeclaration */ ? getInitialTypeOfVariableDeclaration(node) : getInitialTypeOfBindingElement(node); } function getInitialOrAssignedType(node) { - return node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */ ? + return node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */ ? getInitialType(node) : getAssignedType(node); } function isEmptyArrayAssignment(node) { - return node.kind === 227 /* VariableDeclaration */ && node.initializer && + return node.kind === 230 /* VariableDeclaration */ && node.initializer && isEmptyArrayLiteral(node.initializer) || - node.kind !== 177 /* BindingElement */ && node.parent.kind === 195 /* BinaryExpression */ && + node.kind !== 180 /* BindingElement */ && node.parent.kind === 198 /* BinaryExpression */ && isEmptyArrayLiteral(node.parent.right); } function getReferenceCandidate(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return getReferenceCandidate(node.expression); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: switch (node.operatorToken.kind) { case 58 /* EqualsToken */: return getReferenceCandidate(node.left); @@ -35375,13 +36947,13 @@ var ts; } function getReferenceRoot(node) { var parent = node.parent; - return parent.kind === 186 /* ParenthesizedExpression */ || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || - parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? + return parent.kind === 189 /* ParenthesizedExpression */ || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */ && parent.left === node || + parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 26 /* CommaToken */ && parent.right === node ? getReferenceRoot(parent) : node; } function getTypeOfSwitchClause(clause) { - if (clause.kind === 261 /* CaseClause */) { + if (clause.kind === 264 /* CaseClause */) { var caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression)); return isUnitType(caseType) ? caseType : undefined; } @@ -35440,6 +37012,9 @@ var ts; // is a union type, the mapping function is applied to each constituent type and a union // of the resulting types is returned. function mapType(type, mapper, noReductions) { + if (type.flags & 16384 /* Never */) { + return type; + } if (!(type.flags & 131072 /* Union */)) { return mapper(type); } @@ -35551,11 +37126,11 @@ var ts; function isEvolvingArrayOperationTarget(node) { var root = getReferenceRoot(node); var parent = root.parent; - var isLengthPushOrUnshift = parent.kind === 180 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || - parent.parent.kind === 182 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); - var isElementAssignment = parent.kind === 181 /* ElementAccessExpression */ && + var isLengthPushOrUnshift = parent.kind === 183 /* PropertyAccessExpression */ && (parent.name.escapedText === "length" || + parent.parent.kind === 185 /* CallExpression */ && ts.isPushOrUnshiftIdentifier(parent.name)); + var isElementAssignment = parent.kind === 184 /* ElementAccessExpression */ && parent.expression === root && - parent.parent.kind === 195 /* BinaryExpression */ && + parent.parent.kind === 198 /* BinaryExpression */ && parent.parent.operatorToken.kind === 58 /* EqualsToken */ && parent.parent.left === parent && !ts.isAssignmentTarget(parent.parent) && @@ -35592,7 +37167,7 @@ var ts; if (flowAnalysisDisabled) { return unknownType; } - if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 35620607 /* Narrowable */)) { + if (!reference.flowNode || !couldBeUninitialized && !(declaredType.flags & 142575359 /* Narrowable */)) { return declaredType; } var sharedFlowStart = sharedFlowCount; @@ -35603,7 +37178,7 @@ var ts; // on empty arrays are possible without implicit any errors and new element types can be inferred without // type mismatch errors. var resultType = ts.getObjectFlags(evolvedType) & 256 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? anyArrayType : finalizeEvolvingArrayType(evolvedType); - if (reference.parent && reference.parent.kind === 204 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { + if (reference.parent && reference.parent.kind === 207 /* NonNullExpression */ && getTypeWithFacts(resultType, 524288 /* NEUndefinedOrNull */).flags & 16384 /* Never */) { return declaredType; } return resultType; @@ -35674,7 +37249,7 @@ var ts; else if (flags & 2 /* Start */) { // Check if we should continue with the control flow of the containing function. var container = flow.container; - if (container && container !== flowContainer && reference.kind !== 180 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { + if (container && container !== flowContainer && reference.kind !== 183 /* PropertyAccessExpression */ && reference.kind !== 99 /* ThisKeyword */) { flow = container.flowNode; continue; } @@ -35730,7 +37305,7 @@ var ts; function getTypeAtFlowArrayMutation(flow) { if (declaredType === autoType || declaredType === autoArrayType) { var node = flow.node; - var expr = node.kind === 182 /* CallExpression */ ? + var expr = node.kind === 185 /* CallExpression */ ? node.expression.expression : node.left.expression; if (isMatchingReference(reference, getReferenceCandidate(expr))) { @@ -35738,7 +37313,7 @@ var ts; var type = getTypeFromFlowType(flowType); if (ts.getObjectFlags(type) & 256 /* EvolvingArray */) { var evolvedType_1 = type; - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { for (var _i = 0, _a = node.arguments; _i < _a.length; _i++) { var arg = _a[_i]; evolvedType_1 = addEvolvingArrayElementType(evolvedType_1, arg); @@ -35903,7 +37478,7 @@ var ts; return result; } function isMatchingReferenceDiscriminant(expr, computedType) { - return expr.kind === 180 /* PropertyAccessExpression */ && + return expr.kind === 183 /* PropertyAccessExpression */ && computedType.flags & 131072 /* Union */ && isMatchingReference(reference, expr.expression) && isDiscriminantProperty(computedType, expr.name.escapedText); @@ -35954,10 +37529,10 @@ var ts; var operator_1 = expr.operatorToken.kind; var left_1 = getReferenceCandidate(expr.left); var right_1 = getReferenceCandidate(expr.right); - if (left_1.kind === 190 /* TypeOfExpression */ && (right_1.kind === 9 /* StringLiteral */ || right_1.kind === 13 /* NoSubstitutionTemplateLiteral */)) { + if (left_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(right_1)) { return narrowTypeByTypeof(type, left_1, operator_1, right_1, assumeTrue); } - if (right_1.kind === 190 /* TypeOfExpression */ && (left_1.kind === 9 /* StringLiteral */ || left_1.kind === 13 /* NoSubstitutionTemplateLiteral */)) { + if (right_1.kind === 193 /* TypeOfExpression */ && ts.isStringLiteralLike(left_1)) { return narrowTypeByTypeof(type, right_1, operator_1, left_1, assumeTrue); } if (isMatchingReference(reference, left_1)) { @@ -35980,7 +37555,7 @@ var ts; return narrowTypeByInstanceof(type, expr, assumeTrue); case 92 /* InKeyword */: var target = getReferenceCandidate(expr.right); - if ((expr.left.kind === 9 /* StringLiteral */ || expr.left.kind === 13 /* NoSubstitutionTemplateLiteral */) && isMatchingReference(reference, target)) { + if (ts.isStringLiteralLike(expr.left) && isMatchingReference(reference, target)) { return narrowByInKeyword(type, expr.left, assumeTrue); } break; @@ -36009,7 +37584,7 @@ var ts; assumeTrue ? 16384 /* EQUndefined */ : 131072 /* NEUndefined */; return getTypeWithFacts(type, facts); } - if (type.flags & 33620481 /* NotUnionOrUnit */) { + if (type.flags & 134283777 /* NotUnionOrUnit */) { return type; } if (assumeTrue) { @@ -36045,7 +37620,7 @@ var ts; if (isTypeSubtypeOf(targetType, type)) { return targetType; } - if (type.flags & 1081344 /* TypeVariable */) { + if (type.flags & 7897088 /* Instantiable */) { var constraint = getBaseConstraintOfType(type) || anyType; if (isTypeSubtypeOf(targetType, constraint)) { return getIntersectionType([type, targetType]); @@ -36169,7 +37744,7 @@ var ts; } else { var invokedExpression = ts.skipParentheses(callExpression.expression); - if (invokedExpression.kind === 181 /* ElementAccessExpression */ || invokedExpression.kind === 180 /* PropertyAccessExpression */) { + if (invokedExpression.kind === 184 /* ElementAccessExpression */ || invokedExpression.kind === 183 /* PropertyAccessExpression */) { var accessExpression = invokedExpression; var possibleReference = ts.skipParentheses(accessExpression.expression); if (isMatchingReference(reference, possibleReference)) { @@ -36189,15 +37764,15 @@ var ts; case 71 /* Identifier */: case 99 /* ThisKeyword */: case 97 /* SuperKeyword */: - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return narrowTypeByTruthiness(type, expr, assumeTrue); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return narrowTypeByTypePredicate(type, expr, assumeTrue); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return narrowType(type, expr.expression, assumeTrue); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return narrowTypeByBinaryExpression(type, expr, assumeTrue); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (expr.operator === 51 /* ExclamationToken */) { return narrowType(type, expr.operand, !assumeTrue); } @@ -36233,9 +37808,9 @@ var ts; function getControlFlowContainer(node) { return ts.findAncestor(node.parent, function (node) { return ts.isFunctionLike(node) && !ts.getImmediatelyInvokedFunctionExpression(node) || - node.kind === 235 /* ModuleBlock */ || - node.kind === 269 /* SourceFile */ || - node.kind === 150 /* PropertyDeclaration */; + node.kind === 238 /* ModuleBlock */ || + node.kind === 272 /* SourceFile */ || + node.kind === 151 /* PropertyDeclaration */; }); } // Check if a parameter is assigned anywhere within its declaring function. @@ -36257,7 +37832,7 @@ var ts; if (node.kind === 71 /* Identifier */) { if (ts.isAssignmentTarget(node)) { var symbol = getResolvedSymbol(node); - if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 147 /* Parameter */) { + if (symbol.valueDeclaration && ts.getRootDeclaration(symbol.valueDeclaration).kind === 148 /* Parameter */) { symbol.isAssigned = true; } } @@ -36272,35 +37847,34 @@ var ts; /** remove undefined from the annotated type of a parameter when there is an initializer (that doesn't include undefined) */ function removeOptionalityFromDeclaredType(declaredType, declaration) { var annotationIncludesUndefined = strictNullChecks && - declaration.kind === 147 /* Parameter */ && + declaration.kind === 148 /* Parameter */ && declaration.initializer && getFalsyFlags(declaredType) & 4096 /* Undefined */ && !(getFalsyFlags(checkExpression(declaration.initializer)) & 4096 /* Undefined */); return annotationIncludesUndefined ? getTypeWithFacts(declaredType, 131072 /* NEUndefined */) : declaredType; } - function isApparentTypePosition(node) { + function isConstraintPosition(node) { var parent = node.parent; - return parent.kind === 180 /* PropertyAccessExpression */ || - parent.kind === 182 /* CallExpression */ && parent.expression === node || - parent.kind === 181 /* ElementAccessExpression */ && parent.expression === node || - parent.kind === 204 /* NonNullExpression */ || - parent.kind === 177 /* BindingElement */ && parent.name === node && !!parent.initializer; + return parent.kind === 183 /* PropertyAccessExpression */ || + parent.kind === 185 /* CallExpression */ && parent.expression === node || + parent.kind === 184 /* ElementAccessExpression */ && parent.expression === node || + parent.kind === 180 /* BindingElement */ && parent.name === node && !!parent.initializer; } function typeHasNullableConstraint(type) { - return type.flags & 1081344 /* TypeVariable */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); + return type.flags & 7372800 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || emptyObjectType, 12288 /* Nullable */); } - function getApparentTypeForLocation(type, node) { + function getConstraintForLocation(type, node) { // When a node is the left hand expression of a property access, element access, or call expression, // and the type of the node includes type variables with constraints that are nullable, we fetch the // apparent type of the node *before* performing control flow analysis such that narrowings apply to // the constraint type. - if (isApparentTypePosition(node) && forEachType(type, typeHasNullableConstraint)) { - return mapType(getWidenedType(type), getApparentType); + if (isConstraintPosition(node) && forEachType(type, typeHasNullableConstraint)) { + return mapType(getWidenedType(type), getBaseConstraintOrType); } return type; } function markAliasReferenced(symbol, location) { - if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { + if (isNonLocalAlias(symbol, /*excludes*/ 67216319 /* Value */) && !isInTypeQuery(location) && !isConstEnumOrConstEnumOnlyModule(resolveAlias(symbol))) { markAliasSymbolAsReferenced(symbol); } } @@ -36318,7 +37892,7 @@ var ts; if (symbol === argumentsSymbol) { var container = ts.getContainingFunction(node); if (languageVersion < 2 /* ES2015 */) { - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { error(node, ts.Diagnostics.The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression); } else if (ts.hasModifier(container, 256 /* Async */)) { @@ -36339,7 +37913,7 @@ var ts; // Due to the emit for class decorators, any reference to the class from inside of the class body // must instead be rewritten to point to a temporary variable to avoid issues with the double-bind // behavior of class names in ES6. - if (declaration.kind === 230 /* ClassDeclaration */ + if (declaration.kind === 233 /* ClassDeclaration */ && ts.nodeIsDecorated(declaration)) { var container = ts.getContainingClass(node); while (container !== undefined) { @@ -36351,14 +37925,14 @@ var ts; container = ts.getContainingClass(container); } } - else if (declaration.kind === 200 /* ClassExpression */) { + else if (declaration.kind === 203 /* ClassExpression */) { // When we emit a class expression with static members that contain a reference // to the constructor in the initializer, we will need to substitute that // binding with an alias as the class name is not in scope. var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); while (container !== undefined) { if (container.parent === declaration) { - if (container.kind === 150 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { + if (container.kind === 151 /* PropertyDeclaration */ && ts.hasModifier(container, 32 /* Static */)) { getNodeLinks(declaration).flags |= 8388608 /* ClassWithConstructorReference */; getNodeLinks(node).flags |= 16777216 /* ConstructorReferenceInClass */; } @@ -36372,7 +37946,7 @@ var ts; checkCollisionWithCapturedThisVariable(node, node); checkCollisionWithCapturedNewTargetVariable(node, node); checkNestedBlockScopedBinding(node, symbol); - var type = getApparentTypeForLocation(getTypeOfSymbol(localOrExportSymbol), node); + var type = getConstraintForLocation(getTypeOfSymbol(localOrExportSymbol), node); var assignmentKind = ts.getAssignmentTargetKind(node); if (assignmentKind) { if (!(localOrExportSymbol.flags & 3 /* Variable */)) { @@ -36404,7 +37978,7 @@ var ts; // The declaration container is the innermost function that encloses the declaration of the variable // or parameter. The flow container is the innermost function starting with which we analyze the control // flow graph to determine the control flow based type. - var isParameter = ts.getRootDeclaration(declaration).kind === 147 /* Parameter */; + var isParameter = ts.getRootDeclaration(declaration).kind === 148 /* Parameter */; var declarationContainer = getControlFlowContainer(declaration); var flowContainer = getControlFlowContainer(node); var isOuterVariable = flowContainer !== declarationContainer; @@ -36412,8 +37986,8 @@ var ts; // When the control flow originates in a function expression or arrow function and we are referencing // a const variable or parameter from an outer function, we extend the origin of the control flow // analysis to include the immediately enclosing function. - while (flowContainer !== declarationContainer && (flowContainer.kind === 187 /* FunctionExpression */ || - flowContainer.kind === 188 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && + while (flowContainer !== declarationContainer && (flowContainer.kind === 190 /* FunctionExpression */ || + flowContainer.kind === 191 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethod(flowContainer)) && (isConstVariable(localOrExportSymbol) || isParameter && !isParameterAssigned(localOrExportSymbol))) { flowContainer = getControlFlowContainer(flowContainer); } @@ -36422,11 +37996,11 @@ var ts; // declaration container are the same). var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAsignmentTarget || type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & 1 /* Any */) !== 0 || - isInTypeQuery(node) || node.parent.kind === 247 /* ExportSpecifier */) || - node.parent.kind === 204 /* NonNullExpression */ || - declaration.kind === 227 /* VariableDeclaration */ && declaration.exclamationToken || + isInTypeQuery(node) || node.parent.kind === 250 /* ExportSpecifier */) || + node.parent.kind === 207 /* NonNullExpression */ || + declaration.kind === 230 /* VariableDeclaration */ && declaration.exclamationToken || declaration.flags & 2097152 /* Ambient */; - var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, ts.getRootDeclaration(declaration)) : type) : + var initialType = assumeInitialized ? (isParameter ? removeOptionalityFromDeclaredType(type, declaration) : type) : type === autoType || type === autoArrayType ? undefinedType : getOptionalType(type); var flowType = getFlowTypeOfReference(node, type, initialType, flowContainer, !assumeInitialized); @@ -36455,7 +38029,7 @@ var ts; function checkNestedBlockScopedBinding(node, symbol) { if (languageVersion >= 2 /* ES2015 */ || (symbol.flags & (2 /* BlockScopedVariable */ | 32 /* Class */)) === 0 || - symbol.valueDeclaration.parent.kind === 264 /* CatchClause */) { + symbol.valueDeclaration.parent.kind === 267 /* CatchClause */) { return; } // 1. walk from the use site up to the declaration and check @@ -36480,8 +38054,8 @@ var ts; } // mark variables that are declared in loop initializer and reassigned inside the body of ForStatement. // if body of ForStatement will be converted to function then we'll need a extra machinery to propagate reassigned values back. - if (container.kind === 215 /* ForStatement */ && - ts.getAncestor(symbol.valueDeclaration, 228 /* VariableDeclarationList */).parent === container && + if (container.kind === 218 /* ForStatement */ && + ts.getAncestor(symbol.valueDeclaration, 231 /* VariableDeclarationList */).parent === container && isAssignedInBodyOfForStatement(node, container)) { getNodeLinks(symbol.valueDeclaration).flags |= 2097152 /* NeedsLoopOutParameter */; } @@ -36495,7 +38069,7 @@ var ts; function isAssignedInBodyOfForStatement(node, container) { // skip parenthesized nodes var current = node; - while (current.parent.kind === 186 /* ParenthesizedExpression */) { + while (current.parent.kind === 189 /* ParenthesizedExpression */) { current = current.parent; } // check if node is used as LHS in some assignment expression @@ -36503,7 +38077,7 @@ var ts; if (ts.isAssignmentTarget(current)) { isAssigned = true; } - else if ((current.parent.kind === 193 /* PrefixUnaryExpression */ || current.parent.kind === 194 /* PostfixUnaryExpression */)) { + else if ((current.parent.kind === 196 /* PrefixUnaryExpression */ || current.parent.kind === 197 /* PostfixUnaryExpression */)) { var expr = current.parent; isAssigned = expr.operator === 43 /* PlusPlusToken */ || expr.operator === 44 /* MinusMinusToken */; } @@ -36516,7 +38090,7 @@ var ts; } function captureLexicalThis(node, container) { getNodeLinks(node).flags |= 2 /* LexicalThis */; - if (container.kind === 150 /* PropertyDeclaration */ || container.kind === 153 /* Constructor */) { + if (container.kind === 151 /* PropertyDeclaration */ || container.kind === 154 /* Constructor */) { var classNode = container.parent; getNodeLinks(classNode).flags |= 4 /* CaptureThis */; } @@ -36584,38 +38158,38 @@ var ts; // tell whether 'this' needs to be captured. var container = ts.getThisContainer(node, /* includeArrowFunctions */ true); var needToCaptureLexicalThis = false; - if (container.kind === 153 /* Constructor */) { + if (container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class); } // Now skip arrow functions to get the "real" owner of 'this'. - if (container.kind === 188 /* ArrowFunction */) { + if (container.kind === 191 /* ArrowFunction */) { container = ts.getThisContainer(container, /* includeArrowFunctions */ false); // When targeting es6, arrow function lexically bind "this" so we do not need to do the work of binding "this" in emitted code needToCaptureLexicalThis = (languageVersion < 2 /* ES2015 */); } switch (container.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_module_or_namespace_body); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_current_location); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks break; - case 153 /* Constructor */: + case 154 /* Constructor */: if (isInConstructorArgumentInitializer(node, container)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_constructor_arguments); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (ts.hasModifier(container, 32 /* Static */)) { error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_static_property_initializer); // do not return here so in case if lexical this is captured - it will be reflected in flags on NodeLinks } break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: error(node, ts.Diagnostics.this_cannot_be_referenced_in_a_computed_property_name); break; } @@ -36636,8 +38210,8 @@ var ts; // Note: a parameter initializer should refer to class-this unless function-this is explicitly annotated. // If this is a function in a JS file, it might be a class method. Check if it's the RHS // of a x.prototype.y = function [name]() { .... } - if (container.kind === 187 /* FunctionExpression */ && - container.parent.kind === 195 /* BinaryExpression */ && + if (container.kind === 190 /* FunctionExpression */ && + container.parent.kind === 198 /* BinaryExpression */ && ts.getSpecialPropertyAssignmentKind(container.parent) === 3 /* PrototypeProperty */) { // Get the 'x' of 'x.prototype.y = f' (here, 'f' is 'container') var className = container.parent // x.prototype.y = f @@ -36646,12 +38220,12 @@ var ts; .expression; // x var classSymbol = checkExpression(className).symbol; if (classSymbol && classSymbol.members && (classSymbol.flags & 16 /* Function */)) { - return getInferredClassType(classSymbol); + return getFlowTypeOfReference(node, getInferredClassType(classSymbol)); } } var thisType = getThisTypeOfDeclaration(container) || getContextualThisParameterType(container); if (thisType) { - return thisType; + return getFlowTypeOfReference(node, thisType); } } if (ts.isClassLike(container.parent)) { @@ -36662,13 +38236,13 @@ var ts; if (ts.isInJavaScriptFile(node)) { var type = getTypeForThisExpressionFromJSDoc(container); if (type && type !== unknownType) { - return type; + return getFlowTypeOfReference(node, type); } } } function getTypeForThisExpressionFromJSDoc(node) { var jsdocType = ts.getJSDocType(node); - if (jsdocType && jsdocType.kind === 277 /* JSDocFunctionType */) { + if (jsdocType && jsdocType.kind === 280 /* JSDocFunctionType */) { var jsDocFunctionType = jsdocType; if (jsDocFunctionType.parameters.length > 0 && jsDocFunctionType.parameters[0].name && @@ -36678,15 +38252,15 @@ var ts; } } function isInConstructorArgumentInitializer(node, constructorDecl) { - return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 147 /* Parameter */; }); + return !!ts.findAncestor(node, function (n) { return n === constructorDecl ? "quit" : n.kind === 148 /* Parameter */; }); } function checkSuperExpression(node) { - var isCallExpression = node.parent.kind === 182 /* CallExpression */ && node.parent.expression === node; + var isCallExpression = node.parent.kind === 185 /* CallExpression */ && node.parent.expression === node; var container = ts.getSuperContainer(node, /*stopOnFunctions*/ true); var needToCaptureLexicalThis = false; // adjust the container reference in case if super is used inside arrow functions with arbitrarily deep nesting if (!isCallExpression) { - while (container && container.kind === 188 /* ArrowFunction */) { + while (container && container.kind === 191 /* ArrowFunction */) { container = ts.getSuperContainer(container, /*stopOnFunctions*/ true); needToCaptureLexicalThis = languageVersion < 2 /* ES2015 */; } @@ -36699,14 +38273,14 @@ var ts; // class B { // [super.foo()]() {} // } - var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 145 /* ComputedPropertyName */; }); - if (current && current.kind === 145 /* ComputedPropertyName */) { + var current = ts.findAncestor(node, function (n) { return n === container ? "quit" : n.kind === 146 /* ComputedPropertyName */; }); + if (current && current.kind === 146 /* ComputedPropertyName */) { error(node, ts.Diagnostics.super_cannot_be_referenced_in_a_computed_property_name); } else if (isCallExpression) { error(node, ts.Diagnostics.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors); } - else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */)) { + else if (!container || !container.parent || !(ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */)) { error(node, ts.Diagnostics.super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions); } else { @@ -36714,7 +38288,7 @@ var ts; } return unknownType; } - if (!isCallExpression && container.kind === 153 /* Constructor */) { + if (!isCallExpression && container.kind === 154 /* Constructor */) { checkThisBeforeSuper(node, container, ts.Diagnostics.super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class); } if (ts.hasModifier(container, 32 /* Static */) || isCallExpression) { @@ -36780,7 +38354,7 @@ var ts; // This helper creates an object with a "value" property that wraps the `super` property or indexed access for both get and set. // This is required for destructuring assignments, as a call expression cannot be used as the target of a destructuring assignment // while a property access can. - if (container.kind === 152 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { + if (container.kind === 153 /* MethodDeclaration */ && ts.hasModifier(container, 256 /* Async */)) { if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) { getNodeLinks(container).flags |= 4096 /* AsyncMethodWithSuperBinding */; } @@ -36794,7 +38368,7 @@ var ts; // in this case they should also use correct lexical this captureLexicalThis(node.parent, container); } - if (container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (container.parent.kind === 182 /* ObjectLiteralExpression */) { if (languageVersion < 2 /* ES2015 */) { error(node, ts.Diagnostics.super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher); return unknownType; @@ -36815,7 +38389,7 @@ var ts; if (!baseClassType) { return unknownType; } - if (container.kind === 153 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { + if (container.kind === 154 /* Constructor */ && isInConstructorArgumentInitializer(node, container)) { // issue custom error message for super property access in constructor arguments (to be aligned with old compiler) error(node, ts.Diagnostics.super_cannot_be_referenced_in_constructor_arguments); return unknownType; @@ -36830,7 +38404,7 @@ var ts; if (isCallExpression) { // TS 1.0 SPEC (April 2014): 4.8.1 // Super calls are only permitted in constructors of derived classes - return container.kind === 153 /* Constructor */; + return container.kind === 154 /* Constructor */; } else { // TS 1.0 SPEC (April 2014) @@ -36838,21 +38412,21 @@ var ts; // - In a constructor, instance member function, instance member accessor, or instance member variable initializer where this references a derived class instance // - In a static member function or static member accessor // topmost container must be something that is directly nested in the class declaration\object literal expression - if (ts.isClassLike(container.parent) || container.parent.kind === 179 /* ObjectLiteralExpression */) { + if (ts.isClassLike(container.parent) || container.parent.kind === 182 /* ObjectLiteralExpression */) { if (ts.hasModifier(container, 32 /* Static */)) { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */; } else { - return container.kind === 152 /* MethodDeclaration */ || - container.kind === 151 /* MethodSignature */ || - container.kind === 154 /* GetAccessor */ || - container.kind === 155 /* SetAccessor */ || - container.kind === 150 /* PropertyDeclaration */ || - container.kind === 149 /* PropertySignature */ || - container.kind === 153 /* Constructor */; + return container.kind === 153 /* MethodDeclaration */ || + container.kind === 152 /* MethodSignature */ || + container.kind === 155 /* GetAccessor */ || + container.kind === 156 /* SetAccessor */ || + container.kind === 151 /* PropertyDeclaration */ || + container.kind === 150 /* PropertySignature */ || + container.kind === 154 /* Constructor */; } } } @@ -36860,10 +38434,10 @@ var ts; } } function getContainingObjectLiteral(func) { - return (func.kind === 152 /* MethodDeclaration */ || - func.kind === 154 /* GetAccessor */ || - func.kind === 155 /* SetAccessor */) && func.parent.kind === 179 /* ObjectLiteralExpression */ ? func.parent : - func.kind === 187 /* FunctionExpression */ && func.parent.kind === 265 /* PropertyAssignment */ ? func.parent.parent : + return (func.kind === 153 /* MethodDeclaration */ || + func.kind === 155 /* GetAccessor */ || + func.kind === 156 /* SetAccessor */) && func.parent.kind === 182 /* ObjectLiteralExpression */ ? func.parent : + func.kind === 190 /* FunctionExpression */ && func.parent.kind === 268 /* PropertyAssignment */ ? func.parent.parent : undefined; } function getThisTypeArgument(type) { @@ -36875,7 +38449,7 @@ var ts; }); } function getContextualThisParameterType(func) { - if (func.kind === 188 /* ArrowFunction */) { + if (func.kind === 191 /* ArrowFunction */) { return undefined; } if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) { @@ -36902,7 +38476,7 @@ var ts; if (thisType) { return instantiateType(thisType, getContextualMapper(containingLiteral)); } - if (literal.parent.kind !== 265 /* PropertyAssignment */) { + if (literal.parent.kind !== 268 /* PropertyAssignment */) { break; } literal = literal.parent.parent; @@ -36916,9 +38490,9 @@ var ts; // In an assignment of the form 'obj.xxx = function(...)' or 'obj[xxx] = function(...)', the // contextual type for 'this' is 'obj'. var parent = func.parent; - if (parent.kind === 195 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { + if (parent.kind === 198 /* BinaryExpression */ && parent.operatorToken.kind === 58 /* EqualsToken */) { var target = parent.left; - if (target.kind === 180 /* PropertyAccessExpression */ || target.kind === 181 /* ElementAccessExpression */) { + if (target.kind === 183 /* PropertyAccessExpression */ || target.kind === 184 /* ElementAccessExpression */) { var expression = target.expression; // Don't contextually type `this` as `exports` in `exports.Point = function(x, y) { this.x = x; this.y = y; }` if (inJs && ts.isIdentifier(expression)) { @@ -36993,7 +38567,7 @@ var ts; if (typeNode) { return getTypeFromTypeNode(typeNode); } - if (declaration.kind === 147 /* Parameter */) { + if (declaration.kind === 148 /* Parameter */) { var type = getContextuallyTypedParameterType(declaration); if (type) { return type; @@ -37005,7 +38579,7 @@ var ts; if (ts.isBindingPattern(declaration.parent)) { var parentDeclaration = declaration.parent.parent; var name = declaration.propertyName || declaration.name; - if (parentDeclaration.kind !== 177 /* BindingElement */) { + if (parentDeclaration.kind !== 180 /* BindingElement */) { var parentTypeNode = ts.getEffectiveTypeAnnotationNode(parentDeclaration); if (parentTypeNode && !ts.isBindingPattern(name)) { var text = ts.getTextOfPropertyName(name); @@ -37022,7 +38596,7 @@ var ts; var func = ts.getContainingFunction(node); if (func) { var functionFlags = ts.getFunctionFlags(func); - if (functionFlags & 1 /* Generator */) { + if (functionFlags & 1 /* Generator */) { // AsyncGenerator function or Generator function return undefined; } var contextualReturnType = getContextualReturnType(func); @@ -37061,7 +38635,7 @@ var ts; function getContextualReturnType(functionDecl) { // If the containing function has a return type annotation, is a constructor, or is a get accessor whose // corresponding set accessor has a type annotation, return statements in the function are contextually typed - if (functionDecl.kind === 153 /* Constructor */ || + if (functionDecl.kind === 154 /* Constructor */ || ts.getEffectiveReturnTypeNode(functionDecl) || isGetAccessorWithAnnotatedSetAccessor(functionDecl)) { return getReturnTypeOfSignature(getSignatureFromDeclaration(functionDecl)); @@ -37077,17 +38651,17 @@ var ts; // In a typed function call, an argument or substitution expression is contextually typed by the type of the corresponding parameter. function getContextualTypeForArgument(callTarget, arg) { var args = getEffectiveCallArguments(callTarget); - var argIndex = args.indexOf(arg); - if (argIndex >= 0) { - // If we're already in the process of resolving the given signature, don't resolve again as - // that could cause infinite recursion. Instead, return anySignature. - var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); - return getTypeAtPosition(signature, argIndex); - } - return undefined; + var argIndex = args.indexOf(arg); // -1 for e.g. the expression of a CallExpression, or the tag of a TaggedTemplateExpression + return argIndex === -1 ? undefined : getContextualTypeForArgumentAtIndex(callTarget, argIndex); + } + function getContextualTypeForArgumentAtIndex(callTarget, argIndex) { + // If we're already in the process of resolving the given signature, don't resolve again as + // that could cause infinite recursion. Instead, return anySignature. + var signature = getNodeLinks(callTarget).resolvedSignature === resolvingSignature ? resolvingSignature : getResolvedSignature(callTarget); + return getTypeAtPosition(signature, argIndex); } function getContextualTypeForSubstitutionExpression(template, substitutionExpression) { - if (template.parent.kind === 184 /* TaggedTemplateExpression */) { + if (template.parent.kind === 187 /* TaggedTemplateExpression */) { return getContextualTypeForArgument(template.parent, substitutionExpression); } return undefined; @@ -37100,9 +38674,11 @@ var ts; return node === right && isContextSensitiveAssignment(binaryExpression) ? getTypeOfExpression(left) : undefined; case 54 /* BarBarToken */: // When an || expression has a contextual type, the operands are contextually typed by that type. When an || - // expression has no contextual type, the right operand is contextually typed by the type of the left operand. + // expression has no contextual type, the right operand is contextually typed by the type of the left operand, + // except for the special case of Javascript declarations of the form `namespace.prop = namespace.prop || {}` var type = getContextualType(binaryExpression); - return !type && node === right ? getTypeOfExpression(left, /*cache*/ true) : type; + return !type && node === right && !ts.getDeclaredJavascriptInitializer(binaryExpression.parent) && !ts.getAssignedJavascriptInitializer(binaryExpression) ? + getTypeOfExpression(left, /*cache*/ true) : type; case 53 /* AmpersandAmpersandToken */: case 26 /* CommaToken */: return node === right ? getContextualType(binaryExpression) : undefined; @@ -37125,6 +38701,7 @@ var ts; case 2 /* ModuleExports */: case 3 /* PrototypeProperty */: case 4 /* ThisProperty */: + case 6 /* Prototype */: return false; default: ts.Debug.assertNever(kind); @@ -37190,7 +38767,7 @@ var ts; function getContextualTypeForChildJsxExpression(node) { var attributesType = getApparentTypeOfContextualType(node.openingElement.tagName); // JSX expression is in children of JSX Element, we will look for an "children" atttribute (we get the name from JSX.ElementAttributesProperty) - var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(node)); return attributesType && !isTypeAny(attributesType) && jsxChildrenPropertyName && jsxChildrenPropertyName !== "" ? getTypeOfPropertyOfContextualType(attributesType, jsxChildrenPropertyName) : undefined; } function getContextualTypeForJsxExpression(node) { @@ -37230,7 +38807,7 @@ var ts; var prop = _a[_i]; if (!prop.symbol) continue; - if (prop.kind !== 265 /* PropertyAssignment */) + if (prop.kind !== 268 /* PropertyAssignment */) continue; if (isDiscriminantProperty(contextualType, prop.symbol.escapedName)) { var discriminatingType = getTypeOfNode(prop.initializer); @@ -37278,52 +38855,52 @@ var ts; } var parent = node.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 177 /* BindingElement */: + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 180 /* BindingElement */: return getContextualTypeForInitializerExpression(node); - case 188 /* ArrowFunction */: - case 220 /* ReturnStatement */: + case 191 /* ArrowFunction */: + case 223 /* ReturnStatement */: return getContextualTypeForReturnExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return getContextualTypeForYieldOperand(parent); - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: return getContextualTypeForArgument(parent, node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return getTypeFromTypeNode(parent.type); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return getContextualTypeForBinaryOperand(node); - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return getContextualTypeForObjectLiteralElement(parent); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return getApparentTypeOfContextualType(parent.parent); - case 178 /* ArrayLiteralExpression */: { + case 181 /* ArrayLiteralExpression */: { var arrayLiteral = parent; var type = getApparentTypeOfContextualType(arrayLiteral); return getContextualTypeForElementExpression(type, ts.indexOfNode(arrayLiteral.elements, node)); } - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return getContextualTypeForConditionalOperand(node); - case 206 /* TemplateSpan */: - ts.Debug.assert(parent.parent.kind === 197 /* TemplateExpression */); + case 209 /* TemplateSpan */: + ts.Debug.assert(parent.parent.kind === 200 /* TemplateExpression */); return getContextualTypeForSubstitutionExpression(parent.parent, node); - case 186 /* ParenthesizedExpression */: { + case 189 /* ParenthesizedExpression */: { // Like in `checkParenthesizedExpression`, an `/** @type {xyz} */` comment before a parenthesized expression acts as a type cast. var tag = ts.isInJavaScriptFile(parent) ? ts.getJSDocTypeTag(parent) : undefined; return tag ? getTypeFromTypeNode(tag.typeExpression.type) : getContextualType(parent); } - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return getContextualTypeForJsxExpression(parent); - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: return getContextualTypeForJsxAttribute(parent); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: return getContextualJsxElementAttributesType(parent); } return undefined; @@ -37342,15 +38919,9 @@ var ts; return anyType; } var isJs = ts.isInJavaScriptFile(node); - return mapType(valueType, isJs ? getJsxSignaturesParameterTypesJs : getJsxSignaturesParameterTypes); + return mapType(valueType, function (t) { return getJsxSignaturesParameterTypes(t, isJs, node); }); } - function getJsxSignaturesParameterTypes(valueType) { - return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ false); - } - function getJsxSignaturesParameterTypesJs(valueType) { - return getJsxSignaturesParameterTypesInternal(valueType, /*isJs*/ true); - } - function getJsxSignaturesParameterTypesInternal(valueType, isJs) { + function getJsxSignaturesParameterTypes(valueType, isJs, context) { // If the elemType is a string type, we have to return anyType to prevent an error downstream as we will try to find construct or call signature of the type if (valueType.flags & 2 /* String */) { return anyType; @@ -37360,7 +38931,7 @@ var ts; // For example: // var CustomTag: "h1" = "h1"; // Hello World - var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, context); if (intrinsicElementsType !== unknownType) { var stringLiteralTypeName = valueType.value; var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); @@ -37386,21 +38957,21 @@ var ts; return unknownType; } } - return getUnionType(ts.map(signatures, ctor ? isJs ? getJsxPropsTypeFromConstructSignatureJs : getJsxPropsTypeFromConstructSignature : getJsxPropsTypeFromCallSignature), 0 /* None */); + return getUnionType(ts.map(signatures, ctor ? function (t) { return getJsxPropsTypeFromConstructSignature(t, isJs, context); } : function (t) { return getJsxPropsTypeFromCallSignature(t, context); }), 0 /* None */); } - function getJsxPropsTypeFromCallSignature(sig) { + function getJsxPropsTypeFromCallSignature(sig, context) { var propsType = getTypeOfFirstParameterOfSignature(sig); - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== unknownType) { propsType = intersectTypes(intrinsicAttribs, propsType); } return propsType; } - function getJsxPropsTypeFromClassType(hostClassType, isJs) { + function getJsxPropsTypeFromClassType(hostClassType, isJs, context) { if (isTypeAny(hostClassType)) { return hostClassType; } - var propsName = getJsxElementPropertiesName(); + var propsName = getJsxElementPropertiesName(getJsxNamespaceAt(context)); if (propsName === undefined) { // There is no type ElementAttributesProperty, return 'any' return anyType; @@ -37422,14 +38993,14 @@ var ts; else { // Normal case -- add in IntrinsicClassElements and IntrinsicElements var apparentAttributesType = attributesType; - var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes); + var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context); if (intrinsicClassAttribs !== unknownType) { var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol); apparentAttributesType = intersectTypes(typeParams ? createTypeReference(intrinsicClassAttribs, fillMissingTypeArguments([hostClassType], typeParams, getMinTypeArgumentCount(typeParams), isJs)) : intrinsicClassAttribs, apparentAttributesType); } - var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context); if (intrinsicAttribs !== unknownType) { apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType); } @@ -37437,18 +39008,12 @@ var ts; } } } - function getJsxPropsTypeFromConstructSignatureJs(sig) { - return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ true); - } - function getJsxPropsTypeFromConstructSignature(sig) { - return getJsxPropsTypeFromConstructSignatureInternal(sig, /*isJs*/ false); - } - function getJsxPropsTypeFromConstructSignatureInternal(sig, isJs) { + function getJsxPropsTypeFromConstructSignature(sig, isJs, context) { var hostClassType = getReturnTypeOfSignature(sig); if (hostClassType) { - return getJsxPropsTypeFromClassType(hostClassType, isJs); + return getJsxPropsTypeFromClassType(hostClassType, isJs, context); } - return getJsxPropsTypeFromCallSignature(sig); + return getJsxPropsTypeFromCallSignature(sig, context); } // If the given type is an object or union type with a single signature, and if that signature has at // least as many parameters as the given function, return the signature. Otherwise return undefined. @@ -37477,7 +39042,7 @@ var ts; return sourceLength < targetParameterCount; } function isFunctionExpressionOrArrowFunction(node) { - return node.kind === 187 /* FunctionExpression */ || node.kind === 188 /* ArrowFunction */; + return node.kind === 190 /* FunctionExpression */ || node.kind === 191 /* ArrowFunction */; } function getContextualSignatureForFunctionLikeDeclaration(node) { // Only function expressions, arrow functions, and object literal methods are contextually typed. @@ -37496,7 +39061,7 @@ var ts; // all identical ignoring their return type, the result is same signature but with return type as // union type of return types from these signatures function getContextualSignature(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var type = getContextualTypeForFunctionLikeDeclaration(node); if (!type) { return undefined; @@ -37540,8 +39105,8 @@ var ts; return checkIteratedTypeOrElementType(arrayOrIterableType, node.expression, /*allowStringInput*/ false, /*allowAsyncIterables*/ false); } function hasDefaultValue(node) { - return (node.kind === 177 /* BindingElement */ && !!node.initializer) || - (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); + return (node.kind === 180 /* BindingElement */ && !!node.initializer) || + (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 58 /* EqualsToken */); } function checkArrayLiteral(node, checkMode) { var elements = node.elements; @@ -37551,7 +39116,7 @@ var ts; var contextualType = getApparentTypeOfContextualType(node); for (var index = 0; index < elements.length; index++) { var e = elements[index]; - if (inDestructuringPattern && e.kind === 199 /* SpreadElement */) { + if (inDestructuringPattern && e.kind === 202 /* SpreadElement */) { // Given the following situation: // var c: {}; // [...c] = ["", 0]; @@ -37576,7 +39141,7 @@ var ts; var type = checkExpressionForMutableLocation(e, checkMode, elementContextualType); elementTypes.push(type); } - hasSpreadElement = hasSpreadElement || e.kind === 199 /* SpreadElement */; + hasSpreadElement = hasSpreadElement || e.kind === 202 /* SpreadElement */; } if (!hasSpreadElement) { // If array literal is actually a destructuring pattern, mark it as an implied type. We do this such @@ -37590,7 +39155,7 @@ var ts; var pattern = contextualType.pattern; // If array literal is contextually typed by a binding pattern or an assignment pattern, pad the resulting // tuple type with the corresponding binding or assignment element types to make the lengths equal. - if (pattern && (pattern.kind === 176 /* ArrayBindingPattern */ || pattern.kind === 178 /* ArrayLiteralExpression */)) { + if (pattern && (pattern.kind === 179 /* ArrayBindingPattern */ || pattern.kind === 181 /* ArrayLiteralExpression */)) { var patternElements = pattern.elements; for (var i = elementTypes.length; i < patternElements.length; i++) { var patternElement = patternElements[i]; @@ -37598,7 +39163,7 @@ var ts; elementTypes.push(contextualType.typeArguments[i]); } else { - if (patternElement.kind !== 201 /* OmittedExpression */) { + if (patternElement.kind !== 204 /* OmittedExpression */) { error(patternElement, ts.Diagnostics.Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value); } elementTypes.push(strictNullChecks ? implicitNeverType : undefinedWideningType); @@ -37616,7 +39181,7 @@ var ts; } function isNumericName(name) { switch (name.kind) { - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return isNumericComputedName(name); case 71 /* Identifier */: return isNumericLiteralName(name.escapedText); @@ -37690,34 +39255,44 @@ var ts; var inDestructuringPattern = ts.isAssignmentTarget(node); // Grammar checking checkGrammarObjectLiteralExpression(node, inDestructuringPattern); - var propertiesTable = ts.createSymbolTable(); + var propertiesTable; var propertiesArray = []; var spread = emptyObjectType; - var propagatedFlags = 2097152 /* FreshLiteral */; + var propagatedFlags = 8388608 /* FreshLiteral */; var contextualType = getApparentTypeOfContextualType(node); var contextualTypeHasPattern = contextualType && contextualType.pattern && - (contextualType.pattern.kind === 175 /* ObjectBindingPattern */ || contextualType.pattern.kind === 179 /* ObjectLiteralExpression */); - var isJSObjectLiteral = !contextualType && ts.isInJavaScriptFile(node); + (contextualType.pattern.kind === 178 /* ObjectBindingPattern */ || contextualType.pattern.kind === 182 /* ObjectLiteralExpression */); + var isInJSFile = ts.isInJavaScriptFile(node); + var isJSObjectLiteral = !contextualType && isInJSFile; var typeFlags = 0; var patternWithComputedProperties = false; var hasComputedStringProperty = false; var hasComputedNumberProperty = false; - var isInJSFile = ts.isInJavaScriptFile(node); + if (isInJSFile && node.properties.length === 0) { + // an empty JS object literal that nonetheless has members is a JS namespace + var symbol = getSymbolOfNode(node); + if (symbol.exports) { + propertiesTable = symbol.exports; + symbol.exports.forEach(function (symbol) { return propertiesArray.push(getMergedSymbol(symbol)); }); + return createObjectLiteralType(); + } + } + propertiesTable = ts.createSymbolTable(); var offset = 0; for (var i = 0; i < node.properties.length; i++) { var memberDecl = node.properties[i]; var member = getSymbolOfNode(memberDecl); var literalName = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */ || - memberDecl.kind === 266 /* ShorthandPropertyAssignment */ || + if (memberDecl.kind === 268 /* PropertyAssignment */ || + memberDecl.kind === 269 /* ShorthandPropertyAssignment */ || ts.isObjectLiteralMethod(memberDecl)) { var jsdocType = void 0; if (isInJSFile) { jsdocType = getTypeForDeclarationFromJSDocComment(memberDecl); } var type = void 0; - if (memberDecl.kind === 265 /* PropertyAssignment */) { - if (memberDecl.name.kind === 145 /* ComputedPropertyName */) { + if (memberDecl.kind === 268 /* PropertyAssignment */) { + if (memberDecl.name.kind === 146 /* ComputedPropertyName */) { var t = checkComputedPropertyName(memberDecl.name); if (t.flags & 224 /* Literal */) { literalName = ts.escapeLeadingUnderscores("" + t.value); @@ -37725,11 +39300,11 @@ var ts; } type = checkPropertyAssignment(memberDecl, checkMode); } - else if (memberDecl.kind === 152 /* MethodDeclaration */) { + else if (memberDecl.kind === 153 /* MethodDeclaration */) { type = checkObjectLiteralMethod(memberDecl, checkMode); } else { - ts.Debug.assert(memberDecl.kind === 266 /* ShorthandPropertyAssignment */); + ts.Debug.assert(memberDecl.kind === 269 /* ShorthandPropertyAssignment */); type = checkExpressionForMutableLocation(memberDecl.name, checkMode); } if (jsdocType) { @@ -37738,14 +39313,18 @@ var ts; } typeFlags |= type.flags; var nameType = hasLateBindableName(memberDecl) ? checkComputedPropertyName(memberDecl.name) : undefined; - var prop = nameType && isTypeUsableAsLateBoundName(nameType) + var hasLateBoundName = nameType && isTypeUsableAsLateBoundName(nameType); + var prop = hasLateBoundName ? createSymbol(4 /* Property */ | member.flags, getLateBoundNameFromType(nameType), 1024 /* Late */) : createSymbol(4 /* Property */ | member.flags, literalName || member.escapedName); + if (hasLateBoundName) { + prop.nameType = nameType; + } if (inDestructuringPattern) { // If object literal is an assignment pattern and if the assignment pattern specifies a default value // for the property, make the property optional. - var isOptional = (memberDecl.kind === 265 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || - (memberDecl.kind === 266 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); + var isOptional = (memberDecl.kind === 268 /* PropertyAssignment */ && hasDefaultValue(memberDecl.initializer)) || + (memberDecl.kind === 269 /* ShorthandPropertyAssignment */ && memberDecl.objectAssignmentInitializer); if (isOptional) { prop.flags |= 16777216 /* Optional */; } @@ -37773,12 +39352,12 @@ var ts; prop.target = member; member = prop; } - else if (memberDecl.kind === 267 /* SpreadAssignment */) { + else if (memberDecl.kind === 270 /* SpreadAssignment */) { if (languageVersion < 2 /* ES2015 */) { checkExternalEmitHelpers(memberDecl, 2 /* Assign */); } if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); propertiesArray = []; propertiesTable = ts.createSymbolTable(); hasComputedStringProperty = false; @@ -37790,7 +39369,7 @@ var ts; error(memberDecl, ts.Diagnostics.Spread_types_may_only_be_created_from_object_types); return unknownType; } - spread = getSpreadType(spread, type, node.symbol, propagatedFlags); + spread = getSpreadType(spread, type, node.symbol, propagatedFlags, /*objectFlags*/ 0); offset = i + 1; continue; } @@ -37800,7 +39379,7 @@ var ts; // an ordinary function declaration(section 6.1) with no parameters. // A set accessor declaration is processed in the same manner // as an ordinary function declaration with a single parameter and a Void return type. - ts.Debug.assert(memberDecl.kind === 154 /* GetAccessor */ || memberDecl.kind === 155 /* SetAccessor */); + ts.Debug.assert(memberDecl.kind === 155 /* GetAccessor */ || memberDecl.kind === 156 /* SetAccessor */); checkNodeDeferred(memberDecl); } if (!literalName && hasNonBindableDynamicName(memberDecl)) { @@ -37832,7 +39411,7 @@ var ts; } if (spread !== emptyObjectType) { if (propertiesArray.length > 0) { - spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags); + spread = getSpreadType(spread, createObjectLiteralType(), node.symbol, propagatedFlags, /*objectFlags*/ 0); } return spread; } @@ -37841,8 +39420,8 @@ var ts; var stringIndexInfo = isJSObjectLiteral ? jsObjectLiteralIndexInfo : hasComputedStringProperty ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 0 /* String */) : undefined; var numberIndexInfo = hasComputedNumberProperty && !isJSObjectLiteral ? getObjectLiteralIndexInfo(node.properties, offset, propertiesArray, 1 /* Number */) : undefined; var result = createAnonymousType(node.symbol, propertiesTable, ts.emptyArray, ts.emptyArray, stringIndexInfo, numberIndexInfo); - var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 2097152 /* FreshLiteral */; - result.flags |= 8388608 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 29360128 /* PropagatingFlags */); + var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 8388608 /* FreshLiteral */; + result.flags |= 33554432 /* ContainsObjectLiteral */ | freshObjectLiteralFlag | (typeFlags & 117440512 /* PropagatingFlags */); result.objectFlags |= 128 /* ObjectLiteral */; if (patternWithComputedProperties) { result.objectFlags |= 512 /* ObjectLiteralPatternWithComputedProperties */; @@ -37851,20 +39430,20 @@ var ts; result.pattern = node; } if (!(result.flags & 12288 /* Nullable */)) { - propagatedFlags |= (result.flags & 29360128 /* PropagatingFlags */); + propagatedFlags |= (result.flags & 117440512 /* PropagatingFlags */); } return result; } } function isValidSpreadType(type) { - return !!(type.flags & (1 /* Any */ | 33554432 /* NonPrimitive */) || + return !!(type.flags & (1 /* Any */ | 134217728 /* NonPrimitive */) || getFalsyFlags(type) & 14560 /* DefinitelyFalsy */ && isValidSpreadType(removeDefinitelyFalsyTypes(type)) || type.flags & 65536 /* Object */ && !isGenericMappedType(type) || type.flags & 393216 /* UnionOrIntersection */ && !ts.forEach(type.types, function (t) { return !isValidSpreadType(t); })); } function checkJsxSelfClosingElement(node, checkMode) { checkJsxOpeningLikeElementOrOpeningFragment(node, checkMode); - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } function checkJsxElement(node, checkMode) { // Check attributes @@ -37876,14 +39455,16 @@ var ts; else { checkExpression(node.closingElement.tagName); } - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } function checkJsxFragment(node, checkMode) { checkJsxOpeningLikeElementOrOpeningFragment(node.openingFragment, checkMode); - if (compilerOptions.jsx === 2 /* React */ && compilerOptions.jsxFactory) { - error(node, ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory); + if (compilerOptions.jsx === 2 /* React */ && (compilerOptions.jsxFactory || ts.getSourceFileOfNode(node).pragmas.has("jsx"))) { + error(node, compilerOptions.jsxFactory + ? ts.Diagnostics.JSX_fragment_is_not_supported_when_using_jsxFactory + : ts.Diagnostics.JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma); } - return getJsxGlobalElementType() || anyType; + return getJsxElementTypeAt(node) || anyType; } /** * Returns true iff the JSX element name would be a valid JS identifier, ignoring restrictions about keywords not being identifiers @@ -37898,7 +39479,7 @@ var ts; function isJsxIntrinsicIdentifier(tagName) { // TODO (yuisu): comment switch (tagName.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: case 99 /* ThisKeyword */: return false; case 71 /* Identifier */: @@ -37928,7 +39509,7 @@ var ts; var hasSpreadAnyType = false; var typeToIntersect; var explicitlySpecifyChildrenAttribute = false; - var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(); + var jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement)); for (var _i = 0, _a = attributes.properties; _i < _a.length; _i++) { var attributeDecl = _a[_i]; var member = attributeDecl.symbol; @@ -37948,9 +39529,9 @@ var ts; } } else { - ts.Debug.assert(attributeDecl.kind === 259 /* JsxSpreadAttribute */); + ts.Debug.assert(attributeDecl.kind === 262 /* JsxSpreadAttribute */); if (attributesTable.size > 0) { - spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); attributesTable = ts.createSymbolTable(); } var exprType = checkExpressionCached(attributeDecl.expression, checkMode); @@ -37958,7 +39539,7 @@ var ts; hasSpreadAnyType = true; } if (isValidSpreadType(exprType)) { - spread = getSpreadType(spread, exprType, openingLikeElement.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, exprType, openingLikeElement.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } else { typeToIntersect = typeToIntersect ? getIntersectionType([typeToIntersect, exprType]) : exprType; @@ -37967,11 +39548,11 @@ var ts; } if (!hasSpreadAnyType) { if (attributesTable.size > 0) { - spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, createJsxAttributesType(), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } // Handle children attribute - var parent = openingLikeElement.parent.kind === 250 /* JsxElement */ ? openingLikeElement.parent : undefined; + var parent = openingLikeElement.parent.kind === 253 /* JsxElement */ ? openingLikeElement.parent : undefined; // We have to check that openingElement of the parent is the one we are visiting as this may not be true for selfClosingElement if (parent && parent.openingElement === openingLikeElement && parent.children.length > 0) { var childrenTypes = checkJsxChildren(parent, checkMode); @@ -37989,7 +39570,7 @@ var ts; createArrayType(getUnionType(childrenTypes)); var childPropMap = ts.createSymbolTable(); childPropMap.set(jsxChildrenPropertyName, childrenPropSymbol); - spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, 67108864 /* JsxAttributes */); + spread = getSpreadType(spread, createAnonymousType(attributes.symbol, childPropMap, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined), attributes.symbol, /*typeFlags*/ 0, 4096 /* JsxAttributes */); } } if (hasSpreadAnyType) { @@ -38003,8 +39584,8 @@ var ts; */ function createJsxAttributesType() { var result = createAnonymousType(attributes.symbol, attributesTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); - result.flags |= 67108864 /* JsxAttributes */ | 8388608 /* ContainsObjectLiteral */; - result.objectFlags |= 128 /* ObjectLiteral */; + result.flags |= 33554432 /* ContainsObjectLiteral */; + result.objectFlags |= 128 /* ObjectLiteral */ | 4096 /* JsxAttributes */; return result; } } @@ -38033,12 +39614,11 @@ var ts; function checkJsxAttributes(node, checkMode) { return createJsxAttributesTypeFromAttributesProperty(node.parent, checkMode); } - function getJsxType(name) { - var jsxType = jsxTypes.get(name); - if (jsxType === undefined) { - jsxTypes.set(name, jsxType = getExportedTypeFromNamespace(JsxNames.JSX, name) || unknownType); - } - return jsxType; + function getJsxType(name, location) { + var namespace = getJsxNamespaceAt(location); + var exports = namespace && getExportsOfSymbol(namespace); + var typeSymbol = exports && getSymbol(exports, name, 67901928 /* Type */); + return typeSymbol ? getDeclaredTypeOfSymbol(typeSymbol) : unknownType; } /** * Looks up an intrinsic tag name and returns a symbol that either points to an intrinsic @@ -38049,11 +39629,11 @@ var ts; function getIntrinsicTagSymbol(node) { var links = getNodeLinks(node); if (!links.resolvedSymbol) { - var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node); if (intrinsicElementsType !== unknownType) { // Property case if (!ts.isIdentifier(node.tagName)) - throw ts.Debug.fail(); + return ts.Debug.fail(); var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText); if (intrinsicProp) { links.jsxFlags |= 1 /* IntrinsicNamedElement */; @@ -38106,7 +39686,7 @@ var ts; var signature = signatures_3[_i]; if (signature.typeParameters) { var isJavascript = ts.isInJavaScriptFile(node); - var inferenceContext = createInferenceContext(signature, /*flags*/ isJavascript ? 4 /* AnyDefault */ : 0 /* None */); + var inferenceContext = createInferenceContext(signature.typeParameters, signature, /*flags*/ isJavascript ? 4 /* AnyDefault */ : 0 /* None */); var typeArguments = inferJsxTypeArguments(signature, node, inferenceContext); instantiatedSignatures.push(getSignatureInstantiation(signature, typeArguments, isJavascript)); } @@ -38116,6 +39696,18 @@ var ts; } return getUnionType(ts.map(instantiatedSignatures, getReturnTypeOfSignature), 2 /* Subtype */); } + function getJsxNamespaceAt(location) { + var namespaceName = getJsxNamespace(location); + var resolvedNamespace = resolveName(location, namespaceName, 1920 /* Namespace */, /*diagnosticMessage*/ undefined, namespaceName, /*isUse*/ false); + if (resolvedNamespace) { + var candidate = getSymbol(getExportsOfSymbol(resolveSymbol(resolvedNamespace)), JsxNames.JSX, 1920 /* Namespace */); + if (candidate) { + return candidate; + } + } + // JSX global fallback + return getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); + } /** * Look into JSX namespace and then look for container with matching name as nameOfAttribPropContainer. * Get a single property from that container if existed. Report an error if there are more than one property. @@ -38123,11 +39715,9 @@ var ts; * @param nameOfAttribPropContainer a string of value JsxNames.ElementAttributesPropertyNameContainer or JsxNames.ElementChildrenAttributeNameContainer * if other string is given or the container doesn't exist, return undefined. */ - function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer) { - // JSX - var jsxNamespace = getGlobalSymbol(JsxNames.JSX, 1920 /* Namespace */, /*diagnosticMessage*/ undefined); + function getNameFromJsxElementAttributesContainer(nameOfAttribPropContainer, jsxNamespace) { // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [symbol] - var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, 793064 /* Type */); + var jsxElementAttribPropInterfaceSym = jsxNamespace && getSymbol(jsxNamespace.exports, nameOfAttribPropContainer, 67901928 /* Type */); // JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute [type] var jsxElementAttribPropInterfaceType = jsxElementAttribPropInterfaceSym && getDeclaredTypeOfSymbol(jsxElementAttribPropInterfaceSym); // The properties of JSX.ElementAttributesProperty | JSX.ElementChildrenAttribute @@ -38137,6 +39727,8 @@ var ts; if (propertiesOfJsxElementAttribPropInterface.length === 0) { return ""; } + // Element Attributes has one property, so the element attributes type will be the type of the corresponding + // property of the class instance type else if (propertiesOfJsxElementAttribPropInterface.length === 1) { return propertiesOfJsxElementAttribPropInterface[0].escapedName; } @@ -38152,19 +39744,11 @@ var ts; /// non-intrinsic elements' attributes type is 'any'), /// or '' if it has 0 properties (which means every /// non-intrinsic elements' attributes type is the element instance type) - function getJsxElementPropertiesName() { - if (!_hasComputedJsxElementPropertiesName) { - _hasComputedJsxElementPropertiesName = true; - _jsxElementPropertiesName = getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer); - } - return _jsxElementPropertiesName; + function getJsxElementPropertiesName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementAttributesPropertyNameContainer, jsxNamespace); } - function getJsxElementChildrenPropertyName() { - if (!_hasComputedJsxElementChildrenPropertyName) { - _hasComputedJsxElementChildrenPropertyName = true; - _jsxElementChildrenPropertyName = getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer); - } - return _jsxElementChildrenPropertyName; + function getJsxElementChildrenPropertyName(jsxNamespace) { + return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace); } function getApparentTypeOfJsxPropsType(propsType) { if (!propsType) { @@ -38193,7 +39777,7 @@ var ts; function defaultTryGetJsxStatelessFunctionAttributesType(openingLikeElement, elementType, elemInstanceType, elementClassType) { ts.Debug.assert(!(elementType.flags & 131072 /* Union */)); if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { - var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement); if (jsxStatelessElementType) { // We don't call getResolvedSignature here because we have already resolve the type of JSX Element. var callSignature = getResolvedJsxStatelessFunctionSignature(openingLikeElement, elementType, /*candidatesOutArray*/ undefined); @@ -38203,7 +39787,7 @@ var ts; paramType = getApparentTypeOfJsxPropsType(paramType); if (callReturnType && isTypeAssignableTo(callReturnType, jsxStatelessElementType)) { // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement); if (intrinsicAttributes !== unknownType) { paramType = intersectTypes(intrinsicAttributes, paramType); } @@ -38228,7 +39812,7 @@ var ts; ts.Debug.assert(!(elementType.flags & 131072 /* Union */)); if (!elementClassType || !isTypeAssignableTo(elemInstanceType, elementClassType)) { // Is this is a stateless function component? See if its single signature's return type is assignable to the JSX Element Type - var jsxStatelessElementType = getJsxGlobalStatelessElementType(); + var jsxStatelessElementType = getJsxStatelessElementTypeAt(openingLikeElement); if (jsxStatelessElementType) { // We don't call getResolvedSignature because here we have already resolve the type of JSX Element. var candidatesOutArray = []; @@ -38262,7 +39846,7 @@ var ts; result = allMatchingAttributesType; } // Intersect in JSX.IntrinsicAttributes if it exists - var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes); + var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, openingLikeElement); if (intrinsicAttributes !== unknownType) { result = intersectTypes(intrinsicAttributes, result); } @@ -38305,7 +39889,7 @@ var ts; // For example: // var CustomTag: "h1" = "h1"; // Hello World - var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements); + var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, openingLikeElement); if (intrinsicElementsType !== unknownType) { var stringLiteralTypeName = elementType.value; var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName)); @@ -38335,7 +39919,7 @@ var ts; if (elementClassType) { checkTypeRelatedTo(elemInstanceType, elementClassType, assignableRelation, openingLikeElement, ts.Diagnostics.JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements); } - return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement)); + return getJsxPropsTypeFromClassType(elemInstanceType, ts.isInJavaScriptFile(openingLikeElement), openingLikeElement); } /** * Get attributes type of the given intrinsic opening-like Jsx element by resolving the tag name. @@ -38366,7 +39950,7 @@ var ts; * @param shouldIncludeAllStatelessAttributesType a boolean value used by language service to get all possible attributes type from an overload stateless function component */ function getCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType) { - return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxGlobalElementClassType()); + return resolveCustomJsxElementAttributesType(node, shouldIncludeAllStatelessAttributesType, checkExpression(node.tagName), getJsxElementClassTypeAt(node)); } /** * Get all possible attributes type, especially from an overload stateless function component, of the given JSX opening-like element. @@ -38406,32 +39990,26 @@ var ts; var prop = getPropertyOfType(attributesType, attrib.name.escapedText); return prop || unknownSymbol; } - function getJsxGlobalElementClassType() { - if (!deferredJsxElementClassType) { - deferredJsxElementClassType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.ElementClass); - } - return deferredJsxElementClassType; + function getJsxElementClassTypeAt(location) { + var type = getJsxType(JsxNames.ElementClass, location); + if (type === unknownType) + return undefined; + return type; } - function getJsxGlobalElementType() { - if (!deferredJsxElementType) { - deferredJsxElementType = getExportedTypeFromNamespace(JsxNames.JSX, JsxNames.Element); - } - return deferredJsxElementType; + function getJsxElementTypeAt(location) { + return getJsxType(JsxNames.Element, location); } - function getJsxGlobalStatelessElementType() { - if (!deferredJsxStatelessElementType) { - var jsxElementType = getJsxGlobalElementType(); - if (jsxElementType) { - deferredJsxStatelessElementType = getUnionType([jsxElementType, nullType]); - } + function getJsxStatelessElementTypeAt(location) { + var jsxElementType = getJsxElementTypeAt(location); + if (jsxElementType) { + return getUnionType([jsxElementType, nullType]); } - return deferredJsxStatelessElementType; } /** * Returns all the properties of the Jsx.IntrinsicElements interface */ - function getJsxIntrinsicTagNames() { - var intrinsics = getJsxType(JsxNames.IntrinsicElements); + function getJsxIntrinsicTagNamesAt(location) { + var intrinsics = getJsxType(JsxNames.IntrinsicElements, location); return intrinsics ? getPropertiesOfType(intrinsics) : ts.emptyArray; } function checkJsxPreconditions(errorNode) { @@ -38439,7 +40017,7 @@ var ts; if ((compilerOptions.jsx || 0 /* None */) === 0 /* None */) { error(errorNode, ts.Diagnostics.Cannot_use_JSX_unless_the_jsx_flag_is_provided); } - if (getJsxGlobalElementType() === undefined) { + if (getJsxElementTypeAt(errorNode) === undefined) { if (noImplicitAny) { error(errorNode, ts.Diagnostics.JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist); } @@ -38454,13 +40032,13 @@ var ts; // The reactNamespace/jsxFactory's root symbol should be marked as 'used' so we don't incorrectly elide its import. // And if there is no reactNamespace/jsxFactory's symbol in scope when targeting React emit, we should issue an error. var reactRefErr = diagnostics && compilerOptions.jsx === 2 /* React */ ? ts.Diagnostics.Cannot_find_name_0 : undefined; - var reactNamespace = getJsxNamespace(); + var reactNamespace = getJsxNamespace(node); var reactLocation = isNodeOpeningLikeElement ? node.tagName : node; - var reactSym = resolveName(reactLocation, reactNamespace, 107455 /* Value */, reactRefErr, reactNamespace, /*isUse*/ true); + var reactSym = resolveName(reactLocation, reactNamespace, 67216319 /* Value */, reactRefErr, reactNamespace, /*isUse*/ true); if (reactSym) { // Mark local symbol as referenced here because it might not have been marked // if jsx emit was not react as there wont be error being emitted - reactSym.isReferenced = true; + reactSym.isReferenced = 67108863 /* All */; // If react symbol is alias, mark it as refereced if (reactSym.flags & 2097152 /* Alias */ && !isConstEnumOrConstEnumOnlyModule(resolveAlias(reactSym))) { markAliasSymbolAsReferenced(reactSym); @@ -38529,8 +40107,8 @@ var ts; var sourceAttributesType = createJsxAttributesTypeFromAttributesProperty(openingLikeElement, checkMode); // If the targetAttributesType is an emptyObjectType, indicating that there is no property named 'props' on this instance type. // but there exists a sourceAttributesType, we need to explicitly give an error as normal assignability check allow excess properties and will pass. - if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || sourceAttributesType.properties.length > 0)) { - error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName())); + if (targetAttributesType === emptyObjectType && (isTypeAny(sourceAttributesType) || getPropertiesOfType(sourceAttributesType).length > 0)) { + error(openingLikeElement, ts.Diagnostics.JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property, ts.unescapeLeadingUnderscores(getJsxElementPropertiesName(getJsxNamespaceAt(openingLikeElement)))); } else { // Check if sourceAttributesType assignable to targetAttributesType though this check will allow excess properties @@ -38569,7 +40147,7 @@ var ts; // If a symbol is a synthesized symbol with no value declaration, we assume it is a property. Example of this are the synthesized // '.prototype' property as well as synthesized tuple index properties. function getDeclarationKindFromSymbol(s) { - return s.valueDeclaration ? s.valueDeclaration.kind : 150 /* PropertyDeclaration */; + return s.valueDeclaration ? s.valueDeclaration.kind : 151 /* PropertyDeclaration */; } function getDeclarationNodeFlagsFromSymbol(s) { return s.valueDeclaration ? ts.getCombinedNodeFlags(s.valueDeclaration) : 0; @@ -38587,7 +40165,7 @@ var ts; */ function checkPropertyAccessibility(node, left, type, prop) { var flags = ts.getDeclarationModifierFlagsFromSymbol(prop); - var errorNode = node.kind === 180 /* PropertyAccessExpression */ || node.kind === 227 /* VariableDeclaration */ ? + var errorNode = node.kind === 183 /* PropertyAccessExpression */ || node.kind === 230 /* VariableDeclaration */ ? node.name : node.right; if (ts.getCheckFlags(prop) & 256 /* ContainsPrivate */) { @@ -38673,7 +40251,7 @@ var ts; function symbolHasNonMethodDeclaration(symbol) { return forEachProperty(symbol, function (prop) { var propKind = getDeclarationKindFromSymbol(prop); - return propKind !== 152 /* MethodDeclaration */ && propKind !== 151 /* MethodSignature */; + return propKind !== 153 /* MethodDeclaration */ && propKind !== 152 /* MethodSignature */; }); } function checkNonNullExpression(node, nullDiagnostic, undefinedDiagnostic, nullOrUndefinedDiagnostic) { @@ -38737,12 +40315,12 @@ var ts; return unknownType; } } - propType = getApparentTypeForLocation(getTypeOfSymbol(prop), node); + propType = getConstraintForLocation(getTypeOfSymbol(prop), node); } // Only compute control flow type if this is a property access expression that isn't an // assignment target, and the referenced property was declared as a variable, property, // accessor, or optional method. - if (node.kind !== 180 /* PropertyAccessExpression */ || + if (node.kind !== 183 /* PropertyAccessExpression */ || assignmentKind === 1 /* Definite */ || prop && !(prop.flags & (3 /* Variable */ | 4 /* Property */ | 98304 /* Accessor */)) && !(prop.flags & 8192 /* Method */ && propType.flags & 131072 /* Union */)) { return propType; @@ -38756,7 +40334,7 @@ var ts; var declaration = prop && prop.valueDeclaration; if (declaration && isInstancePropertyWithoutInitializer(declaration)) { var flowContainer = getControlFlowContainer(node); - if (flowContainer.kind === 153 /* Constructor */ && flowContainer.parent === declaration.parent) { + if (flowContainer.kind === 154 /* Constructor */ && flowContainer.parent === declaration.parent) { assumeUninitialized = true; } } @@ -38779,8 +40357,8 @@ var ts; && !isPropertyDeclaredInAncestorClass(prop)) { error(right, ts.Diagnostics.Block_scoped_variable_0_used_before_its_declaration, ts.idText(right)); } - else if (valueDeclaration.kind === 230 /* ClassDeclaration */ && - node.parent.kind !== 160 /* TypeReference */ && + else if (valueDeclaration.kind === 233 /* ClassDeclaration */ && + node.parent.kind !== 161 /* TypeReference */ && !(valueDeclaration.flags & 2097152 /* Ambient */) && !isBlockScopedNameDeclaredBeforeUse(valueDeclaration, right)) { error(right, ts.Diagnostics.Class_0_used_before_its_declaration, ts.idText(right)); @@ -38789,9 +40367,9 @@ var ts; function isInPropertyInitializer(node) { return !!ts.findAncestor(node, function (node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return true; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // We might be in `a = { b: this.b }`, so keep looking. See `tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts`. return false; default: @@ -38848,7 +40426,7 @@ var ts; diagnostics.add(ts.createDiagnosticForNodeFromMessageChain(propNode, errorInfo)); } function getSuggestionForNonexistentProperty(node, containingType) { - var suggestion = getSpellingSuggestionForName(ts.idText(node), getPropertiesOfType(containingType), 107455 /* Value */); + var suggestion = getSpellingSuggestionForName(ts.idText(node), getPropertiesOfType(containingType), 67216319 /* Value */); return suggestion && ts.symbolName(suggestion); } function getSuggestionForNonexistentSymbol(location, outerName, meaning) { @@ -38863,6 +40441,10 @@ var ts; }); return result && ts.symbolName(result); } + function getSuggestionForNonexistentModule(name, targetModule) { + var suggestion = targetModule.exports && getSpellingSuggestionForName(ts.idText(name), getExportsOfModuleAsArray(targetModule), 2623475 /* ModuleMember */); + return suggestion && ts.symbolName(suggestion); + } /** * Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough. * Names less than length 3 only check for case-insensitive equality, not levenshtein distance. @@ -38971,55 +40553,48 @@ var ts; return; } } - if (ts.getCheckFlags(prop) & 1 /* Instantiated */) { - getSymbolLinks(prop).target.isReferenced = true; - } - else { - prop.isReferenced = true; - } + (ts.getCheckFlags(prop) & 1 /* Instantiated */ ? getSymbolLinks(prop).target : prop).isReferenced = 67108863 /* All */; } function isValidPropertyAccess(node, propertyName) { - var left = node.kind === 180 /* PropertyAccessExpression */ ? node.expression : node.left; + var left = node.kind === 183 /* PropertyAccessExpression */ ? node.expression : node.left; return isValidPropertyAccessWithType(node, left, propertyName, getWidenedType(checkExpression(left))); } function isValidPropertyAccessForCompletions(node, type, property) { return isValidPropertyAccessWithType(node, node.expression, property.escapedName, type) && (!(property.flags & 8192 /* Method */) || isValidMethodAccess(property, type)); } - function isValidMethodAccess(method, type) { + function isValidMethodAccess(method, actualThisType) { var propType = getTypeOfFuncClassEnumModule(method); var signatures = getSignaturesOfType(getNonNullableType(propType), 0 /* Call */); ts.Debug.assert(signatures.length !== 0); return signatures.some(function (sig) { - var thisType = getThisTypeOfSignature(sig); - return !thisType || isTypeAssignableTo(type, thisType); + var signatureThisType = getThisTypeOfSignature(sig); + return !signatureThisType || isTypeAssignableTo(actualThisType, getInstantiatedSignatureThisType(sig, signatureThisType, actualThisType)); }); } - function isValidPropertyAccessWithType(node, left, propertyName, type) { - if (type !== unknownType && !isTypeAny(type)) { - var prop = getPropertyOfType(type, propertyName); - if (prop) { - return checkPropertyAccessibility(node, left, type, prop); - } - // In js files properties of unions are allowed in completion - if (ts.isInJavaScriptFile(left) && (type.flags & 131072 /* Union */)) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var elementType = _a[_i]; - if (isValidPropertyAccessWithType(node, left, propertyName, elementType)) { - return true; - } - } - } - return false; + function getInstantiatedSignatureThisType(sig, signatureThisType, actualThisType) { + if (!sig.typeParameters) { + return signatureThisType; } - return true; + var context = createInferenceContext(sig.typeParameters, sig, 0 /* None */); + inferTypes(context.inferences, actualThisType, signatureThisType); + return instantiateType(signatureThisType, createSignatureTypeMapper(sig, getInferredTypes(context))); + } + function isValidPropertyAccessWithType(node, left, propertyName, type) { + if (type === unknownType || isTypeAny(type)) { + return true; + } + var prop = getPropertyOfType(type, propertyName); + return prop ? checkPropertyAccessibility(node, left, type, prop) + // In js files properties of unions are allowed in completion + : ts.isInJavaScriptFile(node) && (type.flags & 131072 /* Union */) && type.types.some(function (elementType) { return isValidPropertyAccessWithType(node, left, propertyName, elementType); }); } /** * Return the symbol of the for-in variable declared or referenced by the given for-in statement. */ function getForInVariableSymbol(node) { var initializer = node.initializer; - if (initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer.kind === 231 /* VariableDeclarationList */) { var variable = initializer.declarations[0]; if (variable && !ts.isBindingPattern(variable.name)) { return getSymbolOfNode(variable); @@ -39048,7 +40623,7 @@ var ts; var child = expr; var node = expr.parent; while (node) { - if (node.kind === 216 /* ForInStatement */ && + if (node.kind === 219 /* ForInStatement */ && child === node.statement && getForInVariableSymbol(node) === symbol && hasNumericPropertyNames(getTypeOfExpression(node.expression))) { @@ -39066,7 +40641,7 @@ var ts; var indexExpression = node.argumentExpression; if (!indexExpression) { var sourceFile = ts.getSourceFileOfNode(node); - if (node.parent.kind === 183 /* NewExpression */ && node.parent.expression === node) { + if (node.parent.kind === 186 /* NewExpression */ && node.parent.expression === node) { var start = ts.skipTrivia(sourceFile.text, node.expression.end); var end = node.end; grammarErrorAtPos(sourceFile, start, end - start, ts.Diagnostics.new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead); @@ -39133,10 +40708,10 @@ var ts; // This gets us diagnostics for the type arguments and marks them as referenced. ts.forEach(node.typeArguments, checkSourceElement); } - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { checkExpression(node.template); } - else if (node.kind !== 148 /* Decorator */) { + else if (node.kind !== 149 /* Decorator */) { ts.forEach(node.arguments, function (argument) { checkExpression(argument); }); @@ -39202,7 +40777,7 @@ var ts; function getSpreadArgumentIndex(args) { for (var i = 0; i < args.length; i++) { var arg = args[i]; - if (arg && arg.kind === 199 /* SpreadElement */) { + if (arg && arg.kind === 202 /* SpreadElement */) { return i; } } @@ -39218,17 +40793,15 @@ var ts; // The arity check will be done in "checkApplicableSignatureForJsxOpeningLikeElement". return true; } - if (node.kind === 184 /* TaggedTemplateExpression */) { - var tagExpression = node; + if (node.kind === 187 /* TaggedTemplateExpression */) { // Even if the call is incomplete, we'll have a missing expression as our last argument, // so we can say the count is just the arg list length argCount = args.length; typeArguments = undefined; - if (tagExpression.template.kind === 197 /* TemplateExpression */) { + if (node.template.kind === 200 /* TemplateExpression */) { // If a tagged template expression lacks a tail literal, the call is incomplete. // Specifically, a template only can end in a TemplateTail or a Missing literal. - var templateExpression = tagExpression.template; - var lastSpan = ts.lastOrUndefined(templateExpression.templateSpans); + var lastSpan = ts.lastOrUndefined(node.template.templateSpans); ts.Debug.assert(lastSpan !== undefined); // we should always have at least one span. callIsIncomplete = ts.nodeIsMissing(lastSpan.literal) || !!lastSpan.literal.isUnterminated; } @@ -39236,26 +40809,25 @@ var ts; // If the template didn't end in a backtick, or its beginning occurred right prior to EOF, // then this might actually turn out to be a TemplateHead in the future; // so we consider the call to be incomplete. - var templateLiteral = tagExpression.template; + var templateLiteral = node.template; ts.Debug.assert(templateLiteral.kind === 13 /* NoSubstitutionTemplateLiteral */); callIsIncomplete = !!templateLiteral.isUnterminated; } } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { typeArguments = undefined; argCount = getEffectiveArgumentCount(node, /*args*/ undefined, signature); } else { - var callExpression = node; - if (!callExpression.arguments) { + if (!node.arguments) { // This only happens when we have something of the form: 'new C' - ts.Debug.assert(callExpression.kind === 183 /* NewExpression */); + ts.Debug.assert(node.kind === 186 /* NewExpression */); return signature.minArgumentCount === 0; } argCount = signatureHelpTrailingComma ? args.length + 1 : args.length; // If we are missing the close parenthesis, the call is incomplete. - callIsIncomplete = callExpression.arguments.end === callExpression.end; - typeArguments = callExpression.typeArguments; + callIsIncomplete = node.arguments.end === node.end; + typeArguments = node.typeArguments; spreadArgIndex = getSpreadArgumentIndex(args); } // If the user supplied type arguments, but the number of type arguments does not match @@ -39293,13 +40865,13 @@ var ts; } // Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec) function instantiateSignatureInContextOf(signature, contextualSignature, contextualMapper, compareTypes) { - var context = createInferenceContext(signature, 1 /* InferUnionTypes */, compareTypes); + var context = createInferenceContext(signature.typeParameters, signature, 1 /* InferUnionTypes */, compareTypes); forEachMatchingParameterType(contextualSignature, signature, function (source, target) { // Type parameters from outer context referenced by source type are fixed by instantiation of the source type inferTypes(context.inferences, instantiateType(source, contextualMapper || identityMapper), target); }); if (!contextualMapper) { - inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 4 /* ReturnType */); + inferTypes(context.inferences, getReturnTypeOfSignature(contextualSignature), getReturnTypeOfSignature(signature), 8 /* ReturnType */); } return getSignatureInstantiation(signature, getInferredTypes(context), ts.isInJavaScriptFile(contextualSignature.declaration)); } @@ -39330,7 +40902,7 @@ var ts; // example, given a 'function wrap(cb: (x: T) => U): (x: T) => U' and a call expression // 'let f: (x: string) => number = wrap(s => s.length)', we infer from the declared type of 'f' to the // return type of 'wrap'. - if (node.kind !== 148 /* Decorator */) { + if (node.kind !== 149 /* Decorator */) { var contextualType = getContextualType(node); if (contextualType) { // We clone the contextual mapper to avoid disturbing a resolution in progress for an @@ -39350,7 +40922,7 @@ var ts; instantiatedType; var inferenceTargetType = getReturnTypeOfSignature(signature); // Inferences made from return types have lower priority than all other inferences. - inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 4 /* ReturnType */); + inferTypes(context.inferences, inferenceSourceType, inferenceTargetType, 8 /* ReturnType */); } } var thisType = getThisTypeOfSignature(signature); @@ -39365,7 +40937,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { var paramType = getTypeAtPosition(signature, i); var argType = getEffectiveArgumentType(node, i); // If the effective argument type is 'undefined', there is no synthetic type @@ -39455,7 +41027,7 @@ var ts; return checkApplicableSignatureForJsxOpeningLikeElement(node, signature, relation); } var thisType = getThisTypeOfSignature(signature); - if (thisType && thisType !== voidType && node.kind !== 183 /* NewExpression */) { + if (thisType && thisType !== voidType && node.kind !== 186 /* NewExpression */) { // If the called expression is not of the form `x.f` or `x["f"]`, then sourceType = voidType // If the signature's 'this' type is voidType, then the check is skipped -- anything is compatible. // If the expression is a new expression, then the check is skipped. @@ -39472,7 +41044,7 @@ var ts; for (var i = 0; i < argCount; i++) { var arg = getEffectiveArgument(node, args, i); // If the effective argument is 'undefined', then it is an argument that is present but is synthetic. - if (arg === undefined || arg.kind !== 201 /* OmittedExpression */) { + if (arg === undefined || arg.kind !== 204 /* OmittedExpression */) { // Check spread elements against rest type (from arity check we know spread argument corresponds to a rest parameter) var paramType = getTypeAtPosition(signature, i); // If the effective argument type is undefined, there is no synthetic type for the argument. @@ -39496,12 +41068,12 @@ var ts; * Returns the this argument in calls like x.f(...) and x[f](...). Undefined otherwise. */ function getThisArgumentOfCall(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { var callee = node.expression; - if (callee.kind === 180 /* PropertyAccessExpression */) { + if (callee.kind === 183 /* PropertyAccessExpression */) { return callee.expression; } - else if (callee.kind === 181 /* ElementAccessExpression */) { + else if (callee.kind === 184 /* ElementAccessExpression */) { return callee.expression; } } @@ -39516,17 +41088,17 @@ var ts; * will be supplied from calls to `getEffectiveArgumentCount` and `getEffectiveArgumentType`. */ function getEffectiveCallArguments(node) { - if (node.kind === 184 /* TaggedTemplateExpression */) { + if (node.kind === 187 /* TaggedTemplateExpression */) { var template = node.template; var args_4 = [undefined]; - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { ts.forEach(template.templateSpans, function (span) { args_4.push(span.expression); }); } return args_4; } - else if (node.kind === 148 /* Decorator */) { + else if (node.kind === 149 /* Decorator */) { // For a decorator, we return undefined as we will determine // the number and types of arguments for a decorator using // `getEffectiveArgumentCount` and `getEffectiveArgumentType` below. @@ -39553,19 +41125,19 @@ var ts; * Otherwise, the argument count is the length of the 'args' array. */ function getEffectiveArgumentCount(node, args, signature) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: // A class decorator will have one argument (see `ClassDecorator` in core.d.ts) return 1; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // A property declaration decorator will have two arguments (see // `PropertyDecorator` in core.d.ts) return 2; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // A method or accessor declaration decorator will have two or three arguments (see // `PropertyDecorator` and `MethodDecorator` in core.d.ts) // If we are emitting decorators for ES3, we will only pass two arguments. @@ -39575,7 +41147,7 @@ var ts; // If the method decorator signature only accepts a target and a key, we will only // type check those arguments. return signature.parameters.length >= 3 ? 3 : 2; - case 147 /* Parameter */: + case 148 /* Parameter */: // A parameter declaration decorator will have three arguments (see // `ParameterDecorator` in core.d.ts) return 3; @@ -39599,25 +41171,25 @@ var ts; */ function getEffectiveDecoratorFirstArgumentType(node) { // The first argument to a decorator is its `target`. - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { // For a class decorator, the `target` is the type of the class (e.g. the // "static" or "constructor" side of the class) var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // For a parameter decorator, the `target` is the parent type of the // parameter's containing method. node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { var classSymbol = getSymbolOfNode(node); return getTypeOfSymbol(classSymbol); } } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // For a property or method decorator, the `target` is the // "static"-side type of the parent of the member if the member is // declared "static"; otherwise, it is the "instance"-side type of the @@ -39644,23 +41216,23 @@ var ts; */ function getEffectiveDecoratorSecondArgumentType(node) { // The second argument to a decorator is its `propertyKey` - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a second synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { node = node.parent; - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { // For a constructor parameter decorator, the `propertyKey` will be `undefined`. return anyType; } // For a non-constructor parameter decorator, the `propertyKey` will be either // a string or a symbol, based on the name of the parameter's containing method. } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `propertyKey` for a property or method decorator will be a // string literal type if the member name is an identifier, number, or string; // otherwise, if the member name is a computed property name it will @@ -39672,7 +41244,7 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return getLiteralType(element.name.text); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: var nameType = checkComputedPropertyName(element.name); if (isTypeAssignableToKind(nameType, 1536 /* ESSymbolLike */)) { return nameType; @@ -39698,21 +41270,21 @@ var ts; function getEffectiveDecoratorThirdArgumentType(node) { // The third argument to a decorator is either its `descriptor` for a method decorator // or its `parameterIndex` for a parameter decorator - if (node.kind === 230 /* ClassDeclaration */) { + if (node.kind === 233 /* ClassDeclaration */) { ts.Debug.fail("Class decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { // The `parameterIndex` for a parameter decorator is always a number return numberType; } - if (node.kind === 150 /* PropertyDeclaration */) { + if (node.kind === 151 /* PropertyDeclaration */) { ts.Debug.fail("Property decorators should not have a third synthetic argument."); return unknownType; } - if (node.kind === 152 /* MethodDeclaration */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 153 /* MethodDeclaration */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // The `descriptor` for a method decorator will be a `TypedPropertyDescriptor` // for the type of the member. var propertyType = getTypeOfNode(node); @@ -39744,10 +41316,10 @@ var ts; // Decorators provide special arguments, a tagged template expression provides // a special first argument, and string literals get string literal types // unless we're reporting errors - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { return getEffectiveDecoratorArgumentType(node, argIndex); } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { return getGlobalTemplateStringsArrayType(); } // This is not a synthetic argument, so we return 'undefined' @@ -39759,8 +41331,8 @@ var ts; */ function getEffectiveArgument(node, args, argIndex) { // For a decorator or the first argument of a tagged template expression we return undefined. - if (node.kind === 148 /* Decorator */ || - (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */)) { + if (node.kind === 149 /* Decorator */ || + (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */)) { return undefined; } return args[argIndex]; @@ -39769,11 +41341,11 @@ var ts; * Gets the error node to use when reporting errors for an effective argument. */ function getEffectiveArgumentErrorNode(node, argIndex, arg) { - if (node.kind === 148 /* Decorator */) { + if (node.kind === 149 /* Decorator */) { // For a decorator, we use the expression of the decorator for error reporting. return node.expression; } - else if (argIndex === 0 && node.kind === 184 /* TaggedTemplateExpression */) { + else if (argIndex === 0 && node.kind === 187 /* TaggedTemplateExpression */) { // For a the first argument of a tagged template expression, we use the template of the tag for error reporting. return node.template; } @@ -39782,8 +41354,8 @@ var ts; } } function resolveCall(node, signatures, candidatesOutArray, fallbackError) { - var isTaggedTemplate = node.kind === 184 /* TaggedTemplateExpression */; - var isDecorator = node.kind === 148 /* Decorator */; + var isTaggedTemplate = node.kind === 187 /* TaggedTemplateExpression */; + var isDecorator = node.kind === 149 /* Decorator */; var isJsxOpeningOrSelfClosingElement = ts.isJsxOpeningLikeElement(node); var typeArguments; if (!isTaggedTemplate && !isDecorator && !isJsxOpeningOrSelfClosingElement) { @@ -39857,7 +41429,7 @@ var ts; var result; // If we are in signature help, a trailing comma indicates that we intend to provide another argument, // so we will only accept overloads with arity at least 1 higher than the current number of provided arguments. - var signatureHelpTrailingComma = candidatesOutArray && node.kind === 182 /* CallExpression */ && node.arguments.hasTrailingComma; + var signatureHelpTrailingComma = candidatesOutArray && node.kind === 185 /* CallExpression */ && node.arguments.hasTrailingComma; // Section 4.12.1: // if the candidate list contains one or more signatures for which the type of each argument // expression is a subtype of each corresponding parameter type, the return type of the first @@ -39905,7 +41477,7 @@ var ts; max = Math.max(max, ts.length(sig.typeParameters)); } var paramCount = min < max ? min + "-" + max : min; - diagnostics.add(ts.createDiagnosticForNode(node, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); + diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Expected_0_type_arguments_but_got_1, paramCount, typeArguments.length)); } else if (args) { var min = Number.POSITIVE_INFINITY; @@ -39983,7 +41555,7 @@ var ts; } var candidate = void 0; var inferenceContext = originalCandidate.typeParameters ? - createInferenceContext(originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0 /* None */) : + createInferenceContext(originalCandidate.typeParameters, originalCandidate, /*flags*/ ts.isInJavaScriptFile(node) ? 4 /* AnyDefault */ : 0 /* None */) : undefined; while (true) { candidate = originalCandidate; @@ -40252,16 +41824,16 @@ var ts; */ function getDiagnosticHeadMessageForDecoratorResolution(node) { switch (node.parent.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.Diagnostics.Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression; - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.Diagnostics.Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.Diagnostics.Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.Diagnostics.Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression; } } @@ -40349,16 +41921,16 @@ var ts; } function resolveSignature(node, candidatesOutArray) { switch (node.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return resolveCallExpression(node, candidatesOutArray); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return resolveNewExpression(node, candidatesOutArray); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return resolveTaggedTemplateExpression(node, candidatesOutArray); - case 148 /* Decorator */: + case 149 /* Decorator */: return resolveDecorator(node, candidatesOutArray); - case 252 /* JsxOpeningElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: // This code-path is called by language service return resolveStatelessJsxOpeningLikeElement(node, checkExpression(node.tagName), candidatesOutArray) || unknownSignature; } @@ -40407,19 +41979,50 @@ var ts; return false; } function getJavaScriptClassType(symbol) { - if (ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = getSymbolOfNode(symbol.valueDeclaration.initializer); + var initializer = ts.getDeclaredJavascriptInitializer(symbol.valueDeclaration); + if (initializer) { + symbol = getSymbolOfNode(initializer); } + var inferred; if (isJavaScriptConstructor(symbol.valueDeclaration)) { - return getInferredClassType(symbol); + inferred = getInferredClassType(symbol); } - if (symbol.flags & 3 /* Variable */) { - var valueType = getTypeOfSymbol(symbol); - if (valueType.symbol && !isInferredClassType(valueType) && isJavaScriptConstructor(valueType.symbol.valueDeclaration)) { - return getInferredClassType(valueType.symbol); + var assigned = getAssignedClassType(symbol); + var valueType = getTypeOfSymbol(symbol); + if (valueType.symbol && !isInferredClassType(valueType) && isJavaScriptConstructor(valueType.symbol.valueDeclaration)) { + inferred = getInferredClassType(valueType.symbol); + } + return assigned && inferred ? + getIntersectionType([inferred, assigned]) : + assigned || inferred; + } + function getAssignedClassType(symbol) { + var decl = symbol.valueDeclaration; + var assignmentSymbol = decl && decl.parent && + (ts.isBinaryExpression(decl.parent) && getSymbolOfNode(decl.parent.left) || + ts.isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent)); + if (assignmentSymbol) { + var prototype = ts.forEach(assignmentSymbol.declarations, getAssignedJavascriptPrototype); + if (prototype) { + return checkExpression(prototype); } } } + function getAssignedJavascriptPrototype(node) { + if (!node.parent) { + return false; + } + var parent = node.parent; + while (parent && parent.kind === 183 /* PropertyAccessExpression */) { + parent = parent.parent; + } + return parent && ts.isBinaryExpression(parent) && + ts.isPropertyAccessExpression(parent.left) && + parent.left.name.escapedText === "prototype" && + parent.operatorToken.kind === 58 /* EqualsToken */ && + ts.isObjectLiteralExpression(parent.right) && + parent.right; + } function getInferredClassType(symbol) { var links = getSymbolLinks(symbol); if (!links.inferredClassType) { @@ -40444,12 +42047,12 @@ var ts; if (node.expression.kind === 97 /* SuperKeyword */) { return voidType; } - if (node.kind === 183 /* NewExpression */) { + if (node.kind === 186 /* NewExpression */) { var declaration = signature.declaration; if (declaration && - declaration.kind !== 153 /* Constructor */ && - declaration.kind !== 157 /* ConstructSignature */ && - declaration.kind !== 162 /* ConstructorType */ && + declaration.kind !== 154 /* Constructor */ && + declaration.kind !== 158 /* ConstructSignature */ && + declaration.kind !== 163 /* ConstructorType */ && !ts.isJSDocConstructSignature(declaration)) { // When resolved signature is a call signature (and not a construct signature) the result type is any, unless // the declaring function had members created through 'x.prototype.y = expr' or 'this.y = expr' psuedodeclarations @@ -40497,7 +42100,7 @@ var ts; if (!globalESSymbol) { return false; } - return globalESSymbol === resolveName(left, "Symbol", 107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); + return globalESSymbol === resolveName(left, "Symbol", 67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); } function checkImportCallExpression(node) { // Check grammar of dynamic import @@ -40539,7 +42142,7 @@ var ts; var anonymousSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */); var defaultContainingObject = createAnonymousType(anonymousSymbol, memberTable, ts.emptyArray, ts.emptyArray, /*stringIndexInfo*/ undefined, /*numberIndexInfo*/ undefined); anonymousSymbol.type = defaultContainingObject; - synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*propegatedFlags*/ 0) : defaultContainingObject; + synthType.syntheticType = isValidSpreadType(type) ? getSpreadType(type, defaultContainingObject, anonymousSymbol, /*typeFLags*/ 0, /*objectFlags*/ 0) : defaultContainingObject; } else { synthType.syntheticType = type; @@ -40555,8 +42158,8 @@ var ts; } // Make sure require is not a local function if (!ts.isIdentifier(node.expression)) - throw ts.Debug.fail(); - var resolvedRequire = resolveName(node.expression, node.expression.escapedText, 107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); + return ts.Debug.fail(); + var resolvedRequire = resolveName(node.expression, node.expression.escapedText, 67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); if (!resolvedRequire) { // project does not contain symbol named 'require' - assume commonjs require return true; @@ -40566,9 +42169,9 @@ var ts; return false; } var targetDeclarationKind = resolvedRequire.flags & 16 /* Function */ - ? 229 /* FunctionDeclaration */ + ? 232 /* FunctionDeclaration */ : resolvedRequire.flags & 3 /* Variable */ - ? 227 /* VariableDeclaration */ + ? 230 /* VariableDeclaration */ : 0 /* Unknown */; if (targetDeclarationKind !== 0 /* Unknown */) { var decl = ts.getDeclarationOfKind(resolvedRequire, targetDeclarationKind); @@ -40608,7 +42211,7 @@ var ts; error(node, ts.Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target"); return unknownType; } - else if (container.kind === 153 /* Constructor */) { + else if (container.kind === 154 /* Constructor */) { var symbol = getSymbolOfNode(container.parent); return getTypeOfSymbol(symbol); } @@ -40735,7 +42338,7 @@ var ts; } var functionFlags = ts.getFunctionFlags(func); var type; - if (func.body.kind !== 208 /* Block */) { + if (func.body.kind !== 211 /* Block */) { type = checkExpressionCached(func.body, checkMode); if (functionFlags & 2 /* Async */) { // From within an async function you can return either a non-promise value or a promise. Any @@ -40747,7 +42350,7 @@ var ts; } else { var types = checkAndAggregateReturnExpressionTypes(func, checkMode); - if (functionFlags & 1 /* Generator */) { + if (functionFlags & 1 /* Generator */) { // Generator or AsyncGenerator function types = ts.concatenate(checkAndAggregateYieldOperandTypes(func, checkMode), types); if (!types || types.length === 0) { var iterableIteratorAny = functionFlags & 2 /* Async */ @@ -40816,25 +42419,21 @@ var ts; } function checkAndAggregateYieldOperandTypes(func, checkMode) { var aggregatedTypes = []; - var functionFlags = ts.getFunctionFlags(func); + var isAsync = (ts.getFunctionFlags(func) & 2 /* Async */) !== 0; ts.forEachYieldExpression(func.body, function (yieldExpression) { - var expr = yieldExpression.expression; - if (expr) { - var type = checkExpressionCached(expr, checkMode); - if (yieldExpression.asteriskToken) { - // A yield* expression effectively yields everything that its operand yields - type = checkIteratedTypeOrElementType(type, yieldExpression.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); - } - if (functionFlags & 2 /* Async */) { - type = checkAwaitedType(type, expr, yieldExpression.asteriskToken - ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member - : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); - } - ts.pushIfUnique(aggregatedTypes, type); - } + ts.pushIfUnique(aggregatedTypes, getYieldedTypeOfYieldExpression(yieldExpression, isAsync, checkMode)); }); return aggregatedTypes; } + function getYieldedTypeOfYieldExpression(node, isAsync, checkMode) { + var errorNode = node.expression || node; + var expressionType = node.expression ? checkExpressionCached(node.expression, checkMode) : undefinedWideningType; + // A `yield*` expression effectively yields everything that its operand yields + var yieldedType = node.asteriskToken ? checkIteratedTypeOrElementType(expressionType, errorNode, /*allowStringInput*/ false, isAsync) : expressionType; + return !isAsync ? yieldedType : getAwaitedType(yieldedType, errorNode, node.asteriskToken + ? ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member + : ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); + } function isExhaustiveSwitchStatement(node) { if (!node.possiblyExhaustive) { return false; @@ -40853,7 +42452,7 @@ var ts; if (!(func.flags & 128 /* HasImplicitReturn */)) { return false; } - if (ts.some(func.body.statements, function (statement) { return statement.kind === 222 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { + if (ts.some(func.body.statements, function (statement) { return statement.kind === 225 /* SwitchStatement */ && isExhaustiveSwitchStatement(statement); })) { return false; } return true; @@ -40894,11 +42493,11 @@ var ts; } function mayReturnNever(func) { switch (func.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return true; - case 152 /* MethodDeclaration */: - return func.parent.kind === 179 /* ObjectLiteralExpression */; + case 153 /* MethodDeclaration */: + return func.parent.kind === 182 /* ObjectLiteralExpression */; default: return false; } @@ -40922,7 +42521,7 @@ var ts; } // If all we have is a function signature, or an arrow function with an expression body, then there is nothing to check. // also if HasImplicitReturn flag is not set this means that all codepaths in function body end with return or throw - if (ts.nodeIsMissing(func.body) || func.body.kind !== 208 /* Block */ || !functionHasImplicitReturn(func)) { + if (func.kind === 152 /* MethodSignature */ || ts.nodeIsMissing(func.body) || func.body.kind !== 211 /* Block */ || !functionHasImplicitReturn(func)) { return; } var hasExplicitReturn = func.flags & 256 /* HasExplicitReturn */; @@ -40955,7 +42554,7 @@ var ts; } } function checkFunctionExpressionOrObjectLiteralMethod(node, checkMode) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); // The identityMapper object is used to indicate that function expressions are wildcards if (checkMode === 1 /* SkipContextSensitive */ && isContextSensitive(node)) { checkNodeDeferred(node); @@ -40963,7 +42562,7 @@ var ts; } // Grammar checking var hasGrammarError = checkGrammarFunctionLikeDeclaration(node); - if (!hasGrammarError && node.kind === 187 /* FunctionExpression */) { + if (!hasGrammarError && node.kind === 190 /* FunctionExpression */) { checkGrammarForGenerator(node); } var links = getNodeLinks(node); @@ -40998,7 +42597,7 @@ var ts; checkNodeDeferred(node); } } - if (produceDiagnostics && node.kind !== 152 /* MethodDeclaration */) { + if (produceDiagnostics && node.kind !== 153 /* MethodDeclaration */) { checkCollisionWithCapturedSuperVariable(node, node.name); checkCollisionWithCapturedThisVariable(node, node.name); checkCollisionWithCapturedNewTargetVariable(node, node.name); @@ -41006,14 +42605,14 @@ var ts; return type; } function checkFunctionExpressionOrObjectLiteralMethodDeferred(node) { - ts.Debug.assert(node.kind !== 152 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); + ts.Debug.assert(node.kind !== 153 /* MethodDeclaration */ || ts.isObjectLiteralMethod(node)); var functionFlags = ts.getFunctionFlags(node); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); var returnOrPromisedType = returnTypeNode && ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */ ? checkAsyncFunctionReturnType(node) : // Async function getTypeFromTypeNode(returnTypeNode)); // AsyncGenerator function, Generator function, or normal function - if ((functionFlags & 1 /* Generator */) === 0) { + if ((functionFlags & 1 /* Generator */) === 0) { // Async function or normal function // return is not necessary in the body of generators checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnOrPromisedType); } @@ -41026,7 +42625,7 @@ var ts; // checkFunctionExpressionBodies). So it must be done now. getReturnTypeOfSignature(getSignatureFromDeclaration(node)); } - if (node.body.kind === 208 /* Block */) { + if (node.body.kind === 211 /* Block */) { checkSourceElement(node.body); } else { @@ -41037,11 +42636,11 @@ var ts; // its return type annotation. var exprType = checkExpression(node.body); if (returnOrPromisedType) { - if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) { + if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) { // Async function var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); checkTypeAssignableTo(awaitedType, returnOrPromisedType, node.body); } - else { + else { // Normal function checkTypeAssignableTo(exprType, returnOrPromisedType, node.body); } } @@ -41073,11 +42672,11 @@ var ts; if (isReadonlySymbol(symbol)) { // Allow assignments to readonly properties within constructors of the same class declaration. if (symbol.flags & 4 /* Property */ && - (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) && + (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) && expr.expression.kind === 99 /* ThisKeyword */) { // Look for if this is the constructor for the class that `symbol` is a property of. var func = ts.getContainingFunction(expr); - if (!(func && func.kind === 153 /* Constructor */)) { + if (!(func && func.kind === 154 /* Constructor */)) { return true; } // If func.parent is a class and symbol is a (readonly) property of that class, or @@ -41090,13 +42689,13 @@ var ts; return false; } function isReferenceThroughNamespaceImport(expr) { - if (expr.kind === 180 /* PropertyAccessExpression */ || expr.kind === 181 /* ElementAccessExpression */) { + if (expr.kind === 183 /* PropertyAccessExpression */ || expr.kind === 184 /* ElementAccessExpression */) { var node = ts.skipParentheses(expr.expression); if (node.kind === 71 /* Identifier */) { var symbol = getNodeLinks(node).resolvedSymbol; if (symbol.flags & 2097152 /* Alias */) { var declaration = getDeclarationOfAliasSymbol(symbol); - return declaration && declaration.kind === 241 /* NamespaceImport */; + return declaration && declaration.kind === 244 /* NamespaceImport */; } } } @@ -41105,7 +42704,7 @@ var ts; function checkReferenceExpression(expr, invalidReferenceMessage) { // References are combinations of identifiers, parentheses, and property accesses. var node = ts.skipOuterExpressions(expr, 2 /* Assertions */ | 1 /* Parentheses */); - if (node.kind !== 71 /* Identifier */ && node.kind !== 180 /* PropertyAccessExpression */ && node.kind !== 181 /* ElementAccessExpression */) { + if (node.kind !== 71 /* Identifier */ && node.kind !== 183 /* PropertyAccessExpression */ && node.kind !== 184 /* ElementAccessExpression */) { error(expr, invalidReferenceMessage); return false; } @@ -41114,7 +42713,7 @@ var ts; function checkDeleteExpression(node) { checkExpression(node.expression); var expr = ts.skipParentheses(node.expression); - if (expr.kind !== 180 /* PropertyAccessExpression */ && expr.kind !== 181 /* ElementAccessExpression */) { + if (expr.kind !== 183 /* PropertyAccessExpression */ && expr.kind !== 184 /* ElementAccessExpression */) { error(expr, ts.Diagnostics.The_operand_of_a_delete_operator_must_be_a_property_reference); return booleanType; } @@ -41199,7 +42798,7 @@ var ts; // Return true if type might be of the given kind. A union or intersection type might be of a given // kind if at least one constituent type is of the given kind. function maybeTypeOfKind(type, kind) { - if (type.flags & kind) { + if (type.flags & kind || kind & 536870912 /* GenericMappedType */ && isGenericMappedType(type)) { return true; } if (type.flags & 393216 /* UnionOrIntersection */) { @@ -41228,7 +42827,7 @@ var ts; (kind & 8192 /* Null */ && isTypeAssignableTo(source, nullType)) || (kind & 4096 /* Undefined */ && isTypeAssignableTo(source, undefinedType)) || (kind & 512 /* ESSymbol */ && isTypeAssignableTo(source, esSymbolType)) || - (kind & 33554432 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); + (kind & 134217728 /* NonPrimitive */ && isTypeAssignableTo(source, nonPrimitiveType)); } function allTypesAssignableToKind(source, kind, strict) { return source.flags & 131072 /* Union */ ? @@ -41273,7 +42872,7 @@ var ts; if (!(isTypeComparableTo(leftType, stringType) || isTypeAssignableToKind(leftType, 84 /* NumberLike */ | 1536 /* ESSymbolLike */))) { error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol); } - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter); } return booleanType; @@ -41291,9 +42890,9 @@ var ts; } /** Note: If property cannot be a SpreadAssignment, then allProperties does not need to be provided */ function checkObjectLiteralDestructuringPropertyAssignment(objectLiteralType, property, allProperties) { - if (property.kind === 265 /* PropertyAssignment */ || property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 268 /* PropertyAssignment */ || property.kind === 269 /* ShorthandPropertyAssignment */) { var name = property.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(name); } if (isComputedNonLiteralName(name)) { @@ -41306,7 +42905,7 @@ var ts; isNumericLiteralName(text) && getIndexTypeOfType(objectLiteralType, 1 /* Number */) || getIndexTypeOfType(objectLiteralType, 0 /* String */); if (type) { - if (property.kind === 266 /* ShorthandPropertyAssignment */) { + if (property.kind === 269 /* ShorthandPropertyAssignment */) { return checkDestructuringAssignment(property, type); } else { @@ -41318,7 +42917,7 @@ var ts; error(name, ts.Diagnostics.Type_0_has_no_property_1_and_no_string_index_signature, typeToString(objectLiteralType), ts.declarationNameToString(name)); } } - else if (property.kind === 267 /* SpreadAssignment */) { + else if (property.kind === 270 /* SpreadAssignment */) { if (languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(property, 4 /* Rest */); } @@ -41352,8 +42951,8 @@ var ts; function checkArrayLiteralDestructuringElementAssignment(node, sourceType, elementIndex, elementType, checkMode) { var elements = node.elements; var element = elements[elementIndex]; - if (element.kind !== 201 /* OmittedExpression */) { - if (element.kind !== 199 /* SpreadElement */) { + if (element.kind !== 204 /* OmittedExpression */) { + if (element.kind !== 202 /* SpreadElement */) { var propName = "" + elementIndex; var type = isTypeAny(sourceType) ? sourceType @@ -41381,7 +42980,7 @@ var ts; } else { var restExpression = element.expression; - if (restExpression.kind === 195 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { + if (restExpression.kind === 198 /* BinaryExpression */ && restExpression.operatorToken.kind === 58 /* EqualsToken */) { error(restExpression.operatorToken, ts.Diagnostics.A_rest_element_cannot_have_an_initializer); } else { @@ -41394,7 +42993,7 @@ var ts; } function checkDestructuringAssignment(exprOrAssignment, sourceType, checkMode) { var target; - if (exprOrAssignment.kind === 266 /* ShorthandPropertyAssignment */) { + if (exprOrAssignment.kind === 269 /* ShorthandPropertyAssignment */) { var prop = exprOrAssignment; if (prop.objectAssignmentInitializer) { // In strict null checking mode, if a default value of a non-undefined type is specified, remove @@ -41410,21 +43009,21 @@ var ts; else { target = exprOrAssignment; } - if (target.kind === 195 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { + if (target.kind === 198 /* BinaryExpression */ && target.operatorToken.kind === 58 /* EqualsToken */) { checkBinaryExpression(target, checkMode); target = target.left; } - if (target.kind === 179 /* ObjectLiteralExpression */) { + if (target.kind === 182 /* ObjectLiteralExpression */) { return checkObjectLiteralAssignment(target, sourceType); } - if (target.kind === 178 /* ArrayLiteralExpression */) { + if (target.kind === 181 /* ArrayLiteralExpression */) { return checkArrayLiteralAssignment(target, sourceType, checkMode); } return checkReferenceAssignment(target, sourceType, checkMode); } function checkReferenceAssignment(target, sourceType, checkMode) { var targetType = checkExpression(target, checkMode); - var error = target.parent.kind === 267 /* SpreadAssignment */ ? + var error = target.parent.kind === 270 /* SpreadAssignment */ ? ts.Diagnostics.The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access : ts.Diagnostics.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access; if (checkReferenceExpression(target, error)) { @@ -41446,35 +43045,35 @@ var ts; case 71 /* Identifier */: case 9 /* StringLiteral */: case 12 /* RegularExpressionLiteral */: - case 184 /* TaggedTemplateExpression */: - case 197 /* TemplateExpression */: + case 187 /* TaggedTemplateExpression */: + case 200 /* TemplateExpression */: case 13 /* NoSubstitutionTemplateLiteral */: case 8 /* NumericLiteral */: case 101 /* TrueKeyword */: case 86 /* FalseKeyword */: case 95 /* NullKeyword */: - case 139 /* UndefinedKeyword */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: - case 188 /* ArrowFunction */: - case 178 /* ArrayLiteralExpression */: - case 179 /* ObjectLiteralExpression */: - case 190 /* TypeOfExpression */: - case 204 /* NonNullExpression */: - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: + case 140 /* UndefinedKeyword */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 181 /* ArrayLiteralExpression */: + case 182 /* ObjectLiteralExpression */: + case 193 /* TypeOfExpression */: + case 207 /* NonNullExpression */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: return true; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isSideEffectFree(node.whenTrue) && isSideEffectFree(node.whenFalse); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.isAssignmentOperator(node.operatorToken.kind)) { return false; } return isSideEffectFree(node.left) && isSideEffectFree(node.right); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: // Unary operators ~, !, +, and - have no side effects. // The rest do. switch (node.operator) { @@ -41486,9 +43085,9 @@ var ts; } return false; // Some forms listed here for clarity - case 191 /* VoidExpression */: // Explicit opt-out - case 185 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings - case 203 /* AsExpression */: // Not SEF, but can produce useful type warnings + case 194 /* VoidExpression */: // Explicit opt-out + case 188 /* TypeAssertionExpression */: // Not SEF, but can produce useful type warnings + case 206 /* AsExpression */: // Not SEF, but can produce useful type warnings default: return false; } @@ -41497,11 +43096,14 @@ var ts; return (target.flags & 12288 /* Nullable */) !== 0 || isTypeComparableTo(source, target); } function checkBinaryExpression(node, checkMode) { + if (ts.isInJavaScriptFile(node) && ts.getAssignedJavascriptInitializer(node)) { + return checkExpression(node.right, checkMode); + } return checkBinaryLikeExpression(node.left, node.operatorToken, node.right, checkMode, node); } function checkBinaryLikeExpression(left, operatorToken, right, checkMode, errorNode) { var operator = operatorToken.kind; - if (operator === 58 /* EqualsToken */ && (left.kind === 179 /* ObjectLiteralExpression */ || left.kind === 178 /* ArrayLiteralExpression */)) { + if (operator === 58 /* EqualsToken */ && (left.kind === 182 /* ObjectLiteralExpression */ || left.kind === 181 /* ArrayLiteralExpression */)) { return checkDestructuringAssignment(left, checkExpression(right, checkMode), checkMode); } var leftType = checkExpression(left, checkMode); @@ -41706,52 +43308,35 @@ var ts; error(node, ts.Diagnostics.yield_expressions_cannot_be_used_in_a_parameter_initializer); } } - if (node.expression) { - var func = ts.getContainingFunction(node); - // If the user's code is syntactically correct, the func should always have a star. After all, - // we are in a yield context. - var functionFlags = func && ts.getFunctionFlags(func); - if (node.asteriskToken) { - // Async generator functions prior to ESNext require the __await, __asyncDelegator, - // and __asyncValues helpers - if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && - languageVersion < 6 /* ESNext */) { - checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */); - } - // Generator functions prior to ES2015 require the __values helper - if ((functionFlags & 3 /* AsyncGenerator */) === 1 /* Generator */ && - languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { - checkExternalEmitHelpers(node, 256 /* Values */); - } + var func = ts.getContainingFunction(node); + var functionFlags = func ? ts.getFunctionFlags(func) : 0 /* Normal */; + if (!(functionFlags & 1 /* Generator */)) { + // If the user's code is syntactically correct, the func should always have a star. After all, we are in a yield context. + return anyType; + } + if (node.asteriskToken) { + // Async generator functions prior to ESNext require the __await, __asyncDelegator, + // and __asyncValues helpers + if ((functionFlags & 3 /* AsyncGenerator */) === 3 /* AsyncGenerator */ && + languageVersion < 6 /* ESNext */) { + checkExternalEmitHelpers(node, 26624 /* AsyncDelegatorIncludes */); } - if (functionFlags & 1 /* Generator */) { - var expressionType = checkExpressionCached(node.expression); - var expressionElementType = void 0; - var nodeIsYieldStar = !!node.asteriskToken; - if (nodeIsYieldStar) { - expressionElementType = checkIteratedTypeOrElementType(expressionType, node.expression, /*allowStringInput*/ false, (functionFlags & 2 /* Async */) !== 0); - } - // There is no point in doing an assignability check if the function - // has no explicit return type because the return type is directly computed - // from the yield expressions. - var returnType = ts.getEffectiveReturnTypeNode(func); - if (returnType) { - var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(returnType), (functionFlags & 2 /* Async */) !== 0) || anyType; - if (nodeIsYieldStar) { - checkTypeAssignableTo(functionFlags & 2 /* Async */ - ? getAwaitedType(expressionElementType, node.expression, ts.Diagnostics.Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) - : expressionElementType, signatureElementType, node.expression, - /*headMessage*/ undefined); - } - else { - checkTypeAssignableTo(functionFlags & 2 /* Async */ - ? getAwaitedType(expressionType, node.expression, ts.Diagnostics.Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member) - : expressionType, signatureElementType, node.expression, - /*headMessage*/ undefined); - } - } + // Generator functions prior to ES2015 require the __values helper + if ((functionFlags & 3 /* AsyncGenerator */) === 1 /* Generator */ && + languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + checkExternalEmitHelpers(node, 256 /* Values */); } } + var isAsync = (functionFlags & 2 /* Async */) !== 0; + var yieldedType = getYieldedTypeOfYieldExpression(node, isAsync); + // There is no point in doing an assignability check if the function + // has no explicit return type because the return type is directly computed + // from the yield expressions. + var returnType = ts.getEffectiveReturnTypeNode(func); + if (returnType) { + var signatureElementType = getIteratedTypeOfGenerator(getTypeFromTypeNode(returnType), isAsync) || anyType; + checkTypeAssignableTo(yieldedType, signatureElementType, node.expression || node, /*headMessage*/ undefined); + } // Both yield and yield* expressions have type 'any' return anyType; } @@ -41773,7 +43358,7 @@ var ts; return stringType; } function getContextNode(node) { - if (node.kind === 258 /* JsxAttributes */) { + if (node.kind === 261 /* JsxAttributes */) { return node.parent.parent; // Needs to be the root JsxElement, so it encompasses the attributes _and_ the children (which are essentially part of the attributes) } return node; @@ -41809,13 +43394,14 @@ var ts; } function isTypeAssertion(node) { node = ts.skipParentheses(node); - return node.kind === 185 /* TypeAssertionExpression */ || node.kind === 203 /* AsExpression */; + return node.kind === 188 /* TypeAssertionExpression */ || node.kind === 206 /* AsExpression */; } function checkDeclarationInitializer(declaration) { - var type = getTypeOfExpression(declaration.initializer, /*cache*/ true); + var initializer = ts.isInJavaScriptFile(declaration) && ts.getDeclaredJavascriptInitializer(declaration) || declaration.initializer; + var type = getTypeOfExpression(initializer, /*cache*/ true); return ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || (ts.getCombinedModifierFlags(declaration) & 64 /* Readonly */ && !ts.isParameterPropertyDeclaration(declaration)) || - isTypeAssertion(declaration.initializer) ? type : getWidenedLiteralType(type); + isTypeAssertion(initializer) ? type : getWidenedLiteralType(type); } function isLiteralOfContextualType(candidateType, contextualType) { if (contextualType) { @@ -41823,7 +43409,7 @@ var ts; var types = contextualType.types; return ts.some(types, function (t) { return isLiteralOfContextualType(candidateType, t); }); } - if (contextualType.flags & 1081344 /* TypeVariable */) { + if (contextualType.flags & 7372800 /* InstantiableNonPrimitive */) { // If the contextual type is a type variable constrained to a primitive type, consider // this a literal context for literals of that primitive type. For example, given a // type parameter 'T extends string', infer string literal types for T. @@ -41855,7 +43441,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } return checkExpressionForMutableLocation(node.initializer, checkMode); @@ -41866,7 +43452,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } var uninstantiatedType = checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); @@ -41896,7 +43482,7 @@ var ts; function getTypeOfExpression(node, cache) { // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - if (node.kind === 182 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { + if (node.kind === 185 /* CallExpression */ && node.expression.kind !== 97 /* SuperKeyword */ && !ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true) && !isSymbolOrSymbolForCall(node)) { var funcType = checkNonNullExpression(node.expression); var signature = getSingleCallSignature(funcType); if (signature && !signature.typeParameters) { @@ -41931,7 +43517,7 @@ var ts; // contextually typed function and arrow expressions in the initial phase. function checkExpression(node, checkMode) { var type; - if (node.kind === 144 /* QualifiedName */) { + if (node.kind === 145 /* QualifiedName */) { type = checkQualifiedName(node); } else { @@ -41943,10 +43529,10 @@ var ts; // - 'left' in property access // - 'object' in indexed access // - target in rhs of import statement - var ok = (node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.expression === node) || - (node.parent.kind === 181 /* ElementAccessExpression */ && node.parent.expression === node) || - ((node.kind === 71 /* Identifier */ || node.kind === 144 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || - (node.parent.kind === 163 /* TypeQuery */ && node.parent.exprName === node)); + var ok = (node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.expression === node) || + (node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.expression === node) || + ((node.kind === 71 /* Identifier */ || node.kind === 145 /* QualifiedName */) && isInRightSideOfImportOrExportAssignment(node) || + (node.parent.kind === 164 /* TypeQuery */ && node.parent.exprName === node)); if (!ok) { error(node, ts.Diagnostics.const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query); } @@ -41980,74 +43566,74 @@ var ts; return trueType; case 86 /* FalseKeyword */: return falseType; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return checkTemplateExpression(node); case 12 /* RegularExpressionLiteral */: return globalRegExpType; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return checkArrayLiteral(node, checkMode); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return checkObjectLiteral(node, checkMode); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return checkPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return checkIndexedAccess(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (node.expression.kind === 91 /* ImportKeyword */) { return checkImportCallExpression(node); } /* falls through */ - case 183 /* NewExpression */: + case 186 /* NewExpression */: return checkCallExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return checkTaggedTemplateExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return checkParenthesizedExpression(node, checkMode); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return checkClassExpression(node); - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return checkFunctionExpressionOrObjectLiteralMethod(node, checkMode); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return checkTypeOfExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: return checkAssertion(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return checkNonNullAssertion(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return checkMetaProperty(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return checkDeleteExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return checkVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return checkAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return checkPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return checkPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return checkBinaryExpression(node, checkMode); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return checkConditionalExpression(node, checkMode); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return checkSpreadExpression(node, checkMode); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return undefinedWideningType; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return checkYieldExpression(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return checkJsxExpression(node, checkMode); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return checkJsxElement(node, checkMode); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return checkJsxSelfClosingElement(node, checkMode); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return checkJsxFragment(node, checkMode); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return checkJsxAttributes(node, checkMode); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: ts.Debug.fail("Shouldn't ever directly check a JsxOpeningElement"); } return unknownType; @@ -42085,7 +43671,7 @@ var ts; checkVariableLikeDeclaration(node); var func = ts.getContainingFunction(node); if (ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { - if (!(func.kind === 153 /* Constructor */ && ts.nodeIsPresent(func.body))) { + if (!(func.kind === 154 /* Constructor */ && ts.nodeIsPresent(func.body))) { error(node, ts.Diagnostics.A_parameter_property_is_only_allowed_in_a_constructor_implementation); } } @@ -42096,7 +43682,7 @@ var ts; if (func.parameters.indexOf(node) !== 0) { error(node, ts.Diagnostics.A_0_parameter_must_be_the_first_parameter, node.name.escapedText); } - if (func.kind === 153 /* Constructor */ || func.kind === 157 /* ConstructSignature */ || func.kind === 162 /* ConstructorType */) { + if (func.kind === 154 /* Constructor */ || func.kind === 158 /* ConstructSignature */ || func.kind === 163 /* ConstructorType */) { error(node, ts.Diagnostics.A_constructor_cannot_have_a_this_parameter); } } @@ -42162,13 +43748,13 @@ var ts; } function getTypePredicateParent(node) { switch (node.parent.kind) { - case 188 /* ArrowFunction */: - case 156 /* CallSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 161 /* FunctionType */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 191 /* ArrowFunction */: + case 157 /* CallSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 162 /* FunctionType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var parent = node.parent; if (node === parent.type) { return parent; @@ -42186,7 +43772,7 @@ var ts; error(predicateVariableNode, ts.Diagnostics.A_type_predicate_cannot_reference_element_0_in_a_binding_pattern, predicateVariableName); return true; } - else if (name.kind === 176 /* ArrayBindingPattern */ || name.kind === 175 /* ObjectBindingPattern */) { + else if (name.kind === 179 /* ArrayBindingPattern */ || name.kind === 178 /* ObjectBindingPattern */) { if (checkIfTypePredicateVariableIsDeclaredInBindingPattern(name, predicateVariableNode, predicateVariableName)) { return true; } @@ -42195,12 +43781,13 @@ var ts; } function checkSignatureDeclaration(node) { // Grammar checking - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { checkGrammarIndexSignature(node); } - else if (node.kind === 161 /* FunctionType */ || node.kind === 229 /* FunctionDeclaration */ || node.kind === 162 /* ConstructorType */ || - node.kind === 156 /* CallSignature */ || node.kind === 153 /* Constructor */ || - node.kind === 157 /* ConstructSignature */) { + // TODO (yuisu): Remove this check in else-if when SyntaxKind.Construct is moved and ambient context is handled + else if (node.kind === 162 /* FunctionType */ || node.kind === 232 /* FunctionDeclaration */ || node.kind === 163 /* ConstructorType */ || + node.kind === 157 /* CallSignature */ || node.kind === 154 /* Constructor */ || + node.kind === 158 /* ConstructSignature */) { checkGrammarFunctionLikeDeclaration(node); } var functionFlags = ts.getFunctionFlags(node); @@ -42230,10 +43817,10 @@ var ts; var returnTypeNode = ts.getEffectiveReturnTypeNode(node); if (noImplicitAny && !returnTypeNode) { switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: error(node, ts.Diagnostics.Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: error(node, ts.Diagnostics.Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type); break; } @@ -42280,7 +43867,7 @@ var ts; var staticNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var param = _c[_b]; if (ts.isParameterPropertyDeclaration(param) && !ts.isBindingPattern(param.name)) { @@ -42294,16 +43881,16 @@ var ts; var memberName = member.name && ts.getPropertyNameForPropertyNameNode(member.name); if (memberName) { switch (member.kind) { - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: addName(names, member.name, memberName, 1 /* Getter */); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: addName(names, member.name, memberName, 2 /* Setter */); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: addName(names, member.name, memberName, 3 /* Property */); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: addName(names, member.name, memberName, 4 /* Method */); break; } @@ -42366,7 +43953,7 @@ var ts; var names = ts.createMap(); for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 149 /* PropertySignature */) { + if (member.kind === 150 /* PropertySignature */) { var memberName = void 0; switch (member.name.kind) { case 9 /* StringLiteral */: @@ -42390,7 +43977,7 @@ var ts; } } function checkTypeForDuplicateIndexSignatures(node) { - if (node.kind === 231 /* InterfaceDeclaration */) { + if (node.kind === 234 /* InterfaceDeclaration */) { var nodeSymbol = getSymbolOfNode(node); // in case of merging interface declaration it is possible that we'll enter this check procedure several times for every declaration // to prevent this run check only for the first declaration of a given kind @@ -42410,7 +43997,7 @@ var ts; var declaration = decl; if (declaration.parameters.length === 1 && declaration.parameters[0].type) { switch (declaration.parameters[0].type.kind) { - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: if (!seenStringIndexer) { seenStringIndexer = true; } @@ -42418,7 +44005,7 @@ var ts; error(declaration, ts.Diagnostics.Duplicate_string_index_signature); } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: if (!seenNumericIndexer) { seenNumericIndexer = true; } @@ -42445,7 +44032,7 @@ var ts; checkFunctionOrMethodDeclaration(node); // Abstract methods cannot have an implementation. // Extra checks are to avoid reporting multiple errors relating to the "abstractness" of the node. - if (ts.hasModifier(node, 128 /* Abstract */) && node.body) { + if (ts.hasModifier(node, 128 /* Abstract */) && node.kind === 153 /* MethodDeclaration */ && node.body) { error(node, ts.Diagnostics.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract, ts.declarationNameToString(node.name)); } } @@ -42471,7 +44058,7 @@ var ts; return; } function isInstancePropertyWithInitializer(n) { - return n.kind === 150 /* PropertyDeclaration */ && + return n.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(n, 32 /* Static */) && !!n.initializer; } @@ -42501,7 +44088,7 @@ var ts; var superCallStatement = void 0; for (var _i = 0, statements_2 = statements; _i < statements_2.length; _i++) { var statement = statements_2[_i]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { superCallStatement = statement; break; } @@ -42526,7 +44113,7 @@ var ts; checkGrammarComputedPropertyName(node.name); checkDecorators(node); checkSignatureDeclaration(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { if (!(node.flags & 2097152 /* Ambient */) && ts.nodeIsPresent(node.body) && (node.flags & 128 /* HasImplicitReturn */)) { if (!(node.flags & 256 /* HasExplicitReturn */)) { error(node.name, ts.Diagnostics.A_get_accessor_must_return_a_value); @@ -42536,13 +44123,13 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); } if (!hasNonBindableDynamicName(node)) { // TypeScript 1.0 spec (April 2014): 8.4.3 // Accessors for the same member name must specify the same accessibility. - var otherKind = node.kind === 154 /* GetAccessor */ ? 155 /* SetAccessor */ : 154 /* GetAccessor */; + var otherKind = node.kind === 155 /* GetAccessor */ ? 156 /* SetAccessor */ : 155 /* GetAccessor */; var otherAccessor = ts.getDeclarationOfKind(getSymbolOfNode(node), otherKind); if (otherAccessor) { var nodeFlags = ts.getModifierFlags(node); @@ -42560,7 +44147,7 @@ var ts; } } var returnType = getTypeOfAccessors(getSymbolOfNode(node)); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { checkAllCodePathsInNonVoidFunctionReturnOrThrow(node, returnType); } } @@ -42577,8 +44164,10 @@ var ts; function checkMissingDeclaration(node) { checkDecorators(node); } - function checkTypeArgumentConstraints(typeParameters, typeArgumentNodes) { - var minTypeArgumentCount = getMinTypeArgumentCount(typeParameters); + function getEffectiveTypeArguments(node, typeParameters) { + return fillMissingTypeArguments(ts.map(node.typeArguments, getTypeFromTypeNode), typeParameters, getMinTypeArgumentCount(typeParameters), ts.isInJavaScriptFile(node)); + } + function checkTypeArgumentConstraints(node, typeParameters) { var typeArguments; var mapper; var result = true; @@ -42586,18 +44175,28 @@ var ts; var constraint = getConstraintOfTypeParameter(typeParameters[i]); if (constraint) { if (!typeArguments) { - typeArguments = fillMissingTypeArguments(ts.map(typeArgumentNodes, getTypeFromTypeNode), typeParameters, minTypeArgumentCount, ts.isInJavaScriptFile(typeArgumentNodes[i])); + typeArguments = getEffectiveTypeArguments(node, typeParameters); mapper = createTypeMapper(typeParameters, typeArguments); } - var typeArgument = typeArguments[i]; - result = result && checkTypeAssignableTo(typeArgument, instantiateType(constraint, mapper), typeArgumentNodes[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); + result = result && checkTypeAssignableTo(typeArguments[i], instantiateType(constraint, mapper), node.typeArguments[i], ts.Diagnostics.Type_0_does_not_satisfy_the_constraint_1); } } return result; } + function getTypeParametersForTypeReference(node) { + var type = getTypeFromTypeReference(node); + if (type !== unknownType) { + var symbol = getNodeLinks(node).resolvedSymbol; + if (symbol) { + return symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters || + (ts.getObjectFlags(type) & 4 /* Reference */ ? type.target.localTypeParameters : undefined); + } + } + return undefined; + } function checkTypeReferenceNode(node) { checkGrammarTypeArguments(node, node.typeArguments); - if (node.kind === 160 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { + if (node.kind === 161 /* TypeReference */ && node.typeName.jsdocDotPos !== undefined && !ts.isInJavaScriptFile(node) && !ts.isInJSDoc(node)) { grammarErrorAtPos(node, node.typeName.jsdocDotPos, 1, ts.Diagnostics.JSDoc_types_can_only_be_used_inside_documentation_comments); } var type = getTypeFromTypeReference(node); @@ -42606,22 +44205,10 @@ var ts; // Do type argument local checks only if referenced type is successfully resolved ts.forEach(node.typeArguments, checkSourceElement); if (produceDiagnostics) { - var symbol = getNodeLinks(node).resolvedSymbol; - if (!symbol) { - // There is no resolved symbol cached if the type resolved to a builtin - // via JSDoc type reference resolution (eg, Boolean became boolean), none - // of which are generic when they have no associated symbol - // (additionally, JSDoc's index signature syntax, Object actually uses generic syntax without being generic) - if (!ts.isJSDocIndexSignature(node)) { - error(node, ts.Diagnostics.Type_0_is_not_generic, typeToString(type)); - } - return; + var typeParameters = getTypeParametersForTypeReference(node); + if (typeParameters) { + checkTypeArgumentConstraints(node, typeParameters); } - var typeParameters = symbol.flags & 524288 /* TypeAlias */ && getSymbolLinks(symbol).typeParameters; - if (!typeParameters && ts.getObjectFlags(type) & 4 /* Reference */) { - typeParameters = type.target.localTypeParameters; - } - checkTypeArgumentConstraints(typeParameters, node.typeArguments); } } if (type.flags & 16 /* Enum */ && getNodeLinks(node).resolvedSymbol.flags & 8 /* EnumMember */) { @@ -42629,6 +44216,14 @@ var ts; } } } + function getTypeArgumentConstraint(node) { + var typeReferenceNode = ts.tryCast(node.parent, ts.isTypeReferenceType); + if (!typeReferenceNode) + return undefined; + var typeParameters = getTypeParametersForTypeReference(typeReferenceNode); + var constraint = getConstraintOfTypeParameter(typeParameters[typeReferenceNode.typeArguments.indexOf(node)]); + return constraint && instantiateType(constraint, createTypeMapper(typeParameters, getEffectiveTypeArguments(typeReferenceNode, typeParameters))); + } function checkTypeQuery(node) { getTypeFromTypeQueryNode(node); } @@ -42663,8 +44258,8 @@ var ts; var objectType = type.objectType; var indexType = type.indexType; if (isTypeAssignableTo(indexType, getIndexType(objectType))) { - if (accessNode.kind === 181 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && - ts.getObjectFlags(objectType) & 32 /* Mapped */ && objectType.declaration.readonlyToken) { + if (accessNode.kind === 184 /* ElementAccessExpression */ && ts.isAssignmentTarget(accessNode) && + ts.getObjectFlags(objectType) & 32 /* Mapped */ && getMappedTypeModifiers(objectType) & 1 /* IncludeReadonly */) { error(accessNode, ts.Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(objectType)); } return type; @@ -42696,6 +44291,15 @@ var ts; checkGrammarTypeOperatorNode(node); checkSourceElement(node.type); } + function checkConditionalType(node) { + ts.forEachChild(node, checkSourceElement); + } + function checkInferType(node) { + if (!ts.findAncestor(node, function (n) { return n.parent && n.parent.kind === 170 /* ConditionalType */ && n.parent.extendsType === n; })) { + grammarErrorOnNode(node, ts.Diagnostics.infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type); + } + checkSourceElement(node.typeParameter); + } function isPrivateWithinAmbient(node) { return ts.hasModifier(node, 8 /* Private */) && !!(node.flags & 2097152 /* Ambient */); } @@ -42703,9 +44307,9 @@ var ts; var flags = ts.getCombinedModifierFlags(n); // children of classes (even ambient classes) should not be marked as ambient or export // because those flags have no useful semantics there. - if (n.parent.kind !== 231 /* InterfaceDeclaration */ && - n.parent.kind !== 230 /* ClassDeclaration */ && - n.parent.kind !== 200 /* ClassExpression */ && + if (n.parent.kind !== 234 /* InterfaceDeclaration */ && + n.parent.kind !== 233 /* ClassDeclaration */ && + n.parent.kind !== 203 /* ClassExpression */ && n.flags & 2097152 /* Ambient */) { if (!(flags & 2 /* Ambient */)) { // It is nested in an ambient context, which means it is automatically exported @@ -42796,7 +44400,7 @@ var ts; if (node.name && subsequentName && (ts.isComputedPropertyName(node.name) && ts.isComputedPropertyName(subsequentName) || !ts.isComputedPropertyName(node.name) && !ts.isComputedPropertyName(subsequentName) && ts.getEscapedTextOfIdentifierOrLiteral(node.name) === ts.getEscapedTextOfIdentifierOrLiteral(subsequentName))) { - var reportError = (node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */) && + var reportError = (node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */) && ts.hasModifier(node, 32 /* Static */) !== ts.hasModifier(subsequentNode, 32 /* Static */); // we can get here in two cases // 1. mixed static and instance class members @@ -42835,7 +44439,7 @@ var ts; var current = declarations_4[_i]; var node = current; var inAmbientContext = node.flags & 2097152 /* Ambient */; - var inAmbientContextOrInterface = node.parent.kind === 231 /* InterfaceDeclaration */ || node.parent.kind === 164 /* TypeLiteral */ || inAmbientContext; + var inAmbientContextOrInterface = node.parent.kind === 234 /* InterfaceDeclaration */ || node.parent.kind === 165 /* TypeLiteral */ || inAmbientContext; if (inAmbientContextOrInterface) { // check if declarations are consecutive only if they are non-ambient // 1. ambient declarations can be interleaved @@ -42846,7 +44450,7 @@ var ts; // 2. mixing ambient and non-ambient declarations is a separate error that will be reported - do not want to report an extra one previousDeclaration = undefined; } - if (node.kind === 229 /* FunctionDeclaration */ || node.kind === 152 /* MethodDeclaration */ || node.kind === 151 /* MethodSignature */ || node.kind === 153 /* Constructor */) { + if (node.kind === 232 /* FunctionDeclaration */ || node.kind === 153 /* MethodDeclaration */ || node.kind === 152 /* MethodSignature */ || node.kind === 154 /* Constructor */) { var currentNodeFlags = getEffectiveDeclarationFlags(node, flagsToCheck); someNodeFlags |= currentNodeFlags; allNodeFlags &= currentNodeFlags; @@ -42974,33 +44578,35 @@ var ts; })(DeclarationSpaces || (DeclarationSpaces = {})); function getDeclarationSpaces(d) { switch (d.kind) { - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: // A jsdoc typedef is, by definition, a type alias - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return 2 /* ExportType */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.isAmbientModule(d) || ts.getModuleInstanceState(d) !== 0 /* NonInstantiated */ ? 4 /* ExportNamespace */ | 1 /* ExportValue */ : 4 /* ExportNamespace */; - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: return 2 /* ExportType */ | 1 /* ExportValue */; + case 272 /* SourceFile */: + return 2 /* ExportType */ | 1 /* ExportValue */ | 4 /* ExportNamespace */; // The below options all declare an Alias, which is allowed to merge with other values within the importing module - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 240 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 243 /* ImportClause */: var result_2 = 0 /* None */; var target = resolveAlias(getSymbolOfNode(d)); ts.forEach(target.declarations, function (d) { result_2 |= getDeclarationSpaces(d); }); return result_2; - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 229 /* FunctionDeclaration */: - case 243 /* ImportSpecifier */:// https://github.com/Microsoft/TypeScript/pull/7591 + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 232 /* FunctionDeclaration */: + case 246 /* ImportSpecifier */: // https://github.com/Microsoft/TypeScript/pull/7591 return 1 /* ExportValue */; default: - ts.Debug.fail(ts.SyntaxKind[d.kind]); + ts.Debug.fail(ts.Debug.showSyntaxKind(d)); } } } @@ -43224,7 +44830,7 @@ var ts; error(returnTypeNode, ts.Diagnostics.Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value, typeToString(returnType)); return unknownType; } - var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 107455 /* Value */, /*ignoreErrors*/ true); + var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 67216319 /* Value */, /*ignoreErrors*/ true); var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : unknownType; if (promiseConstructorType === unknownType) { if (promiseConstructorName.kind === 71 /* Identifier */ && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(/*reportErrors*/ false)) { @@ -43247,7 +44853,7 @@ var ts; } // Verify there is no local declaration that could collide with the promise constructor. var rootName = promiseConstructorName && getFirstIdentifier(promiseConstructorName); - var collidingSymbol = getSymbol(node.locals, rootName.escapedText, 107455 /* Value */); + var collidingSymbol = getSymbol(node.locals, rootName.escapedText, 67216319 /* Value */); if (collidingSymbol) { error(collidingSymbol.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions, ts.idText(rootName), ts.entityNameToString(promiseConstructorName)); return unknownType; @@ -43267,22 +44873,22 @@ var ts; var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node); var errorInfo; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classSymbol = getSymbolOfNode(node.parent); var classConstructorType = getTypeOfSymbol(classSymbol); expectedReturnType = getUnionType([classConstructorType, voidType]); break; - case 147 /* Parameter */: + case 148 /* Parameter */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: expectedReturnType = voidType; errorInfo = ts.chainDiagnosticMessages(errorInfo, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any); break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var methodType = getTypeOfNode(node.parent); var descriptorType = createTypedPropertyDescriptorType(methodType); expectedReturnType = getUnionType([descriptorType, voidType]); @@ -43301,7 +44907,7 @@ var ts; if (!typeName) return; var rootName = getFirstIdentifier(typeName); - var meaning = (typeName.kind === 71 /* Identifier */ ? 793064 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */; + var meaning = (typeName.kind === 71 /* Identifier */ ? 67901928 /* Type */ : 1920 /* Namespace */) | 2097152 /* Alias */; var rootSymbol = resolveName(rootName, rootName.escapedText, meaning, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isRefernce*/ true); if (rootSymbol && rootSymbol.flags & 2097152 /* Alias */ @@ -43326,18 +44932,18 @@ var ts; function getEntityNameForDecoratorMetadata(node) { if (node) { switch (node.kind) { - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: var commonEntityName = void 0; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var individualEntityName = getEntityNameForDecoratorMetadata(typeNode); @@ -43363,9 +44969,9 @@ var ts; } } return commonEntityName; - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return getEntityNameForDecoratorMetadata(node.type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return node.typeName; } } @@ -43389,14 +44995,14 @@ var ts; } var firstDecorator = node.decorators[0]; checkExternalEmitHelpers(firstDecorator, 8 /* Decorate */); - if (node.kind === 147 /* Parameter */) { + if (node.kind === 148 /* Parameter */) { checkExternalEmitHelpers(firstDecorator, 32 /* Param */); } if (compilerOptions.emitDecoratorMetadata) { checkExternalEmitHelpers(firstDecorator, 16 /* Metadata */); // we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator. switch (node.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var constructor = ts.getFirstConstructorWithBody(node); if (constructor) { for (var _i = 0, _a = constructor.parameters; _i < _a.length; _i++) { @@ -43405,19 +45011,19 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: for (var _b = 0, _c = node.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(parameter)); } markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveReturnTypeNode(node)); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: markDecoratorMedataDataTypeNodeAsReferenced(ts.getEffectiveTypeAnnotationNode(node)); break; - case 147 /* Parameter */: + case 148 /* Parameter */: markDecoratorMedataDataTypeNodeAsReferenced(getParameterTypeNodeForDecoratorCheck(node)); var containingSignature = node.parent; for (var _d = 0, _e = containingSignature.parameters; _d < _e.length; _d++) { @@ -43449,7 +45055,20 @@ var ts; function checkJSDocParameterTag(node) { checkSourceElement(node.typeExpression); if (!ts.getParameterSymbolFromJSDoc(node)) { - error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 144 /* QualifiedName */ ? node.name.right : node.name)); + var decl = ts.getHostSignatureFromJSDoc(node); + // don't issue an error for invalid hosts -- just functions -- + // and give a better error message when the host function mentions `arguments` + // but the tag doesn't have an array type + if (decl) { + if (!containsArgumentsReference(decl)) { + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name.kind === 145 /* QualifiedName */ ? node.name.right : node.name)); + } + else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node && + node.typeExpression && node.typeExpression.type && + !isArrayType(getTypeFromTypeNode(node.typeExpression.type))) { + error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 145 /* QualifiedName */ ? node.name.right : node.name)); + } + } } } function checkJSDocAugmentsTag(node) { @@ -43458,7 +45077,7 @@ var ts; error(classLike, ts.Diagnostics.JSDoc_0_is_not_attached_to_a_class, ts.idText(node.tagName)); return; } - var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 282 /* JSDocAugmentsTag */); + var augmentsTags = ts.getAllJSDocTagsOfKind(classLike, 285 /* JSDocAugmentsTag */); ts.Debug.assert(augmentsTags.length > 0); if (augmentsTags.length > 1) { error(augmentsTags[1], ts.Diagnostics.Class_declarations_cannot_have_more_than_one_augments_or_extends_tag); @@ -43476,7 +45095,7 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return node.name; default: return undefined; @@ -43489,7 +45108,7 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name && node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name && node.name.kind === 146 /* ComputedPropertyName */) { // This check will account for methods in class/interface declarations, // as well as accessors in classes/object literals checkComputedPropertyName(node.name); @@ -43518,9 +45137,10 @@ var ts; } } } - checkSourceElement(node.body); + var body = node.kind === 152 /* MethodSignature */ ? undefined : node.body; + checkSourceElement(body); var returnTypeNode = ts.getEffectiveReturnTypeNode(node); - if ((functionFlags & 1 /* Generator */) === 0) { + if ((functionFlags & 1 /* Generator */) === 0) { // Async function or normal function var returnOrPromisedType = returnTypeNode && (functionFlags & 2 /* Async */ ? checkAsyncFunctionReturnType(node) // Async function : getTypeFromTypeNode(returnTypeNode)); // normal function @@ -43529,10 +45149,10 @@ var ts; if (produceDiagnostics && !returnTypeNode) { // Report an implicit any error if there is no body, no explicit return type, and node is not a private method // in an ambient context - if (noImplicitAny && ts.nodeIsMissing(node.body) && !isPrivateWithinAmbient(node)) { + if (noImplicitAny && ts.nodeIsMissing(body) && !isPrivateWithinAmbient(node)) { reportImplicitAnyError(node, anyType); } - if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(node.body)) { + if (functionFlags & 1 /* Generator */ && ts.nodeIsPresent(body)) { // A generator with a body and no type annotation can still cause errors. It can error if the // yielded values have no common supertype, or it can give an implicit any error if it has no // yielded values. The only way to trigger these errors is to try checking its return type. @@ -43551,43 +45171,43 @@ var ts; for (var _i = 0, deferredUnusedIdentifierNodes_1 = deferredUnusedIdentifierNodes; _i < deferredUnusedIdentifierNodes_1.length; _i++) { var node = deferredUnusedIdentifierNodes_1[_i]; switch (node.kind) { - case 269 /* SourceFile */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 237 /* ModuleDeclaration */: checkUnusedModuleMembers(node); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: checkUnusedClassMembers(node); checkUnusedTypeParameters(node); break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: checkUnusedTypeParameters(node); break; - case 208 /* Block */: - case 236 /* CaseBlock */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: checkUnusedLocalsAndParameters(node); break; - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: if (node.body) { checkUnusedLocalsAndParameters(node); } checkUnusedTypeParameters(node); break; - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 232 /* TypeAliasDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 235 /* TypeAliasDeclaration */: checkUnusedTypeParameters(node); break; default: @@ -43599,8 +45219,10 @@ var ts; function checkUnusedLocalsAndParameters(node) { if (noUnusedIdentifiers && !(node.flags & 2097152 /* Ambient */)) { node.locals.forEach(function (local) { - if (!local.isReferenced) { - if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 147 /* Parameter */) { + // If it's purely a type parameter, ignore, will be checked in `checkUnusedTypeParameters`. + // If it's a type parameter merged with a parameter, check if the parameter-side is used. + if (local.flags & 262144 /* TypeParameter */ ? (local.flags & 3 /* Variable */ && !(local.isReferenced & 3 /* Variable */)) : !local.isReferenced) { + if (local.valueDeclaration && ts.getRootDeclaration(local.valueDeclaration).kind === 148 /* Parameter */) { var parameter = ts.getRootDeclaration(local.valueDeclaration); var name = ts.getNameOfDeclaration(local.valueDeclaration); if (compilerOptions.noUnusedParameters && @@ -43628,31 +45250,31 @@ var ts; var node = ts.getNameOfDeclaration(declaration) || declaration; if (isIdentifierThatStartsWithUnderScore(node)) { var declaration_2 = ts.getRootDeclaration(node.parent); - if ((declaration_2.kind === 227 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || - declaration_2.kind === 146 /* TypeParameter */) { + if ((declaration_2.kind === 230 /* VariableDeclaration */ && ts.isForInOrOfStatement(declaration_2.parent.parent)) || + declaration_2.kind === 147 /* TypeParameter */) { return; } } if (!isRemovedPropertyFromObjectSpread(node.kind === 71 /* Identifier */ ? node.parent : node)) { - error(node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name); + diagnostics.add(ts.createDiagnosticForNodeSpan(ts.getSourceFileOfNode(declaration), declaration, node, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, name)); } } function parameterNameStartsWithUnderscore(parameterName) { return parameterName && isIdentifierThatStartsWithUnderScore(parameterName); } function isIdentifierThatStartsWithUnderScore(node) { - return node.kind === 71 /* Identifier */ && ts.idText(node).charCodeAt(0) === 95 /* _ */; + return ts.isIdentifier(node) && ts.idText(node).charCodeAt(0) === 95 /* _ */; } function checkUnusedClassMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 152 /* MethodDeclaration */: - case 150 /* PropertyDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - if (member.kind === 155 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { + case 153 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + if (member.kind === 156 /* SetAccessor */ && member.symbol.flags & 32768 /* GetAccessor */) { // Already would have reported an error on the getter. break; } @@ -43661,7 +45283,7 @@ var ts; error(member.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, symbolToString(symbol)); } break; - case 153 /* Constructor */: + case 154 /* Constructor */: for (var _b = 0, _c = member.parameters; _b < _c.length; _b++) { var parameter = _c[_b]; if (!parameter.symbol.isReferenced && ts.hasModifier(parameter, 8 /* Private */)) { @@ -43669,8 +45291,8 @@ var ts; } } break; - case 158 /* IndexSignature */: - case 207 /* SemicolonClassElement */: + case 159 /* IndexSignature */: + case 210 /* SemicolonClassElement */: // Can't be private break; default: @@ -43680,7 +45302,7 @@ var ts; } } function checkUnusedTypeParameters(node) { - if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { + if (compilerOptions.noUnusedParameters && !(node.flags & 2097152 /* Ambient */)) { if (node.typeParameters) { // Only report errors on the last declaration for the type parameter container; // this ensures that all uses have been accounted for. @@ -43691,7 +45313,7 @@ var ts; } for (var _i = 0, _a = node.typeParameters; _i < _a.length; _i++) { var typeParameter = _a[_i]; - if (!getMergedSymbol(typeParameter.symbol).isReferenced && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { + if (!(getMergedSymbol(typeParameter.symbol).isReferenced & 262144 /* TypeParameter */) && !isIdentifierThatStartsWithUnderScore(typeParameter.name)) { error(typeParameter.name, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.symbolName(typeParameter.symbol)); } } @@ -43700,21 +45322,63 @@ var ts; } function checkUnusedModuleMembers(node) { if (compilerOptions.noUnusedLocals && !(node.flags & 2097152 /* Ambient */)) { + // Ideally we could use the ImportClause directly as a key, but must wait until we have full ES6 maps. So must store key along with value. + var unusedImports_1 = ts.createMap(); node.locals.forEach(function (local) { - if (!local.isReferenced && !local.exportSymbol) { - for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { - var declaration = _a[_i]; - if (!ts.isAmbientModule(declaration)) { - errorUnusedLocal(declaration, ts.symbolName(local)); + if (local.isReferenced || local.exportSymbol) + return; + for (var _i = 0, _a = local.declarations; _i < _a.length; _i++) { + var declaration = _a[_i]; + if (ts.isAmbientModule(declaration)) + continue; + if (isImportedDeclaration(declaration)) { + var importClause = importClauseFromImported(declaration); + var key = String(getNodeId(importClause)); + var group_1 = unusedImports_1.get(key); + if (group_1) { + group_1[1].push(declaration); + } + else { + unusedImports_1.set(key, [importClause, [declaration]]); } } + else { + errorUnusedLocal(declaration, ts.symbolName(local)); + } + } + }); + unusedImports_1.forEach(function (_a) { + var importClause = _a[0], unuseds = _a[1]; + var importDecl = importClause.parent; + if (forEachImportedDeclaration(importClause, function (d) { return !ts.contains(unuseds, d); })) { + for (var _i = 0, unuseds_1 = unuseds; _i < unuseds_1.length; _i++) { + var unused = unuseds_1[_i]; + errorUnusedLocal(unused, ts.idText(unused.name)); + } + } + else if (unuseds.length === 1) { + error(importDecl, ts.Diagnostics._0_is_declared_but_its_value_is_never_read, ts.idText(ts.first(unuseds).name)); + } + else { + error(importDecl, ts.Diagnostics.All_imports_in_import_declaration_are_unused, ts.showModuleSpecifier(importDecl)); } }); } } + function isImportedDeclaration(node) { + return node.kind === 243 /* ImportClause */ || node.kind === 246 /* ImportSpecifier */ || node.kind === 244 /* NamespaceImport */; + } + function importClauseFromImported(decl) { + return decl.kind === 243 /* ImportClause */ ? decl : decl.kind === 244 /* NamespaceImport */ ? decl.parent : decl.parent.parent; + } + function forEachImportedDeclaration(importClause, cb) { + var defaultName = importClause.name, namedBindings = importClause.namedBindings; + return (defaultName && cb(importClause)) || + namedBindings && (namedBindings.kind === 244 /* NamespaceImport */ ? cb(namedBindings) : ts.forEach(namedBindings.elements, cb)); + } function checkBlock(node) { // Grammar checking for SyntaxKind.Block - if (node.kind === 208 /* Block */) { + if (node.kind === 211 /* Block */) { checkGrammarStatementInAmbientContext(node); } if (ts.isFunctionOrModuleBlock(node)) { @@ -43744,12 +45408,12 @@ var ts; if (!(identifier && identifier.escapedText === name)) { return false; } - if (node.kind === 150 /* PropertyDeclaration */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 152 /* MethodDeclaration */ || - node.kind === 151 /* MethodSignature */ || - node.kind === 154 /* GetAccessor */ || - node.kind === 155 /* SetAccessor */) { + if (node.kind === 151 /* PropertyDeclaration */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 153 /* MethodDeclaration */ || + node.kind === 152 /* MethodSignature */ || + node.kind === 155 /* GetAccessor */ || + node.kind === 156 /* SetAccessor */) { // it is ok to have member named '_super' or '_this' - member access is always qualified return false; } @@ -43758,7 +45422,7 @@ var ts; return false; } var root = ts.getRootDeclaration(node); - if (root.kind === 147 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { + if (root.kind === 148 /* Parameter */ && ts.nodeIsMissing(root.parent.body)) { // just an overload - no codegen impact return false; } @@ -43837,7 +45501,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent)) { // If the declaration happens to be in external module, report error that require and exports are reserved keywords error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43852,7 +45516,7 @@ var ts; } // In case of variable declaration, node.parent is variable statement so look at the variable statement's parent var parent = getDeclarationContainer(node); - if (parent.kind === 269 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { + if (parent.kind === 272 /* SourceFile */ && ts.isExternalOrCommonJsModule(parent) && parent.flags & 1024 /* HasAsyncFunctions */) { // If the declaration happens to be in external module, report error that Promise is a reserved identifier. error(name, ts.Diagnostics.Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions, ts.declarationNameToString(name), ts.declarationNameToString(name)); } @@ -43887,29 +45551,29 @@ var ts; // skip variable declarations that don't have initializers // NOTE: in ES6 spec initializer is required in variable declarations where name is binding pattern // so we'll always treat binding elements as initialized - if (node.kind === 227 /* VariableDeclaration */ && !node.initializer) { + if (node.kind === 230 /* VariableDeclaration */ && !node.initializer) { return; } var symbol = getSymbolOfNode(node); if (symbol.flags & 1 /* FunctionScopedVariable */) { if (!ts.isIdentifier(node.name)) - throw ts.Debug.fail(); + return ts.Debug.fail(); var localDeclarationSymbol = resolveName(node, node.name.escapedText, 3 /* Variable */, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); if (localDeclarationSymbol && localDeclarationSymbol !== symbol && localDeclarationSymbol.flags & 2 /* BlockScopedVariable */) { if (getDeclarationNodeFlagsFromSymbol(localDeclarationSymbol) & 3 /* BlockScoped */) { - var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 228 /* VariableDeclarationList */); - var container = varDeclList.parent.kind === 209 /* VariableStatement */ && varDeclList.parent.parent + var varDeclList = ts.getAncestor(localDeclarationSymbol.valueDeclaration, 231 /* VariableDeclarationList */); + var container = varDeclList.parent.kind === 212 /* VariableStatement */ && varDeclList.parent.parent ? varDeclList.parent.parent : undefined; // names of block-scoped and function scoped variables can collide only // if block scoped variable is defined in the function\module\source file scope (because of variable hoisting) var namesShareScope = container && - (container.kind === 208 /* Block */ && ts.isFunctionLike(container.parent) || - container.kind === 235 /* ModuleBlock */ || - container.kind === 234 /* ModuleDeclaration */ || - container.kind === 269 /* SourceFile */); + (container.kind === 211 /* Block */ && ts.isFunctionLike(container.parent) || + container.kind === 238 /* ModuleBlock */ || + container.kind === 237 /* ModuleDeclaration */ || + container.kind === 272 /* SourceFile */); // here we know that function scoped variable is shadowed by block scoped one // if they are defined in the same scope - binder has already reported redeclaration error // otherwise if variable has an initializer - show error that initialization will fail @@ -43924,7 +45588,7 @@ var ts; } // Check that a parameter initializer contains no references to parameters declared to the right of itself function checkParameterInitializer(node) { - if (ts.getRootDeclaration(node).kind !== 147 /* Parameter */) { + if (ts.getRootDeclaration(node).kind !== 148 /* Parameter */) { return; } var func = ts.getContainingFunction(node); @@ -43935,14 +45599,14 @@ var ts; // skip declaration names (i.e. in object literal expressions) return; } - if (n.kind === 180 /* PropertyAccessExpression */) { + if (n.kind === 183 /* PropertyAccessExpression */) { // skip property names in property access expression return visit(n.expression); } else if (n.kind === 71 /* Identifier */) { // check FunctionLikeDeclaration.locals (stores parameters\function local variable) // if it contains entry with a specified name - var symbol = resolveName(n, n.escapedText, 107455 /* Value */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); + var symbol = resolveName(n, n.escapedText, 67216319 /* Value */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false); if (!symbol || symbol === unknownSymbol || !symbol.valueDeclaration) { return; } @@ -43954,8 +45618,8 @@ var ts; // so we need to do a bit of extra work to check if reference is legal var enclosingContainer = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (enclosingContainer === func) { - if (symbol.valueDeclaration.kind === 147 /* Parameter */ || - symbol.valueDeclaration.kind === 177 /* BindingElement */) { + if (symbol.valueDeclaration.kind === 148 /* Parameter */ || + symbol.valueDeclaration.kind === 180 /* BindingElement */) { // it is ok to reference parameter in initializer if either // - parameter is located strictly on the left of current parameter declaration if (symbol.valueDeclaration.pos < node.pos) { @@ -43969,7 +45633,7 @@ var ts; return ts.isFunctionLike(current.parent) || // computed property names/initializers in instance property declaration of class like entities // are executed in constructor and thus deferred - (current.parent.kind === 150 /* PropertyDeclaration */ && + (current.parent.kind === 151 /* PropertyDeclaration */ && !(ts.hasModifier(current.parent, 32 /* Static */)) && ts.isClassLike(current.parent.parent)); })) { @@ -44002,46 +45666,48 @@ var ts; // Do not use hasDynamicName here, because that returns false for well known symbols. // We want to perform checkComputedPropertyName for all computed properties, including // well known symbols. - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.name); if (node.initializer) { checkExpressionCached(node.initializer); } } - if (node.kind === 177 /* BindingElement */) { - if (node.parent.kind === 175 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { + if (node.kind === 180 /* BindingElement */) { + if (node.parent.kind === 178 /* ObjectBindingPattern */ && languageVersion < 6 /* ESNext */) { checkExternalEmitHelpers(node, 4 /* Rest */); } // check computed properties inside property names of binding elements - if (node.propertyName && node.propertyName.kind === 145 /* ComputedPropertyName */) { + if (node.propertyName && node.propertyName.kind === 146 /* ComputedPropertyName */) { checkComputedPropertyName(node.propertyName); } // check private/protected variable access var parent = node.parent.parent; var parentType = getTypeForBindingElementParent(parent); var name = node.propertyName || node.name; - var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); - markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. - if (parent.initializer && property) { - checkPropertyAccessibility(parent, parent.initializer, parentType, property); + if (!ts.isBindingPattern(name)) { + var property = getPropertyOfType(parentType, ts.getTextOfPropertyName(name)); + markPropertyAsReferenced(property, /*nodeForCheckWriteOnly*/ undefined, /*isThisAccess*/ false); // A destructuring is never a write-only reference. + if (parent.initializer && property) { + checkPropertyAccessibility(parent, parent.initializer, parentType, property); + } } } // For a binding pattern, check contained binding elements if (ts.isBindingPattern(node.name)) { - if (node.name.kind === 176 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { + if (node.name.kind === 179 /* ArrayBindingPattern */ && languageVersion < 2 /* ES2015 */ && compilerOptions.downlevelIteration) { checkExternalEmitHelpers(node, 512 /* Read */); } ts.forEach(node.name.elements, checkSourceElement); } // For a parameter declaration with an initializer, error and exit if the containing function doesn't have a body - if (node.initializer && ts.getRootDeclaration(node).kind === 147 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { + if (node.initializer && ts.getRootDeclaration(node).kind === 148 /* Parameter */ && ts.nodeIsMissing(ts.getContainingFunction(node).body)) { error(node, ts.Diagnostics.A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation); return; } // For a binding pattern, validate the initializer and exit if (ts.isBindingPattern(node.name)) { // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { var initializerType = checkExpressionCached(node.initializer); if (strictNullChecks && node.name.elements.length === 0) { checkNonNullType(initializerType, node); @@ -44058,8 +45724,9 @@ var ts; if (node === symbol.valueDeclaration) { // Node is the primary declaration of the symbol, just validate the initializer // Don't validate for-in initializer as it is already an error - if (node.initializer && node.parent.parent.kind !== 216 /* ForInStatement */) { - checkTypeAssignableTo(checkExpressionCached(node.initializer), type, node, /*headMessage*/ undefined); + if (node.initializer && node.parent.parent.kind !== 219 /* ForInStatement */) { + var initializer = ts.isInJavaScriptFile(node) && ts.getDeclaredJavascriptInitializer(node) || node.initializer; + checkTypeAssignableTo(checkExpressionCached(initializer), type, node, /*headMessage*/ undefined); checkParameterInitializer(node); } } @@ -44080,10 +45747,10 @@ var ts; error(node.name, ts.Diagnostics.All_declarations_of_0_must_have_identical_modifiers, ts.declarationNameToString(node.name)); } } - if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */) { + if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */) { // We know we don't have a binding pattern or computed name here checkExportsOnMergedDeclarations(node); - if (node.kind === 227 /* VariableDeclaration */ || node.kind === 177 /* BindingElement */) { + if (node.kind === 230 /* VariableDeclaration */ || node.kind === 180 /* BindingElement */) { checkVarDeclaredNamesNotShadowed(node); } checkCollisionWithCapturedSuperVariable(node, node.name); @@ -44095,14 +45762,14 @@ var ts; } function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType, nextDeclaration, nextType) { var nextDeclarationName = ts.getNameOfDeclaration(nextDeclaration); - var message = nextDeclaration.kind === 150 /* PropertyDeclaration */ || nextDeclaration.kind === 149 /* PropertySignature */ + var message = nextDeclaration.kind === 151 /* PropertyDeclaration */ || nextDeclaration.kind === 150 /* PropertySignature */ ? ts.Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : ts.Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; error(nextDeclarationName, message, ts.declarationNameToString(nextDeclarationName), typeToString(firstType), typeToString(nextType)); } function areDeclarationFlagsIdentical(left, right) { - if ((left.kind === 147 /* Parameter */ && right.kind === 227 /* VariableDeclaration */) || - (left.kind === 227 /* VariableDeclaration */ && right.kind === 147 /* Parameter */)) { + if ((left.kind === 148 /* Parameter */ && right.kind === 230 /* VariableDeclaration */) || + (left.kind === 230 /* VariableDeclaration */ && right.kind === 148 /* Parameter */)) { // Differences in optionality between parameters and variables are allowed. return true; } @@ -44131,19 +45798,6 @@ var ts; checkGrammarForDisallowedLetOrConstStatement(node); ts.forEach(node.declarationList.declarations, checkSourceElement); } - function checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) { - // We only disallow modifier on a method declaration if it is a property of object-literal-expression - if (node.modifiers && node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (ts.getFunctionFlags(node) & 2 /* Async */) { - if (node.modifiers.length > 1) { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - else { - return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); - } - } - } function checkExpressionStatement(node) { // Grammar checking checkGrammarStatementInAmbientContext(node); @@ -44154,7 +45808,7 @@ var ts; checkGrammarStatementInAmbientContext(node); checkExpression(node.expression); checkSourceElement(node.thenStatement); - if (node.thenStatement.kind === 210 /* EmptyStatement */) { + if (node.thenStatement.kind === 213 /* EmptyStatement */) { error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement); } checkSourceElement(node.elseStatement); @@ -44174,12 +45828,12 @@ var ts; function checkForStatement(node) { // Grammar checking if (!checkGrammarStatementInAmbientContext(node)) { - if (node.initializer && node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer && node.initializer.kind === 231 /* VariableDeclarationList */) { checkGrammarVariableDeclarationList(node.initializer); } } if (node.initializer) { - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { ts.forEach(node.initializer.declarations, checkVariableDeclaration); } else { @@ -44197,7 +45851,7 @@ var ts; } function checkForOfStatement(node) { checkGrammarForInOrForOfStatement(node); - if (node.kind === 217 /* ForOfStatement */) { + if (node.kind === 220 /* ForOfStatement */) { if (node.awaitModifier) { var functionFlags = ts.getFunctionFlags(ts.getContainingFunction(node)); if ((functionFlags & (4 /* Invalid */ | 2 /* Async */)) === 2 /* Async */ && languageVersion < 6 /* ESNext */) { @@ -44215,14 +45869,14 @@ var ts; // via checkRightHandSideOfForOf. // If the LHS is an expression, check the LHS, as a destructuring assignment or as a reference. // Then check that the RHS is assignable to it. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { checkForInOrForOfVariableDeclaration(node); } else { var varExpr = node.initializer; var iteratedType = checkRightHandSideOfForOf(node.expression, node.awaitModifier); // There may be a destructuring assignment on the left side - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { // iteratedType may be undefined. In this case, we still want to check the structure of // varExpr, in particular making sure it's a valid LeftHandSideExpression. But we'd like // to short circuit the type relation checking as much as possible, so we pass the unknownType. @@ -44254,7 +45908,7 @@ var ts; // for (let VarDecl in Expr) Statement // VarDecl must be a variable declaration without a type annotation that declares a variable of type Any, // and Expr must be an expression of type Any, an object type, or a type parameter type. - if (node.initializer.kind === 228 /* VariableDeclarationList */) { + if (node.initializer.kind === 231 /* VariableDeclarationList */) { var variable = node.initializer.declarations[0]; if (variable && ts.isBindingPattern(variable.name)) { error(variable.name, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); @@ -44268,7 +45922,7 @@ var ts; // and Expr must be an expression of type Any, an object type, or a type parameter type. var varExpr = node.initializer; var leftType = checkExpression(varExpr); - if (varExpr.kind === 178 /* ArrayLiteralExpression */ || varExpr.kind === 179 /* ObjectLiteralExpression */) { + if (varExpr.kind === 181 /* ArrayLiteralExpression */ || varExpr.kind === 182 /* ObjectLiteralExpression */) { error(varExpr, ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern); } else if (!isTypeAssignableTo(getIndexTypeOrString(rightType), leftType)) { @@ -44281,7 +45935,7 @@ var ts; } // unknownType is returned i.e. if node.expression is identifier whose name cannot be resolved // in this case error about missing name is already reported - do not report extra one - if (!isTypeAssignableToKind(rightType, 33554432 /* NonPrimitive */ | 1081344 /* TypeVariable */)) { + if (!isTypeAssignableToKind(rightType, 134217728 /* NonPrimitive */ | 7372800 /* InstantiableNonPrimitive */)) { error(node.expression, ts.Diagnostics.The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter); } checkSourceElement(node.statement); @@ -44582,8 +46236,8 @@ var ts; // TODO: Check that target label is valid } function isGetAccessorWithAnnotatedSetAccessor(node) { - return node.kind === 154 /* GetAccessor */ - && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 155 /* SetAccessor */)) !== undefined; + return node.kind === 155 /* GetAccessor */ + && ts.getEffectiveSetAccessorTypeAnnotationNode(ts.getDeclarationOfKind(node.symbol, 156 /* SetAccessor */)) !== undefined; } function isUnwrappedReturnTypeVoidOrAny(func, returnType) { var unwrappedReturnType = (ts.getFunctionFlags(func) & 3 /* AsyncGenerator */) === 2 /* Async */ @@ -44607,25 +46261,25 @@ var ts; var isGenerator = functionFlags & 1 /* Generator */; if (strictNullChecks || node.expression || returnType.flags & 16384 /* Never */) { var exprType = node.expression ? checkExpressionCached(node.expression) : undefinedType; - if (isGenerator) { + if (isGenerator) { // AsyncGenerator function or Generator function // A generator does not need its return expressions checked against its return type. // Instead, the yield expressions are checked against the element type. // TODO: Check return types of generators when return type tracking is added // for generators. return; } - else if (func.kind === 155 /* SetAccessor */) { + else if (func.kind === 156 /* SetAccessor */) { if (node.expression) { error(node, ts.Diagnostics.Setters_cannot_return_a_value); } } - else if (func.kind === 153 /* Constructor */) { + else if (func.kind === 154 /* Constructor */) { if (node.expression && !checkTypeAssignableTo(exprType, returnType, node)) { error(node, ts.Diagnostics.Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class); } } else if (ts.getEffectiveReturnTypeNode(func) || isGetAccessorWithAnnotatedSetAccessor(func)) { - if (functionFlags & 2 /* Async */) { + if (functionFlags & 2 /* Async */) { // Async function var promisedType = getPromisedTypeOfPromise(returnType); var awaitedType = checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member); if (promisedType) { @@ -44640,7 +46294,7 @@ var ts; } } } - else if (func.kind !== 153 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { + else if (func.kind !== 154 /* Constructor */ && compilerOptions.noImplicitReturns && !isUnwrappedReturnTypeVoidOrAny(func, returnType) && !isGenerator) { // The function has a return type, but the return statement doesn't have an expression. error(node, ts.Diagnostics.Not_all_code_paths_return_a_value); } @@ -44669,7 +46323,7 @@ var ts; var expressionIsLiteral = isLiteralType(expressionType); ts.forEach(node.caseBlock.clauses, function (clause) { // Grammar check for duplicate default clauses, skip if we already report duplicate default clause - if (clause.kind === 262 /* DefaultClause */ && !hasDuplicateDefaultClause) { + if (clause.kind === 265 /* DefaultClause */ && !hasDuplicateDefaultClause) { if (firstDefaultClause === undefined) { firstDefaultClause = clause; } @@ -44681,12 +46335,11 @@ var ts; hasDuplicateDefaultClause = true; } } - if (produceDiagnostics && clause.kind === 261 /* CaseClause */) { - var caseClause = clause; + if (produceDiagnostics && clause.kind === 264 /* CaseClause */) { // TypeScript 1.0 spec (April 2014): 5.9 // In a 'switch' statement, each 'case' expression must be of a type that is comparable // to or from the type of the 'switch' expression. - var caseType = checkExpression(caseClause.expression); + var caseType = checkExpression(clause.expression); var caseIsLiteral = isLiteralType(caseType); var comparedExpressionType = expressionType; if (!caseIsLiteral || !expressionIsLiteral) { @@ -44695,7 +46348,7 @@ var ts; } if (!isTypeEqualityComparableTo(comparedExpressionType, caseType)) { // expressionType is not comparable to caseType, try the reversed check and report errors if it fails - checkTypeComparableTo(caseType, comparedExpressionType, caseClause.expression, /*headMessage*/ undefined); + checkTypeComparableTo(caseType, comparedExpressionType, clause.expression, /*headMessage*/ undefined); } } ts.forEach(clause.statements, checkSourceElement); @@ -44711,9 +46364,8 @@ var ts; if (ts.isFunctionLike(current)) { return "quit"; } - if (current.kind === 223 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { - var sourceFile = ts.getSourceFileOfNode(node); - grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNodeFromSourceText(sourceFile.text, node.label)); + if (current.kind === 226 /* LabeledStatement */ && current.label.escapedText === node.label.escapedText) { + grammarErrorOnNode(node.label, ts.Diagnostics.Duplicate_label_0, ts.getTextOfNode(node.label)); return true; } }); @@ -44817,8 +46469,8 @@ var ts; // this allows us to rule out cases when both property and indexer are inherited from the base class var errorNode; if (propDeclaration && - (propDeclaration.kind === 195 /* BinaryExpression */ || - ts.getNameOfDeclaration(propDeclaration).kind === 145 /* ComputedPropertyName */ || + (propDeclaration.kind === 198 /* BinaryExpression */ || + ts.getNameOfDeclaration(propDeclaration).kind === 146 /* ComputedPropertyName */ || prop.parent === containingType.symbol)) { errorNode = propDeclaration; } @@ -44996,7 +46648,7 @@ var ts; ts.forEach(baseTypeNode.typeArguments, checkSourceElement); for (var _i = 0, _a = getConstructorsForTypeArguments(staticBaseType, baseTypeNode.typeArguments, baseTypeNode); _i < _a.length; _i++) { var constructor = _a[_i]; - if (!checkTypeArgumentConstraints(constructor.typeParameters, baseTypeNode.typeArguments)) { + if (!checkTypeArgumentConstraints(baseTypeNode, constructor.typeParameters)) { break; } } @@ -45068,7 +46720,7 @@ var ts; var baseProp = getPropertyOfType(baseWithThis, declaredProp.escapedName); if (prop && baseProp) { var rootChain = function () { return ts.chainDiagnosticMessages( - /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, ts.unescapeLeadingUnderscores(declaredProp.escapedName), typeToString(typeWithThis), typeToString(baseWithThis)); }; + /*details*/ undefined, ts.Diagnostics.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2, symbolToString(declaredProp), typeToString(typeWithThis), typeToString(baseWithThis)); }; if (!checkTypeAssignableTo(getTypeOfSymbol(prop), getTypeOfSymbol(baseProp), member.name || member, /*message*/ undefined, rootChain)) { issuedMemberError = true; } @@ -45103,7 +46755,7 @@ var ts; } function getClassOrInterfaceDeclarationsOfSymbol(symbol) { return ts.filter(symbol.declarations, function (d) { - return d.kind === 230 /* ClassDeclaration */ || d.kind === 231 /* InterfaceDeclaration */; + return d.kind === 233 /* ClassDeclaration */ || d.kind === 234 /* InterfaceDeclaration */; }); } function checkKindsOfPropertyMemberOverrides(type, baseType) { @@ -45142,7 +46794,7 @@ var ts; // If there is no declaration for the derived class (as in the case of class expressions), // then the class cannot be declared abstract. if (baseDeclarationFlags & 128 /* Abstract */ && (!derivedClassDecl || !ts.hasModifier(derivedClassDecl, 128 /* Abstract */))) { - if (derivedClassDecl.kind === 200 /* ClassExpression */) { + if (derivedClassDecl.kind === 203 /* ClassExpression */) { error(derivedClassDecl, ts.Diagnostics.Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1, symbolToString(baseProperty), typeToString(baseType)); } else { @@ -45234,7 +46886,7 @@ var ts; } } function isInstancePropertyWithoutInitializer(node) { - return node.kind === 150 /* PropertyDeclaration */ && + return node.kind === 151 /* PropertyDeclaration */ && !ts.hasModifier(node, 32 /* Static */ | 128 /* Abstract */) && !node.exclamationToken && !node.initializer; @@ -45256,7 +46908,7 @@ var ts; var symbol = getSymbolOfNode(node); checkTypeParameterListsIdentical(symbol); // Only check this symbol once - var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 231 /* InterfaceDeclaration */); + var firstInterfaceDecl = ts.getDeclarationOfKind(symbol, 234 /* InterfaceDeclaration */); if (node === firstInterfaceDecl) { var type = getDeclaredTypeOfSymbol(symbol); var typeWithThis = getTypeWithThisArgument(type); @@ -45361,17 +47013,17 @@ var ts; return value; function evaluate(expr) { switch (expr.kind) { - case 193 /* PrefixUnaryExpression */: - var value_1 = evaluate(expr.operand); - if (typeof value_1 === "number") { + case 196 /* PrefixUnaryExpression */: + var value_2 = evaluate(expr.operand); + if (typeof value_2 === "number") { switch (expr.operator) { - case 37 /* PlusToken */: return value_1; - case 38 /* MinusToken */: return -value_1; - case 52 /* TildeToken */: return ~value_1; + case 37 /* PlusToken */: return value_2; + case 38 /* MinusToken */: return -value_2; + case 52 /* TildeToken */: return ~value_2; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var left = evaluate(expr.left); var right = evaluate(expr.right); if (typeof left === "number" && typeof right === "number") { @@ -45396,18 +47048,18 @@ var ts; case 8 /* NumericLiteral */: checkGrammarNumericLiteral(expr); return +expr.text; - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return evaluate(expr.expression); case 71 /* Identifier */: return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), expr.escapedText); - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: var ex = expr; if (isConstantMemberAccess(ex)) { var type = getTypeOfExpression(ex.expression); if (type.symbol && type.symbol.flags & 384 /* Enum */) { var name = void 0; - if (ex.kind === 180 /* PropertyAccessExpression */) { + if (ex.kind === 183 /* PropertyAccessExpression */) { name = ex.name.escapedText; } else { @@ -45439,8 +47091,8 @@ var ts; } function isConstantMemberAccess(node) { return node.kind === 71 /* Identifier */ || - node.kind === 180 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || - node.kind === 181 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && + node.kind === 183 /* PropertyAccessExpression */ && isConstantMemberAccess(node.expression) || + node.kind === 184 /* ElementAccessExpression */ && isConstantMemberAccess(node.expression) && node.argumentExpression.kind === 9 /* StringLiteral */; } function checkEnumDeclaration(node) { @@ -45480,7 +47132,7 @@ var ts; var seenEnumMissingInitialInitializer_1 = false; ts.forEach(enumSymbol.declarations, function (declaration) { // return true if we hit a violation of the rule, false otherwise - if (declaration.kind !== 233 /* EnumDeclaration */) { + if (declaration.kind !== 236 /* EnumDeclaration */) { return false; } var enumDeclaration = declaration; @@ -45503,8 +47155,8 @@ var ts; var declarations = symbol.declarations; for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) { var declaration = declarations_7[_i]; - if ((declaration.kind === 230 /* ClassDeclaration */ || - (declaration.kind === 229 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && + if ((declaration.kind === 233 /* ClassDeclaration */ || + (declaration.kind === 232 /* FunctionDeclaration */ && ts.nodeIsPresent(declaration.body))) && !(declaration.flags & 2097152 /* Ambient */)) { return declaration; } @@ -45568,7 +47220,7 @@ var ts; } // if the module merges with a class declaration in the same lexical scope, // we need to track this to ensure the correct emit. - var mergedClass = ts.getDeclarationOfKind(symbol, 230 /* ClassDeclaration */); + var mergedClass = ts.getDeclarationOfKind(symbol, 233 /* ClassDeclaration */); if (mergedClass && inSameLexicalScope(node, mergedClass)) { getNodeLinks(node).flags |= 32768 /* LexicalModuleMergesWithClass */; @@ -45583,7 +47235,6 @@ var ts; // - augmentation for some external module is applied if symbol for augmentation is merged (it was combined with target module). var checkBody = isGlobalAugmentation || (getSymbolOfNode(node).flags & 33554432 /* Transient */); if (checkBody && node.body) { - // body of ambient external module is always a module block for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) { var statement = _a[_i]; checkModuleAugmentationElement(statement, isGlobalAugmentation); @@ -45619,23 +47270,23 @@ var ts; } function checkModuleAugmentationElement(node, isGlobalAugmentation) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // error each individual name in variable statement instead of marking the entire variable statement for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var decl = _a[_i]; checkModuleAugmentationElement(decl, isGlobalAugmentation); } break; - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations); break; - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: grammarErrorOnFirstToken(node, ts.Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module); break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var name = node.name; if (ts.isBindingPattern(name)) { for (var _b = 0, _c = name.elements; _b < _c.length; _b++) { @@ -45646,12 +47297,12 @@ var ts; break; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 229 /* FunctionDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 235 /* TypeAliasDeclaration */: if (isGlobalAugmentation) { return; } @@ -45674,12 +47325,12 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return node; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: do { node = node.left; } while (node.kind !== 71 /* Identifier */); return node; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: do { node = node.expression; } while (node.kind !== 71 /* Identifier */); @@ -45688,18 +47339,22 @@ var ts; } function checkExternalImportOrExportDeclaration(node) { var moduleName = ts.getExternalModuleName(node); - if (!ts.nodeIsMissing(moduleName) && moduleName.kind !== 9 /* StringLiteral */) { + if (ts.nodeIsMissing(moduleName)) { + // Should be a parse error. + return false; + } + if (!ts.isStringLiteral(moduleName)) { error(moduleName, ts.Diagnostics.String_literal_expected); return false; } - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule) { - error(moduleName, node.kind === 245 /* ExportDeclaration */ ? + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule) { + error(moduleName, node.kind === 248 /* ExportDeclaration */ ? ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace : ts.Diagnostics.Import_declarations_in_a_namespace_cannot_reference_a_module); return false; } - if (inAmbientExternalModule && ts.isExternalModuleNameRelative(ts.getTextOfIdentifierOrLiteral(moduleName))) { + if (inAmbientExternalModule && ts.isExternalModuleNameRelative(moduleName.text)) { // we have already reported errors on top level imports\exports in external module augmentations in checkModuleDeclaration // no need to do this again. if (!isTopLevelInExternalModuleAugmentation(node)) { @@ -45723,19 +47378,19 @@ var ts; // Based on symbol.flags we can compute a set of excluded meanings (meaning that resolved alias should not have, // otherwise it will conflict with some local declaration). Note that in addition to normal flags we include matching SymbolFlags.Export* // in order to prevent collisions with declarations that were exported from the current module (they still contribute to local names). - var excludedMeanings = (symbol.flags & (107455 /* Value */ | 1048576 /* ExportValue */) ? 107455 /* Value */ : 0) | - (symbol.flags & 793064 /* Type */ ? 793064 /* Type */ : 0) | + var excludedMeanings = (symbol.flags & (67216319 /* Value */ | 1048576 /* ExportValue */) ? 67216319 /* Value */ : 0) | + (symbol.flags & 67901928 /* Type */ ? 67901928 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0); if (target.flags & excludedMeanings) { - var message = node.kind === 247 /* ExportSpecifier */ ? + var message = node.kind === 250 /* ExportSpecifier */ ? ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0; error(node, message, symbolToString(symbol)); } // Don't allow to re-export something with no value side when `--isolatedModules` is set. if (compilerOptions.isolatedModules - && node.kind === 247 /* ExportSpecifier */ - && !(target.flags & 107455 /* Value */) + && node.kind === 250 /* ExportSpecifier */ + && !(target.flags & 67216319 /* Value */) && !(node.flags & 2097152 /* Ambient */)) { error(node, ts.Diagnostics.Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided); } @@ -45762,7 +47417,7 @@ var ts; checkImportBinding(importClause); } if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { checkImportBinding(importClause.namedBindings); } else { @@ -45783,17 +47438,17 @@ var ts; if (ts.hasModifier(node, 1 /* Export */)) { markExportAsReferenced(node); } - if (node.moduleReference.kind !== 249 /* ExternalModuleReference */) { + if (node.moduleReference.kind !== 252 /* ExternalModuleReference */) { var target = resolveAlias(getSymbolOfNode(node)); if (target !== unknownSymbol) { - if (target.flags & 107455 /* Value */) { + if (target.flags & 67216319 /* Value */) { // Target is a value symbol, check that it is not hidden by a local declaration with the same name var moduleName = getFirstIdentifier(node.moduleReference); - if (!(resolveEntityName(moduleName, 107455 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) { + if (!(resolveEntityName(moduleName, 67216319 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) { error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName)); } } - if (target.flags & 793064 /* Type */) { + if (target.flags & 67901928 /* Type */) { checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0); } } @@ -45819,10 +47474,10 @@ var ts; // export { x, y } // export { x, y } from "foo" ts.forEach(node.exportClause.elements, checkExportSpecifier); - var inAmbientExternalModule = node.parent.kind === 235 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); - var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 235 /* ModuleBlock */ && + var inAmbientExternalModule = node.parent.kind === 238 /* ModuleBlock */ && ts.isAmbientModule(node.parent.parent); + var inAmbientNamespaceDeclaration = !inAmbientExternalModule && node.parent.kind === 238 /* ModuleBlock */ && !node.moduleSpecifier && node.flags & 2097152 /* Ambient */; - if (node.parent.kind !== 269 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { + if (node.parent.kind !== 272 /* SourceFile */ && !inAmbientExternalModule && !inAmbientNamespaceDeclaration) { error(node, ts.Diagnostics.Export_declarations_are_not_permitted_in_a_namespace); } } @@ -45839,7 +47494,7 @@ var ts; } } function checkGrammarModuleElementContext(node, errorMessage) { - var isInAppropriateContext = node.parent.kind === 269 /* SourceFile */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 234 /* ModuleDeclaration */; + var isInAppropriateContext = node.parent.kind === 272 /* SourceFile */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 237 /* ModuleDeclaration */; if (!isInAppropriateContext) { grammarErrorOnFirstToken(node, errorMessage); } @@ -45853,7 +47508,7 @@ var ts; if (!node.parent.parent.moduleSpecifier) { var exportedName = node.propertyName || node.name; // find immediate value referenced by exported name (SymbolFlags.Alias is set so we don't chase down aliases) - var symbol = resolveName(exportedName, exportedName.escapedText, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, + var symbol = resolveName(exportedName, exportedName.escapedText, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); if (symbol && (symbol === undefinedSymbol || isGlobalSourceFile(getDeclarationContainer(symbol.declarations[0])))) { error(exportedName, ts.Diagnostics.Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module, ts.idText(exportedName)); @@ -45868,8 +47523,8 @@ var ts; // If we hit an export assignment in an illegal context, just bail out to avoid cascading errors. return; } - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { if (node.isExportEquals) { error(node, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_namespace); } @@ -45957,7 +47612,7 @@ var ts; return !ts.isAccessor(declaration); } function isNotOverload(declaration) { - return (declaration.kind !== 229 /* FunctionDeclaration */ && declaration.kind !== 152 /* MethodDeclaration */) || + return (declaration.kind !== 232 /* FunctionDeclaration */ && declaration.kind !== 153 /* MethodDeclaration */) || !!declaration.body; } function checkSourceElement(node) { @@ -45975,145 +47630,149 @@ var ts; // Only bother checking on a few construct kinds. We don't want to be excessively // hitting the cancellation token on every node we check. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } switch (kind) { - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return checkTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return checkParameter(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return checkPropertyDeclaration(node); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: return checkSignatureDeclaration(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return checkSignatureDeclaration(node); - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return checkMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return checkConstructorDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return checkAccessorDeclaration(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return checkTypeReferenceNode(node); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return checkTypePredicate(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return checkTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return checkTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return checkArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return checkTupleType(node); - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return checkUnionOrIntersectionType(node); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return checkSourceElement(node.type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return checkTypeOperator(node); - case 282 /* JSDocAugmentsTag */: + case 170 /* ConditionalType */: + return checkConditionalType(node); + case 171 /* InferType */: + return checkInferType(node); + case 285 /* JSDocAugmentsTag */: return checkJSDocAugmentsTag(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return checkJSDocTypedefTag(node); - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: return checkJSDocParameterTag(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: checkSignatureDeclaration(node); // falls through - case 275 /* JSDocNonNullableType */: - case 274 /* JSDocNullableType */: - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: + case 278 /* JSDocNonNullableType */: + case 277 /* JSDocNullableType */: + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: checkJSDocTypeIsInJsFile(node); ts.forEachChild(node, checkSourceElement); return; - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: checkJSDocVariadicType(node); return; - case 271 /* JSDocTypeExpression */: + case 274 /* JSDocTypeExpression */: return checkSourceElement(node.type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return checkIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return checkMappedType(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return checkFunctionDeclaration(node); - case 208 /* Block */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return checkBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return checkVariableStatement(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return checkExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return checkIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return checkDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return checkWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return checkForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return checkForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return checkForOfStatement(node); - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return checkBreakOrContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return checkReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return checkWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return checkSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return checkLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return checkThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return checkTryStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return checkVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return checkBindingElement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return checkClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return checkInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return checkTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return checkEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return checkModuleDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return checkImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return checkImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return checkExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return checkExportAssignment(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: checkGrammarStatementInAmbientContext(node); return; - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: checkGrammarStatementInAmbientContext(node); return; - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return checkMissingDeclaration(node); } } @@ -46151,18 +47810,19 @@ var ts; var paramTag = parent.parent; if (ts.isJSDocTypeExpression(parent) && ts.isJSDocParameterTag(paramTag)) { // Else we will add a diagnostic, see `checkJSDocVariadicType`. - var param = ts.getParameterSymbolFromJSDoc(paramTag); - if (param) { - var host_1 = ts.getHostSignatureFromJSDoc(paramTag); + var host_1 = ts.getHostSignatureFromJSDoc(paramTag); + if (host_1) { /* - Only return an array type if the corresponding parameter is marked as a rest parameter. + Only return an array type if the corresponding parameter is marked as a rest parameter, or if there are no parameters. So in the following situation we will not create an array type: /** @param {...number} a * / function f(a) {} Because `a` will just be of type `number | undefined`. A synthetic `...args` will also be added, which *will* get an array type. */ - var lastParamDeclaration = host_1 && ts.last(host_1.parameters); - if (lastParamDeclaration.symbol === param && ts.isRestParameter(lastParamDeclaration)) { + var lastParamDeclaration = ts.lastOrUndefined(host_1.parameters); + var symbol = ts.getParameterSymbolFromJSDoc(paramTag); + if (!lastParamDeclaration || + symbol && lastParamDeclaration.symbol === symbol && ts.isRestParameter(lastParamDeclaration)) { return createArrayType(type); } } @@ -46187,17 +47847,17 @@ var ts; for (var _i = 0, deferredNodes_1 = deferredNodes; _i < deferredNodes_1.length; _i++) { var node = deferredNodes_1[_i]; switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: checkFunctionExpressionOrObjectLiteralMethodDeferred(node); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: checkAccessorDeclaration(node); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: checkClassExpressionDeferred(node); break; } @@ -46316,13 +47976,13 @@ var ts; copySymbols(location.locals, meaning); } switch (location.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 2623475 /* ModuleMember */); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: copySymbols(getSymbolOfNode(location).exports, meaning & 8 /* EnumMember */); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: var className = location.name; if (className) { copySymbol(location.symbol, meaning); @@ -46330,17 +47990,17 @@ var ts; // falls through // this fall-through is necessary because we would like to handle // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: // If we didn't come from static member of class or interface, // add the type parameters into the symbol table // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol. // Note: that the memberFlags come from previous iteration. if (!isStatic) { - copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 793064 /* Type */); + copySymbols(getMembersOfSymbol(getSymbolOfNode(location)), meaning & 67901928 /* Type */); } break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: var funcName = location.name; if (funcName) { copySymbol(location.symbol, meaning); @@ -46388,28 +48048,28 @@ var ts; } function isTypeDeclaration(node) { switch (node.kind) { - case 146 /* TypeParameter */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 147 /* TypeParameter */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return true; } } // True if the given identifier is part of a type reference function isTypeReferenceIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 144 /* QualifiedName */) { + while (node.parent && node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } - return node.parent && node.parent.kind === 160 /* TypeReference */; + return node.parent && node.parent.kind === 161 /* TypeReference */; } function isHeritageClauseElementIdentifier(entityName) { var node = entityName; - while (node.parent && node.parent.kind === 180 /* PropertyAccessExpression */) { + while (node.parent && node.parent.kind === 183 /* PropertyAccessExpression */) { node = node.parent; } - return node.parent && node.parent.kind === 202 /* ExpressionWithTypeArguments */; + return node.parent && node.parent.kind === 205 /* ExpressionWithTypeArguments */; } function forEachEnclosingClass(node, callback) { var result; @@ -46437,13 +48097,13 @@ var ts; return !!forEachEnclosingClass(node, function (n) { return n === classDeclaration; }); } function getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide) { - while (nodeOnRightSide.parent.kind === 144 /* QualifiedName */) { + while (nodeOnRightSide.parent.kind === 145 /* QualifiedName */) { nodeOnRightSide = nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 238 /* ImportEqualsDeclaration */) { + if (nodeOnRightSide.parent.kind === 241 /* ImportEqualsDeclaration */) { return nodeOnRightSide.parent.moduleReference === nodeOnRightSide && nodeOnRightSide.parent; } - if (nodeOnRightSide.parent.kind === 244 /* ExportAssignment */) { + if (nodeOnRightSide.parent.kind === 247 /* ExportAssignment */) { return nodeOnRightSide.parent.expression === nodeOnRightSide && nodeOnRightSide.parent; } return undefined; @@ -46468,7 +48128,7 @@ var ts; return getSymbolOfNode(entityName.parent); } if (ts.isInJavaScriptFile(entityName) && - entityName.parent.kind === 180 /* PropertyAccessExpression */ && + entityName.parent.kind === 183 /* PropertyAccessExpression */ && entityName.parent === entityName.parent.parent.left) { // Check if this is a special property assignment var specialPropertyAssignmentSymbol = getSpecialPropertyAssignmentSymbolFromEntityName(entityName); @@ -46476,13 +48136,13 @@ var ts; return specialPropertyAssignmentSymbol; } } - if (entityName.parent.kind === 244 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { + if (entityName.parent.kind === 247 /* ExportAssignment */ && ts.isEntityNameExpression(entityName)) { return resolveEntityName(entityName, - /*all meanings*/ 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); + /*all meanings*/ 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } - if (entityName.kind !== 180 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { + if (entityName.kind !== 183 /* PropertyAccessExpression */ && isInRightSideOfImportOrExportAssignment(entityName)) { // Since we already checked for ExportAssignment, this really could only be an Import - var importEqualsDeclaration = ts.getAncestor(entityName, 238 /* ImportEqualsDeclaration */); + var importEqualsDeclaration = ts.getAncestor(entityName, 241 /* ImportEqualsDeclaration */); ts.Debug.assert(importEqualsDeclaration !== undefined); return getSymbolOfPartOfRightHandSideOfImportEquals(entityName, /*dontResolveAlias*/ true); } @@ -46492,26 +48152,26 @@ var ts; if (isHeritageClauseElementIdentifier(entityName)) { var meaning = 0 /* None */; // In an interface or class, we're definitely interested in a type. - if (entityName.parent.kind === 202 /* ExpressionWithTypeArguments */) { - meaning = 793064 /* Type */; + if (entityName.parent.kind === 205 /* ExpressionWithTypeArguments */) { + meaning = 67901928 /* Type */; // In a class 'extends' clause we are also looking for a value. if (ts.isExpressionWithTypeArgumentsInClassExtendsClause(entityName.parent)) { - meaning |= 107455 /* Value */; + meaning |= 67216319 /* Value */; } } else { meaning = 1920 /* Namespace */; } meaning |= 2097152 /* Alias */; - var entityNameSymbol = resolveEntityName(entityName, meaning); + var entityNameSymbol = ts.isEntityNameExpression(entityName) ? resolveEntityName(entityName, meaning) : undefined; if (entityNameSymbol) { return entityNameSymbol; } } - if (entityName.parent.kind === 284 /* JSDocParameterTag */) { + if (entityName.parent.kind === 287 /* JSDocParameterTag */) { return ts.getParameterSymbolFromJSDoc(entityName.parent); } - if (entityName.parent.kind === 146 /* TypeParameter */ && entityName.parent.parent.kind === 287 /* JSDocTemplateTag */) { + if (entityName.parent.kind === 147 /* TypeParameter */ && entityName.parent.parent.kind === 290 /* JSDocTemplateTag */) { ts.Debug.assert(!ts.isInJavaScriptFile(entityName)); // Otherwise `isDeclarationName` would have been true. var typeParameter = ts.getTypeParameterFromJsDoc(entityName.parent); return typeParameter && typeParameter.symbol; @@ -46523,16 +48183,17 @@ var ts; } if (entityName.kind === 71 /* Identifier */) { if (ts.isJSXTagName(entityName) && isJsxIntrinsicIdentifier(entityName)) { - return getIntrinsicTagSymbol(entityName.parent); + var symbol = getIntrinsicTagSymbol(entityName.parent); + return symbol === unknownSymbol ? undefined : symbol; } - return resolveEntityName(entityName, 107455 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); + return resolveEntityName(entityName, 67216319 /* Value */, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.kind === 180 /* PropertyAccessExpression */ || entityName.kind === 144 /* QualifiedName */) { + else if (entityName.kind === 183 /* PropertyAccessExpression */ || entityName.kind === 145 /* QualifiedName */) { var links = getNodeLinks(entityName); if (links.resolvedSymbol) { return links.resolvedSymbol; } - if (entityName.kind === 180 /* PropertyAccessExpression */) { + if (entityName.kind === 183 /* PropertyAccessExpression */) { checkPropertyAccessExpression(entityName); } else { @@ -46542,20 +48203,20 @@ var ts; } } else if (isTypeReferenceIdentifier(entityName)) { - var meaning = entityName.parent.kind === 160 /* TypeReference */ ? 793064 /* Type */ : 1920 /* Namespace */; + var meaning = entityName.parent.kind === 161 /* TypeReference */ ? 67901928 /* Type */ : 1920 /* Namespace */; return resolveEntityName(entityName, meaning, /*ignoreErrors*/ false, /*dontResolveAlias*/ true); } - else if (entityName.parent.kind === 257 /* JsxAttribute */) { + else if (entityName.parent.kind === 260 /* JsxAttribute */) { return getJsxAttributePropertySymbol(entityName.parent); } - if (entityName.parent.kind === 159 /* TypePredicate */) { + if (entityName.parent.kind === 160 /* TypePredicate */) { return resolveEntityName(entityName, /*meaning*/ 1 /* FunctionScopedVariable */); } // Do we want to return undefined here? return undefined; } function getSymbolAtLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return ts.isExternalModule(node) ? getMergedSymbol(node.symbol) : undefined; } if (node.flags & 4194304 /* InWithStatement */) { @@ -46573,8 +48234,8 @@ var ts; if (isInRightSideOfImportOrExportAssignment(node)) { return getSymbolOfEntityNameOrPropertyAccessExpression(node); } - else if (node.parent.kind === 177 /* BindingElement */ && - node.parent.parent.kind === 175 /* ObjectBindingPattern */ && + else if (node.parent.kind === 180 /* BindingElement */ && + node.parent.parent.kind === 178 /* ObjectBindingPattern */ && node === node.parent.propertyName) { var typeOfPattern = getTypeOfNode(node.parent.parent); var propertyDeclaration = typeOfPattern && getPropertyOfType(typeOfPattern, node.escapedText); @@ -46585,8 +48246,8 @@ var ts; } switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: return getSymbolOfEntityNameOrPropertyAccessExpression(node); case 99 /* ThisKeyword */: var container = ts.getThisContainer(node, /*includeArrowFunctions*/ false); @@ -46600,14 +48261,14 @@ var ts; return checkExpression(node).symbol; } // falls through - case 170 /* ThisType */: + case 173 /* ThisType */: return getTypeFromThisTypeNode(node).symbol; case 97 /* SuperKeyword */: return checkExpression(node).symbol; case 123 /* ConstructorKeyword */: // constructor keyword for an overload, should take us to the definition if it exist var constructorDeclaration = node.parent; - if (constructorDeclaration && constructorDeclaration.kind === 153 /* Constructor */) { + if (constructorDeclaration && constructorDeclaration.kind === 154 /* Constructor */) { return constructorDeclaration.parent.symbol; } return undefined; @@ -46617,7 +48278,7 @@ var ts; // 2). External module name in an import declaration // 3). Dynamic import call or require in javascript if ((ts.isExternalModuleImportEqualsDeclaration(node.parent.parent) && ts.getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node) || - ((node.parent.kind === 239 /* ImportDeclaration */ || node.parent.kind === 245 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || + ((node.parent.kind === 242 /* ImportDeclaration */ || node.parent.kind === 248 /* ExportDeclaration */) && node.parent.moduleSpecifier === node) || ((ts.isInJavaScriptFile(node) && ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false)) || ts.isImportCall(node.parent))) { return resolveExternalModuleName(node, node); } @@ -46642,8 +48303,8 @@ var ts; // The function returns a value symbol of an identifier in the short-hand property assignment. // This is necessary as an identifier in short-hand property assignment can contains two meaning: // property name and property value. - if (location && location.kind === 266 /* ShorthandPropertyAssignment */) { - return resolveEntityName(location.name, 107455 /* Value */ | 2097152 /* Alias */); + if (location && location.kind === 269 /* ShorthandPropertyAssignment */) { + return resolveEntityName(location.name, 67216319 /* Value */ | 2097152 /* Alias */); } return undefined; } @@ -46651,7 +48312,7 @@ var ts; function getExportSpecifierLocalTargetSymbol(node) { return node.parent.parent.moduleSpecifier ? getExternalModuleMember(node.parent.parent, node) : - resolveEntityName(node.propertyName || node.name, 107455 /* Value */ | 793064 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); + resolveEntityName(node.propertyName || node.name, 67216319 /* Value */ | 67901928 /* Type */ | 1920 /* Namespace */ | 2097152 /* Alias */); } function getTypeOfNode(node) { if (node.flags & 4194304 /* InWithStatement */) { @@ -46701,8 +48362,10 @@ var ts; } if (isInRightSideOfImportOrExportAssignment(node)) { var symbol = getSymbolAtLocation(node); - var declaredType = symbol && getDeclaredTypeOfSymbol(symbol); - return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + if (symbol) { + var declaredType = getDeclaredTypeOfSymbol(symbol); + return declaredType !== unknownType ? declaredType : getTypeOfSymbol(symbol); + } } return unknownType; } @@ -46713,28 +48376,28 @@ var ts; // [ a ] from // [a] = [ some array ...] function getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr) { - ts.Debug.assert(expr.kind === 179 /* ObjectLiteralExpression */ || expr.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.kind === 182 /* ObjectLiteralExpression */ || expr.kind === 181 /* ArrayLiteralExpression */); // If this is from "for of" // for ( { a } of elems) { // } - if (expr.parent.kind === 217 /* ForOfStatement */) { + if (expr.parent.kind === 220 /* ForOfStatement */) { var iteratedType = checkRightHandSideOfForOf(expr.parent.expression, expr.parent.awaitModifier); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from "for" initializer // for ({a } = elems[0];.....) { } - if (expr.parent.kind === 195 /* BinaryExpression */) { + if (expr.parent.kind === 198 /* BinaryExpression */) { var iteratedType = getTypeOfExpression(expr.parent.right); return checkDestructuringAssignment(expr, iteratedType || unknownType); } // If this is from nested object binding pattern // for ({ skills: { primary, secondary } } = multiRobot, i = 0; i < 1; i++) { - if (expr.parent.kind === 265 /* PropertyAssignment */) { + if (expr.parent.kind === 268 /* PropertyAssignment */) { var typeOfParentObjectLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent.parent); return checkObjectLiteralDestructuringPropertyAssignment(typeOfParentObjectLiteral || unknownType, expr.parent); } // Array literal assignment - array destructuring pattern - ts.Debug.assert(expr.parent.kind === 178 /* ArrayLiteralExpression */); + ts.Debug.assert(expr.parent.kind === 181 /* ArrayLiteralExpression */); // [{ property1: p1, property2 }] = elems; var typeOfArrayLiteral = getTypeOfArrayLiteralOrObjectLiteralDestructuringAssignment(expr.parent); var elementType = checkIteratedTypeOrElementType(typeOfArrayLiteral || unknownType, expr.parent, /*allowStringInput*/ false, /*allowAsyncIterables*/ false) || unknownType; @@ -46813,7 +48476,7 @@ var ts; if (!ts.isGeneratedIdentifier(node)) { node = ts.getParseTreeNode(node, ts.isIdentifier); if (node) { - var isPropertyName_1 = node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + var isPropertyName_1 = node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; return !isPropertyName_1 && getReferencedValueSymbol(node) === argumentsSymbol; } } @@ -46834,13 +48497,13 @@ var ts; // for export assignments - check if resolved symbol for RHS is itself a value // otherwise - check if at least one export is value symbolLinks.exportsSomeValue = hasExportAssignment - ? !!(moduleSymbol.flags & 107455 /* Value */) + ? !!(moduleSymbol.flags & 67216319 /* Value */) : ts.forEachEntry(getExportsOfModule(moduleSymbol), isValue); } return symbolLinks.exportsSomeValue; function isValue(s) { s = resolveSymbol(s); - return s && !!(s.flags & 107455 /* Value */); + return s && !!(s.flags & 67216319 /* Value */); } } function isNameOfModuleOrEnumDeclaration(node) { @@ -46870,7 +48533,7 @@ var ts; } var parentSymbol_1 = getParentOfSymbol(symbol); if (parentSymbol_1) { - if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 269 /* SourceFile */) { + if (parentSymbol_1.flags & 512 /* ValueModule */ && parentSymbol_1.valueDeclaration.kind === 272 /* SourceFile */) { var symbolFile = parentSymbol_1.valueDeclaration; var referenceFile = ts.getSourceFileOfNode(node); // If `node` accesses an export and that export isn't in the same file, then symbol is a namespace export, so return undefined. @@ -46890,7 +48553,7 @@ var ts; var symbol = getReferencedValueSymbol(node); // We should only get the declaration of an alias if there isn't a local value // declaration for the symbol - if (isNonLocalAlias(symbol, /*excludes*/ 107455 /* Value */)) { + if (isNonLocalAlias(symbol, /*excludes*/ 67216319 /* Value */)) { return getDeclarationOfAliasSymbol(symbol); } } @@ -46903,7 +48566,7 @@ var ts; var container = ts.getEnclosingBlockScopeContainer(symbol.valueDeclaration); if (ts.isStatementWithLocals(container)) { var nodeLinks_1 = getNodeLinks(symbol.valueDeclaration); - if (resolveName(container.parent, symbol.escapedName, 107455 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)) { + if (resolveName(container.parent, symbol.escapedName, 67216319 /* Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false)) { // redeclaration - always should be renamed links.isDeclarationWithCollidingName = true; } @@ -46925,7 +48588,7 @@ var ts; // they will not collide with anything var isDeclaredInLoop = nodeLinks_1.flags & 262144 /* BlockScopedBindingInLoop */; var inLoopInitializer = ts.isIterationStatement(container, /*lookInLabeledStatements*/ false); - var inLoopBodyBlock = container.kind === 208 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); + var inLoopBodyBlock = container.kind === 211 /* Block */ && ts.isIterationStatement(container.parent, /*lookInLabeledStatements*/ false); links.isDeclarationWithCollidingName = !ts.isBlockScopedContainerTopLevel(container) && (!isDeclaredInLoop || (!inLoopInitializer && !inLoopBodyBlock)); } else { @@ -46966,16 +48629,16 @@ var ts; } function isValueAliasDeclaration(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: return isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: var exportClause = node.exportClause; return exportClause && ts.forEach(exportClause.elements, isValueAliasDeclaration); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return node.expression && node.expression.kind === 71 /* Identifier */ ? isAliasResolvedToValue(getSymbolOfNode(node) || unknownSymbol) @@ -46985,7 +48648,7 @@ var ts; } function isTopLevelValueImportEqualsWithEntityName(node) { node = ts.getParseTreeNode(node, ts.isImportEqualsDeclaration); - if (node === undefined || node.parent.kind !== 269 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { + if (node === undefined || node.parent.kind !== 272 /* SourceFile */ || !ts.isInternalModuleImportEqualsDeclaration(node)) { // parent is not source file or it is not reference to internal module return false; } @@ -46999,7 +48662,7 @@ var ts; } // const enums and modules that contain only const enums are not considered values from the emit perspective // unless 'preserveConstEnums' option is set to true - return target.flags & 107455 /* Value */ && + return target.flags & 67216319 /* Value */ && (compilerOptions.preserveConstEnums || !isConstEnumOrConstEnumOnlyModule(target)); } function isConstEnumOrConstEnumOnlyModule(s) { @@ -47012,7 +48675,7 @@ var ts; return true; } var target = getSymbolLinks(symbol).target; - if (target && ts.getModifierFlags(node) & 1 /* Export */ && target.flags & 107455 /* Value */) { + if (target && ts.getModifierFlags(node) & 1 /* Export */ && target.flags & 67216319 /* Value */) { // An `export import ... =` of a value symbol is always considered referenced return true; } @@ -47063,15 +48726,15 @@ var ts; } function canHaveConstantValue(node) { switch (node.kind) { - case 268 /* EnumMember */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 271 /* EnumMember */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: return true; } return false; } function getConstantValue(node) { - if (node.kind === 268 /* EnumMember */) { + if (node.kind === 271 /* EnumMember */) { return getEnumMemberValue(node); } var symbol = getNodeLinks(node).resolvedSymbol; @@ -47097,9 +48760,9 @@ var ts; return ts.TypeReferenceSerializationKind.Unknown; } // Resolve the symbol as a value to ensure the type can be reached at runtime during emit. - var valueSymbol = resolveEntityName(typeName, 107455 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); + var valueSymbol = resolveEntityName(typeName, 67216319 /* Value */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); // Resolve the symbol as a type so that we can provide a more useful hint for the type serializer. - var typeSymbol = resolveEntityName(typeName, 793064 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); + var typeSymbol = resolveEntityName(typeName, 67901928 /* Type */, /*ignoreErrors*/ true, /*dontResolveAlias*/ false, location); if (valueSymbol && valueSymbol === typeSymbol) { var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(/*reportErrors*/ false); if (globalPromiseSymbol && valueSymbol === globalPromiseSymbol) { @@ -47189,7 +48852,7 @@ var ts; location = getDeclarationContainer(parent); } } - return resolveName(location, reference.escapedText, 107455 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); + return resolveName(location, reference.escapedText, 67216319 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */, /*nodeNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); } function getReferencedValueDeclaration(reference) { if (!ts.isGeneratedIdentifier(reference)) { @@ -47206,7 +48869,7 @@ var ts; function isLiteralConstDeclaration(node) { if (ts.isConst(node)) { var type = getTypeOfSymbol(getSymbolOfNode(node)); - return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 2097152 /* FreshLiteral */); + return !!(type.flags & 96 /* StringOrNumberLiteral */ && type.flags & 8388608 /* FreshLiteral */); } return false; } @@ -47280,7 +48943,7 @@ var ts; return !!(symbol && ts.getCheckFlags(symbol) & 1024 /* Late */); }, writeLiteralConstValue: writeLiteralConstValue, - getJsxFactoryEntity: function () { return _jsxFactoryEntity; } + getJsxFactoryEntity: function (location) { return location ? (getJsxNamespace(location), (ts.getSourceFileOfNode(location).localJsxFactory || _jsxFactoryEntity)) : _jsxFactoryEntity; } }; // defined here to avoid outer scope pollution function getTypeReferenceDirectivesForEntityName(node) { @@ -47291,9 +48954,9 @@ var ts; // property access can only be used as values // qualified names can only be used as types\namespaces // identifiers are treated as values only if they appear in type queries - var meaning = (node.kind === 180 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) - ? 107455 /* Value */ | 1048576 /* ExportValue */ - : 793064 /* Type */ | 1920 /* Namespace */; + var meaning = (node.kind === 183 /* PropertyAccessExpression */) || (node.kind === 71 /* Identifier */ && isInTypeQuery(node)) + ? 67216319 /* Value */ | 1048576 /* ExportValue */ + : 67901928 /* Type */ | 1920 /* Namespace */; var symbol = resolveEntityName(node, meaning, /*ignoreErrors*/ true); return symbol && symbol !== unknownSymbol ? getTypeReferenceDirectivesForSymbol(symbol, meaning) : undefined; } @@ -47342,7 +49005,7 @@ var ts; break; } } - if (current.valueDeclaration && current.valueDeclaration.kind === 269 /* SourceFile */ && current.flags & 512 /* ValueModule */) { + if (current.valueDeclaration && current.valueDeclaration.kind === 272 /* SourceFile */ && current.flags & 512 /* ValueModule */) { return false; } // check that at least one declaration of top level symbol originates from type declaration file @@ -47362,7 +49025,7 @@ var ts; if (!moduleSymbol) { return undefined; } - return ts.getDeclarationOfKind(moduleSymbol, 269 /* SourceFile */); + return ts.getDeclarationOfKind(moduleSymbol, 272 /* SourceFile */); } function initializeTypeChecker() { // Bind all source files and propagate errors @@ -47458,7 +49121,7 @@ var ts; for (var helper = 1 /* FirstEmitHelper */; helper <= 65536 /* LastEmitHelper */; helper <<= 1) { if (uncheckedHelpers & helper) { var name = getHelperName(helper); - var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 107455 /* Value */); + var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 67216319 /* Value */); if (!symbol) { error(location, ts.Diagnostics.This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1, ts.externalHelpersModuleNameText, name); } @@ -47506,14 +49169,14 @@ var ts; return false; } if (!ts.nodeCanBeDecorated(node, node.parent, node.parent.parent)) { - if (node.kind === 152 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { + if (node.kind === 153 /* MethodDeclaration */ && !ts.nodeIsPresent(node.body)) { return grammarErrorOnFirstToken(node, ts.Diagnostics.A_decorator_can_only_decorate_a_method_implementation_not_an_overload); } else { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_are_not_valid_here); } } - else if (node.kind === 154 /* GetAccessor */ || node.kind === 155 /* SetAccessor */) { + else if (node.kind === 155 /* GetAccessor */ || node.kind === 156 /* SetAccessor */) { var accessors = ts.getAllAccessorDeclarations(node.parent.members, node); if (accessors.firstAccessor.decorators && node === accessors.secondAccessor) { return grammarErrorOnFirstToken(node, ts.Diagnostics.Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name); @@ -47530,17 +49193,17 @@ var ts; var flags = 0 /* None */; for (var _i = 0, _a = node.modifiers; _i < _a.length; _i++) { var modifier = _a[_i]; - if (modifier.kind !== 131 /* ReadonlyKeyword */) { - if (node.kind === 149 /* PropertySignature */ || node.kind === 151 /* MethodSignature */) { + if (modifier.kind !== 132 /* ReadonlyKeyword */) { + if (node.kind === 150 /* PropertySignature */ || node.kind === 152 /* MethodSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_type_member, ts.tokenToString(modifier.kind)); } - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_an_index_signature, ts.tokenToString(modifier.kind)); } } switch (modifier.kind) { case 76 /* ConstKeyword */: - if (node.kind !== 233 /* EnumDeclaration */ && node.parent.kind === 230 /* ClassDeclaration */) { + if (node.kind !== 236 /* EnumDeclaration */ && node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(node, ts.Diagnostics.A_class_member_cannot_have_the_0_keyword, ts.tokenToString(76 /* ConstKeyword */)); } break; @@ -47560,7 +49223,7 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, text, "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, text); } else if (flags & 128 /* Abstract */) { @@ -47583,10 +49246,10 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "static", "async"); } - else if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + else if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_module_or_namespace_element, "static"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "static"); } else if (flags & 128 /* Abstract */) { @@ -47595,11 +49258,11 @@ var ts; flags |= 32 /* Static */; lastStatic = modifier; break; - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: if (flags & 64 /* Readonly */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "readonly"); } - else if (node.kind !== 150 /* PropertyDeclaration */ && node.kind !== 149 /* PropertySignature */ && node.kind !== 158 /* IndexSignature */ && node.kind !== 147 /* Parameter */) { + else if (node.kind !== 151 /* PropertyDeclaration */ && node.kind !== 150 /* PropertySignature */ && node.kind !== 159 /* IndexSignature */ && node.kind !== 148 /* Parameter */) { // If node.kind === SyntaxKind.Parameter, checkParameter report an error if it's not a parameter property. return grammarErrorOnNode(modifier, ts.Diagnostics.readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature); } @@ -47619,17 +49282,17 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_must_precede_1_modifier, "export", "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "export"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "export"); } flags |= 1 /* Export */; break; case 79 /* DefaultKeyword */: - var container = node.parent.kind === 269 /* SourceFile */ ? node.parent : node.parent.parent; - if (container.kind === 234 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { + var container = node.parent.kind === 272 /* SourceFile */ ? node.parent : node.parent.parent; + if (container.kind === 237 /* ModuleDeclaration */ && !ts.isAmbientModule(container)) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_default_export_can_only_be_used_in_an_ECMAScript_style_module); } flags |= 512 /* Default */; @@ -47641,13 +49304,13 @@ var ts; else if (flags & 256 /* Async */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_class_element, "declare"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "declare"); } - else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 235 /* ModuleBlock */) { + else if ((node.parent.flags & 2097152 /* Ambient */) && node.parent.kind === 238 /* ModuleBlock */) { return grammarErrorOnNode(modifier, ts.Diagnostics.A_declare_modifier_cannot_be_used_in_an_already_ambient_context); } flags |= 2 /* Ambient */; @@ -47657,14 +49320,14 @@ var ts; if (flags & 128 /* Abstract */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_already_seen, "abstract"); } - if (node.kind !== 230 /* ClassDeclaration */) { - if (node.kind !== 152 /* MethodDeclaration */ && - node.kind !== 150 /* PropertyDeclaration */ && - node.kind !== 154 /* GetAccessor */ && - node.kind !== 155 /* SetAccessor */) { + if (node.kind !== 233 /* ClassDeclaration */) { + if (node.kind !== 153 /* MethodDeclaration */ && + node.kind !== 151 /* PropertyDeclaration */ && + node.kind !== 155 /* GetAccessor */ && + node.kind !== 156 /* SetAccessor */) { return grammarErrorOnNode(modifier, ts.Diagnostics.abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration); } - if (!(node.parent.kind === 230 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { + if (!(node.parent.kind === 233 /* ClassDeclaration */ && ts.hasModifier(node.parent, 128 /* Abstract */))) { return grammarErrorOnNode(modifier, ts.Diagnostics.Abstract_methods_can_only_appear_within_an_abstract_class); } if (flags & 32 /* Static */) { @@ -47683,7 +49346,7 @@ var ts; else if (flags & 2 /* Ambient */ || node.parent.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_be_used_in_an_ambient_context, "async"); } - else if (node.kind === 147 /* Parameter */) { + else if (node.kind === 148 /* Parameter */) { return grammarErrorOnNode(modifier, ts.Diagnostics._0_modifier_cannot_appear_on_a_parameter, "async"); } flags |= 256 /* Async */; @@ -47691,7 +49354,7 @@ var ts; break; } } - if (node.kind === 153 /* Constructor */) { + if (node.kind === 154 /* Constructor */) { if (flags & 32 /* Static */) { return grammarErrorOnNode(lastStatic, ts.Diagnostics._0_modifier_cannot_appear_on_a_constructor_declaration, "static"); } @@ -47706,13 +49369,13 @@ var ts; } return; } - else if ((node.kind === 239 /* ImportDeclaration */ || node.kind === 238 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { + else if ((node.kind === 242 /* ImportDeclaration */ || node.kind === 241 /* ImportEqualsDeclaration */) && flags & 2 /* Ambient */) { return grammarErrorOnNode(lastDeclare, ts.Diagnostics.A_0_modifier_cannot_be_used_with_an_import_declaration, "declare"); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && ts.isBindingPattern(node.name)) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_may_not_be_declared_using_a_binding_pattern); } - else if (node.kind === 147 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { + else if (node.kind === 148 /* Parameter */ && (flags & 92 /* ParameterPropertyModifier */) && node.dotDotDotToken) { return grammarErrorOnNode(node, ts.Diagnostics.A_parameter_property_cannot_be_declared_using_a_rest_parameter); } if (flags & 256 /* Async */) { @@ -47732,37 +49395,37 @@ var ts; } function shouldReportBadModifier(node) { switch (node.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 158 /* IndexSignature */: - case 234 /* ModuleDeclaration */: - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: - case 244 /* ExportAssignment */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 147 /* Parameter */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 159 /* IndexSignature */: + case 237 /* ModuleDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: + case 247 /* ExportAssignment */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 148 /* Parameter */: return false; default: - if (node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { return false; } switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return nodeHasAnyModifiersExcept(node, 120 /* AsyncKeyword */); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return nodeHasAnyModifiersExcept(node, 117 /* AbstractKeyword */); - case 231 /* InterfaceDeclaration */: - case 209 /* VariableStatement */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 212 /* VariableStatement */: + case 235 /* TypeAliasDeclaration */: return true; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return nodeHasAnyModifiersExcept(node, 76 /* ConstKeyword */); default: ts.Debug.fail(); @@ -47775,10 +49438,10 @@ var ts; } function checkGrammarAsyncModifier(node, asyncModifier) { switch (node.kind) { - case 152 /* MethodDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return false; } return grammarErrorOnNode(asyncModifier, ts.Diagnostics._0_modifier_cannot_be_used_here, "async"); @@ -47838,15 +49501,13 @@ var ts; return checkGrammarClassDeclarationHeritageClauses(node) || checkGrammarTypeParameterList(node.typeParameters, file); } function checkGrammarArrowFunction(node, file) { - if (node.kind === 188 /* ArrowFunction */) { - var arrowFunction = node; - var startLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.pos).line; - var endLine = ts.getLineAndCharacterOfPosition(file, arrowFunction.equalsGreaterThanToken.end).line; - if (startLine !== endLine) { - return grammarErrorOnNode(arrowFunction.equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); - } + if (!ts.isArrowFunction(node)) { + return false; } - return false; + var equalsGreaterThanToken = node.equalsGreaterThanToken; + var startLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.pos).line; + var endLine = ts.getLineAndCharacterOfPosition(file, equalsGreaterThanToken.end).line; + return startLine !== endLine && grammarErrorOnNode(equalsGreaterThanToken, ts.Diagnostics.Line_terminator_not_permitted_before_arrow); } function checkGrammarIndexSignatureParameters(node) { var parameter = node.parameters[0]; @@ -47873,7 +49534,7 @@ var ts; if (!parameter.type) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_must_have_a_type_annotation); } - if (parameter.type.kind !== 136 /* StringKeyword */ && parameter.type.kind !== 133 /* NumberKeyword */) { + if (parameter.type.kind !== 137 /* StringKeyword */ && parameter.type.kind !== 134 /* NumberKeyword */) { var type = getTypeFromTypeNode(parameter.type); if (type.flags & 2 /* String */ || type.flags & 4 /* Number */) { return grammarErrorOnNode(parameter.name, ts.Diagnostics.An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead, ts.getTextOfNode(parameter.name), typeToString(type), typeToString(getTypeFromTypeNode(node.type))); @@ -47907,7 +49568,7 @@ var ts; if (args) { for (var _i = 0, args_5 = args; _i < args_5.length; _i++) { var arg = args_5[_i]; - if (arg.kind === 201 /* OmittedExpression */) { + if (arg.kind === 204 /* OmittedExpression */) { return grammarErrorAtPos(arg, arg.pos, 0, ts.Diagnostics.Argument_expression_expected); } } @@ -47983,19 +49644,19 @@ var ts; } function checkGrammarComputedPropertyName(node) { // If node is not a computedPropertyName, just skip the grammar checking - if (node.kind !== 145 /* ComputedPropertyName */) { + if (node.kind !== 146 /* ComputedPropertyName */) { return false; } var computedPropertyName = node; - if (computedPropertyName.expression.kind === 195 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { + if (computedPropertyName.expression.kind === 198 /* BinaryExpression */ && computedPropertyName.expression.operatorToken.kind === 26 /* CommaToken */) { return grammarErrorOnNode(computedPropertyName.expression, ts.Diagnostics.A_comma_expression_is_not_allowed_in_a_computed_property_name); } } function checkGrammarForGenerator(node) { if (node.asteriskToken) { - ts.Debug.assert(node.kind === 229 /* FunctionDeclaration */ || - node.kind === 187 /* FunctionExpression */ || - node.kind === 152 /* MethodDeclaration */); + ts.Debug.assert(node.kind === 232 /* FunctionDeclaration */ || + node.kind === 190 /* FunctionExpression */ || + node.kind === 153 /* MethodDeclaration */); if (node.flags & 2097152 /* Ambient */) { return grammarErrorOnNode(node.asteriskToken, ts.Diagnostics.Generators_are_not_allowed_in_an_ambient_context); } @@ -48020,15 +49681,15 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var prop = _a[_i]; - if (prop.kind === 267 /* SpreadAssignment */) { + if (prop.kind === 270 /* SpreadAssignment */) { continue; } var name = prop.name; - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { // If the name is not a ComputedPropertyName, the grammar checking will skip it checkGrammarComputedPropertyName(name); } - if (prop.kind === 266 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { + if (prop.kind === 269 /* ShorthandPropertyAssignment */ && !inDestructuring && prop.objectAssignmentInitializer) { // having objectAssignmentInitializer is only valid in ObjectAssignmentPattern // outside of destructuring it is a syntax error return grammarErrorOnNode(prop.equalsToken, ts.Diagnostics.can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment); @@ -48037,7 +49698,7 @@ var ts; if (prop.modifiers) { for (var _b = 0, _c = prop.modifiers; _b < _c.length; _b++) { var mod = _c[_b]; - if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 152 /* MethodDeclaration */) { + if (mod.kind !== 120 /* AsyncKeyword */ || prop.kind !== 153 /* MethodDeclaration */) { grammarErrorOnNode(mod, ts.Diagnostics._0_modifier_cannot_be_used_here, ts.getTextOfNode(mod)); } } @@ -48052,21 +49713,21 @@ var ts; // and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields var currentKind = void 0; switch (prop.kind) { - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // Grammar checking for computedPropertyName and shorthandPropertyAssignment checkGrammarForInvalidQuestionMark(prop.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional); if (name.kind === 8 /* NumericLiteral */) { checkGrammarNumericLiteral(name); } // falls through - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: currentKind = 1 /* Property */; break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: currentKind = 2 /* GetAccessor */; break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: currentKind = 4 /* SetAccessor */; break; default: @@ -48102,20 +49763,18 @@ var ts; var seen = ts.createUnderscoreEscapedMap(); for (var _i = 0, _a = node.attributes.properties; _i < _a.length; _i++) { var attr = _a[_i]; - if (attr.kind === 259 /* JsxSpreadAttribute */) { + if (attr.kind === 262 /* JsxSpreadAttribute */) { continue; } - var jsxAttr = attr; - var name = jsxAttr.name; + var name = attr.name, initializer = attr.initializer; if (!seen.get(name.escapedText)) { seen.set(name.escapedText, true); } else { return grammarErrorOnNode(name, ts.Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name); } - var initializer = jsxAttr.initializer; - if (initializer && initializer.kind === 260 /* JsxExpression */ && !initializer.expression) { - return grammarErrorOnNode(jsxAttr.initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); + if (initializer && initializer.kind === 263 /* JsxExpression */ && !initializer.expression) { + return grammarErrorOnNode(initializer, ts.Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression); } } } @@ -48123,12 +49782,12 @@ var ts; if (checkGrammarStatementInAmbientContext(forInOrOfStatement)) { return true; } - if (forInOrOfStatement.kind === 217 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { + if (forInOrOfStatement.kind === 220 /* ForOfStatement */ && forInOrOfStatement.awaitModifier) { if ((forInOrOfStatement.flags & 16384 /* AwaitContext */) === 0 /* None */) { return grammarErrorOnNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator); } } - if (forInOrOfStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forInOrOfStatement.initializer.kind === 231 /* VariableDeclarationList */) { var variableList = forInOrOfStatement.initializer; if (!checkGrammarVariableDeclarationList(variableList)) { var declarations = variableList.declarations; @@ -48143,20 +49802,20 @@ var ts; return false; } if (declarations.length > 1) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement : ts.Diagnostics.Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement; return grammarErrorOnFirstToken(variableList.declarations[1], diagnostic); } var firstDeclaration = declarations[0]; if (firstDeclaration.initializer) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer : ts.Diagnostics.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer; return grammarErrorOnNode(firstDeclaration.name, diagnostic); } if (firstDeclaration.type) { - var diagnostic = forInOrOfStatement.kind === 216 /* ForInStatement */ + var diagnostic = forInOrOfStatement.kind === 219 /* ForInStatement */ ? ts.Diagnostics.The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation : ts.Diagnostics.The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation; return grammarErrorOnNode(firstDeclaration, diagnostic); @@ -48183,11 +49842,11 @@ var ts; return grammarErrorOnNode(accessor.name, ts.Diagnostics.An_accessor_cannot_have_type_parameters); } else if (!doesAccessorHaveCorrectParameterCount(accessor)) { - return grammarErrorOnNode(accessor.name, kind === 154 /* GetAccessor */ ? + return grammarErrorOnNode(accessor.name, kind === 155 /* GetAccessor */ ? ts.Diagnostics.A_get_accessor_cannot_have_parameters : ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter); } - else if (kind === 155 /* SetAccessor */) { + else if (kind === 156 /* SetAccessor */) { if (accessor.type) { return grammarErrorOnNode(accessor.name, ts.Diagnostics.A_set_accessor_cannot_have_a_return_type_annotation); } @@ -48210,21 +49869,21 @@ var ts; * A set accessor has one parameter or a `this` parameter and one more parameter. */ function doesAccessorHaveCorrectParameterCount(accessor) { - return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 0 : 1); + return getAccessorThisParameter(accessor) || accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 0 : 1); } function getAccessorThisParameter(accessor) { - if (accessor.parameters.length === (accessor.kind === 154 /* GetAccessor */ ? 1 : 2)) { + if (accessor.parameters.length === (accessor.kind === 155 /* GetAccessor */ ? 1 : 2)) { return ts.getThisParameter(accessor); } } function checkGrammarTypeOperatorNode(node) { - if (node.operator === 140 /* UniqueKeyword */) { - if (node.type.kind !== 137 /* SymbolKeyword */) { - return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(137 /* SymbolKeyword */)); + if (node.operator === 141 /* UniqueKeyword */) { + if (node.type.kind !== 138 /* SymbolKeyword */) { + return grammarErrorOnNode(node.type, ts.Diagnostics._0_expected, ts.tokenToString(138 /* SymbolKeyword */)); } var parent = ts.walkUpParenthesizedTypes(node.parent); switch (parent.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: var decl = parent; if (decl.name.kind !== 71 /* Identifier */) { return grammarErrorOnNode(node, ts.Diagnostics.unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name); @@ -48236,13 +49895,13 @@ var ts; return grammarErrorOnNode(parent.name, ts.Diagnostics.A_variable_whose_type_is_a_unique_symbol_type_must_be_const); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: if (!ts.hasModifier(parent, 32 /* Static */) || !ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly); } break; - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: if (!ts.hasModifier(parent, 64 /* Readonly */)) { return grammarErrorOnNode(parent.name, ts.Diagnostics.A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly); } @@ -48258,17 +49917,24 @@ var ts; } } function checkGrammarMethod(node) { - if (checkGrammarDisallowedModifiersOnObjectLiteralExpressionMethod(node) || - checkGrammarFunctionLikeDeclaration(node) || - checkGrammarForGenerator(node)) { + if (checkGrammarFunctionLikeDeclaration(node)) { return true; } - if (node.parent.kind === 179 /* ObjectLiteralExpression */) { - if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { - return true; + if (node.kind === 153 /* MethodDeclaration */) { + if (node.parent.kind === 182 /* ObjectLiteralExpression */) { + // We only disallow modifier on a method declaration if it is a property of object-literal-expression + if (node.modifiers && !(node.modifiers.length === 1 && ts.first(node.modifiers).kind === 120 /* AsyncKeyword */)) { + return grammarErrorOnFirstToken(node, ts.Diagnostics.Modifiers_cannot_appear_here); + } + else if (checkGrammarForInvalidQuestionMark(node.questionToken, ts.Diagnostics.An_object_member_cannot_be_declared_optional)) { + return true; + } + else if (node.body === undefined) { + return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + } } - else if (node.body === undefined) { - return grammarErrorAtPos(node, node.end - 1, ";".length, ts.Diagnostics._0_expected, "{"); + if (checkGrammarForGenerator(node)) { + return true; } } if (ts.isClassLike(node.parent)) { @@ -48280,14 +49946,14 @@ var ts; if (node.flags & 2097152 /* Ambient */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (!node.body) { + else if (node.kind === 153 /* MethodDeclaration */ && !node.body) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { return checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type); } } @@ -48298,11 +49964,11 @@ var ts; return grammarErrorOnNode(node, ts.Diagnostics.Jump_target_cannot_cross_function_boundary); } switch (current.kind) { - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: if (node.label && current.label.escapedText === node.label.escapedText) { // found matching label - verify that label usage is correct // continue can only target labels that are on iteration statements - var isMisplacedContinueLabel = node.kind === 218 /* ContinueStatement */ + var isMisplacedContinueLabel = node.kind === 221 /* ContinueStatement */ && !ts.isIterationStatement(current.statement, /*lookInLabeledStatement*/ true); if (isMisplacedContinueLabel) { return grammarErrorOnNode(node, ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement); @@ -48310,8 +49976,8 @@ var ts; return false; } break; - case 222 /* SwitchStatement */: - if (node.kind === 219 /* BreakStatement */ && !node.label) { + case 225 /* SwitchStatement */: + if (node.kind === 222 /* BreakStatement */ && !node.label) { // unlabeled break within switch statement - ok return false; } @@ -48326,13 +49992,13 @@ var ts; current = current.parent; } if (node.label) { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement : ts.Diagnostics.A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); } else { - var message = node.kind === 219 /* BreakStatement */ + var message = node.kind === 222 /* BreakStatement */ ? ts.Diagnostics.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement : ts.Diagnostics.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement; return grammarErrorOnNode(node, message); @@ -48344,7 +50010,7 @@ var ts; if (node !== ts.last(elements)) { return grammarErrorOnNode(node, ts.Diagnostics.A_rest_element_must_be_last_in_a_destructuring_pattern); } - if (node.name.kind === 176 /* ArrayBindingPattern */ || node.name.kind === 175 /* ObjectBindingPattern */) { + if (node.name.kind === 179 /* ArrayBindingPattern */ || node.name.kind === 178 /* ObjectBindingPattern */) { return grammarErrorOnNode(node.name, ts.Diagnostics.A_rest_element_cannot_contain_a_binding_pattern); } if (node.propertyName) { @@ -48358,11 +50024,11 @@ var ts; } function isStringOrNumberLiteralExpression(expr) { return expr.kind === 9 /* StringLiteral */ || expr.kind === 8 /* NumericLiteral */ || - expr.kind === 193 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && + expr.kind === 196 /* PrefixUnaryExpression */ && expr.operator === 38 /* MinusToken */ && expr.operand.kind === 8 /* NumericLiteral */; } function checkGrammarVariableDeclaration(node) { - if (node.parent.parent.kind !== 216 /* ForInStatement */ && node.parent.parent.kind !== 217 /* ForOfStatement */) { + if (node.parent.parent.kind !== 219 /* ForInStatement */ && node.parent.parent.kind !== 220 /* ForOfStatement */) { if (node.flags & 2097152 /* Ambient */) { if (node.initializer) { if (ts.isConst(node) && !node.type) { @@ -48391,7 +50057,7 @@ var ts; } } } - if (node.exclamationToken && (node.parent.parent.kind !== 209 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { + if (node.exclamationToken && (node.parent.parent.kind !== 212 /* VariableStatement */ || !node.type || node.initializer || node.flags & 2097152 /* Ambient */)) { return grammarErrorOnNode(node.exclamationToken, ts.Diagnostics.A_definite_assignment_assertion_is_not_permitted_in_this_context); } if (compilerOptions.module !== ts.ModuleKind.ES2015 && compilerOptions.module !== ts.ModuleKind.ESNext && compilerOptions.module !== ts.ModuleKind.System && !compilerOptions.noEmit && @@ -48450,15 +50116,15 @@ var ts; } function allowLetAndConstDeclarations(parent) { switch (parent.kind) { - case 212 /* IfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 215 /* IfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: return false; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return allowLetAndConstDeclarations(parent.parent); } return true; @@ -48524,7 +50190,7 @@ var ts; return true; } } - else if (node.parent.kind === 231 /* InterfaceDeclaration */) { + else if (node.parent.kind === 234 /* InterfaceDeclaration */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48532,7 +50198,7 @@ var ts; return grammarErrorOnNode(node.initializer, ts.Diagnostics.An_interface_property_cannot_have_an_initializer); } } - else if (node.parent.kind === 164 /* TypeLiteral */) { + else if (node.parent.kind === 165 /* TypeLiteral */) { if (checkGrammarForInvalidDynamicName(node.name, ts.Diagnostics.A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type)) { return true; } @@ -48561,13 +50227,13 @@ var ts; // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if (node.kind === 231 /* InterfaceDeclaration */ || - node.kind === 232 /* TypeAliasDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 238 /* ImportEqualsDeclaration */ || - node.kind === 245 /* ExportDeclaration */ || - node.kind === 244 /* ExportAssignment */ || - node.kind === 237 /* NamespaceExportDeclaration */ || + if (node.kind === 234 /* InterfaceDeclaration */ || + node.kind === 235 /* TypeAliasDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 241 /* ImportEqualsDeclaration */ || + node.kind === 248 /* ExportDeclaration */ || + node.kind === 247 /* ExportAssignment */ || + node.kind === 240 /* NamespaceExportDeclaration */ || ts.hasModifier(node, 2 /* Ambient */ | 1 /* Export */ | 512 /* Default */)) { return false; } @@ -48576,7 +50242,7 @@ var ts; function checkGrammarTopLevelElementsForRequiredDeclareModifier(file) { for (var _i = 0, _a = file.statements; _i < _a.length; _i++) { var decl = _a[_i]; - if (ts.isDeclaration(decl) || decl.kind === 209 /* VariableStatement */) { + if (ts.isDeclaration(decl) || decl.kind === 212 /* VariableStatement */) { if (checkGrammarTopLevelElementForRequiredDeclareModifier(decl)) { return true; } @@ -48602,7 +50268,7 @@ var ts; // to prevent noisiness. So use a bit on the block to indicate if // this has already been reported, and don't report if it has. // - if (node.parent.kind === 208 /* Block */ || node.parent.kind === 235 /* ModuleBlock */ || node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 211 /* Block */ || node.parent.kind === 238 /* ModuleBlock */ || node.parent.kind === 272 /* SourceFile */) { var links_1 = getNodeLinks(node.parent); // Check if the containing block ever report this error if (!links_1.hasReportedStatementInAmbientContext) { @@ -48623,10 +50289,10 @@ var ts; if (languageVersion >= 1 /* ES5 */) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 174 /* LiteralType */)) { + else if (ts.isChildOfNodeWithKind(node, 177 /* LiteralType */)) { diagnosticMessage = ts.Diagnostics.Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0; } - else if (ts.isChildOfNodeWithKind(node, 268 /* EnumMember */)) { + else if (ts.isChildOfNodeWithKind(node, 271 /* EnumMember */)) { diagnosticMessage = ts.Diagnostics.Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0; } if (diagnosticMessage) { @@ -48678,23 +50344,23 @@ var ts; /** Like 'isDeclarationName', but returns true for LHS of `import { x as y }` or `export { x as y }`. */ function isDeclarationNameOrImportPropertyName(name) { switch (name.parent.kind) { - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: - return true; + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: + return ts.isIdentifier(name); default: return ts.isDeclarationName(name); } } function isSomeImportDeclaration(decl) { switch (decl.kind) { - case 240 /* ImportClause */: // For default import - case 238 /* ImportEqualsDeclaration */: - case 241 /* NamespaceImport */: - case 243 /* ImportSpecifier */:// For rename import `x as y` + case 243 /* ImportClause */: // For default import + case 241 /* ImportEqualsDeclaration */: + case 244 /* NamespaceImport */: + case 246 /* ImportSpecifier */: // For rename import `x as y` return true; case 71 /* Identifier */: // For regular import, `decl` is an Identifier under the ImportSpecifier. - return decl.parent.kind === 243 /* ImportSpecifier */; + return decl.parent.kind === 246 /* ImportSpecifier */; default: return false; } @@ -48895,7 +50561,7 @@ var ts; ts.createFalse = createFalse; // Names function createQualifiedName(left, right) { - var node = createSynthesizedNode(144 /* QualifiedName */); + var node = createSynthesizedNode(145 /* QualifiedName */); node.left = left; node.right = asName(right); return node; @@ -48908,9 +50574,15 @@ var ts; : node; } ts.updateQualifiedName = updateQualifiedName; + function parenthesizeForComputedName(expression) { + return (ts.isBinaryExpression(expression) && expression.operatorToken.kind === 26 /* CommaToken */) || + expression.kind === 296 /* CommaListExpression */ ? + createParen(expression) : + expression; + } function createComputedPropertyName(expression) { - var node = createSynthesizedNode(145 /* ComputedPropertyName */); - node.expression = expression; + var node = createSynthesizedNode(146 /* ComputedPropertyName */); + node.expression = parenthesizeForComputedName(expression); return node; } ts.createComputedPropertyName = createComputedPropertyName; @@ -48922,7 +50594,7 @@ var ts; ts.updateComputedPropertyName = updateComputedPropertyName; // Signature elements function createTypeParameterDeclaration(name, constraint, defaultType) { - var node = createSynthesizedNode(146 /* TypeParameter */); + var node = createSynthesizedNode(147 /* TypeParameter */); node.name = asName(name); node.constraint = constraint; node.default = defaultType; @@ -48938,7 +50610,7 @@ var ts; } ts.updateTypeParameterDeclaration = updateTypeParameterDeclaration; function createParameter(decorators, modifiers, dotDotDotToken, name, questionToken, type, initializer) { - var node = createSynthesizedNode(147 /* Parameter */); + var node = createSynthesizedNode(148 /* Parameter */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.dotDotDotToken = dotDotDotToken; @@ -48962,7 +50634,7 @@ var ts; } ts.updateParameter = updateParameter; function createDecorator(expression) { - var node = createSynthesizedNode(148 /* Decorator */); + var node = createSynthesizedNode(149 /* Decorator */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -48975,7 +50647,7 @@ var ts; ts.updateDecorator = updateDecorator; // Type Elements function createPropertySignature(modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(149 /* PropertySignature */); + var node = createSynthesizedNode(150 /* PropertySignature */); node.modifiers = asNodeArray(modifiers); node.name = asName(name); node.questionToken = questionToken; @@ -48994,30 +50666,32 @@ var ts; : node; } ts.updatePropertySignature = updatePropertySignature; - function createProperty(decorators, modifiers, name, questionToken, type, initializer) { - var node = createSynthesizedNode(150 /* PropertyDeclaration */); + function createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer) { + var node = createSynthesizedNode(151 /* PropertyDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); - node.questionToken = questionToken; + node.questionToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined; + node.exclamationToken = questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined; node.type = type; node.initializer = initializer; return node; } ts.createProperty = createProperty; - function updateProperty(node, decorators, modifiers, name, questionToken, type, initializer) { + function updateProperty(node, decorators, modifiers, name, questionOrExclamationToken, type, initializer) { return node.decorators !== decorators || node.modifiers !== modifiers || node.name !== name - || node.questionToken !== questionToken + || node.questionToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 55 /* QuestionToken */ ? questionOrExclamationToken : undefined) + || node.exclamationToken !== (questionOrExclamationToken !== undefined && questionOrExclamationToken.kind === 51 /* ExclamationToken */ ? questionOrExclamationToken : undefined) || node.type !== type || node.initializer !== initializer - ? updateNode(createProperty(decorators, modifiers, name, questionToken, type, initializer), node) + ? updateNode(createProperty(decorators, modifiers, name, questionOrExclamationToken, type, initializer), node) : node; } ts.updateProperty = updateProperty; function createMethodSignature(typeParameters, parameters, type, name, questionToken) { - var node = createSignatureDeclaration(151 /* MethodSignature */, typeParameters, parameters, type); + var node = createSignatureDeclaration(152 /* MethodSignature */, typeParameters, parameters, type); node.name = asName(name); node.questionToken = questionToken; return node; @@ -49034,7 +50708,7 @@ var ts; } ts.updateMethodSignature = updateMethodSignature; function createMethod(decorators, modifiers, asteriskToken, name, questionToken, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(152 /* MethodDeclaration */); + var node = createSynthesizedNode(153 /* MethodDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -49062,7 +50736,7 @@ var ts; } ts.updateMethod = updateMethod; function createConstructor(decorators, modifiers, parameters, body) { - var node = createSynthesizedNode(153 /* Constructor */); + var node = createSynthesizedNode(154 /* Constructor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.typeParameters = undefined; @@ -49082,7 +50756,7 @@ var ts; } ts.updateConstructor = updateConstructor; function createGetAccessor(decorators, modifiers, name, parameters, type, body) { - var node = createSynthesizedNode(154 /* GetAccessor */); + var node = createSynthesizedNode(155 /* GetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49105,7 +50779,7 @@ var ts; } ts.updateGetAccessor = updateGetAccessor; function createSetAccessor(decorators, modifiers, name, parameters, body) { - var node = createSynthesizedNode(155 /* SetAccessor */); + var node = createSynthesizedNode(156 /* SetAccessor */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49126,7 +50800,7 @@ var ts; } ts.updateSetAccessor = updateSetAccessor; function createCallSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(156 /* CallSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(157 /* CallSignature */, typeParameters, parameters, type); } ts.createCallSignature = createCallSignature; function updateCallSignature(node, typeParameters, parameters, type) { @@ -49134,7 +50808,7 @@ var ts; } ts.updateCallSignature = updateCallSignature; function createConstructSignature(typeParameters, parameters, type) { - return createSignatureDeclaration(157 /* ConstructSignature */, typeParameters, parameters, type); + return createSignatureDeclaration(158 /* ConstructSignature */, typeParameters, parameters, type); } ts.createConstructSignature = createConstructSignature; function updateConstructSignature(node, typeParameters, parameters, type) { @@ -49142,7 +50816,7 @@ var ts; } ts.updateConstructSignature = updateConstructSignature; function createIndexSignature(decorators, modifiers, parameters, type) { - var node = createSynthesizedNode(158 /* IndexSignature */); + var node = createSynthesizedNode(159 /* IndexSignature */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.parameters = createNodeArray(parameters); @@ -49182,7 +50856,7 @@ var ts; } ts.createKeywordTypeNode = createKeywordTypeNode; function createTypePredicateNode(parameterName, type) { - var node = createSynthesizedNode(159 /* TypePredicate */); + var node = createSynthesizedNode(160 /* TypePredicate */); node.parameterName = asName(parameterName); node.type = type; return node; @@ -49196,7 +50870,7 @@ var ts; } ts.updateTypePredicateNode = updateTypePredicateNode; function createTypeReferenceNode(typeName, typeArguments) { - var node = createSynthesizedNode(160 /* TypeReference */); + var node = createSynthesizedNode(161 /* TypeReference */); node.typeName = asName(typeName); node.typeArguments = typeArguments && ts.parenthesizeTypeParameters(typeArguments); return node; @@ -49210,7 +50884,7 @@ var ts; } ts.updateTypeReferenceNode = updateTypeReferenceNode; function createFunctionTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(161 /* FunctionType */, typeParameters, parameters, type); + return createSignatureDeclaration(162 /* FunctionType */, typeParameters, parameters, type); } ts.createFunctionTypeNode = createFunctionTypeNode; function updateFunctionTypeNode(node, typeParameters, parameters, type) { @@ -49218,7 +50892,7 @@ var ts; } ts.updateFunctionTypeNode = updateFunctionTypeNode; function createConstructorTypeNode(typeParameters, parameters, type) { - return createSignatureDeclaration(162 /* ConstructorType */, typeParameters, parameters, type); + return createSignatureDeclaration(163 /* ConstructorType */, typeParameters, parameters, type); } ts.createConstructorTypeNode = createConstructorTypeNode; function updateConstructorTypeNode(node, typeParameters, parameters, type) { @@ -49226,7 +50900,7 @@ var ts; } ts.updateConstructorTypeNode = updateConstructorTypeNode; function createTypeQueryNode(exprName) { - var node = createSynthesizedNode(163 /* TypeQuery */); + var node = createSynthesizedNode(164 /* TypeQuery */); node.exprName = exprName; return node; } @@ -49238,7 +50912,7 @@ var ts; } ts.updateTypeQueryNode = updateTypeQueryNode; function createTypeLiteralNode(members) { - var node = createSynthesizedNode(164 /* TypeLiteral */); + var node = createSynthesizedNode(165 /* TypeLiteral */); node.members = createNodeArray(members); return node; } @@ -49250,7 +50924,7 @@ var ts; } ts.updateTypeLiteralNode = updateTypeLiteralNode; function createArrayTypeNode(elementType) { - var node = createSynthesizedNode(165 /* ArrayType */); + var node = createSynthesizedNode(166 /* ArrayType */); node.elementType = ts.parenthesizeArrayTypeMember(elementType); return node; } @@ -49262,7 +50936,7 @@ var ts; } ts.updateArrayTypeNode = updateArrayTypeNode; function createTupleTypeNode(elementTypes) { - var node = createSynthesizedNode(166 /* TupleType */); + var node = createSynthesizedNode(167 /* TupleType */); node.elementTypes = createNodeArray(elementTypes); return node; } @@ -49274,7 +50948,7 @@ var ts; } ts.updateTypleTypeNode = updateTypleTypeNode; function createUnionTypeNode(types) { - return createUnionOrIntersectionTypeNode(167 /* UnionType */, types); + return createUnionOrIntersectionTypeNode(168 /* UnionType */, types); } ts.createUnionTypeNode = createUnionTypeNode; function updateUnionTypeNode(node, types) { @@ -49282,7 +50956,7 @@ var ts; } ts.updateUnionTypeNode = updateUnionTypeNode; function createIntersectionTypeNode(types) { - return createUnionOrIntersectionTypeNode(168 /* IntersectionType */, types); + return createUnionOrIntersectionTypeNode(169 /* IntersectionType */, types); } ts.createIntersectionTypeNode = createIntersectionTypeNode; function updateIntersectionTypeNode(node, types) { @@ -49300,8 +50974,38 @@ var ts; ? updateNode(createUnionOrIntersectionTypeNode(node.kind, types), node) : node; } + function createConditionalTypeNode(checkType, extendsType, trueType, falseType) { + var node = createSynthesizedNode(170 /* ConditionalType */); + node.checkType = ts.parenthesizeConditionalTypeMember(checkType); + node.extendsType = ts.parenthesizeConditionalTypeMember(extendsType); + node.trueType = trueType; + node.falseType = falseType; + return node; + } + ts.createConditionalTypeNode = createConditionalTypeNode; + function updateConditionalTypeNode(node, checkType, extendsType, trueType, falseType) { + return node.checkType !== checkType + || node.extendsType !== extendsType + || node.trueType !== trueType + || node.falseType !== falseType + ? updateNode(createConditionalTypeNode(checkType, extendsType, trueType, falseType), node) + : node; + } + ts.updateConditionalTypeNode = updateConditionalTypeNode; + function createInferTypeNode(typeParameter) { + var node = createSynthesizedNode(171 /* InferType */); + node.typeParameter = typeParameter; + return node; + } + ts.createInferTypeNode = createInferTypeNode; + function updateInferTypeNode(node, typeParameter) { + return node.typeParameter !== typeParameter + ? updateNode(createInferTypeNode(typeParameter), node) + : node; + } + ts.updateInferTypeNode = updateInferTypeNode; function createParenthesizedType(type) { - var node = createSynthesizedNode(169 /* ParenthesizedType */); + var node = createSynthesizedNode(172 /* ParenthesizedType */); node.type = type; return node; } @@ -49313,12 +51017,12 @@ var ts; } ts.updateParenthesizedType = updateParenthesizedType; function createThisTypeNode() { - return createSynthesizedNode(170 /* ThisType */); + return createSynthesizedNode(173 /* ThisType */); } ts.createThisTypeNode = createThisTypeNode; function createTypeOperatorNode(operatorOrType, type) { - var node = createSynthesizedNode(171 /* TypeOperator */); - node.operator = typeof operatorOrType === "number" ? operatorOrType : 127 /* KeyOfKeyword */; + var node = createSynthesizedNode(174 /* TypeOperator */); + node.operator = typeof operatorOrType === "number" ? operatorOrType : 128 /* KeyOfKeyword */; node.type = ts.parenthesizeElementTypeMember(typeof operatorOrType === "number" ? type : operatorOrType); return node; } @@ -49328,7 +51032,7 @@ var ts; } ts.updateTypeOperatorNode = updateTypeOperatorNode; function createIndexedAccessTypeNode(objectType, indexType) { - var node = createSynthesizedNode(172 /* IndexedAccessType */); + var node = createSynthesizedNode(175 /* IndexedAccessType */); node.objectType = ts.parenthesizeElementTypeMember(objectType); node.indexType = indexType; return node; @@ -49342,7 +51046,7 @@ var ts; } ts.updateIndexedAccessTypeNode = updateIndexedAccessTypeNode; function createMappedTypeNode(readonlyToken, typeParameter, questionToken, type) { - var node = createSynthesizedNode(173 /* MappedType */); + var node = createSynthesizedNode(176 /* MappedType */); node.readonlyToken = readonlyToken; node.typeParameter = typeParameter; node.questionToken = questionToken; @@ -49360,7 +51064,7 @@ var ts; } ts.updateMappedTypeNode = updateMappedTypeNode; function createLiteralTypeNode(literal) { - var node = createSynthesizedNode(174 /* LiteralType */); + var node = createSynthesizedNode(177 /* LiteralType */); node.literal = literal; return node; } @@ -49373,7 +51077,7 @@ var ts; ts.updateLiteralTypeNode = updateLiteralTypeNode; // Binding Patterns function createObjectBindingPattern(elements) { - var node = createSynthesizedNode(175 /* ObjectBindingPattern */); + var node = createSynthesizedNode(178 /* ObjectBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -49385,7 +51089,7 @@ var ts; } ts.updateObjectBindingPattern = updateObjectBindingPattern; function createArrayBindingPattern(elements) { - var node = createSynthesizedNode(176 /* ArrayBindingPattern */); + var node = createSynthesizedNode(179 /* ArrayBindingPattern */); node.elements = createNodeArray(elements); return node; } @@ -49397,7 +51101,7 @@ var ts; } ts.updateArrayBindingPattern = updateArrayBindingPattern; function createBindingElement(dotDotDotToken, propertyName, name, initializer) { - var node = createSynthesizedNode(177 /* BindingElement */); + var node = createSynthesizedNode(180 /* BindingElement */); node.dotDotDotToken = dotDotDotToken; node.propertyName = asName(propertyName); node.name = asName(name); @@ -49416,7 +51120,7 @@ var ts; ts.updateBindingElement = updateBindingElement; // Expression function createArrayLiteral(elements, multiLine) { - var node = createSynthesizedNode(178 /* ArrayLiteralExpression */); + var node = createSynthesizedNode(181 /* ArrayLiteralExpression */); node.elements = ts.parenthesizeListElements(createNodeArray(elements)); if (multiLine) node.multiLine = true; @@ -49430,7 +51134,7 @@ var ts; } ts.updateArrayLiteral = updateArrayLiteral; function createObjectLiteral(properties, multiLine) { - var node = createSynthesizedNode(179 /* ObjectLiteralExpression */); + var node = createSynthesizedNode(182 /* ObjectLiteralExpression */); node.properties = createNodeArray(properties); if (multiLine) node.multiLine = true; @@ -49444,7 +51148,7 @@ var ts; } ts.updateObjectLiteral = updateObjectLiteral; function createPropertyAccess(expression, name) { - var node = createSynthesizedNode(180 /* PropertyAccessExpression */); + var node = createSynthesizedNode(183 /* PropertyAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.name = asName(name); setEmitFlags(node, 131072 /* NoIndentation */); @@ -49461,7 +51165,7 @@ var ts; } ts.updatePropertyAccess = updatePropertyAccess; function createElementAccess(expression, index) { - var node = createSynthesizedNode(181 /* ElementAccessExpression */); + var node = createSynthesizedNode(184 /* ElementAccessExpression */); node.expression = ts.parenthesizeForAccess(expression); node.argumentExpression = asExpression(index); return node; @@ -49475,7 +51179,7 @@ var ts; } ts.updateElementAccess = updateElementAccess; function createCall(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(182 /* CallExpression */); + var node = createSynthesizedNode(185 /* CallExpression */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = ts.parenthesizeListElements(createNodeArray(argumentsArray)); @@ -49491,7 +51195,7 @@ var ts; } ts.updateCall = updateCall; function createNew(expression, typeArguments, argumentsArray) { - var node = createSynthesizedNode(183 /* NewExpression */); + var node = createSynthesizedNode(186 /* NewExpression */); node.expression = ts.parenthesizeForNew(expression); node.typeArguments = asNodeArray(typeArguments); node.arguments = argumentsArray ? ts.parenthesizeListElements(createNodeArray(argumentsArray)) : undefined; @@ -49507,7 +51211,7 @@ var ts; } ts.updateNew = updateNew; function createTaggedTemplate(tag, template) { - var node = createSynthesizedNode(184 /* TaggedTemplateExpression */); + var node = createSynthesizedNode(187 /* TaggedTemplateExpression */); node.tag = ts.parenthesizeForAccess(tag); node.template = template; return node; @@ -49521,7 +51225,7 @@ var ts; } ts.updateTaggedTemplate = updateTaggedTemplate; function createTypeAssertion(type, expression) { - var node = createSynthesizedNode(185 /* TypeAssertionExpression */); + var node = createSynthesizedNode(188 /* TypeAssertionExpression */); node.type = type; node.expression = ts.parenthesizePrefixOperand(expression); return node; @@ -49535,7 +51239,7 @@ var ts; } ts.updateTypeAssertion = updateTypeAssertion; function createParen(expression) { - var node = createSynthesizedNode(186 /* ParenthesizedExpression */); + var node = createSynthesizedNode(189 /* ParenthesizedExpression */); node.expression = expression; return node; } @@ -49547,7 +51251,7 @@ var ts; } ts.updateParen = updateParen; function createFunctionExpression(modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(187 /* FunctionExpression */); + var node = createSynthesizedNode(190 /* FunctionExpression */); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; node.name = asName(name); @@ -49571,7 +51275,7 @@ var ts; } ts.updateFunctionExpression = updateFunctionExpression; function createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body) { - var node = createSynthesizedNode(188 /* ArrowFunction */); + var node = createSynthesizedNode(191 /* ArrowFunction */); node.modifiers = asNodeArray(modifiers); node.typeParameters = asNodeArray(typeParameters); node.parameters = createNodeArray(parameters); @@ -49605,7 +51309,7 @@ var ts; } ts.updateArrowFunction = updateArrowFunction; function createDelete(expression) { - var node = createSynthesizedNode(189 /* DeleteExpression */); + var node = createSynthesizedNode(192 /* DeleteExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49617,7 +51321,7 @@ var ts; } ts.updateDelete = updateDelete; function createTypeOf(expression) { - var node = createSynthesizedNode(190 /* TypeOfExpression */); + var node = createSynthesizedNode(193 /* TypeOfExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49629,7 +51333,7 @@ var ts; } ts.updateTypeOf = updateTypeOf; function createVoid(expression) { - var node = createSynthesizedNode(191 /* VoidExpression */); + var node = createSynthesizedNode(194 /* VoidExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49641,7 +51345,7 @@ var ts; } ts.updateVoid = updateVoid; function createAwait(expression) { - var node = createSynthesizedNode(192 /* AwaitExpression */); + var node = createSynthesizedNode(195 /* AwaitExpression */); node.expression = ts.parenthesizePrefixOperand(expression); return node; } @@ -49653,7 +51357,7 @@ var ts; } ts.updateAwait = updateAwait; function createPrefix(operator, operand) { - var node = createSynthesizedNode(193 /* PrefixUnaryExpression */); + var node = createSynthesizedNode(196 /* PrefixUnaryExpression */); node.operator = operator; node.operand = ts.parenthesizePrefixOperand(operand); return node; @@ -49666,7 +51370,7 @@ var ts; } ts.updatePrefix = updatePrefix; function createPostfix(operand, operator) { - var node = createSynthesizedNode(194 /* PostfixUnaryExpression */); + var node = createSynthesizedNode(197 /* PostfixUnaryExpression */); node.operand = ts.parenthesizePostfixOperand(operand); node.operator = operator; return node; @@ -49679,7 +51383,7 @@ var ts; } ts.updatePostfix = updatePostfix; function createBinary(left, operator, right) { - var node = createSynthesizedNode(195 /* BinaryExpression */); + var node = createSynthesizedNode(198 /* BinaryExpression */); var operatorToken = asToken(operator); var operatorKind = operatorToken.kind; node.left = ts.parenthesizeBinaryOperand(operatorKind, left, /*isLeftSideOfBinary*/ true, /*leftOperand*/ undefined); @@ -49696,7 +51400,7 @@ var ts; } ts.updateBinary = updateBinary; function createConditional(condition, questionTokenOrWhenTrue, whenTrueOrWhenFalse, colonToken, whenFalse) { - var node = createSynthesizedNode(196 /* ConditionalExpression */); + var node = createSynthesizedNode(199 /* ConditionalExpression */); node.condition = ts.parenthesizeForConditionalHead(condition); node.questionToken = whenFalse ? questionTokenOrWhenTrue : createToken(55 /* QuestionToken */); node.whenTrue = ts.parenthesizeSubexpressionOfConditionalExpression(whenFalse ? whenTrueOrWhenFalse : questionTokenOrWhenTrue); @@ -49726,7 +51430,7 @@ var ts; } ts.updateConditional = updateConditional; function createTemplateExpression(head, templateSpans) { - var node = createSynthesizedNode(197 /* TemplateExpression */); + var node = createSynthesizedNode(200 /* TemplateExpression */); node.head = head; node.templateSpans = createNodeArray(templateSpans); return node; @@ -49764,7 +51468,7 @@ var ts; } ts.createNoSubstitutionTemplateLiteral = createNoSubstitutionTemplateLiteral; function createYield(asteriskTokenOrExpression, expression) { - var node = createSynthesizedNode(198 /* YieldExpression */); + var node = createSynthesizedNode(201 /* YieldExpression */); node.asteriskToken = asteriskTokenOrExpression && asteriskTokenOrExpression.kind === 39 /* AsteriskToken */ ? asteriskTokenOrExpression : undefined; node.expression = asteriskTokenOrExpression && asteriskTokenOrExpression.kind !== 39 /* AsteriskToken */ ? asteriskTokenOrExpression : expression; return node; @@ -49778,7 +51482,7 @@ var ts; } ts.updateYield = updateYield; function createSpread(expression) { - var node = createSynthesizedNode(199 /* SpreadElement */); + var node = createSynthesizedNode(202 /* SpreadElement */); node.expression = ts.parenthesizeExpressionForList(expression); return node; } @@ -49790,7 +51494,7 @@ var ts; } ts.updateSpread = updateSpread; function createClassExpression(modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(200 /* ClassExpression */); + var node = createSynthesizedNode(203 /* ClassExpression */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -49811,11 +51515,11 @@ var ts; } ts.updateClassExpression = updateClassExpression; function createOmittedExpression() { - return createSynthesizedNode(201 /* OmittedExpression */); + return createSynthesizedNode(204 /* OmittedExpression */); } ts.createOmittedExpression = createOmittedExpression; function createExpressionWithTypeArguments(typeArguments, expression) { - var node = createSynthesizedNode(202 /* ExpressionWithTypeArguments */); + var node = createSynthesizedNode(205 /* ExpressionWithTypeArguments */); node.expression = ts.parenthesizeForAccess(expression); node.typeArguments = asNodeArray(typeArguments); return node; @@ -49829,7 +51533,7 @@ var ts; } ts.updateExpressionWithTypeArguments = updateExpressionWithTypeArguments; function createAsExpression(expression, type) { - var node = createSynthesizedNode(203 /* AsExpression */); + var node = createSynthesizedNode(206 /* AsExpression */); node.expression = expression; node.type = type; return node; @@ -49843,7 +51547,7 @@ var ts; } ts.updateAsExpression = updateAsExpression; function createNonNullExpression(expression) { - var node = createSynthesizedNode(204 /* NonNullExpression */); + var node = createSynthesizedNode(207 /* NonNullExpression */); node.expression = ts.parenthesizeForAccess(expression); return node; } @@ -49855,7 +51559,7 @@ var ts; } ts.updateNonNullExpression = updateNonNullExpression; function createMetaProperty(keywordToken, name) { - var node = createSynthesizedNode(205 /* MetaProperty */); + var node = createSynthesizedNode(208 /* MetaProperty */); node.keywordToken = keywordToken; node.name = name; return node; @@ -49869,7 +51573,7 @@ var ts; ts.updateMetaProperty = updateMetaProperty; // Misc function createTemplateSpan(expression, literal) { - var node = createSynthesizedNode(206 /* TemplateSpan */); + var node = createSynthesizedNode(209 /* TemplateSpan */); node.expression = expression; node.literal = literal; return node; @@ -49883,12 +51587,12 @@ var ts; } ts.updateTemplateSpan = updateTemplateSpan; function createSemicolonClassElement() { - return createSynthesizedNode(207 /* SemicolonClassElement */); + return createSynthesizedNode(210 /* SemicolonClassElement */); } ts.createSemicolonClassElement = createSemicolonClassElement; // Element function createBlock(statements, multiLine) { - var block = createSynthesizedNode(208 /* Block */); + var block = createSynthesizedNode(211 /* Block */); block.statements = createNodeArray(statements); if (multiLine) block.multiLine = multiLine; @@ -49902,7 +51606,7 @@ var ts; } ts.updateBlock = updateBlock; function createVariableStatement(modifiers, declarationList) { - var node = createSynthesizedNode(209 /* VariableStatement */); + var node = createSynthesizedNode(212 /* VariableStatement */); node.decorators = undefined; node.modifiers = asNodeArray(modifiers); node.declarationList = ts.isArray(declarationList) ? createVariableDeclarationList(declarationList) : declarationList; @@ -49917,11 +51621,11 @@ var ts; } ts.updateVariableStatement = updateVariableStatement; function createEmptyStatement() { - return createSynthesizedNode(210 /* EmptyStatement */); + return createSynthesizedNode(213 /* EmptyStatement */); } ts.createEmptyStatement = createEmptyStatement; function createStatement(expression) { - var node = createSynthesizedNode(211 /* ExpressionStatement */); + var node = createSynthesizedNode(214 /* ExpressionStatement */); node.expression = ts.parenthesizeExpressionForExpressionStatement(expression); return node; } @@ -49933,7 +51637,7 @@ var ts; } ts.updateStatement = updateStatement; function createIf(expression, thenStatement, elseStatement) { - var node = createSynthesizedNode(212 /* IfStatement */); + var node = createSynthesizedNode(215 /* IfStatement */); node.expression = expression; node.thenStatement = thenStatement; node.elseStatement = elseStatement; @@ -49949,7 +51653,7 @@ var ts; } ts.updateIf = updateIf; function createDo(statement, expression) { - var node = createSynthesizedNode(213 /* DoStatement */); + var node = createSynthesizedNode(216 /* DoStatement */); node.statement = statement; node.expression = expression; return node; @@ -49963,7 +51667,7 @@ var ts; } ts.updateDo = updateDo; function createWhile(expression, statement) { - var node = createSynthesizedNode(214 /* WhileStatement */); + var node = createSynthesizedNode(217 /* WhileStatement */); node.expression = expression; node.statement = statement; return node; @@ -49977,7 +51681,7 @@ var ts; } ts.updateWhile = updateWhile; function createFor(initializer, condition, incrementor, statement) { - var node = createSynthesizedNode(215 /* ForStatement */); + var node = createSynthesizedNode(218 /* ForStatement */); node.initializer = initializer; node.condition = condition; node.incrementor = incrementor; @@ -49995,7 +51699,7 @@ var ts; } ts.updateFor = updateFor; function createForIn(initializer, expression, statement) { - var node = createSynthesizedNode(216 /* ForInStatement */); + var node = createSynthesizedNode(219 /* ForInStatement */); node.initializer = initializer; node.expression = expression; node.statement = statement; @@ -50011,7 +51715,7 @@ var ts; } ts.updateForIn = updateForIn; function createForOf(awaitModifier, initializer, expression, statement) { - var node = createSynthesizedNode(217 /* ForOfStatement */); + var node = createSynthesizedNode(220 /* ForOfStatement */); node.awaitModifier = awaitModifier; node.initializer = initializer; node.expression = expression; @@ -50029,7 +51733,7 @@ var ts; } ts.updateForOf = updateForOf; function createContinue(label) { - var node = createSynthesizedNode(218 /* ContinueStatement */); + var node = createSynthesizedNode(221 /* ContinueStatement */); node.label = asName(label); return node; } @@ -50041,7 +51745,7 @@ var ts; } ts.updateContinue = updateContinue; function createBreak(label) { - var node = createSynthesizedNode(219 /* BreakStatement */); + var node = createSynthesizedNode(222 /* BreakStatement */); node.label = asName(label); return node; } @@ -50053,7 +51757,7 @@ var ts; } ts.updateBreak = updateBreak; function createReturn(expression) { - var node = createSynthesizedNode(220 /* ReturnStatement */); + var node = createSynthesizedNode(223 /* ReturnStatement */); node.expression = expression; return node; } @@ -50065,7 +51769,7 @@ var ts; } ts.updateReturn = updateReturn; function createWith(expression, statement) { - var node = createSynthesizedNode(221 /* WithStatement */); + var node = createSynthesizedNode(224 /* WithStatement */); node.expression = expression; node.statement = statement; return node; @@ -50079,7 +51783,7 @@ var ts; } ts.updateWith = updateWith; function createSwitch(expression, caseBlock) { - var node = createSynthesizedNode(222 /* SwitchStatement */); + var node = createSynthesizedNode(225 /* SwitchStatement */); node.expression = ts.parenthesizeExpressionForList(expression); node.caseBlock = caseBlock; return node; @@ -50093,7 +51797,7 @@ var ts; } ts.updateSwitch = updateSwitch; function createLabel(label, statement) { - var node = createSynthesizedNode(223 /* LabeledStatement */); + var node = createSynthesizedNode(226 /* LabeledStatement */); node.label = asName(label); node.statement = statement; return node; @@ -50107,7 +51811,7 @@ var ts; } ts.updateLabel = updateLabel; function createThrow(expression) { - var node = createSynthesizedNode(224 /* ThrowStatement */); + var node = createSynthesizedNode(227 /* ThrowStatement */); node.expression = expression; return node; } @@ -50119,7 +51823,7 @@ var ts; } ts.updateThrow = updateThrow; function createTry(tryBlock, catchClause, finallyBlock) { - var node = createSynthesizedNode(225 /* TryStatement */); + var node = createSynthesizedNode(228 /* TryStatement */); node.tryBlock = tryBlock; node.catchClause = catchClause; node.finallyBlock = finallyBlock; @@ -50135,11 +51839,11 @@ var ts; } ts.updateTry = updateTry; function createDebuggerStatement() { - return createSynthesizedNode(226 /* DebuggerStatement */); + return createSynthesizedNode(229 /* DebuggerStatement */); } ts.createDebuggerStatement = createDebuggerStatement; function createVariableDeclaration(name, type, initializer) { - var node = createSynthesizedNode(227 /* VariableDeclaration */); + var node = createSynthesizedNode(230 /* VariableDeclaration */); node.name = asName(name); node.type = type; node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; @@ -50155,7 +51859,7 @@ var ts; } ts.updateVariableDeclaration = updateVariableDeclaration; function createVariableDeclarationList(declarations, flags) { - var node = createSynthesizedNode(228 /* VariableDeclarationList */); + var node = createSynthesizedNode(231 /* VariableDeclarationList */); node.flags |= flags & 3 /* BlockScoped */; node.declarations = createNodeArray(declarations); return node; @@ -50168,7 +51872,7 @@ var ts; } ts.updateVariableDeclarationList = updateVariableDeclarationList; function createFunctionDeclaration(decorators, modifiers, asteriskToken, name, typeParameters, parameters, type, body) { - var node = createSynthesizedNode(229 /* FunctionDeclaration */); + var node = createSynthesizedNode(232 /* FunctionDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.asteriskToken = asteriskToken; @@ -50194,7 +51898,7 @@ var ts; } ts.updateFunctionDeclaration = updateFunctionDeclaration; function createClassDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(230 /* ClassDeclaration */); + var node = createSynthesizedNode(233 /* ClassDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50216,7 +51920,7 @@ var ts; } ts.updateClassDeclaration = updateClassDeclaration; function createInterfaceDeclaration(decorators, modifiers, name, typeParameters, heritageClauses, members) { - var node = createSynthesizedNode(231 /* InterfaceDeclaration */); + var node = createSynthesizedNode(234 /* InterfaceDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50238,7 +51942,7 @@ var ts; } ts.updateInterfaceDeclaration = updateInterfaceDeclaration; function createTypeAliasDeclaration(decorators, modifiers, name, typeParameters, type) { - var node = createSynthesizedNode(232 /* TypeAliasDeclaration */); + var node = createSynthesizedNode(235 /* TypeAliasDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50258,7 +51962,7 @@ var ts; } ts.updateTypeAliasDeclaration = updateTypeAliasDeclaration; function createEnumDeclaration(decorators, modifiers, name, members) { - var node = createSynthesizedNode(233 /* EnumDeclaration */); + var node = createSynthesizedNode(236 /* EnumDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50276,7 +51980,7 @@ var ts; } ts.updateEnumDeclaration = updateEnumDeclaration; function createModuleDeclaration(decorators, modifiers, name, body, flags) { - var node = createSynthesizedNode(234 /* ModuleDeclaration */); + var node = createSynthesizedNode(237 /* ModuleDeclaration */); node.flags |= flags & (16 /* Namespace */ | 4 /* NestedNamespace */ | 512 /* GlobalAugmentation */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); @@ -50295,7 +51999,7 @@ var ts; } ts.updateModuleDeclaration = updateModuleDeclaration; function createModuleBlock(statements) { - var node = createSynthesizedNode(235 /* ModuleBlock */); + var node = createSynthesizedNode(238 /* ModuleBlock */); node.statements = createNodeArray(statements); return node; } @@ -50307,7 +52011,7 @@ var ts; } ts.updateModuleBlock = updateModuleBlock; function createCaseBlock(clauses) { - var node = createSynthesizedNode(236 /* CaseBlock */); + var node = createSynthesizedNode(239 /* CaseBlock */); node.clauses = createNodeArray(clauses); return node; } @@ -50319,7 +52023,7 @@ var ts; } ts.updateCaseBlock = updateCaseBlock; function createNamespaceExportDeclaration(name) { - var node = createSynthesizedNode(237 /* NamespaceExportDeclaration */); + var node = createSynthesizedNode(240 /* NamespaceExportDeclaration */); node.name = asName(name); return node; } @@ -50331,7 +52035,7 @@ var ts; } ts.updateNamespaceExportDeclaration = updateNamespaceExportDeclaration; function createImportEqualsDeclaration(decorators, modifiers, name, moduleReference) { - var node = createSynthesizedNode(238 /* ImportEqualsDeclaration */); + var node = createSynthesizedNode(241 /* ImportEqualsDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.name = asName(name); @@ -50349,7 +52053,7 @@ var ts; } ts.updateImportEqualsDeclaration = updateImportEqualsDeclaration; function createImportDeclaration(decorators, modifiers, importClause, moduleSpecifier) { - var node = createSynthesizedNode(239 /* ImportDeclaration */); + var node = createSynthesizedNode(242 /* ImportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.importClause = importClause; @@ -50367,7 +52071,7 @@ var ts; } ts.updateImportDeclaration = updateImportDeclaration; function createImportClause(name, namedBindings) { - var node = createSynthesizedNode(240 /* ImportClause */); + var node = createSynthesizedNode(243 /* ImportClause */); node.name = name; node.namedBindings = namedBindings; return node; @@ -50381,7 +52085,7 @@ var ts; } ts.updateImportClause = updateImportClause; function createNamespaceImport(name) { - var node = createSynthesizedNode(241 /* NamespaceImport */); + var node = createSynthesizedNode(244 /* NamespaceImport */); node.name = name; return node; } @@ -50393,7 +52097,7 @@ var ts; } ts.updateNamespaceImport = updateNamespaceImport; function createNamedImports(elements) { - var node = createSynthesizedNode(242 /* NamedImports */); + var node = createSynthesizedNode(245 /* NamedImports */); node.elements = createNodeArray(elements); return node; } @@ -50405,7 +52109,7 @@ var ts; } ts.updateNamedImports = updateNamedImports; function createImportSpecifier(propertyName, name) { - var node = createSynthesizedNode(243 /* ImportSpecifier */); + var node = createSynthesizedNode(246 /* ImportSpecifier */); node.propertyName = propertyName; node.name = name; return node; @@ -50419,7 +52123,7 @@ var ts; } ts.updateImportSpecifier = updateImportSpecifier; function createExportAssignment(decorators, modifiers, isExportEquals, expression) { - var node = createSynthesizedNode(244 /* ExportAssignment */); + var node = createSynthesizedNode(247 /* ExportAssignment */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.isExportEquals = isExportEquals; @@ -50436,7 +52140,7 @@ var ts; } ts.updateExportAssignment = updateExportAssignment; function createExportDeclaration(decorators, modifiers, exportClause, moduleSpecifier) { - var node = createSynthesizedNode(245 /* ExportDeclaration */); + var node = createSynthesizedNode(248 /* ExportDeclaration */); node.decorators = asNodeArray(decorators); node.modifiers = asNodeArray(modifiers); node.exportClause = exportClause; @@ -50454,7 +52158,7 @@ var ts; } ts.updateExportDeclaration = updateExportDeclaration; function createNamedExports(elements) { - var node = createSynthesizedNode(246 /* NamedExports */); + var node = createSynthesizedNode(249 /* NamedExports */); node.elements = createNodeArray(elements); return node; } @@ -50466,7 +52170,7 @@ var ts; } ts.updateNamedExports = updateNamedExports; function createExportSpecifier(propertyName, name) { - var node = createSynthesizedNode(247 /* ExportSpecifier */); + var node = createSynthesizedNode(250 /* ExportSpecifier */); node.propertyName = asName(propertyName); node.name = asName(name); return node; @@ -50481,7 +52185,7 @@ var ts; ts.updateExportSpecifier = updateExportSpecifier; // Module references function createExternalModuleReference(expression) { - var node = createSynthesizedNode(249 /* ExternalModuleReference */); + var node = createSynthesizedNode(252 /* ExternalModuleReference */); node.expression = expression; return node; } @@ -50494,7 +52198,7 @@ var ts; ts.updateExternalModuleReference = updateExternalModuleReference; // JSX function createJsxElement(openingElement, children, closingElement) { - var node = createSynthesizedNode(250 /* JsxElement */); + var node = createSynthesizedNode(253 /* JsxElement */); node.openingElement = openingElement; node.children = createNodeArray(children); node.closingElement = closingElement; @@ -50510,7 +52214,7 @@ var ts; } ts.updateJsxElement = updateJsxElement; function createJsxSelfClosingElement(tagName, attributes) { - var node = createSynthesizedNode(251 /* JsxSelfClosingElement */); + var node = createSynthesizedNode(254 /* JsxSelfClosingElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50524,7 +52228,7 @@ var ts; } ts.updateJsxSelfClosingElement = updateJsxSelfClosingElement; function createJsxOpeningElement(tagName, attributes) { - var node = createSynthesizedNode(252 /* JsxOpeningElement */); + var node = createSynthesizedNode(255 /* JsxOpeningElement */); node.tagName = tagName; node.attributes = attributes; return node; @@ -50538,7 +52242,7 @@ var ts; } ts.updateJsxOpeningElement = updateJsxOpeningElement; function createJsxClosingElement(tagName) { - var node = createSynthesizedNode(253 /* JsxClosingElement */); + var node = createSynthesizedNode(256 /* JsxClosingElement */); node.tagName = tagName; return node; } @@ -50550,7 +52254,7 @@ var ts; } ts.updateJsxClosingElement = updateJsxClosingElement; function createJsxFragment(openingFragment, children, closingFragment) { - var node = createSynthesizedNode(254 /* JsxFragment */); + var node = createSynthesizedNode(257 /* JsxFragment */); node.openingFragment = openingFragment; node.children = createNodeArray(children); node.closingFragment = closingFragment; @@ -50566,7 +52270,7 @@ var ts; } ts.updateJsxFragment = updateJsxFragment; function createJsxAttribute(name, initializer) { - var node = createSynthesizedNode(257 /* JsxAttribute */); + var node = createSynthesizedNode(260 /* JsxAttribute */); node.name = name; node.initializer = initializer; return node; @@ -50580,7 +52284,7 @@ var ts; } ts.updateJsxAttribute = updateJsxAttribute; function createJsxAttributes(properties) { - var node = createSynthesizedNode(258 /* JsxAttributes */); + var node = createSynthesizedNode(261 /* JsxAttributes */); node.properties = createNodeArray(properties); return node; } @@ -50592,7 +52296,7 @@ var ts; } ts.updateJsxAttributes = updateJsxAttributes; function createJsxSpreadAttribute(expression) { - var node = createSynthesizedNode(259 /* JsxSpreadAttribute */); + var node = createSynthesizedNode(262 /* JsxSpreadAttribute */); node.expression = expression; return node; } @@ -50604,7 +52308,7 @@ var ts; } ts.updateJsxSpreadAttribute = updateJsxSpreadAttribute; function createJsxExpression(dotDotDotToken, expression) { - var node = createSynthesizedNode(260 /* JsxExpression */); + var node = createSynthesizedNode(263 /* JsxExpression */); node.dotDotDotToken = dotDotDotToken; node.expression = expression; return node; @@ -50618,7 +52322,7 @@ var ts; ts.updateJsxExpression = updateJsxExpression; // Clauses function createCaseClause(expression, statements) { - var node = createSynthesizedNode(261 /* CaseClause */); + var node = createSynthesizedNode(264 /* CaseClause */); node.expression = ts.parenthesizeExpressionForList(expression); node.statements = createNodeArray(statements); return node; @@ -50632,7 +52336,7 @@ var ts; } ts.updateCaseClause = updateCaseClause; function createDefaultClause(statements) { - var node = createSynthesizedNode(262 /* DefaultClause */); + var node = createSynthesizedNode(265 /* DefaultClause */); node.statements = createNodeArray(statements); return node; } @@ -50644,7 +52348,7 @@ var ts; } ts.updateDefaultClause = updateDefaultClause; function createHeritageClause(token, types) { - var node = createSynthesizedNode(263 /* HeritageClause */); + var node = createSynthesizedNode(266 /* HeritageClause */); node.token = token; node.types = createNodeArray(types); return node; @@ -50657,7 +52361,7 @@ var ts; } ts.updateHeritageClause = updateHeritageClause; function createCatchClause(variableDeclaration, block) { - var node = createSynthesizedNode(264 /* CatchClause */); + var node = createSynthesizedNode(267 /* CatchClause */); node.variableDeclaration = ts.isString(variableDeclaration) ? createVariableDeclaration(variableDeclaration) : variableDeclaration; node.block = block; return node; @@ -50672,10 +52376,10 @@ var ts; ts.updateCatchClause = updateCatchClause; // Property assignments function createPropertyAssignment(name, initializer) { - var node = createSynthesizedNode(265 /* PropertyAssignment */); + var node = createSynthesizedNode(268 /* PropertyAssignment */); node.name = asName(name); node.questionToken = undefined; - node.initializer = initializer !== undefined ? ts.parenthesizeExpressionForList(initializer) : undefined; + node.initializer = ts.parenthesizeExpressionForList(initializer); return node; } ts.createPropertyAssignment = createPropertyAssignment; @@ -50687,7 +52391,7 @@ var ts; } ts.updatePropertyAssignment = updatePropertyAssignment; function createShorthandPropertyAssignment(name, objectAssignmentInitializer) { - var node = createSynthesizedNode(266 /* ShorthandPropertyAssignment */); + var node = createSynthesizedNode(269 /* ShorthandPropertyAssignment */); node.name = asName(name); node.objectAssignmentInitializer = objectAssignmentInitializer !== undefined ? ts.parenthesizeExpressionForList(objectAssignmentInitializer) : undefined; return node; @@ -50701,7 +52405,7 @@ var ts; } ts.updateShorthandPropertyAssignment = updateShorthandPropertyAssignment; function createSpreadAssignment(expression) { - var node = createSynthesizedNode(267 /* SpreadAssignment */); + var node = createSynthesizedNode(270 /* SpreadAssignment */); node.expression = expression !== undefined ? ts.parenthesizeExpressionForList(expression) : undefined; return node; } @@ -50714,7 +52418,7 @@ var ts; ts.updateSpreadAssignment = updateSpreadAssignment; // Enum function createEnumMember(name, initializer) { - var node = createSynthesizedNode(268 /* EnumMember */); + var node = createSynthesizedNode(271 /* EnumMember */); node.name = asName(name); node.initializer = initializer && ts.parenthesizeExpressionForList(initializer); return node; @@ -50730,7 +52434,7 @@ var ts; // Top-level nodes function updateSourceFileNode(node, statements) { if (node.statements !== statements) { - var updated = createSynthesizedNode(269 /* SourceFile */); + var updated = createSynthesizedNode(272 /* SourceFile */); updated.flags |= node.flags; updated.statements = createNodeArray(statements); updated.endOfFileToken = node.endOfFileToken; @@ -50785,6 +52489,12 @@ var ts; updated.imports = node.imports; if (node.moduleAugmentations !== undefined) updated.moduleAugmentations = node.moduleAugmentations; + if (node.pragmas !== undefined) + updated.pragmas = node.pragmas; + if (node.localJsxFactory !== undefined) + updated.localJsxFactory = node.localJsxFactory; + if (node.localJsxNamespace !== undefined) + updated.localJsxNamespace = node.localJsxNamespace; return updateNode(updated, node); } return node; @@ -50809,7 +52519,7 @@ var ts; * @param original The original statement. */ function createNotEmittedStatement(original) { - var node = createSynthesizedNode(291 /* NotEmittedStatement */); + var node = createSynthesizedNode(294 /* NotEmittedStatement */); node.original = original; setTextRange(node, original); return node; @@ -50821,7 +52531,7 @@ var ts; */ /* @internal */ function createEndOfDeclarationMarker(original) { - var node = createSynthesizedNode(295 /* EndOfDeclarationMarker */); + var node = createSynthesizedNode(298 /* EndOfDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50833,7 +52543,7 @@ var ts; */ /* @internal */ function createMergeDeclarationMarker(original) { - var node = createSynthesizedNode(294 /* MergeDeclarationMarker */); + var node = createSynthesizedNode(297 /* MergeDeclarationMarker */); node.emitNode = {}; node.original = original; return node; @@ -50848,7 +52558,7 @@ var ts; * @param location The location for the expression. Defaults to the positions from "original" if provided. */ function createPartiallyEmittedExpression(expression, original) { - var node = createSynthesizedNode(292 /* PartiallyEmittedExpression */); + var node = createSynthesizedNode(295 /* PartiallyEmittedExpression */); node.expression = expression; node.original = original; setTextRange(node, original); @@ -50864,7 +52574,7 @@ var ts; ts.updatePartiallyEmittedExpression = updatePartiallyEmittedExpression; function flattenCommaElements(node) { if (ts.nodeIsSynthesized(node) && !ts.isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) { - if (node.kind === 293 /* CommaListExpression */) { + if (node.kind === 296 /* CommaListExpression */) { return node.elements; } if (ts.isBinaryExpression(node) && node.operatorToken.kind === 26 /* CommaToken */) { @@ -50874,7 +52584,7 @@ var ts; return node; } function createCommaList(elements) { - var node = createSynthesizedNode(293 /* CommaListExpression */); + var node = createSynthesizedNode(296 /* CommaListExpression */); node.elements = createNodeArray(ts.sameFlatMap(elements, flattenCommaElements)); return node; } @@ -50886,7 +52596,7 @@ var ts; } ts.updateCommaList = updateCommaList; function createBundle(sourceFiles) { - var node = ts.createNode(270 /* Bundle */); + var node = ts.createNode(273 /* Bundle */); node.sourceFiles = sourceFiles; return node; } @@ -51022,7 +52732,7 @@ var ts; // To avoid holding onto transformation artifacts, we keep track of any // parse tree node we are annotating. This allows us to clean them up after // all transformations have completed. - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return node.emitNode = { annotatedNodes: [node] }; } var sourceFile = ts.getSourceFileOfNode(node); @@ -51523,7 +53233,7 @@ var ts; if (!outermostLabeledStatement) { return node; } - var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 223 /* LabeledStatement */ + var updated = ts.updateLabel(outermostLabeledStatement, outermostLabeledStatement.label, outermostLabeledStatement.statement.kind === 226 /* LabeledStatement */ ? restoreEnclosingLabel(node, outermostLabeledStatement.statement) : node); if (afterRestoreLabelCallback) { @@ -51533,7 +53243,7 @@ var ts; } ts.restoreEnclosingLabel = restoreEnclosingLabel; function shouldBeCapturedInTempVariable(node, cacheIdentifiers) { - var target = skipParentheses(node); + var target = ts.skipParentheses(node); switch (target.kind) { case 71 /* Identifier */: return cacheIdentifiers; @@ -51541,13 +53251,13 @@ var ts; case 8 /* NumericLiteral */: case 9 /* StringLiteral */: return false; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: var elements = target.elements; if (elements.length === 0) { return false; } return true; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return target.properties.length > 0; default: return true; @@ -51573,7 +53283,7 @@ var ts; } else { switch (callee.kind) { - case 180 /* PropertyAccessExpression */: { + case 183 /* PropertyAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a.b()` target is `(_a = a).b` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51586,7 +53296,7 @@ var ts; } break; } - case 181 /* ElementAccessExpression */: { + case 184 /* ElementAccessExpression */: { if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) { // for `a[b]()` target is `(_a = a)[b]` and thisArg is `_a` thisArg = ts.createTempVariable(recordTempVariable); @@ -51643,14 +53353,14 @@ var ts; ts.createExpressionForPropertyName = createExpressionForPropertyName; function createExpressionForObjectLiteralElementLike(node, property, receiver) { switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return createExpressionForAccessorDeclaration(node.properties, property, receiver, node.multiLine); - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return createExpressionForPropertyAssignment(property, receiver); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return createExpressionForShorthandPropertyAssignment(property, receiver); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return createExpressionForMethodDeclaration(property, receiver); } } @@ -51974,7 +53684,7 @@ var ts; function parenthesizeBinaryOperand(binaryOperator, operand, isLeftSideOfBinary, leftOperand) { var skipped = ts.skipPartiallyEmittedExpressions(operand); // If the resulting expression is already parenthesized, we do not need to do any further processing. - if (skipped.kind === 186 /* ParenthesizedExpression */) { + if (skipped.kind === 189 /* ParenthesizedExpression */) { return operand; } return binaryOperandNeedsParentheses(binaryOperator, operand, isLeftSideOfBinary, leftOperand) @@ -52008,8 +53718,8 @@ var ts; // // If `a ** d` is on the left of operator `**`, we need to parenthesize to preserve // the intended order of operations: `(a ** b) ** c` - var binaryOperatorPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, binaryOperator); - var binaryOperatorAssociativity = ts.getOperatorAssociativity(195 /* BinaryExpression */, binaryOperator); + var binaryOperatorPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, binaryOperator); + var binaryOperatorAssociativity = ts.getOperatorAssociativity(198 /* BinaryExpression */, binaryOperator); var emittedOperand = ts.skipPartiallyEmittedExpressions(operand); var operandPrecedence = ts.getExpressionPrecedence(emittedOperand); switch (ts.compareValues(operandPrecedence, binaryOperatorPrecedence)) { @@ -52018,7 +53728,7 @@ var ts; // and is a yield expression, then we do not need parentheses. if (!isLeftSideOfBinary && binaryOperatorAssociativity === 1 /* Right */ - && operand.kind === 198 /* YieldExpression */) { + && operand.kind === 201 /* YieldExpression */) { return false; } return true; @@ -52106,7 +53816,7 @@ var ts; if (ts.isLiteralKind(node.kind)) { return node.kind; } - if (node.kind === 195 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { + if (node.kind === 198 /* BinaryExpression */ && node.operatorToken.kind === 37 /* PlusToken */) { if (node.cachedLiteralKind !== undefined) { return node.cachedLiteralKind; } @@ -52121,7 +53831,7 @@ var ts; return 0 /* Unknown */; } function parenthesizeForConditionalHead(condition) { - var conditionalPrecedence = ts.getOperatorPrecedence(196 /* ConditionalExpression */, 55 /* QuestionToken */); + var conditionalPrecedence = ts.getOperatorPrecedence(199 /* ConditionalExpression */, 55 /* QuestionToken */); var emittedCondition = ts.skipPartiallyEmittedExpressions(condition); var conditionPrecedence = ts.getExpressionPrecedence(emittedCondition); if (ts.compareValues(conditionPrecedence, conditionalPrecedence) === -1 /* LessThan */) { @@ -52135,8 +53845,8 @@ var ts; // so in case when comma expression is introduced as a part of previous transformations // if should be wrapped in parens since comma operator has the lowest precedence var emittedExpression = ts.skipPartiallyEmittedExpressions(e); - return emittedExpression.kind === 195 /* BinaryExpression */ && emittedExpression.operatorToken.kind === 26 /* CommaToken */ || - emittedExpression.kind === 293 /* CommaListExpression */ + return emittedExpression.kind === 198 /* BinaryExpression */ && emittedExpression.operatorToken.kind === 26 /* CommaToken */ || + emittedExpression.kind === 296 /* CommaListExpression */ ? ts.createParen(e) : e; } @@ -52154,9 +53864,9 @@ var ts; */ function parenthesizeDefaultExpression(e) { var check = ts.skipPartiallyEmittedExpressions(e); - return (check.kind === 200 /* ClassExpression */ || - check.kind === 187 /* FunctionExpression */ || - check.kind === 293 /* CommaListExpression */ || + return (check.kind === 203 /* ClassExpression */ || + check.kind === 190 /* FunctionExpression */ || + check.kind === 296 /* CommaListExpression */ || ts.isBinaryExpression(check) && check.operatorToken.kind === 26 /* CommaToken */) ? ts.createParen(e) : e; @@ -52171,9 +53881,9 @@ var ts; function parenthesizeForNew(expression) { var leftmostExpr = getLeftmostExpression(expression, /*stopAtCallExpressions*/ true); switch (leftmostExpr.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.createParen(expression); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return !leftmostExpr.arguments ? ts.createParen(expression) : expression; @@ -52196,7 +53906,7 @@ var ts; // var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); if (ts.isLeftHandSideExpression(emittedExpression) - && (emittedExpression.kind !== 183 /* NewExpression */ || emittedExpression.arguments)) { + && (emittedExpression.kind !== 186 /* NewExpression */ || emittedExpression.arguments)) { return expression; } return ts.setTextRange(ts.createParen(expression), expression); @@ -52234,7 +53944,7 @@ var ts; function parenthesizeExpressionForList(expression) { var emittedExpression = ts.skipPartiallyEmittedExpressions(expression); var expressionPrecedence = ts.getExpressionPrecedence(emittedExpression); - var commaPrecedence = ts.getOperatorPrecedence(195 /* BinaryExpression */, 26 /* CommaToken */); + var commaPrecedence = ts.getOperatorPrecedence(198 /* BinaryExpression */, 26 /* CommaToken */); return expressionPrecedence > commaPrecedence ? expression : ts.setTextRange(ts.createParen(expression), expression); @@ -52245,34 +53955,38 @@ var ts; if (ts.isCallExpression(emittedExpression)) { var callee = emittedExpression.expression; var kind = ts.skipPartiallyEmittedExpressions(callee).kind; - if (kind === 187 /* FunctionExpression */ || kind === 188 /* ArrowFunction */) { + if (kind === 190 /* FunctionExpression */ || kind === 191 /* ArrowFunction */) { var mutableCall = ts.getMutableClone(emittedExpression); mutableCall.expression = ts.setTextRange(ts.createParen(callee), callee); return recreateOuterExpressions(expression, mutableCall, 4 /* PartiallyEmittedExpressions */); } } var leftmostExpressionKind = getLeftmostExpression(emittedExpression, /*stopAtCallExpressions*/ false).kind; - if (leftmostExpressionKind === 179 /* ObjectLiteralExpression */ || leftmostExpressionKind === 187 /* FunctionExpression */) { + if (leftmostExpressionKind === 182 /* ObjectLiteralExpression */ || leftmostExpressionKind === 190 /* FunctionExpression */) { return ts.setTextRange(ts.createParen(expression), expression); } return expression; } ts.parenthesizeExpressionForExpressionStatement = parenthesizeExpressionForExpressionStatement; + function parenthesizeConditionalTypeMember(member) { + return member.kind === 170 /* ConditionalType */ ? ts.createParenthesizedType(member) : member; + } + ts.parenthesizeConditionalTypeMember = parenthesizeConditionalTypeMember; function parenthesizeElementTypeMember(member) { switch (member.kind) { - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createParenthesizedType(member); } - return member; + return parenthesizeConditionalTypeMember(member); } ts.parenthesizeElementTypeMember = parenthesizeElementTypeMember; function parenthesizeArrayTypeMember(member) { switch (member.kind) { - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: return ts.createParenthesizedType(member); } return parenthesizeElementTypeMember(member); @@ -52298,25 +54012,25 @@ var ts; function getLeftmostExpression(node, stopAtCallExpressions) { while (true) { switch (node.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: node = node.operand; continue; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: node = node.left; continue; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: node = node.condition; continue; - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (stopAtCallExpressions) { return node; } // falls through - case 181 /* ElementAccessExpression */: - case 180 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: + case 183 /* PropertyAccessExpression */: node = node.expression; continue; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: node = node.expression; continue; } @@ -52324,7 +54038,7 @@ var ts; } } function parenthesizeConciseBody(body) { - if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 179 /* ObjectLiteralExpression */) { + if (!ts.isBlock(body) && getLeftmostExpression(body, /*stopAtCallExpressions*/ false).kind === 182 /* ObjectLiteralExpression */) { return ts.setTextRange(ts.createParen(body), body); } return body; @@ -52340,13 +54054,13 @@ var ts; function isOuterExpression(node, kinds) { if (kinds === void 0) { kinds = 7 /* All */; } switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return (kinds & 1 /* Parentheses */) !== 0; - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: - case 204 /* NonNullExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: + case 207 /* NonNullExpression */: return (kinds & 2 /* Assertions */) !== 0; - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return (kinds & 4 /* PartiallyEmittedExpressions */) !== 0; } return false; @@ -52358,7 +54072,7 @@ var ts; do { previousNode = node; if (kinds & 1 /* Parentheses */) { - node = skipParentheses(node); + node = ts.skipParentheses(node); } if (kinds & 2 /* Assertions */) { node = skipAssertions(node); @@ -52370,15 +54084,8 @@ var ts; return node; } ts.skipOuterExpressions = skipOuterExpressions; - function skipParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */) { - node = node.expression; - } - return node; - } - ts.skipParentheses = skipParentheses; function skipAssertions(node) { - while (ts.isAssertionExpression(node) || node.kind === 204 /* NonNullExpression */) { + while (ts.isAssertionExpression(node) || node.kind === 207 /* NonNullExpression */) { node = node.expression; } return node; @@ -52386,11 +54093,11 @@ var ts; ts.skipAssertions = skipAssertions; function updateOuterExpression(outerExpression, expression) { switch (outerExpression.kind) { - case 186 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); - case 185 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); - case 203 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); - case 204 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); - case 292 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); + case 189 /* ParenthesizedExpression */: return ts.updateParen(outerExpression, expression); + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(outerExpression, outerExpression.type, expression); + case 206 /* AsExpression */: return ts.updateAsExpression(outerExpression, expression, outerExpression.type); + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(outerExpression, expression); + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(outerExpression, expression); } } /** @@ -52408,7 +54115,7 @@ var ts; * the containing expression is created/updated. */ function isIgnorableParen(node) { - return node.kind === 186 /* ParenthesizedExpression */ + return node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node) && ts.nodeIsSynthesized(ts.getSourceMapRange(node)) && ts.nodeIsSynthesized(ts.getCommentRange(node)) @@ -52473,10 +54180,10 @@ var ts; var name = namespaceDeclaration.name; return ts.isGeneratedIdentifier(name) ? name : ts.createIdentifier(ts.getSourceTextOfNodeFromSourceFile(sourceFile, name) || ts.idText(name)); } - if (node.kind === 239 /* ImportDeclaration */ && node.importClause) { + if (node.kind === 242 /* ImportDeclaration */ && node.importClause) { return ts.getGeneratedNameForNode(node); } - if (node.kind === 245 /* ExportDeclaration */ && node.moduleSpecifier) { + if (node.kind === 248 /* ExportDeclaration */ && node.moduleSpecifier) { return ts.getGeneratedNameForNode(node); } return undefined; @@ -52594,7 +54301,7 @@ var ts; } if (ts.isObjectLiteralElementLike(bindingElement)) { switch (bindingElement.kind) { - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `b` in `({ a: b } = ...)` // `b` in `({ a: b = 1 } = ...)` // `{b}` in `({ a: {b} } = ...)` @@ -52606,11 +54313,11 @@ var ts; // `b[0]` in `({ a: b[0] } = ...)` // `b[0]` in `({ a: b[0] = 1 } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.initializer); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: // `a` in `({ a } = ...)` // `a` in `({ a = 1 } = ...)` return bindingElement.name; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return getTargetOfBindingOrAssignmentElement(bindingElement.expression); } @@ -52642,12 +54349,12 @@ var ts; */ function getRestIndicatorOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 147 /* Parameter */: - case 177 /* BindingElement */: + case 148 /* Parameter */: + case 180 /* BindingElement */: // `...` in `let [...a] = ...` return bindingElement.dotDotDotToken; - case 199 /* SpreadElement */: - case 267 /* SpreadAssignment */: + case 202 /* SpreadElement */: + case 270 /* SpreadAssignment */: // `...` in `[...a] = ...` return bindingElement; } @@ -52659,7 +54366,7 @@ var ts; */ function getPropertyNameOfBindingOrAssignmentElement(bindingElement) { switch (bindingElement.kind) { - case 177 /* BindingElement */: + case 180 /* BindingElement */: // `a` in `let { a: b } = ...` // `[a]` in `let { [a]: b } = ...` // `"a"` in `let { "a": b } = ...` @@ -52671,7 +54378,7 @@ var ts; : propertyName; } break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: // `a` in `({ a: b } = ...)` // `[a]` in `({ [a]: b } = ...)` // `"a"` in `({ "a": b } = ...)` @@ -52683,7 +54390,7 @@ var ts; : propertyName; } break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: // `a` in `({ ...a } = ...)` return bindingElement.name; } @@ -52701,13 +54408,13 @@ var ts; */ function getElementsOfBindingOrAssignmentPattern(name) { switch (name.kind) { - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: // `a` in `{a}` // `a` in `[a]` return name.elements; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: // `a` in `{a}` return name.properties; } @@ -52747,11 +54454,11 @@ var ts; ts.convertToObjectAssignmentElement = convertToObjectAssignmentElement; function convertToAssignmentPattern(node) { switch (node.kind) { - case 176 /* ArrayBindingPattern */: - case 178 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 181 /* ArrayLiteralExpression */: return convertToArrayAssignmentPattern(node); - case 175 /* ObjectBindingPattern */: - case 179 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 182 /* ObjectLiteralExpression */: return convertToObjectAssignmentPattern(node); } } @@ -52915,266 +54622,270 @@ var ts; } var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */) || kind === 170 /* ThisType */) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */) || kind === 173 /* ThisType */) { return node; } switch (kind) { // Names case 71 /* Identifier */: return ts.updateIdentifier(node, nodesVisitor(node.typeArguments, visitor, isTypeNodeOrTypeParameterDeclaration)); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return ts.updateQualifiedName(node, visitNode(node.left, visitor, ts.isEntityName), visitNode(node.right, visitor, ts.isIdentifier)); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return ts.updateComputedPropertyName(node, visitNode(node.expression, visitor, ts.isExpression)); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return ts.updateTypeParameterDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.constraint, visitor, ts.isTypeNode), visitNode(node.default, visitor, ts.isTypeNode)); - case 147 /* Parameter */: + case 148 /* Parameter */: return ts.updateParameter(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 148 /* Decorator */: + case 149 /* Decorator */: return ts.updateDecorator(node, visitNode(node.expression, visitor, ts.isExpression)); // Type elements - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return ts.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return ts.updateProperty(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return ts.updateMethodSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken)); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return ts.updateMethod(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.questionToken, tokenVisitor, ts.isToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 153 /* Constructor */: + case 154 /* Constructor */: return ts.updateConstructor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return ts.updateGetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return ts.updateSetAccessor(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isPropertyName), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitFunctionBody(node.body, visitor, context)); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return ts.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return ts.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return ts.updateIndexSignature(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return ts.updateTypePredicateNode(node, visitNode(node.parameterName, visitor), visitNode(node.type, visitor, ts.isTypeNode)); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return ts.updateTypeReferenceNode(node, visitNode(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode)); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return ts.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return ts.updateConstructorTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return ts.updateTypeQueryNode(node, visitNode(node.exprName, visitor, ts.isEntityName)); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return ts.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return ts.updateArrayTypeNode(node, visitNode(node.elementType, visitor, ts.isTypeNode)); - case 166 /* TupleType */: + case 167 /* TupleType */: return ts.updateTypleTypeNode(node, nodesVisitor(node.elementTypes, visitor, ts.isTypeNode)); - case 167 /* UnionType */: + case 168 /* UnionType */: return ts.updateUnionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return ts.updateIntersectionTypeNode(node, nodesVisitor(node.types, visitor, ts.isTypeNode)); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return ts.updateConditionalTypeNode(node, visitNode(node.checkType, visitor, ts.isTypeNode), visitNode(node.extendsType, visitor, ts.isTypeNode), visitNode(node.trueType, visitor, ts.isTypeNode), visitNode(node.falseType, visitor, ts.isTypeNode)); + case 171 /* InferType */: + return ts.updateInferTypeNode(node, visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration)); + case 172 /* ParenthesizedType */: return ts.updateParenthesizedType(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return ts.updateTypeOperatorNode(node, visitNode(node.type, visitor, ts.isTypeNode)); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return ts.updateIndexedAccessTypeNode(node, visitNode(node.objectType, visitor, ts.isTypeNode), visitNode(node.indexType, visitor, ts.isTypeNode)); - case 173 /* MappedType */: + case 176 /* MappedType */: return ts.updateMappedTypeNode(node, visitNode(node.readonlyToken, tokenVisitor, ts.isToken), visitNode(node.typeParameter, visitor, ts.isTypeParameterDeclaration), visitNode(node.questionToken, tokenVisitor, ts.isToken), visitNode(node.type, visitor, ts.isTypeNode)); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return ts.updateLiteralTypeNode(node, visitNode(node.literal, visitor, ts.isExpression)); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return ts.updateObjectBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isBindingElement)); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return ts.updateArrayBindingPattern(node, nodesVisitor(node.elements, visitor, ts.isArrayBindingElement)); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return ts.updateBindingElement(node, visitNode(node.dotDotDotToken, tokenVisitor, ts.isToken), visitNode(node.propertyName, visitor, ts.isPropertyName), visitNode(node.name, visitor, ts.isBindingName), visitNode(node.initializer, visitor, ts.isExpression)); // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return ts.updateArrayLiteral(node, nodesVisitor(node.elements, visitor, ts.isExpression)); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return ts.updateObjectLiteral(node, nodesVisitor(node.properties, visitor, ts.isObjectLiteralElementLike)); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return ts.updatePropertyAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.name, visitor, ts.isIdentifier)); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return ts.updateElementAccess(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.argumentExpression, visitor, ts.isExpression)); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.updateCall(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return ts.updateNew(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), nodesVisitor(node.arguments, visitor, ts.isExpression)); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return ts.updateTaggedTemplate(node, visitNode(node.tag, visitor, ts.isExpression), visitNode(node.template, visitor, ts.isTemplateLiteral)); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return ts.updateTypeAssertion(node, visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitNode(node.expression, visitor, ts.isExpression)); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return ts.updateFunctionExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return ts.updateArrowFunction(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.equalsGreaterThanToken, visitor, ts.isToken), visitFunctionBody(node.body, visitor, context)); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return ts.updateDelete(node, visitNode(node.expression, visitor, ts.isExpression)); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return ts.updateTypeOf(node, visitNode(node.expression, visitor, ts.isExpression)); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return ts.updateVoid(node, visitNode(node.expression, visitor, ts.isExpression)); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return ts.updateAwait(node, visitNode(node.expression, visitor, ts.isExpression)); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return ts.updatePrefix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return ts.updatePostfix(node, visitNode(node.operand, visitor, ts.isExpression)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateBinary(node, visitNode(node.left, visitor, ts.isExpression), visitNode(node.right, visitor, ts.isExpression), visitNode(node.operatorToken, visitor, ts.isToken)); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return ts.updateConditional(node, visitNode(node.condition, visitor, ts.isExpression), visitNode(node.questionToken, visitor, ts.isToken), visitNode(node.whenTrue, visitor, ts.isExpression), visitNode(node.colonToken, visitor, ts.isToken), visitNode(node.whenFalse, visitor, ts.isExpression)); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return ts.updateTemplateExpression(node, visitNode(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateSpan)); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return ts.updateYield(node, visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.expression, visitor, ts.isExpression)); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return ts.updateSpread(node, visitNode(node.expression, visitor, ts.isExpression)); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return ts.updateClassExpression(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return ts.updateExpressionWithTypeArguments(node, nodesVisitor(node.typeArguments, visitor, ts.isTypeNode), visitNode(node.expression, visitor, ts.isExpression)); - case 203 /* AsExpression */: + case 206 /* AsExpression */: return ts.updateAsExpression(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.type, visitor, ts.isTypeNode)); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return ts.updateNonNullExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return ts.updateMetaProperty(node, visitNode(node.name, visitor, ts.isIdentifier)); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.updateTemplateSpan(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.literal, visitor, ts.isTemplateMiddleOrTemplateTail)); // Element - case 208 /* Block */: + case 211 /* Block */: return ts.updateBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return ts.updateVariableStatement(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.declarationList, visitor, ts.isVariableDeclarationList)); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return ts.updateStatement(node, visitNode(node.expression, visitor, ts.isExpression)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return ts.updateIf(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.thenStatement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.elseStatement, visitor, ts.isStatement, ts.liftToBlock)); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return ts.updateDo(node, visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock), visitNode(node.expression, visitor, ts.isExpression)); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return ts.updateWhile(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return ts.updateFor(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.condition, visitor, ts.isExpression), visitNode(node.incrementor, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return ts.updateForIn(node, visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return ts.updateForOf(node, visitNode(node.awaitModifier, visitor, ts.isToken), visitNode(node.initializer, visitor, ts.isForInitializer), visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return ts.updateContinue(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return ts.updateBreak(node, visitNode(node.label, visitor, ts.isIdentifier)); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return ts.updateReturn(node, visitNode(node.expression, visitor, ts.isExpression)); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return ts.updateWith(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return ts.updateSwitch(node, visitNode(node.expression, visitor, ts.isExpression), visitNode(node.caseBlock, visitor, ts.isCaseBlock)); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return ts.updateLabel(node, visitNode(node.label, visitor, ts.isIdentifier), visitNode(node.statement, visitor, ts.isStatement, ts.liftToBlock)); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return ts.updateThrow(node, visitNode(node.expression, visitor, ts.isExpression)); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return ts.updateTry(node, visitNode(node.tryBlock, visitor, ts.isBlock), visitNode(node.catchClause, visitor, ts.isCatchClause), visitNode(node.finallyBlock, visitor, ts.isBlock)); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return ts.updateVariableDeclaration(node, visitNode(node.name, visitor, ts.isBindingName), visitNode(node.type, visitor, ts.isTypeNode), visitNode(node.initializer, visitor, ts.isExpression)); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return ts.updateVariableDeclarationList(node, nodesVisitor(node.declarations, visitor, ts.isVariableDeclaration)); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return ts.updateFunctionDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.asteriskToken, tokenVisitor, ts.isToken), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), visitNode(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return ts.updateClassDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isClassElement)); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.updateInterfaceDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.heritageClauses, visitor, ts.isHeritageClause), nodesVisitor(node.members, visitor, ts.isTypeElement)); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return ts.updateTypeAliasDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitNode(node.type, visitor, ts.isTypeNode)); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return ts.updateEnumDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), nodesVisitor(node.members, visitor, ts.isEnumMember)); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return ts.updateModuleDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.body, visitor, ts.isModuleBody)); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return ts.updateModuleBlock(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return ts.updateCaseBlock(node, nodesVisitor(node.clauses, visitor, ts.isCaseOrDefaultClause)); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return ts.updateNamespaceExportDeclaration(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return ts.updateImportEqualsDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.moduleReference, visitor, ts.isModuleReference)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return ts.updateImportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.importClause, visitor, ts.isImportClause), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return ts.updateImportClause(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.namedBindings, visitor, ts.isNamedImportBindings)); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return ts.updateNamespaceImport(node, visitNode(node.name, visitor, ts.isIdentifier)); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return ts.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier)); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return ts.updateImportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return ts.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.expression, visitor, ts.isExpression)); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return ts.updateExportDeclaration(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), visitNode(node.exportClause, visitor, ts.isNamedExports), visitNode(node.moduleSpecifier, visitor, ts.isExpression)); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return ts.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier)); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return ts.updateExportSpecifier(node, visitNode(node.propertyName, visitor, ts.isIdentifier), visitNode(node.name, visitor, ts.isIdentifier)); // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return ts.updateExternalModuleReference(node, visitNode(node.expression, visitor, ts.isExpression)); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return ts.updateJsxElement(node, visitNode(node.openingElement, visitor, ts.isJsxOpeningElement), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingElement, visitor, ts.isJsxClosingElement)); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return ts.updateJsxSelfClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: return ts.updateJsxOpeningElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression), visitNode(node.attributes, visitor, ts.isJsxAttributes)); - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: return ts.updateJsxClosingElement(node, visitNode(node.tagName, visitor, ts.isJsxTagNameExpression)); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return ts.updateJsxFragment(node, visitNode(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), visitNode(node.closingFragment, visitor, ts.isJsxClosingFragment)); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return ts.updateJsxAttribute(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.initializer, visitor, ts.isStringLiteralOrJsxExpression)); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return ts.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike)); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return ts.updateJsxSpreadAttribute(node, visitNode(node.expression, visitor, ts.isExpression)); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return ts.updateJsxExpression(node, visitNode(node.expression, visitor, ts.isExpression)); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return ts.updateCaseClause(node, visitNode(node.expression, visitor, ts.isExpression), nodesVisitor(node.statements, visitor, ts.isStatement)); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return ts.updateDefaultClause(node, nodesVisitor(node.statements, visitor, ts.isStatement)); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return ts.updateHeritageClause(node, nodesVisitor(node.types, visitor, ts.isExpressionWithTypeArguments)); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.updateCatchClause(node, visitNode(node.variableDeclaration, visitor, ts.isVariableDeclaration), visitNode(node.block, visitor, ts.isBlock)); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return ts.updatePropertyAssignment(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return ts.updateShorthandPropertyAssignment(node, visitNode(node.name, visitor, ts.isIdentifier), visitNode(node.objectAssignmentInitializer, visitor, ts.isExpression)); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return ts.updateSpreadAssignment(node, visitNode(node.expression, visitor, ts.isExpression)); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return ts.updateEnumMember(node, visitNode(node.name, visitor, ts.isPropertyName), visitNode(node.initializer, visitor, ts.isExpression)); // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.updateSourceFileNode(node, visitLexicalEnvironment(node.statements, visitor, context)); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return ts.updatePartiallyEmittedExpression(node, visitNode(node.expression, visitor, ts.isExpression)); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return ts.updateCommaList(node, nodesVisitor(node.elements, visitor, ts.isExpression)); default: // No need to visit nodes with no children. @@ -53216,58 +54927,58 @@ var ts; var cbNodes = cbNodeArray || cbNode; var kind = node.kind; // No need to visit nodes with no children. - if ((kind > 0 /* FirstToken */ && kind <= 143 /* LastToken */)) { + if ((kind > 0 /* FirstToken */ && kind <= 144 /* LastToken */)) { return initial; } // We do not yet support types. - if ((kind >= 159 /* TypePredicate */ && kind <= 174 /* LiteralType */)) { + if ((kind >= 160 /* TypePredicate */ && kind <= 177 /* LiteralType */)) { return initial; } var result = initial; switch (node.kind) { // Leaf nodes - case 207 /* SemicolonClassElement */: - case 210 /* EmptyStatement */: - case 201 /* OmittedExpression */: - case 226 /* DebuggerStatement */: - case 291 /* NotEmittedStatement */: + case 210 /* SemicolonClassElement */: + case 213 /* EmptyStatement */: + case 204 /* OmittedExpression */: + case 229 /* DebuggerStatement */: + case 294 /* NotEmittedStatement */: // No need to visit nodes with no children. break; // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: result = reduceNode(node.expression, cbNode, result); break; // Signature elements - case 147 /* Parameter */: + case 148 /* Parameter */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 148 /* Decorator */: + case 149 /* Decorator */: result = reduceNode(node.expression, cbNode, result); break; // Type member - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.questionToken, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53276,12 +54987,12 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 153 /* Constructor */: + case 154 /* Constructor */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.body, cbNode, result); break; - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53289,7 +55000,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53297,49 +55008,49 @@ var ts; result = reduceNode(node.body, cbNode, result); break; // Binding patterns - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: result = reduceNodes(node.elements, cbNodes, result); break; - case 177 /* BindingElement */: + case 180 /* BindingElement */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Expression - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: result = reduceNodes(node.elements, cbNodes, result); break; - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: result = reduceNodes(node.properties, cbNodes, result); break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.argumentExpression, cbNode, result); break; - case 182 /* CallExpression */: + case 185 /* CallExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 183 /* NewExpression */: + case 186 /* NewExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); result = reduceNodes(node.arguments, cbNodes, result); break; - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: result = reduceNode(node.tag, cbNode, result); result = reduceNode(node.template, cbNode, result); break; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: result = reduceNode(node.type, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); @@ -53347,123 +55058,123 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.parameters, cbNodes, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 186 /* ParenthesizedExpression */: - case 189 /* DeleteExpression */: - case 190 /* TypeOfExpression */: - case 191 /* VoidExpression */: - case 192 /* AwaitExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: - case 204 /* NonNullExpression */: + case 189 /* ParenthesizedExpression */: + case 192 /* DeleteExpression */: + case 193 /* TypeOfExpression */: + case 194 /* VoidExpression */: + case 195 /* AwaitExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: + case 207 /* NonNullExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: result = reduceNode(node.operand, cbNode, result); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: result = reduceNode(node.left, cbNode, result); result = reduceNode(node.right, cbNode, result); break; - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.whenTrue, cbNode, result); result = reduceNode(node.whenFalse, cbNode, result); break; - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: result = reduceNode(node.head, cbNode, result); result = reduceNodes(node.templateSpans, cbNodes, result); break; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.typeParameters, cbNodes, result); result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: result = reduceNode(node.expression, cbNode, result); result = reduceNodes(node.typeArguments, cbNodes, result); break; - case 203 /* AsExpression */: + case 206 /* AsExpression */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.type, cbNode, result); break; // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.literal, cbNode, result); break; // Element - case 208 /* Block */: + case 211 /* Block */: result = reduceNodes(node.statements, cbNodes, result); break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.declarationList, cbNode, result); break; - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 212 /* IfStatement */: + case 215 /* IfStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.thenStatement, cbNode, result); result = reduceNode(node.elseStatement, cbNode, result); break; - case 213 /* DoStatement */: + case 216 /* DoStatement */: result = reduceNode(node.statement, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 214 /* WhileStatement */: - case 221 /* WithStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 215 /* ForStatement */: + case 218 /* ForStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.condition, cbNode, result); result = reduceNode(node.incrementor, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: result = reduceNode(node.initializer, cbNode, result); result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: result = reduceNode(node.expression, cbNode, result); break; - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: result = reduceNode(node.expression, cbNode, result); result = reduceNode(node.caseBlock, cbNode, result); break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: result = reduceNode(node.label, cbNode, result); result = reduceNode(node.statement, cbNode, result); break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: result = reduceNode(node.tryBlock, cbNode, result); result = reduceNode(node.catchClause, cbNode, result); result = reduceNode(node.finallyBlock, cbNode, result); break; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.type, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: result = reduceNodes(node.declarations, cbNodes, result); break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53472,7 +55183,7 @@ var ts; result = reduceNode(node.type, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); @@ -53480,139 +55191,139 @@ var ts; result = reduceNodes(node.heritageClauses, cbNodes, result); result = reduceNodes(node.members, cbNodes, result); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNodes(node.members, cbNodes, result); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.body, cbNode, result); break; - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: result = reduceNodes(node.statements, cbNodes, result); break; - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: result = reduceNodes(node.clauses, cbNodes, result); break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.name, cbNode, result); result = reduceNode(node.moduleReference, cbNode, result); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: result = reduceNodes(node.decorators, cbNodes, result); result = reduceNodes(node.modifiers, cbNodes, result); result = reduceNode(node.importClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.namedBindings, cbNode, result); break; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: result = reduceNode(node.name, cbNode, result); break; - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: result = reduceNodes(node.elements, cbNodes, result); break; - case 243 /* ImportSpecifier */: - case 247 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 250 /* ExportSpecifier */: result = reduceNode(node.propertyName, cbNode, result); result = reduceNode(node.name, cbNode, result); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.expression, cbNode, result); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: result = ts.reduceLeft(node.decorators, cbNode, result); result = ts.reduceLeft(node.modifiers, cbNode, result); result = reduceNode(node.exportClause, cbNode, result); result = reduceNode(node.moduleSpecifier, cbNode, result); break; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: result = reduceNode(node.expression, cbNode, result); break; // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: result = reduceNode(node.openingElement, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingElement, cbNode, result); break; - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: result = reduceNode(node.openingFragment, cbNode, result); result = ts.reduceLeft(node.children, cbNode, result); result = reduceNode(node.closingFragment, cbNode, result); break; - case 251 /* JsxSelfClosingElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: result = reduceNode(node.tagName, cbNode, result); result = reduceNode(node.attributes, cbNode, result); break; - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: result = reduceNodes(node.properties, cbNodes, result); break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: result = reduceNode(node.tagName, cbNode, result); break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: result = reduceNode(node.expression, cbNode, result); break; - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: result = reduceNode(node.expression, cbNode, result); break; // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: result = reduceNode(node.expression, cbNode, result); // falls through - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: result = reduceNodes(node.statements, cbNodes, result); break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: result = reduceNodes(node.types, cbNodes, result); break; - case 264 /* CatchClause */: + case 267 /* CatchClause */: result = reduceNode(node.variableDeclaration, cbNode, result); result = reduceNode(node.block, cbNode, result); break; // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.objectAssignmentInitializer, cbNode, result); break; - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: result = reduceNode(node.expression, cbNode, result); break; // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: result = reduceNode(node.name, cbNode, result); result = reduceNode(node.initializer, cbNode, result); break; // Top-level nodes - case 269 /* SourceFile */: + case 272 /* SourceFile */: result = reduceNodes(node.statements, cbNodes, result); break; // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: result = reduceNode(node.expression, cbNode, result); break; - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: result = reduceNodes(node.elements, cbNodes, result); break; default: @@ -53685,7 +55396,7 @@ var ts; function aggregateTransformFlagsForSubtree(node) { // We do not transform ambient declarations or types, so there is no need to // recursively aggregate transform flags. - if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 202 /* ExpressionWithTypeArguments */)) { + if (ts.hasModifier(node, 2 /* Ambient */) || (ts.isTypeNode(node) && node.kind !== 205 /* ExpressionWithTypeArguments */)) { return 0 /* None */; } // Aggregate the transform flags of each child. @@ -53706,7 +55417,7 @@ var ts; var isDebugInfoEnabled = false; Debug.failBadSyntaxKind = Debug.shouldAssert(1 /* Normal */) ? function (node, message) { return Debug.fail((message || "Unexpected node.") + "\r\nNode " + ts.formatSyntaxKind(node.kind) + " was unexpected.", Debug.failBadSyntaxKind); } - : ts.noop; + : ts.noop; // TODO: GH#22091 Debug.assertEachNode = Debug.shouldAssert(1 /* Normal */) ? function (nodes, test, message) { return Debug.assert(test === undefined || ts.every(nodes, test), message || "Unexpected node.", function () { return "Node array did not pass test '" + Debug.getFunctionName(test) + "'."; }, Debug.assertEachNode); } : ts.noop; @@ -53811,13 +55522,13 @@ var ts; var uniqueExports = ts.createMap(); var exportedNames; var hasExportDefault = false; - var exportEquals = undefined; + var exportEquals; var hasExportStarsToExportValues = false; var hasImportStarOrImportDefault = false; for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { var node = _a[_i]; switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import "mod" // import x from "mod" // import * as x from "mod" @@ -53825,13 +55536,13 @@ var ts; externalImports.push(node); hasImportStarOrImportDefault = getImportNeedsImportStarHelper(node) || getImportNeedsImportDefaultHelper(node); break; - case 238 /* ImportEqualsDeclaration */: - if (node.moduleReference.kind === 249 /* ExternalModuleReference */) { + case 241 /* ImportEqualsDeclaration */: + if (node.moduleReference.kind === 252 /* ExternalModuleReference */) { // import x = require("mod") externalImports.push(node); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (node.moduleSpecifier) { if (!node.exportClause) { // export * from "mod" @@ -53861,13 +55572,13 @@ var ts; } } break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals && !exportEquals) { // export = x exportEquals = node; } break; - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: if (ts.hasModifier(node, 1 /* Export */)) { for (var _d = 0, _e = node.declarationList.declarations; _d < _e.length; _d++) { var decl = _e[_d]; @@ -53875,7 +55586,7 @@ var ts; } } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default function() { } @@ -53895,7 +55606,7 @@ var ts; } } break; - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (ts.hasModifier(node, 1 /* Export */)) { if (ts.hasModifier(node, 512 /* Default */)) { // export default class { } @@ -53963,9 +55674,8 @@ var ts; * - this is mostly subjective beyond the requirement that the expression not be sideeffecting */ function isSimpleCopiableExpression(expression) { - return expression.kind === 9 /* StringLiteral */ || + return ts.isStringLiteralLike(expression) || expression.kind === 8 /* NumericLiteral */ || - expression.kind === 13 /* NoSubstitutionTemplateLiteral */ || ts.isKeyword(expression.kind) || ts.isIdentifier(expression); } @@ -54496,8 +56206,8 @@ var ts; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; // Enable substitution for property/element access to emit const enum values. - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // These variables contain state that changes as we descend into the tree. var currentSourceFile; var currentNamespace; @@ -54566,15 +56276,15 @@ var ts; */ function onBeforeVisitNode(node) { switch (node.kind) { - case 269 /* SourceFile */: - case 236 /* CaseBlock */: - case 235 /* ModuleBlock */: - case 208 /* Block */: + case 272 /* SourceFile */: + case 239 /* CaseBlock */: + case 238 /* ModuleBlock */: + case 211 /* Block */: currentScope = node; currentScopeFirstDeclarationsOfName = undefined; break; - case 230 /* ClassDeclaration */: - case 229 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 232 /* FunctionDeclaration */: if (ts.hasModifier(node, 2 /* Ambient */)) { break; } @@ -54586,7 +56296,7 @@ var ts; // These nodes should always have names unless they are default-exports; // however, class declaration parsing allows for undefined names, so syntactically invalid // programs may also have an undefined name. - ts.Debug.assert(node.kind === 230 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); + ts.Debug.assert(node.kind === 233 /* ClassDeclaration */ || ts.hasModifier(node, 512 /* Default */)); } break; } @@ -54630,10 +56340,10 @@ var ts; */ function sourceElementVisitorWorker(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return visitEllidableStatement(node); default: return visitorWorker(node); @@ -54654,13 +56364,13 @@ var ts; return node; } switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); default: ts.Debug.fail("Unhandled ellided statement"); @@ -54680,11 +56390,11 @@ var ts; * @param node The node to visit. */ function namespaceElementVisitorWorker(node) { - if (node.kind === 245 /* ExportDeclaration */ || - node.kind === 239 /* ImportDeclaration */ || - node.kind === 240 /* ImportClause */ || - (node.kind === 238 /* ImportEqualsDeclaration */ && - node.moduleReference.kind === 249 /* ExternalModuleReference */)) { + if (node.kind === 248 /* ExportDeclaration */ || + node.kind === 242 /* ImportDeclaration */ || + node.kind === 243 /* ImportClause */ || + (node.kind === 241 /* ImportEqualsDeclaration */ && + node.moduleReference.kind === 252 /* ExternalModuleReference */)) { // do not emit ES6 imports and exports since they are illegal inside a namespace return undefined; } @@ -54714,19 +56424,19 @@ var ts; */ function classElementVisitorWorker(node) { switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // TypeScript constructors are transformed in `visitClassDeclaration`. // We elide them here as `visitorWorker` checks transform flags, which could // erronously include an ES6 constructor without TypeScript syntax. return undefined; - case 150 /* PropertyDeclaration */: - case 158 /* IndexSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 152 /* MethodDeclaration */: + case 151 /* PropertyDeclaration */: + case 159 /* IndexSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 153 /* MethodDeclaration */: // Fallback to the default visit behavior. return visitorWorker(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return node; default: ts.Debug.failBadSyntaxKind(node); @@ -54764,53 +56474,54 @@ var ts; case 117 /* AbstractKeyword */: case 76 /* ConstKeyword */: case 124 /* DeclareKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: // TypeScript accessibility and readonly modifiers are elided. - case 165 /* ArrayType */: - case 166 /* TupleType */: - case 164 /* TypeLiteral */: - case 159 /* TypePredicate */: - case 146 /* TypeParameter */: + case 166 /* ArrayType */: + case 167 /* TupleType */: + case 165 /* TypeLiteral */: + case 160 /* TypePredicate */: + case 147 /* TypeParameter */: case 119 /* AnyKeyword */: case 122 /* BooleanKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: - case 130 /* NeverKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: + case 131 /* NeverKeyword */: case 105 /* VoidKeyword */: - case 137 /* SymbolKeyword */: - case 162 /* ConstructorType */: - case 161 /* FunctionType */: - case 163 /* TypeQuery */: - case 160 /* TypeReference */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: - case 169 /* ParenthesizedType */: - case 170 /* ThisType */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 174 /* LiteralType */: + case 138 /* SymbolKeyword */: + case 163 /* ConstructorType */: + case 162 /* FunctionType */: + case 164 /* TypeQuery */: + case 161 /* TypeReference */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: + case 170 /* ConditionalType */: + case 172 /* ParenthesizedType */: + case 173 /* ThisType */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 177 /* LiteralType */: // TypeScript type nodes are elided. - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // TypeScript index signatures are elided. - case 148 /* Decorator */: + case 149 /* Decorator */: // TypeScript decorators are elided. They will be emitted as part of visitClassDeclaration. - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // TypeScript type-only declarations are elided. return undefined; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // TypeScript property declarations are elided. However their names are still visited, and can potentially be retained if they could have sideeffects return visitPropertyDeclaration(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: // TypeScript namespace export declarations are elided. return undefined; - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructor(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: // TypeScript interfaces are elided, but some comments may be preserved. // See the implementation of `getLeadingComments` in comments.ts for more details. return ts.createNotEmittedStatement(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: // This is a class declaration with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54821,7 +56532,7 @@ var ts; // - index signatures // - method overload signatures return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: // This is a class expression with TypeScript syntax extensions. // // TypeScript class syntax extensions include: @@ -54832,35 +56543,35 @@ var ts; // - index signatures // - method overload signatures return visitClassExpression(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: // This is a heritage clause with TypeScript syntax extensions. // // TypeScript heritage clause extensions include: // - `implements` clause return visitHeritageClause(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: // TypeScript supports type arguments on an expression in an `extends` heritage clause. return visitExpressionWithTypeArguments(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: // TypeScript method declarations may have decorators, modifiers // or type annotations. return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: // Get Accessors can have TypeScript modifiers, decorators, and type annotations. return visitGetAccessor(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: // Set Accessors can have TypeScript modifiers and type annotations. return visitSetAccessor(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: // Typescript function declarations can have modifiers, decorators, and type annotations. return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: // TypeScript function expressions can have modifiers and type annotations. return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: // TypeScript arrow functions can have modifiers and type annotations. return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: // This is a parameter declaration with TypeScript syntax extensions. // // TypeScript parameter declaration syntax extensions include: @@ -54870,33 +56581,33 @@ var ts; // - type annotations // - this parameters return visitParameter(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: // ParenthesizedExpressions are TypeScript if their expression is a // TypeAssertion or AsExpression return visitParenthesizedExpression(node); - case 185 /* TypeAssertionExpression */: - case 203 /* AsExpression */: + case 188 /* TypeAssertionExpression */: + case 206 /* AsExpression */: // TypeScript type assertions are removed, but their subtrees are preserved. return visitAssertionExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: // TypeScript non-null expressions are removed, but their subtrees are preserved. return visitNonNullExpression(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: // TypeScript enum declarations do not exist in ES6 and must be rewritten. return visitEnumDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // TypeScript namespace exports for variable statements must be transformed. return visitVariableStatement(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // TypeScript namespace declarations must be transformed. return visitModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // TypeScript namespace or external module import. return visitImportEqualsDeclaration(node); default: @@ -55378,7 +57089,7 @@ var ts; return index; } var statement = statements[index]; - if (statement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { + if (statement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(statement.expression)) { result.push(ts.visitNode(statement, visitor, ts.isStatement)); return index + 1; } @@ -55415,7 +57126,7 @@ var ts; ts.setEmitFlags(propertyName, 1536 /* NoComments */ | 48 /* NoSourceMap */); var localName = ts.getMutableClone(name); ts.setEmitFlags(localName, 1536 /* NoComments */); - return ts.startOnNewLine(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1))); + return ts.startOnNewLine(ts.setEmitFlags(ts.setTextRange(ts.createStatement(ts.createAssignment(ts.setTextRange(ts.createPropertyAccess(ts.createThis(), propertyName), node.name), localName)), ts.moveRangePos(node, -1)), 1536 /* NoComments */)); } /** * Gets all property declarations with initializers on either the static or instance side of a class. @@ -55449,7 +57160,7 @@ var ts; * @param isStatic A value indicating whether the member should be a static or instance member. */ function isInitializedProperty(member, isStatic) { - return member.kind === 150 /* PropertyDeclaration */ + return member.kind === 151 /* PropertyDeclaration */ && isStatic === ts.hasModifier(member, 32 /* Static */) && member.initializer !== undefined; } @@ -55587,12 +57298,12 @@ var ts; */ function getAllDecoratorsOfClassElement(node, member) { switch (member.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return getAllDecoratorsOfAccessors(node, member); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return getAllDecoratorsOfMethod(member); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return getAllDecoratorsOfProperty(member); default: return undefined; @@ -55745,7 +57456,7 @@ var ts; var prefix = getClassMemberPrefix(node, member); var memberName = getExpressionForPropertyName(member, /*generateNameForComputedPropertyName*/ true); var descriptor = languageVersion > 0 /* ES3 */ - ? member.kind === 150 /* PropertyDeclaration */ + ? member.kind === 151 /* PropertyDeclaration */ // We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it // should not invoke `Object.getOwnPropertyDescriptor`. ? ts.createVoidZero() @@ -55868,10 +57579,10 @@ var ts; */ function shouldAddTypeMetadata(node) { var kind = node.kind; - return kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */ - || kind === 150 /* PropertyDeclaration */; + return kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */ + || kind === 151 /* PropertyDeclaration */; } /** * Determines whether to emit the "design:returntype" metadata based on the node's kind. @@ -55881,7 +57592,7 @@ var ts; * @param node The node to test. */ function shouldAddReturnTypeMetadata(node) { - return node.kind === 152 /* MethodDeclaration */; + return node.kind === 153 /* MethodDeclaration */; } /** * Determines whether to emit the "design:paramtypes" metadata based on the node's kind. @@ -55892,12 +57603,12 @@ var ts; */ function shouldAddParamTypesMetadata(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return ts.getFirstConstructorWithBody(node) !== undefined; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return true; } return false; @@ -55909,15 +57620,15 @@ var ts; */ function serializeTypeOfNode(node) { switch (node.kind) { - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: - case 154 /* GetAccessor */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 155 /* GetAccessor */: return serializeTypeNode(node.type); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return serializeTypeNode(ts.getSetAccessorTypeAnnotationNode(node)); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 153 /* MethodDeclaration */: return ts.createIdentifier("Function"); default: return ts.createVoidZero(); @@ -55954,7 +57665,7 @@ var ts; return ts.createArrayLiteral(expressions); } function getParametersOfDecoratedDeclaration(node, container) { - if (container && node.kind === 154 /* GetAccessor */) { + if (container && node.kind === 155 /* GetAccessor */) { var setAccessor = ts.getAllAccessorDeclarations(container.members, node).setAccessor; if (setAccessor) { return setAccessor.parameters; @@ -56000,26 +57711,26 @@ var ts; } switch (node.kind) { case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: + case 131 /* NeverKeyword */: return ts.createVoidZero(); - case 169 /* ParenthesizedType */: + case 172 /* ParenthesizedType */: return serializeTypeNode(node.type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return ts.createIdentifier("Function"); - case 165 /* ArrayType */: - case 166 /* TupleType */: + case 166 /* ArrayType */: + case 167 /* TupleType */: return ts.createIdentifier("Array"); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: case 122 /* BooleanKeyword */: return ts.createIdentifier("Boolean"); - case 136 /* StringKeyword */: + case 137 /* StringKeyword */: return ts.createIdentifier("String"); - case 134 /* ObjectKeyword */: + case 135 /* ObjectKeyword */: return ts.createIdentifier("Object"); - case 174 /* LiteralType */: + case 177 /* LiteralType */: switch (node.literal.kind) { case 9 /* StringLiteral */: return ts.createIdentifier("String"); @@ -56033,24 +57744,24 @@ var ts; break; } break; - case 133 /* NumberKeyword */: + case 134 /* NumberKeyword */: return ts.createIdentifier("Number"); - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: return languageVersion < 2 /* ES2015 */ ? getGlobalSymbolNameWithFallback() : ts.createIdentifier("Symbol"); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return serializeTypeReferenceNode(node); - case 168 /* IntersectionType */: - case 167 /* UnionType */: + case 169 /* IntersectionType */: + case 168 /* UnionType */: return serializeUnionOrIntersectionType(node); - case 163 /* TypeQuery */: - case 171 /* TypeOperator */: - case 172 /* IndexedAccessType */: - case 173 /* MappedType */: - case 164 /* TypeLiteral */: + case 164 /* TypeQuery */: + case 174 /* TypeOperator */: + case 175 /* IndexedAccessType */: + case 176 /* MappedType */: + case 165 /* TypeLiteral */: case 119 /* AnyKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: break; default: ts.Debug.failBadSyntaxKind(node); @@ -56064,13 +57775,13 @@ var ts; var serializedUnion; for (var _i = 0, _a = node.types; _i < _a.length; _i++) { var typeNode = _a[_i]; - while (typeNode.kind === 169 /* ParenthesizedType */) { + while (typeNode.kind === 172 /* ParenthesizedType */) { typeNode = typeNode.type; // Skip parens if need be } - if (typeNode.kind === 130 /* NeverKeyword */) { + if (typeNode.kind === 131 /* NeverKeyword */) { continue; // Always elide `never` from the union/intersection if possible } - if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 139 /* UndefinedKeyword */)) { + if (!strictNullChecks && (typeNode.kind === 95 /* NullKeyword */ || typeNode.kind === 140 /* UndefinedKeyword */)) { continue; // Elide null and undefined from unions for metadata, just like what we did prior to the implementation of strict null checks } var serializedIndividual = serializeTypeNode(typeNode); @@ -56078,6 +57789,8 @@ var ts; // One of the individual is global object, return immediately return serializedIndividual; } + // If there exists union that is not void 0 expression, check if the the common type is identifier. + // anything more complex and we will just default to Object else if (serializedUnion) { // Different types if (!ts.isIdentifier(serializedUnion) || @@ -56151,7 +57864,7 @@ var ts; return ts.createLogicalAnd(ts.createStrictInequality(ts.createTypeOf(name), ts.createLiteral("undefined")), name); } return name; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return serializeQualifiedNameAsExpression(node, useFallback); } } @@ -56241,7 +57954,7 @@ var ts; function visitPropertyNameOfClassElement(member) { var name = member.name; var expr = getPropertyNameExpressionIfNeeded(name, ts.some(member.decorators), /*omitSimple*/ false); - if (expr) { + if (expr) { // expr only exists if `name` is a computed property name // Inline any pending expressions from previous elided or relocated computed property name expressions in order to preserve execution order if (ts.some(pendingExpressions)) { expr = ts.inlineExpressions(pendingExpressions.concat([expr])); @@ -56726,12 +58439,12 @@ var ts; // enums in any other scope are emitted as a `let` declaration. var statement = ts.createVariableStatement(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.createVariableDeclarationList([ ts.createVariableDeclaration(ts.getLocalName(node, /*allowComments*/ false, /*allowSourceMaps*/ true)) - ], currentScope.kind === 269 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); + ], currentScope.kind === 272 /* SourceFile */ ? 0 /* None */ : 1 /* Let */)); ts.setOriginalNode(statement, node); recordEmittedDeclarationInScope(node); if (isFirstEmittedDeclarationInScope(node)) { // Adjust the source map emit to match the old emitter. - if (node.kind === 233 /* EnumDeclaration */) { + if (node.kind === 236 /* EnumDeclaration */) { ts.setSourceMapRange(statement.declarationList, node); } else { @@ -56850,7 +58563,7 @@ var ts; var statementsLocation; var blockLocation; var body = node.body; - if (body.kind === 235 /* ModuleBlock */) { + if (body.kind === 238 /* ModuleBlock */) { saveStateAndInvoke(body, function (body) { return ts.addRange(statements, ts.visitNodes(body.statements, namespaceElementVisitor, ts.isStatement)); }); statementsLocation = body.statements; blockLocation = body; @@ -56896,13 +58609,13 @@ var ts; // })(hi = hello.hi || (hello.hi = {})); // })(hello || (hello = {})); // We only want to emit comment on the namespace which contains block body itself, not the containing namespaces. - if (body.kind !== 235 /* ModuleBlock */) { + if (body.kind !== 238 /* ModuleBlock */) { ts.setEmitFlags(block, ts.getEmitFlags(block) | 1536 /* NoComments */); } return block; } function getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration) { - if (moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + if (moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { var recursiveInnerModule = getInnerMostModuleDeclarationFromDottedModule(moduleDeclaration.body); return recursiveInnerModule || moduleDeclaration.body; } @@ -56943,7 +58656,7 @@ var ts; * @param node The named import bindings node. */ function visitNamedImportBindings(node) { - if (node.kind === 241 /* NamespaceImport */) { + if (node.kind === 244 /* NamespaceImport */) { // Elide a namespace import if it is not referenced. return resolver.isReferencedAliasDeclaration(node) ? node : undefined; } @@ -57175,16 +58888,16 @@ var ts; // We need to enable substitutions for identifiers and shorthand property assignments. This allows us to // substitute the names of exported members of a namespace. context.enableSubstitution(71 /* Identifier */); - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // We need to be notified when entering and exiting namespaces. - context.enableEmitNotification(234 /* ModuleDeclaration */); + context.enableEmitNotification(237 /* ModuleDeclaration */); } } function isTransformedModuleDeclaration(node) { - return ts.getOriginalNode(node).kind === 234 /* ModuleDeclaration */; + return ts.getOriginalNode(node).kind === 237 /* ModuleDeclaration */; } function isTransformedEnumDeclaration(node) { - return ts.getOriginalNode(node).kind === 233 /* EnumDeclaration */; + return ts.getOriginalNode(node).kind === 236 /* EnumDeclaration */; } /** * Hook for node emit. @@ -57245,9 +58958,9 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); } return node; @@ -57285,9 +58998,9 @@ var ts; // If we are nested within a namespace declaration, we may need to qualifiy // an identifier that is exported from a merged namespace. var container = resolver.getReferencedExportContainer(node, /*prefixLocals*/ false); - if (container && container.kind !== 269 /* SourceFile */) { - var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 234 /* ModuleDeclaration */) || - (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 233 /* EnumDeclaration */); + if (container && container.kind !== 272 /* SourceFile */) { + var substitute = (applicableSubstitutions & 2 /* NamespaceExports */ && container.kind === 237 /* ModuleDeclaration */) || + (applicableSubstitutions & 8 /* NonQualifiedEnumMembers */ && container.kind === 236 /* EnumDeclaration */); if (substitute) { return ts.setTextRange(ts.createPropertyAccess(ts.getGeneratedNameForNode(container), node), /*location*/ node); @@ -57322,9 +59035,7 @@ var ts; if (compilerOptions.isolatedModules) { return undefined; } - return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) - ? resolver.getConstantValue(node) - : undefined; + return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined; } } ts.transformTypeScript = transformTypeScript; @@ -57426,15 +59137,15 @@ var ts; case 120 /* AsyncKeyword */: // ES2017 async modifier should be elided for targets < ES2017 return undefined; - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); default: return ts.visitEachChild(node, visitor, context); @@ -57443,27 +59154,27 @@ var ts; function asyncBodyVisitor(node) { if (ts.isNodeWithPossibleHoistedDeclaration(node)) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatementInAsyncBody(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatementInAsyncBody(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatementInAsyncBody(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatementInAsyncBody(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClauseInAsyncBody(node); - case 208 /* Block */: - case 222 /* SwitchStatement */: - case 236 /* CaseBlock */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 225 /* TryStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 212 /* IfStatement */: - case 221 /* WithStatement */: - case 223 /* LabeledStatement */: + case 211 /* Block */: + case 225 /* SwitchStatement */: + case 239 /* CaseBlock */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 224 /* WithStatement */: + case 226 /* LabeledStatement */: return ts.visitEachChild(node, asyncBodyVisitor, context); default: return ts.Debug.assertNever(node, "Unhandled node."); @@ -57663,7 +59374,7 @@ var ts; var original = ts.getOriginalNode(node, ts.isFunctionLike); var nodeType = original.type; var promiseConstructor = languageVersion < 2 /* ES2015 */ ? getPromiseConstructor(nodeType) : undefined; - var isArrowFunction = node.kind === 188 /* ArrowFunction */; + var isArrowFunction = node.kind === 191 /* ArrowFunction */; var hasLexicalArguments = (resolver.getNodeCheckFlags(node) & 8192 /* CaptureArguments */) !== 0; // An async function is emit as an outer function that calls an inner // generator function. To preserve lexical bindings, we pass the current @@ -57736,15 +59447,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -57784,11 +59495,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -57820,11 +59531,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -57922,45 +59633,45 @@ var ts; return node; } switch (node.kind) { - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return visitAwaitExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, noDestructuringValue); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return visitVoidExpression(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return visitConstructorDeclaration(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return visitGetAccessorDeclaration(node); - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return visitSetAccessorDeclaration(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, noDestructuringValue); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); default: return ts.visitEachChild(node, visitor, context); @@ -57983,7 +59694,7 @@ var ts; function visitLabeledStatement(node) { if (enclosingFunctionFlags & 2 /* Async */) { var statement = ts.unwrapInnermostStatementOfLabel(node); - if (statement.kind === 217 /* ForOfStatement */ && statement.awaitModifier) { + if (statement.kind === 220 /* ForOfStatement */ && statement.awaitModifier) { return visitForOfStatement(statement, node); } return ts.restoreEnclosingLabel(ts.visitEachChild(statement, visitor, context), node); @@ -57995,7 +59706,7 @@ var ts; var objects = []; for (var _i = 0, elements_4 = elements; _i < elements_4.length; _i++) { var e = elements_4[_i]; - if (e.kind === 267 /* SpreadAssignment */) { + if (e.kind === 270 /* SpreadAssignment */) { if (chunkObject) { objects.push(ts.createObjectLiteral(chunkObject)); chunkObject = undefined; @@ -58004,16 +59715,9 @@ var ts; objects.push(ts.visitNode(target, visitor, ts.isExpression)); } else { - if (!chunkObject) { - chunkObject = []; - } - if (e.kind === 265 /* PropertyAssignment */) { - var p = e; - chunkObject.push(ts.createPropertyAssignment(p.name, ts.visitNode(p.initializer, visitor, ts.isExpression))); - } - else { - chunkObject.push(ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); - } + chunkObject = ts.append(chunkObject, e.kind === 268 /* PropertyAssignment */ + ? ts.createPropertyAssignment(e.name, ts.visitNode(e.initializer, visitor, ts.isExpression)) + : ts.visitNode(e, visitor, ts.isObjectLiteralElementLike)); } } if (chunkObject) { @@ -58029,7 +59733,7 @@ var ts; // If the first element is a spread element, then the first argument to __assign is {}: // { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2) var objects = chunkObjectLiteralElements(node.properties); - if (objects.length && objects[0].kind !== 179 /* ObjectLiteralExpression */) { + if (objects.length && objects[0].kind !== 182 /* ObjectLiteralExpression */) { objects.unshift(ts.createObjectLiteral()); } return createAssignHelper(context, objects); @@ -58337,15 +60041,15 @@ var ts; enabledSubstitutions |= 1 /* AsyncMethodsWithSuper */; // We need to enable substitutions for call, property access, and element access // if we need to rewrite super calls. - context.enableSubstitution(182 /* CallExpression */); - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(181 /* ElementAccessExpression */); + context.enableSubstitution(185 /* CallExpression */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(184 /* ElementAccessExpression */); // We need to be notified when entering and exiting declarations that bind super. - context.enableEmitNotification(230 /* ClassDeclaration */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(153 /* Constructor */); + context.enableEmitNotification(233 /* ClassDeclaration */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(154 /* Constructor */); } } /** @@ -58385,11 +60089,11 @@ var ts; } function substituteExpression(node) { switch (node.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return substitutePropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return substituteElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return substituteCallExpression(node); } return node; @@ -58421,11 +60125,11 @@ var ts; } function isSuperContainer(node) { var kind = node.kind; - return kind === 230 /* ClassDeclaration */ - || kind === 153 /* Constructor */ - || kind === 152 /* MethodDeclaration */ - || kind === 154 /* GetAccessor */ - || kind === 155 /* SetAccessor */; + return kind === 233 /* ClassDeclaration */ + || kind === 154 /* Constructor */ + || kind === 153 /* MethodDeclaration */ + || kind === 155 /* GetAccessor */ + || kind === 156 /* SetAccessor */; } function createSuperAccessInAsyncMethod(argumentExpression, location) { if (enclosingSuperContainerFlags & 4096 /* AsyncMethodWithSuperBinding */) { @@ -58537,13 +60241,13 @@ var ts; } function visitorWorker(node) { switch (node.kind) { - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ false); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ false); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ false); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -58553,13 +60257,13 @@ var ts; switch (node.kind) { case 10 /* JsxText */: return visitJsxText(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return visitJsxExpression(node); - case 250 /* JsxElement */: + case 253 /* JsxElement */: return visitJsxElement(node, /*isChild*/ true); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return visitJsxSelfClosingElement(node, /*isChild*/ true); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return visitJsxFragment(node, /*isChild*/ true); default: ts.Debug.failBadSyntaxKind(node); @@ -58601,14 +60305,14 @@ var ts; objectProperties = ts.createAssignHelper(context, segments); } } - var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); + var element = ts.createExpressionForJsxElement(context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, tagName, objectProperties, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } return element; } function visitJsxOpeningFragment(node, children, isChild, location) { - var element = ts.createExpressionForJsxFragment(context.getEmitResolver().getJsxFactoryEntity(), compilerOptions.reactNamespace, ts.mapDefined(children, transformJsxChildToExpression), node, location); + var element = ts.createExpressionForJsxFragment(context.getEmitResolver().getJsxFactoryEntity(currentSourceFile), compilerOptions.reactNamespace, ts.mapDefined(children, transformJsxChildToExpression), node, location); if (isChild) { ts.startOnNewLine(element); } @@ -58633,7 +60337,7 @@ var ts; literal.singleQuote = node.singleQuote !== undefined ? node.singleQuote : !ts.isStringDoubleQuoted(node, currentSourceFile); return ts.setTextRange(literal, node); } - else if (node.kind === 260 /* JsxExpression */) { + else if (node.kind === 263 /* JsxExpression */) { if (node.expression === undefined) { return ts.createTrue(); } @@ -58727,7 +60431,7 @@ var ts; return decoded === text ? undefined : decoded; } function getTagName(node) { - if (node.kind === 250 /* JsxElement */) { + if (node.kind === 253 /* JsxElement */) { return getTagName(node.openingElement); } else { @@ -59035,7 +60739,7 @@ var ts; return node; } switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -59271,13 +60975,13 @@ var ts; } function isReturnVoidStatementInConstructorWithCapturedSuper(node) { return hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ - && node.kind === 220 /* ReturnStatement */ + && node.kind === 223 /* ReturnStatement */ && !node.expression; } function shouldVisitNode(node) { return (node.transformFlags & 128 /* ContainsES2015 */) !== 0 || convertedLoopState !== undefined - || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 208 /* Block */))) + || (hierarchyFacts & 4096 /* ConstructorWithCapturedSuper */ && (ts.isStatement(node) || (node.kind === 211 /* Block */))) || (ts.isIterationStatement(node, /*lookInLabeledStatements*/ false) && shouldConvertIterationStatementBody(node)) || (ts.getEmitFlags(node) & 33554432 /* TypeScriptClassWrapper */) !== 0; } @@ -59305,63 +61009,63 @@ var ts; switch (node.kind) { case 115 /* StaticKeyword */: return undefined; // elide static keyword - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return visitClassExpression(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return visitParameter(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return visitArrowFunction(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return visitVariableDeclaration(node); case 71 /* Identifier */: return visitIdentifier(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return visitVariableDeclarationList(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node, /*isFunctionBody*/ false); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: return visitBreakOrContinueStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, /*outermostLabeledStatement*/ undefined); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, /*outermostLabeledStatement*/ undefined); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, /*outermostLabeledStatement*/ undefined); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, /*outermostLabeledStatement*/ undefined); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return visitExpressionStatement(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return visitShorthandPropertyAssignment(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return visitComputedPropertyName(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return visitParenthesizedExpression(node, /*needsDestructuringValue*/ true); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node, /*needsDestructuringValue*/ true); case 13 /* NoSubstitutionTemplateLiteral */: case 14 /* TemplateHead */: @@ -59372,28 +61076,28 @@ var ts; return visitStringLiteral(node); case 8 /* NumericLiteral */: return visitNumericLiteral(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return visitTaggedTemplateExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return visitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return visitSpreadElement(node); case 97 /* SuperKeyword */: return visitSuperKeyword(/*isExpressionOfCall*/ false); case 99 /* ThisKeyword */: return visitThisKeyword(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return visitMetaProperty(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return visitMethodDeclaration(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: return ts.visitEachChild(node, visitor, context); @@ -59480,13 +61184,13 @@ var ts; // it is possible if either // - break/continue is labeled and label is located inside the converted loop // - break/continue is non-labeled and located in non-converted loop/switch statement - var jump = node.kind === 219 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; + var jump = node.kind === 222 /* BreakStatement */ ? 2 /* Break */ : 4 /* Continue */; var canUseBreakOrContinue = (node.label && convertedLoopState.labels && convertedLoopState.labels.get(ts.idText(node.label))) || (!node.label && (convertedLoopState.allowedNonLabeledJumps & jump)); if (!canUseBreakOrContinue) { var labelMarker = void 0; if (!node.label) { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { convertedLoopState.nonLocalJumps |= 2 /* Break */; labelMarker = "break"; } @@ -59497,7 +61201,7 @@ var ts; } } else { - if (node.kind === 219 /* BreakStatement */) { + if (node.kind === 222 /* BreakStatement */) { labelMarker = "break-" + node.label.escapedText; setLabeledJump(convertedLoopState, /*isBreak*/ true, ts.idText(node.label), labelMarker); } @@ -59797,17 +61501,19 @@ var ts; */ function isSufficientlyCoveredByReturnStatements(statement) { // A return statement is considered covered. - if (statement.kind === 220 /* ReturnStatement */) { + if (statement.kind === 223 /* ReturnStatement */) { return true; } - else if (statement.kind === 212 /* IfStatement */) { + // An if-statement with two covered branches is covered. + else if (statement.kind === 215 /* IfStatement */) { var ifStatement = statement; if (ifStatement.elseStatement) { return isSufficientlyCoveredByReturnStatements(ifStatement.thenStatement) && isSufficientlyCoveredByReturnStatements(ifStatement.elseStatement); } } - else if (statement.kind === 208 /* Block */) { + // A block is covered if it has a last statement which is covered. + else if (statement.kind === 211 /* Block */) { var lastStatement = ts.lastOrUndefined(statement.statements); if (lastStatement && isSufficientlyCoveredByReturnStatements(lastStatement)) { return true; @@ -59865,7 +61571,7 @@ var ts; var ctorStatements = ctor.body.statements; if (statementOffset < ctorStatements.length) { firstStatement = ctorStatements[statementOffset]; - if (firstStatement.kind === 211 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { + if (firstStatement.kind === 214 /* ExpressionStatement */ && ts.isSuperCall(firstStatement.expression)) { superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression); } } @@ -59875,8 +61581,8 @@ var ts; && statementOffset === ctorStatements.length - 1 && !(ctor.transformFlags & (16384 /* ContainsLexicalThis */ | 32768 /* ContainsCapturedLexicalThis */))) { var returnStatement = ts.createReturn(superCallExpression); - if (superCallExpression.kind !== 195 /* BinaryExpression */ - || superCallExpression.left.kind !== 182 /* CallExpression */) { + if (superCallExpression.kind !== 198 /* BinaryExpression */ + || superCallExpression.left.kind !== 185 /* CallExpression */) { ts.Debug.fail("Assumed generated super call would have form 'super.call(...) || this'."); } // Shift comments from the original super call to the return statement. @@ -60005,11 +61711,11 @@ var ts; function addDefaultValueAssignmentForInitializer(statements, parameter, name, initializer) { initializer = ts.visitNode(initializer, visitor, ts.isExpression); var statement = ts.createIf(ts.createTypeCheck(ts.getSynthesizedClone(name), "undefined"), ts.setEmitFlags(ts.setTextRange(ts.createBlock([ - ts.createStatement(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer))), parameter)) - ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */)); + ts.createStatement(ts.setEmitFlags(ts.setTextRange(ts.createAssignment(ts.setEmitFlags(ts.getMutableClone(name), 48 /* NoSourceMap */), ts.setEmitFlags(initializer, 48 /* NoSourceMap */ | ts.getEmitFlags(initializer) | 1536 /* NoComments */)), parameter), 1536 /* NoComments */)) + ]), parameter), 1 /* SingleLine */ | 32 /* NoTrailingSourceMap */ | 384 /* NoTokenSourceMaps */ | 1536 /* NoComments */)); ts.startOnNewLine(statement); ts.setTextRange(statement, parameter); - ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1048576 /* CustomPrologue */); + ts.setEmitFlags(statement, 384 /* NoTokenSourceMaps */ | 32 /* NoTrailingSourceMap */ | 1048576 /* CustomPrologue */ | 1536 /* NoComments */); statements.push(statement); } /** @@ -60073,7 +61779,7 @@ var ts; * @param node A node. */ function addCaptureThisForNodeIfNeeded(statements, node) { - if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 188 /* ArrowFunction */) { + if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */ && node.kind !== 191 /* ArrowFunction */) { captureThisForNode(statements, node, ts.createThis()); } } @@ -60093,22 +61799,22 @@ var ts; if (hierarchyFacts & 16384 /* NewTarget */) { var newTarget = void 0; switch (node.kind) { - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return statements; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // Methods and accessors cannot be constructors, so 'new.target' will // always return 'undefined'. newTarget = ts.createVoidZero(); break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Class constructors can only be called with `new`, so `this.constructor` // should be relatively safe to use. newTarget = ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"); break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: // Functions can be called or constructed, and may have a `this` due to // being a member or when calling an imported function via `other_1.f()`. newTarget = ts.createConditional(ts.createLogicalAnd(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), ts.createBinary(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), 93 /* InstanceOfKeyword */, ts.getLocalName(node))), ts.createPropertyAccess(ts.setEmitFlags(ts.createThis(), 4 /* NoSubstitution */), "constructor"), ts.createVoidZero()); @@ -60140,20 +61846,20 @@ var ts; for (var _i = 0, _a = node.members; _i < _a.length; _i++) { var member = _a[_i]; switch (member.kind) { - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: statements.push(transformSemicolonClassElementToStatement(member)); break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: statements.push(transformClassMethodDeclarationToStatement(getClassMemberPrefix(node, member), member, node)); break; - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.members, member); if (member === accessors.firstAccessor) { statements.push(transformAccessorsToStatement(getClassMemberPrefix(node, member), accessors, node)); } break; - case 153 /* Constructor */: + case 154 /* Constructor */: // Constructors are handled in visitClassExpression/visitClassDeclaration break; default: @@ -60345,7 +62051,7 @@ var ts; : enterSubtree(16286 /* FunctionExcludes */, 65 /* FunctionIncludes */); var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 229 /* FunctionDeclaration */ || node.kind === 187 /* FunctionExpression */)) { + if (hierarchyFacts & 16384 /* NewTarget */ && !name && (node.kind === 232 /* FunctionDeclaration */ || node.kind === 190 /* FunctionExpression */)) { name = ts.getGeneratedNameForNode(node); } exitSubtree(ancestorFacts, 49152 /* PropagateNewTargetMask */, 0 /* None */); @@ -60393,7 +62099,7 @@ var ts; } } else { - ts.Debug.assert(node.kind === 188 /* ArrowFunction */); + ts.Debug.assert(node.kind === 191 /* ArrowFunction */); // To align with the old emitter, we use a synthetic end position on the location // for the statement list we synthesize when we down-level an arrow function with // an expression function body. This prevents both comments and source maps from @@ -60460,9 +62166,9 @@ var ts; function visitExpressionStatement(node) { // If we are here it is most likely because our expression is a destructuring assignment. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateStatement(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateStatement(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } return ts.visitEachChild(node, visitor, context); @@ -60481,9 +62187,9 @@ var ts; // expression. If we are in a state where we do not need the destructuring value, // we pass that information along to the children that care about it. switch (node.expression.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return ts.updateParen(node, visitParenthesizedExpression(node.expression, /*needsDestructuringValue*/ false)); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return ts.updateParen(node, visitBinaryExpression(node.expression, /*needsDestructuringValue*/ false)); } } @@ -60685,14 +62391,14 @@ var ts; } function visitIterationStatement(node, outermostLabeledStatement) { switch (node.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return visitDoOrWhileStatement(node, outermostLabeledStatement); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node, outermostLabeledStatement); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node, outermostLabeledStatement); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node, outermostLabeledStatement); } } @@ -60880,7 +62586,7 @@ var ts; && i < numInitialPropertiesWithoutYield) { numInitialPropertiesWithoutYield = i; } - if (property.name.kind === 145 /* ComputedPropertyName */) { + if (property.name.kind === 146 /* ComputedPropertyName */) { numInitialProperties = i; break; } @@ -60952,11 +62658,11 @@ var ts; var functionName = ts.createUniqueName("_loop"); var loopInitializer; switch (node.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: var initializer = node.initializer; - if (initializer && initializer.kind === 228 /* VariableDeclarationList */) { + if (initializer && initializer.kind === 231 /* VariableDeclarationList */) { loopInitializer = initializer; } break; @@ -61236,20 +62942,20 @@ var ts; for (var i = start; i < numProperties; i++) { var property = properties[i]; switch (property.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: var accessors = ts.getAllAccessorDeclarations(node.properties, property); if (property === accessors.firstAccessor) { expressions.push(transformAccessorsToExpression(receiver, accessors, node, node.multiLine)); } break; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: expressions.push(transformObjectLiteralMethodDeclarationToExpression(property, receiver, node, node.multiLine)); break; - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: expressions.push(transformPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: expressions.push(transformShorthandPropertyAssignmentToExpression(property, receiver, node.multiLine)); break; default: @@ -61359,7 +63065,7 @@ var ts; if (node.transformFlags & 32768 /* ContainsCapturedLexicalThis */) { var parameters = ts.visitParameterList(node.parameters, visitor, context); var body = transformFunctionBody(node); - if (node.kind === 154 /* GetAccessor */) { + if (node.kind === 155 /* GetAccessor */) { updated = ts.updateGetAccessor(node, node.decorators, node.modifiers, node.name, parameters, node.type, body); } else { @@ -61639,7 +63345,7 @@ var ts; else { if (segments.length === 1) { var firstElement = elements[0]; - return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 178 /* ArrayLiteralExpression */ + return needsUniqueCopy && ts.isSpreadElement(firstElement) && firstElement.expression.kind !== 181 /* ArrayLiteralExpression */ ? ts.createArraySlice(segments[0]) : segments[0]; } @@ -61902,13 +63608,13 @@ var ts; if ((enabledSubstitutions & 1 /* CapturedThis */) === 0) { enabledSubstitutions |= 1 /* CapturedThis */; context.enableSubstitution(99 /* ThisKeyword */); - context.enableEmitNotification(153 /* Constructor */); - context.enableEmitNotification(152 /* MethodDeclaration */); - context.enableEmitNotification(154 /* GetAccessor */); - context.enableEmitNotification(155 /* SetAccessor */); - context.enableEmitNotification(188 /* ArrowFunction */); - context.enableEmitNotification(187 /* FunctionExpression */); - context.enableEmitNotification(229 /* FunctionDeclaration */); + context.enableEmitNotification(154 /* Constructor */); + context.enableEmitNotification(153 /* MethodDeclaration */); + context.enableEmitNotification(155 /* GetAccessor */); + context.enableEmitNotification(156 /* SetAccessor */); + context.enableEmitNotification(191 /* ArrowFunction */); + context.enableEmitNotification(190 /* FunctionExpression */); + context.enableEmitNotification(232 /* FunctionDeclaration */); } } /** @@ -61950,10 +63656,10 @@ var ts; function isNameOfDeclarationWithCollidingName(node) { var parent = node.parent; switch (parent.kind) { - case 177 /* BindingElement */: - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 230 /* VariableDeclaration */: return parent.name === node && resolver.isDeclarationWithCollidingName(parent); } @@ -62035,11 +63741,11 @@ var ts; return false; } var statement = ts.firstOrUndefined(constructor.body.statements); - if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 211 /* ExpressionStatement */) { + if (!statement || !ts.nodeIsSynthesized(statement) || statement.kind !== 214 /* ExpressionStatement */) { return false; } var statementExpression = statement.expression; - if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 182 /* CallExpression */) { + if (!ts.nodeIsSynthesized(statementExpression) || statementExpression.kind !== 185 /* CallExpression */) { return false; } var callTarget = statementExpression.expression; @@ -62047,7 +63753,7 @@ var ts; return false; } var callArgument = ts.singleOrUndefined(statementExpression.arguments); - if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 199 /* SpreadElement */) { + if (!callArgument || !ts.nodeIsSynthesized(callArgument) || callArgument.kind !== 202 /* SpreadElement */) { return false; } var expression = callArgument.expression; @@ -62102,15 +63808,15 @@ var ts; if (compilerOptions.jsx === 1 /* Preserve */ || compilerOptions.jsx === 3 /* ReactNative */) { previousOnEmitNode = context.onEmitNode; context.onEmitNode = onEmitNode; - context.enableEmitNotification(252 /* JsxOpeningElement */); - context.enableEmitNotification(253 /* JsxClosingElement */); - context.enableEmitNotification(251 /* JsxSelfClosingElement */); + context.enableEmitNotification(255 /* JsxOpeningElement */); + context.enableEmitNotification(256 /* JsxClosingElement */); + context.enableEmitNotification(254 /* JsxSelfClosingElement */); noSubstitution = []; } var previousOnSubstituteNode = context.onSubstituteNode; context.onSubstituteNode = onSubstituteNode; - context.enableSubstitution(180 /* PropertyAccessExpression */); - context.enableSubstitution(265 /* PropertyAssignment */); + context.enableSubstitution(183 /* PropertyAccessExpression */); + context.enableSubstitution(268 /* PropertyAssignment */); return transformSourceFile; /** * Transforms an ES5 source file to ES3. @@ -62129,9 +63835,9 @@ var ts; */ function onEmitNode(hint, node, emitCallback) { switch (node.kind) { - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: var tagName = node.tagName; noSubstitution[ts.getOriginalNodeId(tagName)] = true; break; @@ -62464,13 +64170,13 @@ var ts; */ function visitJavaScriptInStatementContainingYield(node) { switch (node.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); default: return visitJavaScriptInGeneratorFunctionBody(node); @@ -62483,24 +64189,24 @@ var ts; */ function visitJavaScriptInGeneratorFunctionBody(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return visitAccessorDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return visitBreakStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return visitContinueStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return visitReturnStatement(node); default: if (node.transformFlags & 16777216 /* ContainsYield */) { @@ -62521,21 +64227,21 @@ var ts; */ function visitJavaScriptContainingYield(node) { switch (node.kind) { - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return visitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return visitConditionalExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return visitYieldExpression(node); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return visitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return visitObjectLiteralExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return visitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return visitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return visitNewExpression(node); default: return ts.visitEachChild(node, visitor, context); @@ -62548,9 +64254,9 @@ var ts; */ function visitGenerator(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return visitFunctionExpression(node); default: ts.Debug.failBadSyntaxKind(node); @@ -62778,7 +64484,7 @@ var ts; if (containsYield(right)) { var target = void 0; switch (left.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: // [source] // a.b = yield; // @@ -62790,7 +64496,7 @@ var ts; // _a.b = %sent%; target = ts.updatePropertyAccess(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: // [source] // a[b] = yield; // @@ -63166,35 +64872,35 @@ var ts; } function transformAndEmitStatementWorker(node) { switch (node.kind) { - case 208 /* Block */: + case 211 /* Block */: return transformAndEmitBlock(node); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return transformAndEmitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return transformAndEmitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return transformAndEmitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return transformAndEmitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return transformAndEmitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return transformAndEmitForInStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return transformAndEmitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return transformAndEmitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return transformAndEmitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return transformAndEmitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return transformAndEmitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return transformAndEmitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return transformAndEmitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return transformAndEmitTryStatement(node); default: return emitStatement(ts.visitNode(node, visitor, ts.isStatement)); @@ -63624,7 +65330,7 @@ var ts; for (var i = 0; i < numClauses; i++) { var clause = caseBlock.clauses[i]; clauseLabels.push(defineLabel()); - if (clause.kind === 262 /* DefaultClause */ && defaultClauseIndex === -1) { + if (clause.kind === 265 /* DefaultClause */ && defaultClauseIndex === -1) { defaultClauseIndex = i; } } @@ -63637,13 +65343,12 @@ var ts; var defaultClausesSkipped = 0; for (var i = clausesWritten; i < numClauses; i++) { var clause = caseBlock.clauses[i]; - if (clause.kind === 261 /* CaseClause */) { - var caseClause = clause; - if (containsYield(caseClause.expression) && pendingClauses.length > 0) { + if (clause.kind === 264 /* CaseClause */) { + if (containsYield(clause.expression) && pendingClauses.length > 0) { break; } - pendingClauses.push(ts.createCaseClause(ts.visitNode(caseClause.expression, visitor, ts.isExpression), [ - createInlineBreak(clauseLabels[i], /*location*/ caseClause.expression) + pendingClauses.push(ts.createCaseClause(ts.visitNode(clause.expression, visitor, ts.isExpression), [ + createInlineBreak(clauseLabels[i], /*location*/ clause.expression) ])); } else { @@ -64599,6 +66304,7 @@ var ts; withBlockStack.pop(); } break; + // default: do nothing } } } @@ -64868,11 +66574,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers with imported/exported symbols. - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes shorthand property assignments for imported/exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var currentSourceFile; // The current file. @@ -65194,23 +66900,23 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return visitExportDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return ts.visitEachChild(node, importCallExpressionVisitor, context); @@ -65659,7 +67365,7 @@ var ts; // // To balance the declaration, add the exports of the elided variable // statement. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original); } @@ -65714,10 +67420,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -65916,7 +67622,7 @@ var ts; * @param emit A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { currentSourceFile = node; currentModuleInfo = moduleInfoMap[ts.getOriginalNodeId(currentSourceFile)]; noSubstitution = []; @@ -65980,10 +67686,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 194 /* PostfixUnaryExpression */: - case 193 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -66004,7 +67710,7 @@ var ts; } if (!ts.isGeneratedIdentifier(node) && !ts.isLocalName(node)) { var exportContainer = resolver.getReferencedExportContainer(node, ts.isExportName(node)); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { return ts.setTextRange(ts.createPropertyAccess(ts.createIdentifier("exports"), ts.getSynthesizedClone(node)), /*location*/ node); } @@ -66079,7 +67785,7 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createBinary(node.operand, ts.createToken(node.operator === 43 /* PlusPlusToken */ ? 59 /* PlusEqualsToken */ : 60 /* MinusEqualsToken */), ts.createLiteral(1)), /*location*/ node) : node; @@ -66133,13 +67839,13 @@ var ts; var importStarHelper = { name: "typescript:commonjsimportstar", scoped: false, - text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n}" + text: "\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};" }; // emit helper for `import Name from "foo"` var importDefaultHelper = { name: "typescript:commonjsimportdefault", scoped: false, - text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n}" + text: "\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};" }; })(ts || (ts = {})); /// @@ -66158,11 +67864,11 @@ var ts; context.onSubstituteNode = onSubstituteNode; context.onEmitNode = onEmitNode; context.enableSubstitution(71 /* Identifier */); // Substitutes expression identifiers for imported symbols. - context.enableSubstitution(266 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols - context.enableSubstitution(195 /* BinaryExpression */); // Substitutes assignments to exported symbols. - context.enableSubstitution(193 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableSubstitution(194 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. - context.enableEmitNotification(269 /* SourceFile */); // Restore state when substituting nodes in a file. + context.enableSubstitution(269 /* ShorthandPropertyAssignment */); // Substitutes expression identifiers for imported symbols + context.enableSubstitution(198 /* BinaryExpression */); // Substitutes assignments to exported symbols. + context.enableSubstitution(196 /* PrefixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableSubstitution(197 /* PostfixUnaryExpression */); // Substitutes updates to exported symbols. + context.enableEmitNotification(272 /* SourceFile */); // Restore state when substituting nodes in a file. var moduleInfoMap = []; // The ExternalModuleInfo for each file. var deferredExports = []; // Exports to defer until an EndOfDeclarationMarker is found. var exportFunctionsMap = []; // The export function associated with a source file. @@ -66383,7 +68089,7 @@ var ts; var hasExportDeclarationWithExportClause = false; for (var _i = 0, _a = moduleInfo.externalImports; _i < _a.length; _i++) { var externalImport = _a[_i]; - if (externalImport.kind === 245 /* ExportDeclaration */ && externalImport.exportClause) { + if (externalImport.kind === 248 /* ExportDeclaration */ && externalImport.exportClause) { hasExportDeclarationWithExportClause = true; break; } @@ -66408,15 +68114,14 @@ var ts; } for (var _d = 0, _e = moduleInfo.externalImports; _d < _e.length; _d++) { var externalImport = _e[_d]; - if (externalImport.kind !== 245 /* ExportDeclaration */) { + if (externalImport.kind !== 248 /* ExportDeclaration */) { continue; } - var exportDecl = externalImport; - if (!exportDecl.exportClause) { + if (!externalImport.exportClause) { // export * from ... continue; } - for (var _f = 0, _g = exportDecl.exportClause.elements; _f < _g.length; _f++) { + for (var _f = 0, _g = externalImport.exportClause.elements; _f < _g.length; _f++) { var element = _g[_f]; // write name of indirectly exported entry, i.e. 'export {x} from ...' exportedNames.push(ts.createPropertyAssignment(ts.createLiteral(ts.idText(element.name || element.propertyName)), ts.createTrue())); @@ -66478,28 +68183,28 @@ var ts; function createSettersArray(exportStarFunction, dependencyGroups) { var setters = []; for (var _i = 0, dependencyGroups_1 = dependencyGroups; _i < dependencyGroups_1.length; _i++) { - var group = dependencyGroups_1[_i]; + var group_2 = dependencyGroups_1[_i]; // derive a unique name for parameter from the first named entry in the group - var localName = ts.forEach(group.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); + var localName = ts.forEach(group_2.externalImports, function (i) { return ts.getLocalNameForExternalImport(i, currentSourceFile); }); var parameterName = localName ? ts.getGeneratedNameForNode(localName) : ts.createUniqueName(""); var statements = []; - for (var _a = 0, _b = group.externalImports; _a < _b.length; _a++) { + for (var _a = 0, _b = group_2.externalImports; _a < _b.length; _a++) { var entry = _b[_a]; var importVariableName = ts.getLocalNameForExternalImport(entry, currentSourceFile); switch (entry.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: if (!entry.importClause) { // 'import "..."' case // module is imported only for side-effects, no emit required break; } // falls through - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: ts.Debug.assert(importVariableName !== undefined); // save import into the local statements.push(ts.createStatement(ts.createAssignment(importVariableName, parameterName))); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: ts.Debug.assert(importVariableName !== undefined); if (entry.exportClause) { // export {a, b as c} from 'foo' @@ -66549,15 +68254,15 @@ var ts; */ function sourceElementVisitor(node) { switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return visitImportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return visitImportEqualsDeclaration(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // ExportDeclarations are elided as they are handled via // `appendExportsOfDeclaration`. return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); default: return nestedElementVisitor(node); @@ -66733,7 +68438,7 @@ var ts; function shouldHoistVariableDeclarationList(node) { // hoist only non-block scoped declarations or block scoped declarations parented by source file return (ts.getEmitFlags(node) & 2097152 /* NoHoisting */) === 0 - && (enclosingBlockScopedContainer.kind === 269 /* SourceFile */ + && (enclosingBlockScopedContainer.kind === 272 /* SourceFile */ || (ts.getOriginalNode(node).flags & 3 /* BlockScoped */) === 0); } /** @@ -66797,7 +68502,7 @@ var ts; // // To balance the declaration, we defer the exports of the elided variable // statement until we visit this declaration's `EndOfDeclarationMarker`. - if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 209 /* VariableStatement */) { + if (hasAssociatedEndOfDeclarationMarker(node) && node.original.kind === 212 /* VariableStatement */) { var id = ts.getOriginalNodeId(node); var isExportedDeclaration = ts.hasModifier(node.original, 1 /* Export */); deferredExports[id] = appendExportsOfVariableStatement(deferredExports[id], node.original, isExportedDeclaration); @@ -66853,10 +68558,10 @@ var ts; var namedBindings = importClause.namedBindings; if (namedBindings) { switch (namedBindings.kind) { - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: statements = appendExportsOfDeclaration(statements, namedBindings); break; - case 242 /* NamedImports */: + case 245 /* NamedImports */: for (var _i = 0, _a = namedBindings.elements; _i < _a.length; _i++) { var importBinding = _a[_i]; statements = appendExportsOfDeclaration(statements, importBinding); @@ -67036,43 +68741,43 @@ var ts; */ function nestedElementVisitor(node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return visitVariableStatement(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return visitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return visitClassDeclaration(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return visitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return visitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return visitForOfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return visitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return visitWhileStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return visitLabeledStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return visitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return visitSwitchStatement(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return visitCaseBlock(node); - case 261 /* CaseClause */: + case 264 /* CaseClause */: return visitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return visitDefaultClause(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return visitTryStatement(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return visitCatchClause(node); - case 208 /* Block */: + case 211 /* Block */: return visitBlock(node); - case 294 /* MergeDeclarationMarker */: + case 297 /* MergeDeclarationMarker */: return visitMergeDeclarationMarker(node); - case 295 /* EndOfDeclarationMarker */: + case 298 /* EndOfDeclarationMarker */: return visitEndOfDeclarationMarker(node); default: return destructuringAndImportCallVisitor(node); @@ -67258,7 +68963,7 @@ var ts; */ function destructuringAndImportCallVisitor(node) { if (node.transformFlags & 1024 /* DestructuringAssignment */ - && node.kind === 195 /* BinaryExpression */) { + && node.kind === 198 /* BinaryExpression */) { return visitDestructuringAssignment(node); } else if (ts.isImportCall(node)) { @@ -67323,7 +69028,7 @@ var ts; } else if (ts.isIdentifier(node)) { var container = resolver.getReferencedExportContainer(node); - return container !== undefined && container.kind === 269 /* SourceFile */; + return container !== undefined && container.kind === 272 /* SourceFile */; } else { return false; @@ -67356,7 +69061,7 @@ var ts; * @param emitCallback A callback used to emit the node in the printer. */ function onEmitNode(hint, node, emitCallback) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { var id = ts.getOriginalNodeId(node); currentSourceFile = node; moduleInfo = moduleInfoMap[id]; @@ -67404,7 +69109,7 @@ var ts; */ function substituteUnspecified(node) { switch (node.kind) { - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return substituteShorthandPropertyAssignment(node); } return node; @@ -67440,10 +69145,10 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return substituteExpressionIdentifier(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return substituteBinaryExpression(node); - case 193 /* PrefixUnaryExpression */: - case 194 /* PostfixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return substituteUnaryExpression(node); } return node; @@ -67536,14 +69241,14 @@ var ts; && !ts.isDeclarationNameOfEnumOrNamespace(node.operand)) { var exportedNames = getExports(node.operand); if (exportedNames) { - var expression = node.kind === 194 /* PostfixUnaryExpression */ + var expression = node.kind === 197 /* PostfixUnaryExpression */ ? ts.setTextRange(ts.createPrefix(node.operator, node.operand), node) : node; for (var _i = 0, exportedNames_4 = exportedNames; _i < exportedNames_4.length; _i++) { var exportName = exportedNames_4[_i]; expression = createExportExpression(exportName, preventSubstitution(expression)); } - if (node.kind === 194 /* PostfixUnaryExpression */) { + if (node.kind === 197 /* PostfixUnaryExpression */) { expression = node.operator === 43 /* PlusPlusToken */ ? ts.createSubtract(preventSubstitution(expression), ts.createLiteral(1)) : ts.createAdd(preventSubstitution(expression), ts.createLiteral(1)); @@ -67565,7 +69270,7 @@ var ts; || resolver.getReferencedValueDeclaration(name); if (valueDeclaration) { var exportContainer = resolver.getReferencedExportContainer(name, /*prefixLocals*/ false); - if (exportContainer && exportContainer.kind === 269 /* SourceFile */) { + if (exportContainer && exportContainer.kind === 272 /* SourceFile */) { exportedNames = ts.append(exportedNames, ts.getDeclarationName(valueDeclaration)); } exportedNames = ts.addRange(exportedNames, moduleInfo && moduleInfo.exportedBindings[ts.getOriginalNodeId(valueDeclaration)]); @@ -67606,7 +69311,7 @@ var ts; var previousOnSubstituteNode = context.onSubstituteNode; context.onEmitNode = onEmitNode; context.onSubstituteNode = onSubstituteNode; - context.enableEmitNotification(269 /* SourceFile */); + context.enableEmitNotification(272 /* SourceFile */); context.enableSubstitution(71 /* Identifier */); var currentSourceFile; return transformSourceFile; @@ -67635,10 +69340,10 @@ var ts; } function visitor(node) { switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // Elide `import=` as it is not legal with --module ES6 return undefined; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return visitExportAssignment(node); } return node; @@ -67778,7 +69483,7 @@ var ts; * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. */ function transformNodes(resolver, host, options, nodes, transformers, allowDtsFiles) { - var enabledSyntaxKindFeatures = new Array(296 /* Count */); + var enabledSyntaxKindFeatures = new Array(299 /* Count */); var lexicalEnvironmentVariableDeclarations; var lexicalEnvironmentFunctionDeclarations; var lexicalEnvironmentVariableDeclarationsStack = []; @@ -68118,7 +69823,7 @@ var ts; } if (compilerOptions.mapRoot) { sourceMapDir = ts.normalizeSlashes(compilerOptions.mapRoot); - if (sourceFileOrBundle.kind === 269 /* SourceFile */) { + if (sourceFileOrBundle.kind === 272 /* SourceFile */) { // emitting single module file // For modules or multiple emit files the mapRoot will have directory structure like the sources // So if src\a.ts and src\lib\b.ts are compiled together user would be moving the maps into mapRoot\a.js.map and mapRoot\lib\b.js.map sourceMapDir = ts.getDirectoryPath(ts.getSourceFilePathInNewDir(sourceFileOrBundle, host, sourceMapDir)); @@ -68263,7 +69968,7 @@ var ts; source = undefined; if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 16 /* NoLeadingSourceMap */) === 0 && pos >= 0) { emitPos(skipSourceTrivia(pos)); @@ -68280,7 +69985,7 @@ var ts; } if (source) setSourceFile(source); - if (node.kind !== 291 /* NotEmittedStatement */ + if (node.kind !== 294 /* NotEmittedStatement */ && (emitFlags & 32 /* NoTrailingSourceMap */) === 0 && end >= 0) { emitPos(end); @@ -68457,7 +70162,7 @@ var ts; if (extendedDiagnostics) { ts.performance.mark("preEmitNodeWithComment"); } - var isEmittedNode = node.kind !== 291 /* NotEmittedStatement */; + var isEmittedNode = node.kind !== 294 /* NotEmittedStatement */; // We have to explicitly check that the node is JsxText because if the compilerOptions.jsx is "preserve" we will not do any transformation. // It is expensive to walk entire tree just to set one kind of node to have no comments. var skipLeadingComments = pos < 0 || (emitFlags & 512 /* NoLeadingComments */) !== 0 || node.kind === 10 /* JsxText */; @@ -68478,7 +70183,7 @@ var ts; containerEnd = end; // To avoid invalid comment emit in a down-level binding pattern, we // keep track of the last declaration list container's end - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { declarationListContainerEnd = end; } } @@ -68782,8 +70487,8 @@ var ts; } ts.getDeclarationDiagnostics = getDeclarationDiagnostics; function emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; var newLine = host.getNewLine(); var compilerOptions = host.getCompilerOptions(); var write; @@ -68857,7 +70562,7 @@ var ts; var oldWriter = writer; ts.forEach(moduleElementDeclarationEmitInfo, function (aliasEmitInfo) { if (aliasEmitInfo.isVisible && !aliasEmitInfo.asynchronousOutput) { - ts.Debug.assert(aliasEmitInfo.node.kind === 239 /* ImportDeclaration */); + ts.Debug.assert(aliasEmitInfo.node.kind === 242 /* ImportDeclaration */); createAndSetNewTextWriterWithSymbolWriter(); ts.Debug.assert(aliasEmitInfo.indent === 0 || (aliasEmitInfo.indent === 1 && isBundledEmit)); for (var i = 0; i < aliasEmitInfo.indent; i++) { @@ -68934,10 +70639,10 @@ var ts; var oldWriter = writer; ts.forEach(nodes, function (declaration) { var nodeToCheck; - if (declaration.kind === 227 /* VariableDeclaration */) { + if (declaration.kind === 230 /* VariableDeclaration */) { nodeToCheck = declaration.parent.parent; } - else if (declaration.kind === 242 /* NamedImports */ || declaration.kind === 243 /* ImportSpecifier */ || declaration.kind === 240 /* ImportClause */) { + else if (declaration.kind === 245 /* NamedImports */ || declaration.kind === 246 /* ImportSpecifier */ || declaration.kind === 243 /* ImportClause */) { ts.Debug.fail("We should be getting ImportDeclaration instead to write"); } else { @@ -68955,7 +70660,7 @@ var ts; // Writing of function bar would mark alias declaration foo as visible but we haven't yet visited that declaration so do nothing, // we would write alias foo declaration when we visit it since it would now be marked as visible if (moduleElementEmitInfo) { - if (moduleElementEmitInfo.node.kind === 239 /* ImportDeclaration */) { + if (moduleElementEmitInfo.node.kind === 242 /* ImportDeclaration */) { // we have to create asynchronous output only after we have collected complete information // because it is possible to enable multiple bindings as asynchronously visible moduleElementEmitInfo.isVisible = true; @@ -68965,12 +70670,12 @@ var ts; for (var declarationIndent = moduleElementEmitInfo.indent; declarationIndent; declarationIndent--) { increaseIndent(); } - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { ts.Debug.assert(asynchronousSubModuleDeclarationEmitInfo === undefined); asynchronousSubModuleDeclarationEmitInfo = []; } writeModuleElement(nodeToCheck); - if (nodeToCheck.kind === 234 /* ModuleDeclaration */) { + if (nodeToCheck.kind === 237 /* ModuleDeclaration */) { moduleElementEmitInfo.subModuleElementDeclarationEmitInfo = asynchronousSubModuleDeclarationEmitInfo; asynchronousSubModuleDeclarationEmitInfo = undefined; } @@ -68987,8 +70692,8 @@ var ts; if (!usedTypeDirectiveReferences) { usedTypeDirectiveReferences = ts.createMap(); } - for (var _i = 0, typeReferenceDirectives_1 = typeReferenceDirectives; _i < typeReferenceDirectives_1.length; _i++) { - var directive = typeReferenceDirectives_1[_i]; + for (var _i = 0, typeReferenceDirectives_2 = typeReferenceDirectives; _i < typeReferenceDirectives_2.length; _i++) { + var directive = typeReferenceDirectives_2[_i]; if (!usedTypeDirectiveReferences.has(directive)) { usedTypeDirectiveReferences.set(directive, directive); } @@ -69044,7 +70749,7 @@ var ts; // for optional parameter properties // and also for non-optional initialized parameters that aren't a parameter property // these types may need to add `undefined`. - var shouldUseResolverType = declaration.kind === 147 /* Parameter */ && + var shouldUseResolverType = declaration.kind === 148 /* Parameter */ && (resolver.isRequiredInitializedParameter(declaration) || resolver.isOptionalUninitializedParameterProperty(declaration)); if (type && !shouldUseResolverType) { @@ -69110,50 +70815,54 @@ var ts; function emitType(type) { switch (type.kind) { case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 134 /* ObjectKeyword */: - case 137 /* SymbolKeyword */: + case 135 /* ObjectKeyword */: + case 138 /* SymbolKeyword */: case 105 /* VoidKeyword */: - case 139 /* UndefinedKeyword */: + case 140 /* UndefinedKeyword */: case 95 /* NullKeyword */: - case 130 /* NeverKeyword */: - case 170 /* ThisType */: - case 174 /* LiteralType */: + case 131 /* NeverKeyword */: + case 173 /* ThisType */: + case 177 /* LiteralType */: return writeTextOfNode(currentText, type); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(type); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(type); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(type); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(type); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(type); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(type); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(type); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(type); + case 171 /* InferType */: + return emitInferType(type); + case 172 /* ParenthesizedType */: return emitParenType(type); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(type); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(type); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(type); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return emitSignatureDeclarationWithJsDocComments(type); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(type); case 71 /* Identifier */: return emitEntityName(type); - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitEntityName(type); - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(type); } function writeEntityName(entityName) { @@ -69161,8 +70870,8 @@ var ts; writeTextOfNode(currentText, entityName); } else { - var left = entityName.kind === 144 /* QualifiedName */ ? entityName.left : entityName.expression; - var right = entityName.kind === 144 /* QualifiedName */ ? entityName.right : entityName.name; + var left = entityName.kind === 145 /* QualifiedName */ ? entityName.left : entityName.expression; + var right = entityName.kind === 145 /* QualifiedName */ ? entityName.right : entityName.name; writeEntityName(left); write("."); writeTextOfNode(currentText, right); @@ -69171,14 +70880,14 @@ var ts; function emitEntityName(entityName) { var visibilityResult = resolver.isEntityNameVisible(entityName, // Aliases can be written asynchronously so use correct enclosing declaration - entityName.parent.kind === 238 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); + entityName.parent.kind === 241 /* ImportEqualsDeclaration */ ? entityName.parent : enclosingDeclaration); handleSymbolAccessibilityError(visibilityResult); recordTypeReferenceDirectivesIfNecessary(resolver.getTypeReferenceDirectivesForEntityName(entityName)); writeEntityName(entityName); } function emitExpressionWithTypeArguments(node) { if (ts.isEntityNameExpression(node.expression)) { - ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 180 /* PropertyAccessExpression */); + ts.Debug.assert(node.expression.kind === 71 /* Identifier */ || node.expression.kind === 183 /* PropertyAccessExpression */); emitEntityName(node.expression); if (node.typeArguments) { write("<"); @@ -69219,6 +70928,22 @@ var ts; function emitIntersectionType(type) { emitSeparatedList(type.types, " & ", emitType); } + function emitConditionalType(node) { + emitType(node.checkType); + write(" extends "); + emitType(node.extendsType); + write(" ? "); + var prevEnclosingDeclaration = enclosingDeclaration; + enclosingDeclaration = node.trueType; + emitType(node.trueType); + enclosingDeclaration = prevEnclosingDeclaration; + write(" : "); + emitType(node.falseType); + } + function emitInferType(node) { + write("infer "); + writeTextOfNode(currentText, node.typeParameter.name); + } function emitParenType(type) { write("("); emitType(type.type); @@ -69242,7 +70967,9 @@ var ts; writeLine(); increaseIndent(); if (node.readonlyToken) { - write("readonly "); + write(node.readonlyToken.kind === 37 /* PlusToken */ ? "+readonly " : + node.readonlyToken.kind === 38 /* MinusToken */ ? "-readonly " : + "readonly "); } write("["); writeEntityName(node.typeParameter.name); @@ -69250,10 +70977,17 @@ var ts; emitType(node.typeParameter.constraint); write("]"); if (node.questionToken) { - write("?"); + write(node.questionToken.kind === 37 /* PlusToken */ ? "+?" : + node.questionToken.kind === 38 /* MinusToken */ ? "-?" : + "?"); } write(": "); - emitType(node.type); + if (node.type) { + emitType(node.type); + } + else { + write("any"); + } write(";"); writeLine(); decreaseIndent(); @@ -69344,10 +71078,11 @@ var ts; if (isModuleElementVisible) { writeModuleElement(node); } - else if (node.kind === 238 /* ImportEqualsDeclaration */ || - (node.parent.kind === 269 /* SourceFile */ && isCurrentFileExternalModule)) { + // Import equals declaration in internal module can become visible as part of any emit so lets make sure we add these irrespective + else if (node.kind === 241 /* ImportEqualsDeclaration */ || + (node.parent.kind === 272 /* SourceFile */ && isCurrentFileExternalModule)) { var isVisible = void 0; - if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 269 /* SourceFile */) { + if (asynchronousSubModuleDeclarationEmitInfo && node.parent.kind !== 272 /* SourceFile */) { // Import declaration of another module that is visited async so lets put it in right spot asynchronousSubModuleDeclarationEmitInfo.push({ node: node, @@ -69357,7 +71092,7 @@ var ts; }); } else { - if (node.kind === 239 /* ImportDeclaration */) { + if (node.kind === 242 /* ImportDeclaration */) { var importDeclaration = node; if (importDeclaration.importClause) { isVisible = (importDeclaration.importClause.name && resolver.isDeclarationVisible(importDeclaration.importClause)) || @@ -69375,23 +71110,23 @@ var ts; } function writeModuleElement(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return writeFunctionDeclaration(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return writeVariableStatement(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return writeInterfaceDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return writeClassDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return writeTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return writeEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return writeModuleDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return writeImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return writeImportDeclaration(node); default: ts.Debug.fail("Unknown symbol kind"); @@ -69399,7 +71134,7 @@ var ts; } function emitModuleElementDeclarationFlags(node) { // If the node is parented in the current source file we need to emit export declare or just export - if (node.parent.kind === 269 /* SourceFile */) { + if (node.parent.kind === 272 /* SourceFile */) { var modifiers = ts.getModifierFlags(node); // If the node is exported if (modifiers & 1 /* Export */) { @@ -69409,7 +71144,7 @@ var ts; if (modifiers & 512 /* Default */) { write("default "); } - else if (node.kind !== 231 /* InterfaceDeclaration */ && needsDeclare) { + else if (node.kind !== 234 /* InterfaceDeclaration */ && needsDeclare) { write("declare "); } } @@ -69461,11 +71196,11 @@ var ts; } function isVisibleNamedBinding(namedBindings) { if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { return resolver.isDeclarationVisible(namedBindings); } else { - return ts.forEach(namedBindings.elements, function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); + return namedBindings.elements.some(function (namedImport) { return resolver.isDeclarationVisible(namedImport); }); } } } @@ -69485,7 +71220,7 @@ var ts; // If the default binding was emitted, write the separated write(", "); } - if (node.importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (node.importClause.namedBindings.kind === 244 /* NamespaceImport */) { write("* as "); writeTextOfNode(currentText, node.importClause.namedBindings.name); } @@ -69506,19 +71241,9 @@ var ts; // the only case when it is not true is when we call it to emit correct name for module augmentation - d.ts files with just module augmentations are not considered // external modules since they are indistinguishable from script files with ambient modules. To fix this in such d.ts files we'll emit top level 'export {}' // so compiler will treat them as external modules. - resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 234 /* ModuleDeclaration */; - var moduleSpecifier; - if (parent.kind === 238 /* ImportEqualsDeclaration */) { - var node = parent; - moduleSpecifier = ts.getExternalModuleImportEqualsDeclarationExpression(node); - } - else if (parent.kind === 234 /* ModuleDeclaration */) { - moduleSpecifier = parent.name; - } - else { - var node = parent; - moduleSpecifier = node.moduleSpecifier; - } + resultHasExternalModuleIndicator = resultHasExternalModuleIndicator || parent.kind !== 237 /* ModuleDeclaration */; + var moduleSpecifier = parent.kind === 241 /* ImportEqualsDeclaration */ ? ts.getExternalModuleImportEqualsDeclarationExpression(parent) : + parent.kind === 237 /* ModuleDeclaration */ ? parent.name : parent.moduleSpecifier; if (moduleSpecifier.kind === 9 /* StringLiteral */ && isBundledEmit && (compilerOptions.out || compilerOptions.outFile)) { var moduleName = ts.getExternalModuleNameFromDeclaration(host, resolver, parent); if (moduleName) { @@ -69583,7 +71308,7 @@ var ts; writeTextOfNode(currentText, node.name); } } - while (node.body && node.body.kind !== 235 /* ModuleBlock */) { + while (node.body && node.body.kind !== 238 /* ModuleBlock */) { node = node.body; write("."); writeTextOfNode(currentText, node.name); @@ -69653,7 +71378,7 @@ var ts; writeLine(); } function isPrivateMethodTypeParameter(node) { - return node.parent.kind === 152 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); + return node.parent.kind === 153 /* MethodDeclaration */ && ts.hasModifier(node.parent, 8 /* Private */); } function emitTypeParameters(typeParameters) { function emitTypeParameter(node) { @@ -69664,15 +71389,15 @@ var ts; // If there is constraint present and this is not a type parameter of the private method emit the constraint if (node.constraint && !isPrivateMethodTypeParameter(node)) { write(" extends "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.constraint); } else { @@ -69681,15 +71406,15 @@ var ts; } if (node.default && !isPrivateMethodTypeParameter(node)) { write(" = "); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - (node.parent.parent && node.parent.parent.kind === 164 /* TypeLiteral */)) { - ts.Debug.assert(node.parent.kind === 152 /* MethodDeclaration */ || - node.parent.kind === 151 /* MethodSignature */ || - node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.kind === 156 /* CallSignature */ || - node.parent.kind === 157 /* ConstructSignature */); + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + (node.parent.parent && node.parent.parent.kind === 165 /* TypeLiteral */)) { + ts.Debug.assert(node.parent.kind === 153 /* MethodDeclaration */ || + node.parent.kind === 152 /* MethodSignature */ || + node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.kind === 157 /* CallSignature */ || + node.parent.kind === 158 /* ConstructSignature */); emitType(node.default); } else { @@ -69700,34 +71425,34 @@ var ts; // Type parameter constraints are named by user so we should always be able to name it var diagnosticMessage; switch (node.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_class_has_or_is_using_private_name_1; break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1; break; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1; } else { diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_function_has_or_is_using_private_name_1; break; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnosticMessage = ts.Diagnostics.Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1; break; default: @@ -69761,7 +71486,7 @@ var ts; function getHeritageClauseVisibilityError() { var diagnosticMessage; // Heritage clause is written by user so it can always be named - if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + if (node.parent.parent.kind === 233 /* ClassDeclaration */) { // Class or Interface implemented/extended is inaccessible diagnosticMessage = isImplementsList ? ts.Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 : @@ -69800,7 +71525,7 @@ var ts; diagnosticMessage: ts.Diagnostics.extends_clause_of_exported_class_0_has_or_is_using_private_name_1, errorNode: baseTypeNode, typeName: node.name - }, !ts.findAncestor(node, function (n) { return n.kind === 234 /* ModuleDeclaration */; })); + }, !ts.findAncestor(node, function (n) { return n.kind === 237 /* ModuleDeclaration */; })); } emitJsDocComments(node); emitModuleElementDeclarationFlags(node); @@ -69875,7 +71600,7 @@ var ts; function emitVariableDeclaration(node) { // If we are emitting property it isn't moduleElement and hence we already know it needs to be emitted // so there is no check needed to see if declaration is visible - if (node.kind !== 227 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { + if (node.kind !== 230 /* VariableDeclaration */ || isVariableDeclarationVisible(node)) { if (ts.isBindingPattern(node.name)) { emitBindingPattern(node.name); } @@ -69883,11 +71608,11 @@ var ts; writeNameOfDeclaration(node, getVariableDeclarationTypeVisibilityError); // If optional property emit ? but in the case of parameterProperty declaration with "?" indicating optional parameter for the constructor // we don't want to emit property declaration with "?" - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && !ts.isParameterPropertyDeclaration(node))) && ts.hasQuestionToken(node)) { write("?"); } - if ((node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */) && node.parent.kind === 164 /* TypeLiteral */) { + if ((node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */) && node.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (resolver.isLiteralConstDeclaration(node)) { @@ -69900,15 +71625,17 @@ var ts; } } function getVariableDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { - if (node.kind === 227 /* VariableDeclaration */) { + if (node.kind === 230 /* VariableDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Exported_variable_0_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Exported_variable_0_has_or_is_using_private_name_1; } - else if (node.kind === 150 /* PropertyDeclaration */ || node.kind === 149 /* PropertySignature */ || - (node.kind === 147 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { + // This check is to ensure we don't report error on constructor parameter property as that error would be reported during parameter emit + // The only exception here is if the constructor was marked as private. we are not emitting the constructor parameters at all. + else if (node.kind === 151 /* PropertyDeclaration */ || node.kind === 150 /* PropertySignature */ || + (node.kind === 148 /* Parameter */ && ts.hasModifier(node.parent, 8 /* Private */))) { // TODO(jfreeman): Deal with computed properties in error reporting. if (ts.hasModifier(node, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? @@ -69917,7 +71644,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */ || node.kind === 147 /* Parameter */) { + else if (node.parent.kind === 233 /* ClassDeclaration */ || node.kind === 148 /* Parameter */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -69949,7 +71676,7 @@ var ts; var elements = []; for (var _i = 0, _a = bindingPattern.elements; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 201 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { + if (element.kind !== 204 /* OmittedExpression */ && isVariableDeclarationVisible(element)) { elements.push(element); } } @@ -70023,7 +71750,7 @@ var ts; var type = getTypeAnnotationFromAccessor(node); if (!type) { // couldn't get type for the first accessor, try the another one - var anotherAccessor = node.kind === 154 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; + var anotherAccessor = node.kind === 155 /* GetAccessor */ ? accessors.setAccessor : accessors.getAccessor; type = getTypeAnnotationFromAccessor(anotherAccessor); if (type) { accessorWithTypeAnnotation = anotherAccessor; @@ -70036,7 +71763,7 @@ var ts; } function getTypeAnnotationFromAccessor(accessor) { if (accessor) { - return accessor.kind === 154 /* GetAccessor */ + return accessor.kind === 155 /* GetAccessor */ ? accessor.type // Getter - return type : accessor.parameters.length > 0 ? accessor.parameters[0].type // Setter parameter type @@ -70059,7 +71786,7 @@ var ts; ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_property_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70074,7 +71801,7 @@ var ts; } function getAccessorDeclarationTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; - if (accessorWithTypeAnnotation.kind === 155 /* SetAccessor */) { + if (accessorWithTypeAnnotation.kind === 156 /* SetAccessor */) { // Getters can infer the return type from the returned expression, but setters cannot, so the // "_from_external_module_1_but_cannot_be_named" case cannot occur. if (ts.hasModifier(accessorWithTypeAnnotation, 32 /* Static */)) { @@ -70119,17 +71846,17 @@ var ts; // so no need to verify if the declaration is visible if (!resolver.isImplementationOfOverload(node)) { emitJsDocComments(node); - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { emitModuleElementDeclarationFlags(node); } - else if (node.kind === 152 /* MethodDeclaration */ || node.kind === 153 /* Constructor */) { + else if (node.kind === 153 /* MethodDeclaration */ || node.kind === 154 /* Constructor */) { emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); } - if (node.kind === 229 /* FunctionDeclaration */) { + if (node.kind === 232 /* FunctionDeclaration */) { write("function "); writeTextOfNode(currentText, node.name); } - else if (node.kind === 153 /* Constructor */) { + else if (node.kind === 154 /* Constructor */) { write("constructor"); } else { @@ -70156,7 +71883,7 @@ var ts; ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Public_static_method_0_of_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70200,22 +71927,22 @@ var ts; var prevEnclosingDeclaration = enclosingDeclaration; enclosingDeclaration = node; var closeParenthesizedFunctionType = false; - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { // Index signature can have readonly modifier emitClassMemberDeclarationFlags(ts.getModifierFlags(node)); write("["); } else { - if (node.kind === 153 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { + if (node.kind === 154 /* Constructor */ && ts.hasModifier(node, 8 /* Private */)) { write("();"); writeLine(); return; } // Construct signature or constructor type write new Signature - if (node.kind === 157 /* ConstructSignature */ || node.kind === 162 /* ConstructorType */) { + if (node.kind === 158 /* ConstructSignature */ || node.kind === 163 /* ConstructorType */) { write("new "); } - else if (node.kind === 161 /* FunctionType */) { + else if (node.kind === 162 /* FunctionType */) { var currentOutput = writer.getText(); // Do not generate incorrect type when function type with type parameters is type argument // This could happen if user used space between two '<' making it error free @@ -70230,22 +71957,22 @@ var ts; } // Parameters emitCommaList(node.parameters, emitParameterDeclaration); - if (node.kind === 158 /* IndexSignature */) { + if (node.kind === 159 /* IndexSignature */) { write("]"); } else { write(")"); } // If this is not a constructor and is not private, emit the return type - var isFunctionTypeOrConstructorType = node.kind === 161 /* FunctionType */ || node.kind === 162 /* ConstructorType */; - if (isFunctionTypeOrConstructorType || node.parent.kind === 164 /* TypeLiteral */) { + var isFunctionTypeOrConstructorType = node.kind === 162 /* FunctionType */ || node.kind === 163 /* ConstructorType */; + if (isFunctionTypeOrConstructorType || node.parent.kind === 165 /* TypeLiteral */) { // Emit type literal signature return type only if specified if (node.type) { write(isFunctionTypeOrConstructorType ? " => " : ": "); emitType(node.type); } } - else if (node.kind !== 153 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { + else if (node.kind !== 154 /* Constructor */ && !ts.hasModifier(node, 8 /* Private */)) { writeReturnTypeAtSignature(node, getReturnTypeVisibilityError); } enclosingDeclaration = prevEnclosingDeclaration; @@ -70259,26 +71986,26 @@ var ts; function getReturnTypeVisibilityError(symbolAccessibilityResult) { var diagnosticMessage; switch (node.kind) { - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have return types that cannot be named diagnosticMessage = symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0; break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node, 32 /* Static */)) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -70286,7 +72013,7 @@ var ts; ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1 : ts.Diagnostics.Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0; } - else if (node.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.kind === 233 /* ClassDeclaration */) { diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -70300,7 +72027,7 @@ var ts; ts.Diagnostics.Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0; } break; - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: diagnosticMessage = symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named : @@ -70335,9 +72062,9 @@ var ts; write("?"); } decreaseIndent(); - if (node.parent.kind === 161 /* FunctionType */ || - node.parent.kind === 162 /* ConstructorType */ || - node.parent.parent.kind === 164 /* TypeLiteral */) { + if (node.parent.kind === 162 /* FunctionType */ || + node.parent.kind === 163 /* ConstructorType */ || + node.parent.parent.kind === 165 /* TypeLiteral */) { emitTypeOfVariableDeclarationFromTypeLiteral(node); } else if (!ts.hasModifier(node.parent, 8 /* Private */)) { @@ -70353,29 +72080,29 @@ var ts; } function getParameterDeclarationTypeVisibilityDiagnosticMessage(symbolAccessibilityResult) { switch (node.parent.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1; - case 156 /* CallSignature */: + case 157 /* CallSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: // Interfaces cannot have parameter types that cannot be named return symbolAccessibilityResult.errorModuleName ? ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.hasModifier(node.parent, 32 /* Static */)) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? @@ -70383,7 +72110,7 @@ var ts; ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1; } - else if (node.parent.parent.kind === 230 /* ClassDeclaration */) { + else if (node.parent.parent.kind === 233 /* ClassDeclaration */) { return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70396,7 +72123,7 @@ var ts; ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2 : ts.Diagnostics.Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1; } - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return symbolAccessibilityResult.errorModuleName ? symbolAccessibilityResult.accessibility === 2 /* CannotBeNamed */ ? ts.Diagnostics.Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named : @@ -70408,12 +72135,12 @@ var ts; } function emitBindingPattern(bindingPattern) { // We have to explicitly emit square bracket and bracket because these tokens are not store inside the node. - if (bindingPattern.kind === 175 /* ObjectBindingPattern */) { + if (bindingPattern.kind === 178 /* ObjectBindingPattern */) { write("{"); emitCommaList(bindingPattern.elements, emitBindingElement); write("}"); } - else if (bindingPattern.kind === 176 /* ArrayBindingPattern */) { + else if (bindingPattern.kind === 179 /* ArrayBindingPattern */) { write("["); var elements = bindingPattern.elements; emitCommaList(elements, emitBindingElement); @@ -70424,7 +72151,7 @@ var ts; } } function emitBindingElement(bindingElement) { - if (bindingElement.kind === 201 /* OmittedExpression */) { + if (bindingElement.kind === 204 /* OmittedExpression */) { // If bindingElement is an omittedExpression (i.e. containing elision), // we will emit blank space (although this may differ from users' original code, // it allows emitSeparatedList to write separator appropriately) @@ -70434,7 +72161,7 @@ var ts; // emit : function foo([ , x, , ]) {} write(" "); } - else if (bindingElement.kind === 177 /* BindingElement */) { + else if (bindingElement.kind === 180 /* BindingElement */) { if (bindingElement.propertyName) { // bindingElement has propertyName property in the following case: // { y: [a,b,c] ...} -> bindingPattern will have a property called propertyName for "y" @@ -70473,40 +72200,40 @@ var ts; } function emitNode(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 231 /* InterfaceDeclaration */: - case 230 /* ClassDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: + case 232 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 234 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: return emitModuleElement(node, isModuleElementVisible(node)); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitModuleElement(node, isVariableStatementVisible(node)); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // Import declaration without import clause is visible, otherwise it is not visible return emitModuleElement(node, /*isModuleElementVisible*/ !node.importClause); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return writeFunctionDeclaration(node); - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 158 /* IndexSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 159 /* IndexSignature */: return emitSignatureDeclarationWithJsDocComments(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return emitPropertyDeclaration(node); - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMemberDeclaration(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 269 /* SourceFile */: + case 272 /* SourceFile */: return emitSourceFile(node); } } @@ -70534,7 +72261,7 @@ var ts; return addedBundledEmitReference; function getDeclFileName(emitFileNames, sourceFileOrBundle) { // Dont add reference path to this file if it is a bundled emit and caller asked not emit bundled file path - var isBundledEmit = sourceFileOrBundle.kind === 270 /* Bundle */; + var isBundledEmit = sourceFileOrBundle.kind === 273 /* Bundle */; if (isBundledEmit && !addBundledFileReference) { return; } @@ -70549,7 +72276,7 @@ var ts; var emitDeclarationResult = emitDeclarations(host, resolver, emitterDiagnostics, declarationFilePath, sourceFileOrBundle, emitOnlyDtsFiles); var emitSkipped = emitDeclarationResult.reportedDeclarationError || host.isEmitBlocked(declarationFilePath) || host.getCompilerOptions().noEmit; if (!emitSkipped || emitOnlyDtsFiles) { - var sourceFiles = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; + var sourceFiles = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle.sourceFiles : [sourceFileOrBundle]; var declarationOutput = emitDeclarationResult.referencesOutput + getDeclarationOutput(emitDeclarationResult.synchronousDeclarationOutput, emitDeclarationResult.moduleElementDeclarationEmitInfo); ts.writeFile(host, emitterDiagnostics, declarationFilePath, declarationOutput, host.getCompilerOptions().emitBOM, sourceFiles); @@ -70639,7 +72366,7 @@ var ts; return ".js" /* Js */; } function getOriginalSourceFileOrBundle(sourceFileOrBundle) { - if (sourceFileOrBundle.kind === 270 /* Bundle */) { + if (sourceFileOrBundle.kind === 273 /* Bundle */) { return ts.updateBundle(sourceFileOrBundle, ts.sameMap(sourceFileOrBundle.sourceFiles, ts.getOriginalSourceFile)); } return ts.getOriginalSourceFile(sourceFileOrBundle); @@ -70716,8 +72443,8 @@ var ts; } } function printSourceFileOrBundle(jsFilePath, sourceMapFilePath, sourceFileOrBundle) { - var bundle = sourceFileOrBundle.kind === 270 /* Bundle */ ? sourceFileOrBundle : undefined; - var sourceFile = sourceFileOrBundle.kind === 269 /* SourceFile */ ? sourceFileOrBundle : undefined; + var bundle = sourceFileOrBundle.kind === 273 /* Bundle */ ? sourceFileOrBundle : undefined; + var sourceFile = sourceFileOrBundle.kind === 272 /* SourceFile */ ? sourceFileOrBundle : undefined; var sourceFiles = bundle ? bundle.sourceFiles : [sourceFile]; sourceMap.initialize(jsFilePath, sourceMapFilePath, sourceFileOrBundle); if (bundle) { @@ -70757,7 +72484,7 @@ var ts; } function emitHelpers(node, writeLines) { var helpersEmitted = false; - var bundle = node.kind === 270 /* Bundle */ ? node : undefined; + var bundle = node.kind === 273 /* Bundle */ ? node : undefined; if (bundle && moduleKind === ts.ModuleKind.None) { return; } @@ -70851,8 +72578,8 @@ var ts; break; } switch (node.kind) { - case 269 /* SourceFile */: return printFile(node); - case 270 /* Bundle */: return printBundle(node); + case 272 /* SourceFile */: return printFile(node); + case 273 /* Bundle */: return printBundle(node); } writeNode(hint, node, sourceFile, beginPrint()); return endPrint(); @@ -71028,223 +72755,229 @@ var ts; return emitIdentifier(node); // Parse tree nodes // Names - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: return emitQualifiedName(node); - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return emitComputedPropertyName(node); // Signature elements - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return emitTypeParameter(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return emitParameter(node); - case 148 /* Decorator */: + case 149 /* Decorator */: return emitDecorator(node); // Type members - case 149 /* PropertySignature */: + case 150 /* PropertySignature */: return emitPropertySignature(node); - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: return emitPropertyDeclaration(node); - case 151 /* MethodSignature */: + case 152 /* MethodSignature */: return emitMethodSignature(node); - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return emitMethodDeclaration(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return emitConstructor(node); - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return emitAccessorDeclaration(node); - case 156 /* CallSignature */: + case 157 /* CallSignature */: return emitCallSignature(node); - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return emitConstructSignature(node); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return emitIndexSignature(node); // Types - case 159 /* TypePredicate */: + case 160 /* TypePredicate */: return emitTypePredicate(node); - case 160 /* TypeReference */: + case 161 /* TypeReference */: return emitTypeReference(node); - case 161 /* FunctionType */: + case 162 /* FunctionType */: return emitFunctionType(node); - case 277 /* JSDocFunctionType */: + case 280 /* JSDocFunctionType */: return emitJSDocFunctionType(node); - case 162 /* ConstructorType */: + case 163 /* ConstructorType */: return emitConstructorType(node); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return emitTypeQuery(node); - case 164 /* TypeLiteral */: + case 165 /* TypeLiteral */: return emitTypeLiteral(node); - case 165 /* ArrayType */: + case 166 /* ArrayType */: return emitArrayType(node); - case 166 /* TupleType */: + case 167 /* TupleType */: return emitTupleType(node); - case 167 /* UnionType */: + case 168 /* UnionType */: return emitUnionType(node); - case 168 /* IntersectionType */: + case 169 /* IntersectionType */: return emitIntersectionType(node); - case 169 /* ParenthesizedType */: + case 170 /* ConditionalType */: + return emitConditionalType(node); + case 171 /* InferType */: + return emitInferType(node); + case 172 /* ParenthesizedType */: return emitParenthesizedType(node); - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return emitExpressionWithTypeArguments(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return emitThisType(); - case 171 /* TypeOperator */: + case 174 /* TypeOperator */: return emitTypeOperator(node); - case 172 /* IndexedAccessType */: + case 175 /* IndexedAccessType */: return emitIndexedAccessType(node); - case 173 /* MappedType */: + case 176 /* MappedType */: return emitMappedType(node); - case 174 /* LiteralType */: + case 177 /* LiteralType */: return emitLiteralType(node); - case 272 /* JSDocAllType */: + case 275 /* JSDocAllType */: write("*"); return; - case 273 /* JSDocUnknownType */: + case 276 /* JSDocUnknownType */: write("?"); return; - case 274 /* JSDocNullableType */: + case 277 /* JSDocNullableType */: return emitJSDocNullableType(node); - case 275 /* JSDocNonNullableType */: + case 278 /* JSDocNonNullableType */: return emitJSDocNonNullableType(node); - case 276 /* JSDocOptionalType */: + case 279 /* JSDocOptionalType */: return emitJSDocOptionalType(node); - case 278 /* JSDocVariadicType */: + case 281 /* JSDocVariadicType */: return emitJSDocVariadicType(node); // Binding patterns - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: return emitObjectBindingPattern(node); - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: return emitArrayBindingPattern(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return emitBindingElement(node); // Misc - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return emitTemplateSpan(node); - case 207 /* SemicolonClassElement */: + case 210 /* SemicolonClassElement */: return emitSemicolonClassElement(); // Statements - case 208 /* Block */: + case 211 /* Block */: return emitBlock(node); - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: return emitVariableStatement(node); - case 210 /* EmptyStatement */: + case 213 /* EmptyStatement */: return emitEmptyStatement(); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return emitExpressionStatement(node); - case 212 /* IfStatement */: + case 215 /* IfStatement */: return emitIfStatement(node); - case 213 /* DoStatement */: + case 216 /* DoStatement */: return emitDoStatement(node); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: return emitWhileStatement(node); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return emitForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: return emitForInStatement(node); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: return emitForOfStatement(node); - case 218 /* ContinueStatement */: + case 221 /* ContinueStatement */: return emitContinueStatement(node); - case 219 /* BreakStatement */: + case 222 /* BreakStatement */: return emitBreakStatement(node); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: return emitReturnStatement(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: return emitWithStatement(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return emitSwitchStatement(node); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: return emitLabeledStatement(node); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: return emitThrowStatement(node); - case 225 /* TryStatement */: + case 228 /* TryStatement */: return emitTryStatement(node); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: return emitDebuggerStatement(node); // Declarations - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: return emitVariableDeclaration(node); - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return emitVariableDeclarationList(node); - case 229 /* FunctionDeclaration */: + case 232 /* FunctionDeclaration */: return emitFunctionDeclaration(node); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return emitClassDeclaration(node); - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: return emitInterfaceDeclaration(node); - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: return emitTypeAliasDeclaration(node); - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: return emitEnumDeclaration(node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return emitModuleDeclaration(node); - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return emitModuleBlock(node); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return emitCaseBlock(node); - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: return emitNamespaceExportDeclaration(node); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return emitImportEqualsDeclaration(node); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return emitImportDeclaration(node); - case 240 /* ImportClause */: + case 243 /* ImportClause */: return emitImportClause(node); - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: return emitNamespaceImport(node); - case 242 /* NamedImports */: + case 245 /* NamedImports */: return emitNamedImports(node); - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: return emitImportSpecifier(node); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: return emitExportAssignment(node); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: return emitExportDeclaration(node); - case 246 /* NamedExports */: + case 249 /* NamedExports */: return emitNamedExports(node); - case 247 /* ExportSpecifier */: + case 250 /* ExportSpecifier */: return emitExportSpecifier(node); - case 248 /* MissingDeclaration */: + case 251 /* MissingDeclaration */: return; // Module references - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return emitExternalModuleReference(node); // JSX (non-expression) case 10 /* JsxText */: return emitJsxText(node); - case 252 /* JsxOpeningElement */: - case 255 /* JsxOpeningFragment */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: return emitJsxOpeningElementOrFragment(node); - case 253 /* JsxClosingElement */: - case 256 /* JsxClosingFragment */: + case 256 /* JsxClosingElement */: + case 259 /* JsxClosingFragment */: return emitJsxClosingElementOrFragment(node); - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return emitJsxAttribute(node); - case 258 /* JsxAttributes */: + case 261 /* JsxAttributes */: return emitJsxAttributes(node); - case 259 /* JsxSpreadAttribute */: + case 262 /* JsxSpreadAttribute */: return emitJsxSpreadAttribute(node); - case 260 /* JsxExpression */: + case 263 /* JsxExpression */: return emitJsxExpression(node); // Clauses - case 261 /* CaseClause */: + case 264 /* CaseClause */: return emitCaseClause(node); - case 262 /* DefaultClause */: + case 265 /* DefaultClause */: return emitDefaultClause(node); - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: return emitHeritageClause(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return emitCatchClause(node); // Property assignments - case 265 /* PropertyAssignment */: + case 268 /* PropertyAssignment */: return emitPropertyAssignment(node); - case 266 /* ShorthandPropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: return emitShorthandPropertyAssignment(node); - case 267 /* SpreadAssignment */: + case 270 /* SpreadAssignment */: return emitSpreadAssignment(node); // Enum - case 268 /* EnumMember */: + case 271 /* EnumMember */: return emitEnumMember(node); + // JSDoc nodes (ignored) + // Transformation nodes (ignored) } // If the node is an expression, try to emit it as an expression with // substitution. @@ -71279,71 +73012,71 @@ var ts; writeTokenNode(node, writeKeyword); return; // Expressions - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return emitArrayLiteralExpression(node); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return emitObjectLiteralExpression(node); - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: return emitPropertyAccessExpression(node); - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return emitElementAccessExpression(node); - case 182 /* CallExpression */: + case 185 /* CallExpression */: return emitCallExpression(node); - case 183 /* NewExpression */: + case 186 /* NewExpression */: return emitNewExpression(node); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return emitTaggedTemplateExpression(node); - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: return emitTypeAssertionExpression(node); - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return emitParenthesizedExpression(node); - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return emitFunctionExpression(node); - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return emitArrowFunction(node); - case 189 /* DeleteExpression */: + case 192 /* DeleteExpression */: return emitDeleteExpression(node); - case 190 /* TypeOfExpression */: + case 193 /* TypeOfExpression */: return emitTypeOfExpression(node); - case 191 /* VoidExpression */: + case 194 /* VoidExpression */: return emitVoidExpression(node); - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: return emitAwaitExpression(node); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return emitPrefixUnaryExpression(node); - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: return emitPostfixUnaryExpression(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return emitBinaryExpression(node); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return emitConditionalExpression(node); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: return emitTemplateExpression(node); - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: return emitYieldExpression(node); - case 199 /* SpreadElement */: + case 202 /* SpreadElement */: return emitSpreadExpression(node); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return emitClassExpression(node); - case 201 /* OmittedExpression */: + case 204 /* OmittedExpression */: return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: return emitAsExpression(node); - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: return emitNonNullExpression(node); - case 205 /* MetaProperty */: + case 208 /* MetaProperty */: return emitMetaProperty(node); // JSX - case 250 /* JsxElement */: + case 253 /* JsxElement */: return emitJsxElement(node); - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: return emitJsxSelfClosingElement(node); - case 254 /* JsxFragment */: + case 257 /* JsxFragment */: return emitJsxFragment(node); // Transformation nodes - case 292 /* PartiallyEmittedExpression */: + case 295 /* PartiallyEmittedExpression */: return emitPartiallyEmittedExpression(node); - case 293 /* CommaListExpression */: + case 296 /* CommaListExpression */: return emitCommaList(node); } } @@ -71434,13 +73167,14 @@ var ts; emitNodeWithWriter(node.name, writeParameter); } emitIfPresent(node.questionToken); - if (node.parent && node.parent.kind === 277 /* JSDocFunctionType */ && !node.name) { + if (node.parent && node.parent.kind === 280 /* JSDocFunctionType */ && !node.name) { emit(node.type); } else { emitTypeAnnotation(node.type); } - emitInitializer(node.initializer); + // The comment position has to fallback to any present node within the parameterdeclaration because as it turns out, the parser can make parameter declarations with _just_ an initializer. + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name ? node.name.end : node.modifiers ? node.modifiers.end : node.decorators ? node.decorators.end : node.pos, node); } function emitDecorator(decorator) { writePunctuation("@"); @@ -71462,8 +73196,9 @@ var ts; emitModifiers(node, node.modifiers); emit(node.name); emitIfPresent(node.questionToken); + emitIfPresent(node.exclamationToken); emitTypeAnnotation(node.type); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.type ? node.type.end : node.questionToken ? node.questionToken.end : node.name.end, node); writeSemicolon(); } function emitMethodSignature(node) { @@ -71492,7 +73227,7 @@ var ts; function emitAccessorDeclaration(node) { emitDecorators(node, node.decorators); emitModifiers(node, node.modifiers); - writeKeyword(node.kind === 154 /* GetAccessor */ ? "get" : "set"); + writeKeyword(node.kind === 155 /* GetAccessor */ ? "get" : "set"); writeSpace(); emit(node.name); emitSignatureAndBody(node, emitSignatureHead); @@ -71606,6 +73341,26 @@ var ts; function emitIntersectionType(node) { emitList(node, node.types, 264 /* IntersectionTypeConstituents */); } + function emitConditionalType(node) { + emit(node.checkType); + writeSpace(); + writeKeyword("extends"); + writeSpace(); + emit(node.extendsType); + writeSpace(); + writePunctuation("?"); + writeSpace(); + emit(node.trueType); + writeSpace(); + writePunctuation(":"); + writeSpace(); + emit(node.falseType); + } + function emitInferType(node) { + writeKeyword("infer"); + writeSpace(); + emit(node.typeParameter); + } function emitParenthesizedType(node) { writePunctuation("("); emit(node.type); @@ -71637,12 +73392,20 @@ var ts; } if (node.readonlyToken) { emit(node.readonlyToken); + if (node.readonlyToken.kind !== 132 /* ReadonlyKeyword */) { + writeKeyword("readonly"); + } writeSpace(); } writePunctuation("["); pipelineEmitWithNotification(3 /* MappedTypeParameter */, node.typeParameter); writePunctuation("]"); - emitIfPresent(node.questionToken); + if (node.questionToken) { + emit(node.questionToken); + if (node.questionToken.kind !== 55 /* QuestionToken */) { + writePunctuation("?"); + } + } writePunctuation(":"); writeSpace(); emit(node.type); @@ -71680,7 +73443,7 @@ var ts; writeSpace(); } emit(node.name); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.name.end, node); } // // Expressions @@ -71717,7 +73480,10 @@ var ts; emitExpression(node.expression); increaseIndentIf(indentBeforeDot); var shouldEmitDotDot = !indentBeforeDot && needsDotDotForPropertyAccess(node.expression); - writePunctuation(shouldEmitDotDot ? ".." : "."); + if (shouldEmitDotDot) { + writePunctuation("."); + } + emitTokenWithComment(23 /* DotToken */, node.expression.end, writePunctuation, node); increaseIndentIf(indentAfterDot); emit(node.name); decreaseIndentIf(indentBeforeDot, indentAfterDot); @@ -71743,9 +73509,9 @@ var ts; } function emitElementAccessExpression(node) { emitExpression(node.expression); - writePunctuation("["); + var openPos = emitTokenWithComment(21 /* OpenBracketToken */, node.expression.end, writePunctuation, node); emitExpression(node.argumentExpression); - writePunctuation("]"); + emitTokenWithComment(22 /* CloseBracketToken */, node.argumentExpression ? node.argumentExpression.end : openPos, writePunctuation, node); } function emitCallExpression(node) { emitExpression(node.expression); @@ -71753,7 +73519,7 @@ var ts; emitExpressionList(node, node.arguments, 1296 /* CallExpressionArguments */); } function emitNewExpression(node) { - writeKeyword("new"); + emitTokenWithComment(94 /* NewKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); emitTypeArguments(node, node.typeArguments); @@ -71771,9 +73537,9 @@ var ts; emitExpression(node.expression); } function emitParenthesizedExpression(node) { - writePunctuation("("); + var openParenPos = emitTokenWithComment(19 /* OpenParenToken */, node.pos, writePunctuation, node); emitExpression(node.expression); - writePunctuation(")"); + emitTokenWithComment(20 /* CloseParenToken */, node.expression ? node.expression.end : openParenPos, writePunctuation, node); } function emitFunctionExpression(node) { emitFunctionDeclarationOrExpression(node); @@ -71791,22 +73557,22 @@ var ts; emit(node.equalsGreaterThanToken); } function emitDeleteExpression(node) { - writeKeyword("delete"); + emitTokenWithComment(80 /* DeleteKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitTypeOfExpression(node) { - writeKeyword("typeof"); + emitTokenWithComment(103 /* TypeOfKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitVoidExpression(node) { - writeKeyword("void"); + emitTokenWithComment(105 /* VoidKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } function emitAwaitExpression(node) { - writeKeyword("await"); + emitTokenWithComment(121 /* AwaitKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); } @@ -71831,7 +73597,7 @@ var ts; // expression a prefix increment whose operand is a plus expression - (++(+x)) // The same is true of minus of course. var operand = node.operand; - return operand.kind === 193 /* PrefixUnaryExpression */ + return operand.kind === 196 /* PrefixUnaryExpression */ && ((node.operator === 37 /* PlusToken */ && (operand.operator === 37 /* PlusToken */ || operand.operator === 43 /* PlusPlusToken */)) || (node.operator === 38 /* MinusToken */ && (operand.operator === 38 /* MinusToken */ || operand.operator === 44 /* MinusMinusToken */))); } @@ -71874,7 +73640,7 @@ var ts; emitList(node, node.templateSpans, 131072 /* TemplateExpressionSpans */); } function emitYieldExpression(node) { - writeKeyword("yield"); + emitTokenWithComment(116 /* YieldKeyword */, node.pos, writeKeyword, node); emit(node.asteriskToken); emitExpressionWithLeadingSpace(node.expression); } @@ -71918,17 +73684,13 @@ var ts; // Statements // function emitBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node); emitBlockStatements(node, /*forceSingleLine*/ !node.multiLine && isEmptyBlock(node)); - // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted - increaseIndent(); - emitLeadingCommentsOfPosition(node.statements.end); - decreaseIndent(); - writeToken(18 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node); } function emitBlockStatements(node, forceSingleLine) { + emitTokenWithComment(17 /* OpenBraceToken */, node.pos, writePunctuation, /*contextNode*/ node); var format = forceSingleLine || ts.getEmitFlags(node) & 1 /* SingleLine */ ? 384 /* SingleLineBlockStatements */ : 65 /* MultiLineBlockStatements */; emitList(node, node.statements, format); + emitTokenWithComment(18 /* CloseBraceToken */, node.statements.end, writePunctuation, /*contextNode*/ node, /*indentLeading*/ !!(format & 1 /* MultiLine */)); } function emitVariableStatement(node) { emitModifiers(node, node.modifiers); @@ -71943,16 +73705,16 @@ var ts; writeSemicolon(); } function emitIfStatement(node) { - var openParenPos = writeToken(90 /* IfKeyword */, node.pos, writeKeyword, node); + var openParenPos = emitTokenWithComment(90 /* IfKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.thenStatement); if (node.elseStatement) { writeLineOrSpace(node); - writeToken(82 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); - if (node.elseStatement.kind === 212 /* IfStatement */) { + emitTokenWithComment(82 /* ElseKeyword */, node.thenStatement.end, writeKeyword, node); + if (node.elseStatement.kind === 215 /* IfStatement */) { writeSpace(); emit(node.elseStatement); } @@ -71961,8 +73723,15 @@ var ts; } } } + function emitWhileClause(node, startPos) { + var openParenPos = emitTokenWithComment(106 /* WhileKeyword */, startPos, writeKeyword, node); + writeSpace(); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); + emitExpression(node.expression); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); + } function emitDoStatement(node) { - writeKeyword("do"); + emitTokenWithComment(81 /* DoKeyword */, node.pos, writeKeyword, node); emitEmbeddedStatement(node, node.statement); if (ts.isBlock(node.statement)) { writeSpace(); @@ -71970,60 +73739,53 @@ var ts; else { writeLineOrSpace(node); } - writeKeyword("while"); - writeSpace(); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(");"); + emitWhileClause(node, node.statement.end); + writePunctuation(";"); } function emitWhileStatement(node) { - writeKeyword("while"); - writeSpace(); - writePunctuation("("); - emitExpression(node.expression); - writePunctuation(")"); + emitWhileClause(node, node.pos); emitEmbeddedStatement(node, node.statement); } function emitForStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(88 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); + var pos = emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, /*contextNode*/ node); emitForBinding(node.initializer); - writeSemicolon(); + pos = emitTokenWithComment(25 /* SemicolonToken */, node.initializer ? node.initializer.end : pos, writeSemicolon, node); emitExpressionWithLeadingSpace(node.condition); - writeSemicolon(); + pos = emitTokenWithComment(25 /* SemicolonToken */, node.condition ? node.condition.end : pos, writeSemicolon, node); emitExpressionWithLeadingSpace(node.incrementor); - writePunctuation(")"); + emitTokenWithComment(20 /* CloseParenToken */, node.incrementor ? node.incrementor.end : pos, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForInStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(88 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - writeKeyword("in"); + emitTokenWithComment(92 /* InKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForOfStatement(node) { - var openParenPos = writeToken(88 /* ForKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(88 /* ForKeyword */, node.pos, writeKeyword, node); writeSpace(); emitWithTrailingSpace(node.awaitModifier); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitForBinding(node.initializer); writeSpace(); - writeKeyword("of"); + emitTokenWithComment(144 /* OfKeyword */, node.initializer.end, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitForBinding(node) { if (node !== undefined) { - if (node.kind === 228 /* VariableDeclarationList */) { + if (node.kind === 231 /* VariableDeclarationList */) { emit(node); } else { @@ -72032,22 +73794,34 @@ var ts; } } function emitContinueStatement(node) { - writeToken(77 /* ContinueKeyword */, node.pos, writeKeyword); + emitTokenWithComment(77 /* ContinueKeyword */, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeSemicolon(); } function emitBreakStatement(node) { - writeToken(72 /* BreakKeyword */, node.pos, writeKeyword); + emitTokenWithComment(72 /* BreakKeyword */, node.pos, writeKeyword, node); emitWithLeadingSpace(node.label); writeSemicolon(); } - function emitTokenWithComment(token, pos, writer, contextNode) { + function emitTokenWithComment(token, pos, writer, contextNode, indentLeading) { var node = contextNode && ts.getParseTreeNode(contextNode); - if (node && node.kind === contextNode.kind) { + var isSimilarNode = node && node.kind === contextNode.kind; + var startPos = pos; + if (isSimilarNode) { pos = ts.skipTrivia(currentSourceFile.text, pos); } - pos = writeToken(token, pos, writer, /*contextNode*/ contextNode); - if (node && node.kind === contextNode.kind) { + if (emitLeadingCommentsOfPosition && isSimilarNode) { + var needsIndent = indentLeading && !ts.positionsAreOnSameLine(startPos, pos, currentSourceFile); + if (needsIndent) { + increaseIndent(); + } + emitLeadingCommentsOfPosition(startPos); + if (needsIndent) { + decreaseIndent(); + } + } + pos = writeTokenText(token, writer, pos); + if (emitTrailingCommentsOfPosition && isSimilarNode) { emitTrailingCommentsOfPosition(pos, /*prefixSpace*/ true); } return pos; @@ -72058,35 +73832,35 @@ var ts; writeSemicolon(); } function emitWithStatement(node) { - writeKeyword("with"); + var openParenPos = emitTokenWithComment(107 /* WithKeyword */, node.pos, writeKeyword, node); writeSpace(); - writePunctuation("("); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writePunctuation(")"); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); emitEmbeddedStatement(node, node.statement); } function emitSwitchStatement(node) { - var openParenPos = writeToken(98 /* SwitchKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(98 /* SwitchKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emitExpression(node.expression); - writeToken(20 /* CloseParenToken */, node.expression.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.expression.end, writePunctuation, node); writeSpace(); emit(node.caseBlock); } function emitLabeledStatement(node) { emit(node.label); - writePunctuation(":"); + emitTokenWithComment(56 /* ColonToken */, node.label.end, writePunctuation, node); writeSpace(); emit(node.statement); } function emitThrowStatement(node) { - writeKeyword("throw"); + emitTokenWithComment(100 /* ThrowKeyword */, node.pos, writeKeyword, node); emitExpressionWithLeadingSpace(node.expression); writeSemicolon(); } function emitTryStatement(node) { - writeKeyword("try"); + emitTokenWithComment(102 /* TryKeyword */, node.pos, writeKeyword, node); writeSpace(); emit(node.tryBlock); if (node.catchClause) { @@ -72095,7 +73869,7 @@ var ts; } if (node.finallyBlock) { writeLineOrSpace(node); - writeKeyword("finally"); + emitTokenWithComment(87 /* FinallyKeyword */, (node.catchClause || node.tryBlock).end, writeKeyword, node); writeSpace(); emit(node.finallyBlock); } @@ -72110,7 +73884,7 @@ var ts; function emitVariableDeclaration(node) { emit(node.name); emitTypeAnnotation(node.type); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.type ? node.type.end : node.name.end, node); } function emitVariableDeclarationList(node) { writeKeyword(ts.isLet(node) ? "let" : ts.isConst(node) ? "const" : "var"); @@ -72301,7 +74075,7 @@ var ts; } emit(node.name); var body = node.body; - while (body.kind === 234 /* ModuleDeclaration */) { + while (body.kind === 237 /* ModuleDeclaration */) { writePunctuation("."); emit(body.name); body = body.body; @@ -72311,23 +74085,21 @@ var ts; } function emitModuleBlock(node) { pushNameGenerationScope(node); - writePunctuation("{"); emitBlockStatements(node, /*forceSingleLine*/ isEmptyBlock(node)); - writePunctuation("}"); popNameGenerationScope(node); } function emitCaseBlock(node) { - writeToken(17 /* OpenBraceToken */, node.pos, writePunctuation); + emitTokenWithComment(17 /* OpenBraceToken */, node.pos, writePunctuation, node); emitList(node, node.clauses, 65 /* CaseBlockClauses */); - writeToken(18 /* CloseBraceToken */, node.clauses.end, writePunctuation); + emitTokenWithComment(18 /* CloseBraceToken */, node.clauses.end, writePunctuation, node, /*indentLeading*/ true); } function emitImportEqualsDeclaration(node) { emitModifiers(node, node.modifiers); - writeKeyword("import"); + emitTokenWithComment(91 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); emit(node.name); writeSpace(); - writePunctuation("="); + emitTokenWithComment(58 /* EqualsToken */, node.name.end, writePunctuation, node); writeSpace(); emitModuleReference(node.moduleReference); writeSemicolon(); @@ -72342,12 +74114,12 @@ var ts; } function emitImportDeclaration(node) { emitModifiers(node, node.modifiers); - writeKeyword("import"); + emitTokenWithComment(91 /* ImportKeyword */, node.modifiers ? node.modifiers.end : node.pos, writeKeyword, node); writeSpace(); if (node.importClause) { emit(node.importClause); writeSpace(); - writeKeyword("from"); + emitTokenWithComment(142 /* FromKeyword */, node.importClause.end, writeKeyword, node); writeSpace(); } emitExpression(node.moduleSpecifier); @@ -72356,15 +74128,15 @@ var ts; function emitImportClause(node) { emit(node.name); if (node.name && node.namedBindings) { - writePunctuation(","); + emitTokenWithComment(26 /* CommaToken */, node.name.end, writePunctuation, node); writeSpace(); } emit(node.namedBindings); } function emitNamespaceImport(node) { - writePunctuation("*"); + var asPos = emitTokenWithComment(39 /* AsteriskToken */, node.pos, writePunctuation, node); writeSpace(); - writeKeyword("as"); + emitTokenWithComment(118 /* AsKeyword */, asPos, writeKeyword, node); writeSpace(); emit(node.name); } @@ -72375,41 +74147,42 @@ var ts; emitImportOrExportSpecifier(node); } function emitExportAssignment(node) { - writeKeyword("export"); + var nextPos = emitTokenWithComment(84 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.isExportEquals) { - writeOperator("="); + emitTokenWithComment(58 /* EqualsToken */, nextPos, writeOperator, node); } else { - writeKeyword("default"); + emitTokenWithComment(79 /* DefaultKeyword */, nextPos, writeKeyword, node); } writeSpace(); emitExpression(node.expression); writeSemicolon(); } function emitExportDeclaration(node) { - writeKeyword("export"); + var nextPos = emitTokenWithComment(84 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.exportClause) { emit(node.exportClause); } else { - writePunctuation("*"); + nextPos = emitTokenWithComment(39 /* AsteriskToken */, nextPos, writePunctuation, node); } if (node.moduleSpecifier) { writeSpace(); - writeKeyword("from"); + var fromPos = node.exportClause ? node.exportClause.end : nextPos; + emitTokenWithComment(142 /* FromKeyword */, fromPos, writeKeyword, node); writeSpace(); emitExpression(node.moduleSpecifier); } writeSemicolon(); } function emitNamespaceExportDeclaration(node) { - writeKeyword("export"); + var nextPos = emitTokenWithComment(84 /* ExportKeyword */, node.pos, writeKeyword, node); writeSpace(); - writeKeyword("as"); + nextPos = emitTokenWithComment(118 /* AsKeyword */, nextPos, writeKeyword, node); writeSpace(); - writeKeyword("namespace"); + nextPos = emitTokenWithComment(130 /* NamespaceKeyword */, nextPos, writeKeyword, node); writeSpace(); emit(node.name); writeSemicolon(); @@ -72429,7 +74202,7 @@ var ts; if (node.propertyName) { emit(node.propertyName); writeSpace(); - writeKeyword("as"); + emitTokenWithComment(118 /* AsKeyword */, node.propertyName.end, writeKeyword, node); writeSpace(); } emit(node.name); @@ -72521,44 +74294,31 @@ var ts; // Clauses // function emitCaseClause(node) { - writeKeyword("case"); + emitTokenWithComment(73 /* CaseKeyword */, node.pos, writeKeyword, node); writeSpace(); emitExpression(node.expression); - writePunctuation(":"); - emitCaseOrDefaultClauseStatements(node, node.statements); + emitCaseOrDefaultClauseRest(node, node.statements, node.expression.end); } function emitDefaultClause(node) { - writeKeyword("default"); - writePunctuation(":"); - emitCaseOrDefaultClauseStatements(node, node.statements); + var pos = emitTokenWithComment(79 /* DefaultKeyword */, node.pos, writeKeyword, node); + emitCaseOrDefaultClauseRest(node, node.statements, pos); } - function emitCaseOrDefaultClauseStatements(parentNode, statements) { + function emitCaseOrDefaultClauseRest(parentNode, statements, colonPos) { var emitAsSingleStatement = statements.length === 1 && ( // treat synthesized nodes as located on the same line for emit purposes ts.nodeIsSynthesized(parentNode) || ts.nodeIsSynthesized(statements[0]) || ts.rangeStartPositionsAreOnSameLine(parentNode, statements[0], currentSourceFile)); - // e.g: - // case 0: // Zero - // case 1: // One - // case 2: // two - // return "hi"; - // If there is no statements, emitNodeWithComments of the parentNode which is caseClause will take care of trailing comment. - // So in example above, comment "// Zero" and "// One" will be emit in emitTrailingComments in emitNodeWithComments. - // However, for "case 2", because parentNode which is caseClause has an "end" property to be end of the statements (in this case return statement) - // comment "// two" will not be emitted in emitNodeWithComments. - // Therefore, we have to do the check here to emit such comment. - if (statements.length > 0) { - // We use emitTrailingCommentsOfPosition instead of emitLeadingCommentsOfPosition because leading comments is defined as comments before the node after newline character separating it from previous line - // Note: we can't use parentNode.end as such position includes statements. - emitTrailingCommentsOfPosition(statements.pos); - } var format = 81985 /* CaseOrDefaultClauseStatements */; if (emitAsSingleStatement) { + writeToken(56 /* ColonToken */, colonPos, writePunctuation, parentNode); writeSpace(); format &= ~(1 /* MultiLine */ | 64 /* Indented */); } + else { + emitTokenWithComment(56 /* ColonToken */, colonPos, writePunctuation, parentNode); + } emitList(parentNode, statements, format); } function emitHeritageClause(node) { @@ -72568,12 +74328,12 @@ var ts; emitList(node, node.types, 272 /* HeritageClauseTypes */); } function emitCatchClause(node) { - var openParenPos = writeToken(74 /* CatchKeyword */, node.pos, writeKeyword); + var openParenPos = emitTokenWithComment(74 /* CatchKeyword */, node.pos, writeKeyword, node); writeSpace(); if (node.variableDeclaration) { - writeToken(19 /* OpenParenToken */, openParenPos, writePunctuation); + emitTokenWithComment(19 /* OpenParenToken */, openParenPos, writePunctuation, node); emit(node.variableDeclaration); - writeToken(20 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation); + emitTokenWithComment(20 /* CloseParenToken */, node.variableDeclaration.end, writePunctuation, node); writeSpace(); } emit(node.block); @@ -72619,7 +74379,7 @@ var ts; // function emitEnumMember(node) { emit(node.name); - emitInitializer(node.initializer); + emitInitializer(node.initializer, node.name.end, node); } // // Top-level nodes @@ -72736,10 +74496,10 @@ var ts; emit(node); } } - function emitInitializer(node) { + function emitInitializer(node, equalCommentStartPos, container) { if (node) { writeSpace(); - writeOperator("="); + emitTokenWithComment(58 /* EqualsToken */, equalCommentStartPos, writeOperator, container); writeSpace(); emitExpression(node); } @@ -72787,7 +74547,7 @@ var ts; emitList(parentNode, typeArguments, 26896 /* TypeArguments */); } function emitTypeParameters(parentNode, typeParameters) { - if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { + if (ts.isFunctionLike(parentNode) && parentNode.typeArguments) { // Quick info uses type arguments in place of type parameters on instantiated signatures return emitTypeArguments(parentNode, parentNode.typeArguments); } emitList(parentNode, typeParameters, 26896 /* TypeParameters */); @@ -72864,6 +74624,9 @@ var ts; } if (format & 7680 /* BracketsMask */) { writePunctuation(getOpeningBracket(format)); + if (isEmpty) { + emitTrailingCommentsOfPosition(children.pos, /*prefixSpace*/ true); // Emit comments within empty bracketed lists + } } if (onBeforeEmitNodeArray) { onBeforeEmitNodeArray(children); @@ -72971,6 +74734,9 @@ var ts; onAfterEmitNodeArray(children); } if (format & 7680 /* BracketsMask */) { + if (isEmpty) { + emitLeadingCommentsOfPosition(children.end); // Emit leading comments within empty lists + } writePunctuation(getClosingBracket(format)); } } @@ -73207,7 +74973,7 @@ var ts; && ts.rangeEndIsOnSameLineAsRangeStart(block, block, currentSourceFile); } function skipSynthesizedParentheses(node) { - while (node.kind === 186 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { + while (node.kind === 189 /* ParenthesizedExpression */ && ts.nodeIsSynthesized(node)) { node = node.expression; } return node; @@ -73316,7 +75082,7 @@ var ts; if (node.locals) { var local = node.locals.get(ts.escapeLeadingUnderscores(name)); // We conservatively include alias symbols to cover cases where they're emitted as locals - if (local && local.flags & (107455 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { + if (local && local.flags & (67216319 /* Value */ | 1048576 /* ExportValue */ | 2097152 /* Alias */)) { return false; } } @@ -73419,21 +75185,21 @@ var ts; switch (node.kind) { case 71 /* Identifier */: return makeUniqueName(getTextOfNode(node)); - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: return generateNameForModuleOrEnum(node); - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return generateNameForImportOrExportDeclaration(node); - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - case 244 /* ExportAssignment */: + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + case 247 /* ExportAssignment */: return generateNameForExportDefault(); - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: return generateNameForClassExpression(); - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return generateNameForMethodOrAccessor(node); default: return makeTempVariableName(0 /* Auto */); @@ -73551,7 +75317,7 @@ var ts; if (failed) { return ""; } - if (!commonPathComponents) { + if (!commonPathComponents) { // Can happen when all input files are .d.ts files return currentDirectory; } return ts.getNormalizedPathFromPathComponents(commonPathComponents); @@ -73683,8 +75449,7 @@ var ts; } ts.formatDiagnostics = formatDiagnostics; function formatDiagnostic(diagnostic, host) { - var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - var errorMessage = category + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine(); + var errorMessage = ts.diagnosticCategoryName(diagnostic) + " TS" + diagnostic.code + ": " + flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()) + host.getNewLine(); if (diagnostic.file) { var _a = ts.getLineAndCharacterOfPosition(diagnostic.file, diagnostic.start), line = _a.line, character = _a.character; var fileName = diagnostic.file.fileName; @@ -73709,8 +75474,9 @@ var ts; var ellipsis = "..."; function getCategoryFormat(category) { switch (category) { - case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red; + case ts.DiagnosticCategory.Warning: return ForegroundColorEscapeSequences.Yellow; + case ts.DiagnosticCategory.Suggestion: return ts.Debug.fail("Should never get an Info diagnostic on the command line."); case ts.DiagnosticCategory.Message: return ForegroundColorEscapeSequences.Blue; } } @@ -73741,8 +75507,8 @@ var ts; if (hasMoreThanFiveLines) { gutterWidth = Math.max(ellipsis.length, gutterWidth); } - context += host.getNewLine(); for (var i = firstLine; i <= lastLine; i++) { + context += host.getNewLine(); // If the error spans over 5 lines, we'll only show the first 2 and last 2 lines, // so we'll skip ahead to the second-to-last line. if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) { @@ -73783,9 +75549,7 @@ var ts; output += formatColorAndReset("" + (firstLineChar + 1), ForegroundColorEscapeSequences.Yellow); output += " - "; } - var categoryColor = getCategoryFormat(diagnostic.category); - var category = ts.DiagnosticCategory[diagnostic.category].toLowerCase(); - output += formatColorAndReset(category, categoryColor); + output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category)); output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey); output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine()); if (diagnostic.file) { @@ -73844,7 +75608,7 @@ var ts; */ /* @internal */ function isProgramUptoDate(program, rootFileNames, newOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames) { - // If we haven't create a program yet or has changed automatic type directives, then it is not up-to-date + // If we haven't created a program yet or have changed automatic type directives, then it is not up-to-date if (!program || hasChangedAutomaticTypeDirectiveNames) { return false; } @@ -73878,10 +75642,10 @@ var ts; } ts.isProgramUptoDate = isProgramUptoDate; /** - * Determined if source file needs to be re-created even if its text hasnt changed + * Determined if source file needs to be re-created even if its text hasn't changed */ function shouldProgramCreateNewSourceFiles(program, newOptions) { - // If any of these options change, we cant reuse old source file even if version match + // If any of these options change, we can't reuse old source file even if version match // The change in options like these could result in change in syntax tree change var oldOptions = program && program.getCompilerOptions(); return oldOptions && (oldOptions.target !== newOptions.target || @@ -74638,22 +76402,22 @@ var ts; // Return directly from the case if the given node doesnt want to visit each child // Otherwise break to visit each child switch (parent.kind) { - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: if (parent.questionToken === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, "?")); return; } // falls through - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 227 /* VariableDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 230 /* VariableDeclaration */: // type annotation if (parent.type === node) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.types_can_only_be_used_in_a_ts_file)); @@ -74661,41 +76425,41 @@ var ts; } } switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.import_can_only_be_used_in_a_ts_file)); return; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: if (node.isExportEquals) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.export_can_only_be_used_in_a_ts_file)); return; } break; - case 263 /* HeritageClause */: + case 266 /* HeritageClause */: var heritageClause = node; if (heritageClause.token === 108 /* ImplementsKeyword */) { diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.implements_clauses_can_only_be_used_in_a_ts_file)); return; } break; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.interface_declarations_can_only_be_used_in_a_ts_file)); return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.module_declarations_can_only_be_used_in_a_ts_file)); return; - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.type_aliases_can_only_be_used_in_a_ts_file)); return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.enum_declarations_can_only_be_used_in_a_ts_file)); return; - case 204 /* NonNullExpression */: + case 207 /* NonNullExpression */: diagnostics.push(createDiagnosticForNode(node, ts.Diagnostics.non_null_assertions_can_only_be_used_in_a_ts_file)); return; - case 203 /* AsExpression */: + case 206 /* AsExpression */: diagnostics.push(createDiagnosticForNode(node.type, ts.Diagnostics.type_assertion_expressions_can_only_be_used_in_a_ts_file)); return; - case 185 /* TypeAssertionExpression */: + case 188 /* TypeAssertionExpression */: ts.Debug.fail(); // Won't parse these in a JS file anyway, as they are interpreted as JSX. } var prevParent = parent; @@ -74708,28 +76472,28 @@ var ts; diagnostics.push(createDiagnosticForNode(parent, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning)); } switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: + case 233 /* ClassDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: // Check type parameters if (nodes === parent.typeParameters) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_parameter_declarations_can_only_be_used_in_a_ts_file)); return; } // falls through - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Check modifiers if (nodes === parent.modifiers) { - return checkModifiers(nodes, parent.kind === 209 /* VariableStatement */); + return checkModifiers(nodes, parent.kind === 212 /* VariableStatement */); } break; - case 150 /* PropertyDeclaration */: + case 151 /* PropertyDeclaration */: // Check modifiers of property declaration if (nodes === parent.modifiers) { for (var _i = 0, _a = nodes; _i < _a.length; _i++) { @@ -74741,16 +76505,16 @@ var ts; return; } break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Check modifiers of parameter declaration if (nodes === parent.modifiers) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.parameter_modifiers_can_only_be_used_in_a_ts_file)); return; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: // Check type arguments if (nodes === parent.typeArguments) { diagnostics.push(createDiagnosticForNodeArray(nodes, ts.Diagnostics.type_arguments_can_only_be_used_in_a_ts_file)); @@ -74776,7 +76540,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 124 /* DeclareKeyword */: case 117 /* AbstractKeyword */: diagnostics.push(createDiagnosticForNode(modifier, ts.Diagnostics._0_can_only_be_used_in_a_ts_file, ts.tokenToString(modifier.kind))); @@ -74884,9 +76648,9 @@ var ts; return; function collectModuleReferences(node, inAmbientModule) { switch (node.kind) { - case 239 /* ImportDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 245 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 248 /* ExportDeclaration */: var moduleNameExpr = ts.getExternalModuleName(node); if (!moduleNameExpr || !ts.isStringLiteral(moduleNameExpr)) { break; @@ -74901,7 +76665,7 @@ var ts; (imports || (imports = [])).push(moduleNameExpr); } break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node) && (inAmbientModule || ts.hasModifier(node, 2 /* Ambient */) || file.isDeclarationFile)) { var moduleName = node.name; var nameText = ts.getTextOfIdentifierOrLiteral(moduleName); @@ -74938,6 +76702,7 @@ var ts; if (ts.isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) { (imports || (imports = [])).push(node.arguments[0]); } + // we have to check the argument list has length of 1. We will still have to process these even though we have parsing error. else if (ts.isImportCall(node) && node.arguments.length === 1 && node.arguments[0].kind === 9 /* StringLiteral */) { (imports || (imports = [])).push(node.arguments[0]); } @@ -75038,6 +76803,7 @@ var ts; modulesWithElidedImports.set(file_1.path, false); processImportedModules(file_1); } + // See if we need to reprocess the imports due to prior skipped imports else if (file_1 && modulesWithElidedImports.get(file_1.path)) { if (currentNodeModulesDepth < maxNodeModuleJsDepth) { modulesWithElidedImports.set(file_1.path, false); @@ -75376,7 +77142,7 @@ var ts; // if user specified --mapRoot, there needs to be common source directory if there would be multiple files being emitted if (options.outDir || // there is --outDir specified options.sourceRoot || // there is --sourceRoot specified - options.mapRoot) { + options.mapRoot) { // there is --mapRoot specified // Precalculate and cache the common source directory var dir = getCommonSourceDirectory(); // If we failed to find a good common directory, but outDir is specified and at least one of our files is on a windows drive/URL/other resource, add a failure @@ -75392,7 +77158,7 @@ var ts; } if (options.emitDeclarationOnly) { if (!options.declaration) { - createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declarations"); + createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "emitDeclarationOnly", "declaration"); } if (options.noEmit) { createDiagnosticForOptionName(ts.Diagnostics.Option_0_cannot_be_specified_with_option_1, "emitDeclarationOnly", "noEmit"); @@ -75603,7 +77369,6 @@ var ts; if (aug.kind === 9 /* StringLiteral */) { res.push(aug.text); } - // Do nothing if it's an Identifier; we don't need to do module resolution for `declare global`. } return res; } @@ -75920,14 +77685,8 @@ var ts; var ts; (function (ts) { function hasSameKeys(map1, map2) { - if (map1 === undefined) { - return map2 === undefined; - } - if (map2 === undefined) { - return map1 === undefined; - } // Has same size and every key is present in both maps - return map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); }); + return map1 === map2 || map1 && map2 && map1.size === map2.size && !ts.forEachKey(map1, function (key) { return !map2.has(key); }); } /** * Create the state so that we can iterate on changedFiles/affected files @@ -76485,7 +78244,7 @@ var ts; createNewValue: createMissingFileWatch, // Files that are no longer missing (e.g. because they are no longer required) // should no longer be watched. - onDeleteValue: closeFileWatcher + onDeleteValue: ts.closeFileWatcher }); } ts.updateMissingFilePathsWatch = updateMissingFilePathsWatch; @@ -76528,75 +78287,74 @@ var ts; return program.isEmittedFile(file); } ts.isEmittedFileOfProgram = isEmittedFileOfProgram; - function addFileWatcher(host, file, cb) { - return host.watchFile(file, cb); + var WatchLogLevel; + (function (WatchLogLevel) { + WatchLogLevel[WatchLogLevel["None"] = 0] = "None"; + WatchLogLevel[WatchLogLevel["TriggerOnly"] = 1] = "TriggerOnly"; + WatchLogLevel[WatchLogLevel["Verbose"] = 2] = "Verbose"; + })(WatchLogLevel = ts.WatchLogLevel || (ts.WatchLogLevel = {})); + function getWatchFactory(watchLogLevel, log, getDetailWatchInfo) { + return getWatchFactoryWith(watchLogLevel, log, getDetailWatchInfo, watchFile, watchDirectory); } - ts.addFileWatcher = addFileWatcher; - function addFileWatcherWithLogging(host, file, cb, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb); - } - ts.addFileWatcherWithLogging = addFileWatcherWithLogging; - function addFileWatcherWithOnlyTriggerLogging(host, file, cb, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb); - } - ts.addFileWatcherWithOnlyTriggerLogging = addFileWatcherWithOnlyTriggerLogging; - function addFilePathWatcher(host, file, cb, path) { - return host.watchFile(file, function (fileName, eventKind) { return cb(fileName, eventKind, path); }); - } - ts.addFilePathWatcher = addFilePathWatcher; - function addFilePathWatcherWithLogging(host, file, cb, path, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, file, cb, path); - } - ts.addFilePathWatcherWithLogging = addFilePathWatcherWithLogging; - function addFilePathWatcherWithOnlyTriggerLogging(host, file, cb, path, log) { - var watcherCaption = "FileWatcher:: "; - return createWatcherWithLogging(addFileWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, file, cb, path); - } - ts.addFilePathWatcherWithOnlyTriggerLogging = addFilePathWatcherWithOnlyTriggerLogging; - function addDirectoryWatcher(host, directory, cb, flags) { - var recursive = (flags & 1 /* Recursive */) !== 0; - return host.watchDirectory(directory, cb, recursive); - } - ts.addDirectoryWatcher = addDirectoryWatcher; - function addDirectoryWatcherWithLogging(host, directory, cb, flags, log) { - var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; - return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ false, host, directory, cb, flags); - } - ts.addDirectoryWatcherWithLogging = addDirectoryWatcherWithLogging; - function addDirectoryWatcherWithOnlyTriggerLogging(host, directory, cb, flags, log) { - var watcherCaption = "DirectoryWatcher " + ((flags & 1 /* Recursive */) !== 0 ? "recursive" : "") + ":: "; - return createWatcherWithLogging(addDirectoryWatcher, watcherCaption, log, /*logOnlyTrigger*/ true, host, directory, cb, flags); - } - ts.addDirectoryWatcherWithOnlyTriggerLogging = addDirectoryWatcherWithOnlyTriggerLogging; - function createWatcherWithLogging(addWatch, watcherCaption, log, logOnlyTrigger, host, file, cb, optional) { - var info = "PathInfo: " + file; - if (!logOnlyTrigger) { - log(watcherCaption + "Added: " + info); + ts.getWatchFactory = getWatchFactory; + function getWatchFactoryWith(watchLogLevel, log, getDetailWatchInfo, watchFile, watchDirectory) { + var createFileWatcher = getCreateFileWatcher(watchLogLevel, watchFile); + var createFilePathWatcher = watchLogLevel === WatchLogLevel.None ? watchFilePath : createFileWatcher; + var createDirectoryWatcher = getCreateFileWatcher(watchLogLevel, watchDirectory); + return { + watchFile: function (host, file, callback, pollingInterval, detailInfo1, detailInfo2) { + return createFileWatcher(host, file, callback, pollingInterval, /*passThrough*/ undefined, detailInfo1, detailInfo2, watchFile, log, "FileWatcher", getDetailWatchInfo); + }, + watchFilePath: function (host, file, callback, pollingInterval, path, detailInfo1, detailInfo2) { + return createFilePathWatcher(host, file, callback, pollingInterval, path, detailInfo1, detailInfo2, watchFile, log, "FileWatcher", getDetailWatchInfo); + }, + watchDirectory: function (host, directory, callback, flags, detailInfo1, detailInfo2) { + return createDirectoryWatcher(host, directory, callback, flags, /*passThrough*/ undefined, detailInfo1, detailInfo2, watchDirectory, log, "DirectoryWatcher", getDetailWatchInfo); + } + }; + function watchFilePath(host, file, callback, pollingInterval, path) { + return watchFile(host, file, function (fileName, eventKind) { return callback(fileName, eventKind, path); }, pollingInterval); } - var watcher = addWatch(host, file, function (fileName, cbOptional1) { - var optionalInfo = cbOptional1 !== undefined ? " " + cbOptional1 : ""; - log(watcherCaption + "Trigger: " + fileName + optionalInfo + " " + info); - var start = ts.timestamp(); - cb(fileName, cbOptional1, optional); - var elapsed = ts.timestamp() - start; - log(watcherCaption + "Elapsed: " + elapsed + "ms Trigger: " + fileName + optionalInfo + " " + info); - }, optional); + } + function watchFile(host, file, callback, pollingInterval) { + return host.watchFile(file, callback, pollingInterval); + } + function watchDirectory(host, directory, callback, flags) { + return host.watchDirectory(directory, callback, (flags & 1 /* Recursive */) !== 0); + } + function getCreateFileWatcher(watchLogLevel, addWatch) { + switch (watchLogLevel) { + case WatchLogLevel.None: + return addWatch; + case WatchLogLevel.TriggerOnly: + return createFileWatcherWithTriggerLogging; + case WatchLogLevel.Verbose: + return createFileWatcherWithLogging; + } + } + function createFileWatcherWithLogging(host, file, cb, flags, passThrough, detailInfo1, detailInfo2, addWatch, log, watchCaption, getDetailWatchInfo) { + log(watchCaption + ":: Added:: " + getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo)); + var watcher = createFileWatcherWithTriggerLogging(host, file, cb, flags, passThrough, detailInfo1, detailInfo2, addWatch, log, watchCaption, getDetailWatchInfo); return { close: function () { - if (!logOnlyTrigger) { - log(watcherCaption + "Close: " + info); - } + log(watchCaption + ":: Close:: " + getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo)); watcher.close(); } }; } - function closeFileWatcher(watcher) { - watcher.close(); + function createFileWatcherWithTriggerLogging(host, file, cb, flags, passThrough, detailInfo1, detailInfo2, addWatch, log, watchCaption, getDetailWatchInfo) { + return addWatch(host, file, function (fileName, cbOptional) { + var triggerredInfo = watchCaption + ":: Triggered with " + fileName + (cbOptional !== undefined ? cbOptional : "") + ":: " + getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo); + log(triggerredInfo); + var start = ts.timestamp(); + cb(fileName, cbOptional, passThrough); + var elapsed = ts.timestamp() - start; + log("Elapsed:: " + elapsed + "ms " + triggerredInfo); + }, flags); + } + function getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo) { + return "WatchInfo: " + file + " " + flags + " " + (getDetailWatchInfo ? getDetailWatchInfo(detailInfo1, detailInfo2) : ""); } - ts.closeFileWatcher = closeFileWatcher; function closeFileWatcherOf(objWithWatcher) { objWithWatcher.watcher.close(); } @@ -76613,15 +78371,17 @@ var ts; var filesWithChangedSetOfUnresolvedImports; var filesWithInvalidatedResolutions; var allFilesHaveInvalidatedResolution = false; + var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); + var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); // The resolvedModuleNames and resolvedTypeReferenceDirectives are the cache of resolutions per file. // The key in the map is source file's path. // The values are Map of resolutions with key being name lookedup. var resolvedModuleNames = ts.createMap(); var perDirectoryResolvedModuleNames = ts.createMap(); + var nonRelaticeModuleNameCache = ts.createMap(); + var moduleResolutionCache = ts.createModuleResolutionCacheWithMaps(perDirectoryResolvedModuleNames, nonRelaticeModuleNameCache, getCurrentDirectory(), resolutionHost.getCanonicalFileName); var resolvedTypeReferenceDirectives = ts.createMap(); var perDirectoryResolvedTypeReferenceDirectives = ts.createMap(); - var getCurrentDirectory = ts.memoize(function () { return resolutionHost.getCurrentDirectory(); }); - var cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); /** * These are the extensions that failed lookup files will have by default, * any other extension of failed lookup will be store that path in custom failed lookup path @@ -76694,6 +78454,7 @@ var ts; } function clearPerDirectoryResolutions() { perDirectoryResolvedModuleNames.clear(); + nonRelaticeModuleNameCache.clear(); perDirectoryResolvedTypeReferenceDirectives.clear(); } function finishCachingPerDirectoryResolution() { @@ -76707,7 +78468,7 @@ var ts; clearPerDirectoryResolutions(); } function resolveModuleName(moduleName, containingFile, compilerOptions, host) { - var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host); + var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache); // return result immediately only if global cache support is not enabled or if it is .ts, .tsx or .d.ts if (!resolutionHost.getGlobalCache) { return primaryResult; @@ -76753,15 +78514,8 @@ var ts; perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - if (resolution.failedLookupLocations) { - if (existingResolution && existingResolution.failedLookupLocations) { - watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution); - } - else { - watchFailedLookupLocationOfResolution(resolution, 0); - } - } - else if (existingResolution) { + watchFailedLookupLocationOfResolution(resolution); + if (existingResolution) { stopWatchFailedLookupLocationOfResolution(existingResolution); } if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) { @@ -76841,8 +78595,9 @@ var ts; if (isInDirectoryPath(rootPath, failedLookupLocationPath)) { return { dir: rootDir, dirPath: rootPath }; } - var dir = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())); - var dirPath = ts.getDirectoryPath(failedLookupLocationPath); + return getDirectoryToWatchFromFailedLookupLocationDirectory(ts.getDirectoryPath(ts.getNormalizedAbsolutePath(failedLookupLocation, getCurrentDirectory())), ts.getDirectoryPath(failedLookupLocationPath)); + } + function getDirectoryToWatchFromFailedLookupLocationDirectory(dir, dirPath) { // If directory path contains node module, get the most parent node_modules directory for watching while (ts.stringContains(dirPath, "/node_modules/")) { dir = ts.getDirectoryPath(dir); @@ -76868,78 +78623,91 @@ var ts; function isPathWithDefaultFailedLookupExtension(path) { return ts.fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchAndStopWatchDiffFailedLookupLocations(resolution, existingResolution) { - var failedLookupLocations = resolution.failedLookupLocations; - var existingFailedLookupLocations = existingResolution.failedLookupLocations; - for (var index = 0; index < failedLookupLocations.length; index++) { - if (index === existingFailedLookupLocations.length) { - // Additional failed lookup locations, watch from this index - watchFailedLookupLocationOfResolution(resolution, index); - return; - } - else if (failedLookupLocations[index] !== existingFailedLookupLocations[index]) { - // Different failed lookup locations, - // Watch new resolution failed lookup locations from this index and - // stop watching existing resolutions from this index - watchFailedLookupLocationOfResolution(resolution, index); - stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, index); - return; - } + function watchFailedLookupLocationOfResolution(resolution) { + // No need to set the resolution refCount + if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { + return; } - // All new failed lookup locations are already watched (and are same), - // Stop watching failed lookup locations of existing resolution after failed lookup locations length - stopWatchFailedLookupLocationOfResolutionFrom(existingResolution, failedLookupLocations.length); - } - function watchFailedLookupLocationOfResolution(_a, startIndex) { - var failedLookupLocations = _a.failedLookupLocations; - for (var i = startIndex; i < failedLookupLocations.length; i++) { - var failedLookupLocation = failedLookupLocations[i]; + if (resolution.refCount !== undefined) { + resolution.refCount++; + return; + } + resolution.refCount = 1; + var failedLookupLocations = resolution.failedLookupLocations; + var setAtRoot = false; + for (var _i = 0, failedLookupLocations_1 = failedLookupLocations; _i < failedLookupLocations_1.length; _i++) { + var failedLookupLocation = failedLookupLocations_1[_i]; var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - // If the failed lookup location path is not one of the supported extensions, - // store it in the custom path - if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { - var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; - customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); - } - var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _b.dir, dirPath = _b.dirPath, ignore = _b.ignore; + var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dir = _a.dir, dirPath = _a.dirPath, ignore = _a.ignore; if (!ignore) { - var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - if (dirWatcher) { - dirWatcher.refCount++; + // If the failed lookup location path is not one of the supported extensions, + // store it in the custom path + if (!isPathWithDefaultFailedLookupExtension(failedLookupLocationPath)) { + var refCount = customFailedLookupPaths.get(failedLookupLocationPath) || 0; + customFailedLookupPaths.set(failedLookupLocationPath, refCount + 1); + } + if (dirPath === rootPath) { + setAtRoot = true; } else { - directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); + setDirectoryWatcher(dir, dirPath); } } } + if (setAtRoot) { + setDirectoryWatcher(rootDir, rootPath); + } + } + function setDirectoryWatcher(dir, dirPath) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + if (dirWatcher) { + dirWatcher.refCount++; + } + else { + directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath), refCount: 1 }); + } } function stopWatchFailedLookupLocationOfResolution(resolution) { - if (resolution.failedLookupLocations) { - stopWatchFailedLookupLocationOfResolutionFrom(resolution, 0); + if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { + return; } - } - function stopWatchFailedLookupLocationOfResolutionFrom(_a, startIndex) { - var failedLookupLocations = _a.failedLookupLocations; - for (var i = startIndex; i < failedLookupLocations.length; i++) { - var failedLookupLocation = failedLookupLocations[i]; + resolution.refCount--; + if (resolution.refCount) { + return; + } + var failedLookupLocations = resolution.failedLookupLocations; + var removeAtRoot = false; + for (var _i = 0, failedLookupLocations_2 = failedLookupLocations; _i < failedLookupLocations_2.length; _i++) { + var failedLookupLocation = failedLookupLocations_2[_i]; var failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation); - var refCount = customFailedLookupPaths.get(failedLookupLocationPath); - if (refCount) { - if (refCount === 1) { - customFailedLookupPaths.delete(failedLookupLocationPath); + var _a = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _a.dirPath, ignore = _a.ignore; + if (!ignore) { + var refCount = customFailedLookupPaths.get(failedLookupLocationPath); + if (refCount) { + if (refCount === 1) { + customFailedLookupPaths.delete(failedLookupLocationPath); + } + else { + ts.Debug.assert(refCount > 1); + customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + } + } + if (dirPath === rootPath) { + removeAtRoot = true; } else { - ts.Debug.assert(refCount > 1); - customFailedLookupPaths.set(failedLookupLocationPath, refCount - 1); + removeDirectoryWatcher(dirPath); } } - var _b = getDirectoryToWatchFailedLookupLocation(failedLookupLocation, failedLookupLocationPath), dirPath = _b.dirPath, ignore = _b.ignore; - if (!ignore) { - var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); - // Do not close the watcher yet since it might be needed by other failed lookup locations. - dirWatcher.refCount--; - } } + if (removeAtRoot) { + removeDirectoryWatcher(rootPath); + } + } + function removeDirectoryWatcher(dirPath) { + var dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); + // Do not close the watcher yet since it might be needed by other failed lookup locations. + dirWatcher.refCount--; } function createDirectoryWatcher(directory, dirPath) { return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, function (fileOrDirectory) { @@ -77026,7 +78794,8 @@ var ts; // Some file or directory in the watching directory is created // Return early if it does not have any of the watching extension or not the custom failed lookup path var dirOfFileOrDirectory = ts.getDirectoryPath(fileOrDirectoryPath); - if (isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { + if (isNodeModulesAtTypesDirectory(fileOrDirectoryPath) || isNodeModulesDirectory(fileOrDirectoryPath) || + isNodeModulesAtTypesDirectory(dirOfFileOrDirectory) || isNodeModulesDirectory(dirOfFileOrDirectory)) { // Invalidate any resolution from this directory isChangedFailedLookupLocation = function (location) { var locationPath = resolutionHost.toPath(location); @@ -77055,7 +78824,17 @@ var ts; function closeTypeRootsWatch() { ts.clearMap(typeRootsWatches, ts.closeFileWatcher); } - function createTypeRootsWatch(_typeRootPath, typeRoot) { + function getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath) { + if (allFilesHaveInvalidatedResolution) { + return undefined; + } + if (isInDirectoryPath(rootPath, typeRootPath)) { + return rootPath; + } + var _a = getDirectoryToWatchFromFailedLookupLocationDirectory(typeRoot, typeRootPath), dirPath = _a.dirPath, ignore = _a.ignore; + return !ignore && directoryWatchesOfFailedLookups.has(dirPath) && dirPath; + } + function createTypeRootsWatch(typeRootPath, typeRoot) { // Create new watch and recursive info return resolutionHost.watchTypeRootsDirectory(typeRoot, function (fileOrDirectory) { var fileOrDirectoryPath = resolutionHost.toPath(fileOrDirectory); @@ -77067,6 +78846,12 @@ var ts; // We could potentially store more data here about whether it was/would be really be used or not // and with that determine to trigger compilation but for now this is enough resolutionHost.onChangedAutomaticTypeDirectiveNames(); + // Since directory watchers invoked are flaky, the failed lookup location events might not be triggered + // So handle to failed lookup locations here as well to ensure we are invalidating resolutions + var dirPath = getDirectoryToWatchFailedLookupLocationFromTypeRoot(typeRoot, typeRootPath); + if (dirPath && invalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath)) { + resolutionHost.onInvalidatedResolution(); + } }, 1 /* Recursive */); } /** @@ -77140,6 +78925,7 @@ var ts; ts.createDiagnosticReporter = createDiagnosticReporter; function clearScreenIfNotWatchingForFileChanges(system, diagnostic, options) { if (system.clearScreen && + !options.preserveWatchOutput && diagnostic.code !== ts.Diagnostics.Compilation_complete_Watching_for_file_changes.code && !options.extendedDiagnostics && !options.diagnostics) { @@ -77342,6 +79128,7 @@ var ts; } } ts.createWatchCompilerHost = createWatchCompilerHost; + var initialVersion = 1; function createWatchProgram(host) { var builderProgram; var reloadLevel; // level to indicate if the program needs to be reloaded from config file/just filenames etc @@ -77377,16 +79164,16 @@ var ts; parseConfigFile(); } var trace = host.trace && (function (s) { host.trace(s + newLine); }); - var loggingEnabled = trace && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics); - var writeLog = loggingEnabled ? trace : ts.noop; - var watchFile = compilerOptions.extendedDiagnostics ? ts.addFileWatcherWithLogging : loggingEnabled ? ts.addFileWatcherWithOnlyTriggerLogging : ts.addFileWatcher; - var watchFilePath = compilerOptions.extendedDiagnostics ? ts.addFilePathWatcherWithLogging : ts.addFilePathWatcher; - var watchDirectoryWorker = compilerOptions.extendedDiagnostics ? ts.addDirectoryWatcherWithLogging : ts.addDirectoryWatcher; - if (configFileName) { - watchFile(host, configFileName, scheduleProgramReload, writeLog); - } + var watchLogLevel = trace ? compilerOptions.extendedDiagnostics ? ts.WatchLogLevel.Verbose : + compilerOptions.diagnostis ? ts.WatchLogLevel.TriggerOnly : ts.WatchLogLevel.None : ts.WatchLogLevel.None; + var writeLog = watchLogLevel !== ts.WatchLogLevel.None ? trace : ts.noop; + var _b = ts.getWatchFactory(watchLogLevel, writeLog), watchFile = _b.watchFile, watchFilePath = _b.watchFilePath, watchDirectoryWorker = _b.watchDirectory; var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames); var newLine = updateNewLine(); + writeLog("Current directory: " + currentDirectory + " CaseSensitiveFileNames: " + useCaseSensitiveFileNames); + if (configFileName) { + watchFile(host, configFileName, scheduleProgramReload, ts.PollingInterval.High); + } var compilerHost = { // Members for CompilerHost getSourceFile: function (fileName, languageVersion, onError, shouldCreateNewSourceFile) { return getVersionedSourceFileByPath(fileName, toPath(fileName), languageVersion, onError, shouldCreateNewSourceFile); }, @@ -77463,6 +79250,11 @@ var ts; return builderProgram; } // Compile the program + if (watchLogLevel !== ts.WatchLogLevel.None) { + writeLog("CreatingProgramWith::"); + writeLog(" roots: " + JSON.stringify(rootFileNames)); + writeLog(" options: " + JSON.stringify(compilerOptions)); + } var needsUpdateInTypeRootWatch = hasChangedCompilerOptions || !program; hasChangedCompilerOptions = false; resolutionCache.startCachingPerDirectoryResolution(); @@ -77506,49 +79298,58 @@ var ts; function toPath(fileName) { return ts.toPath(fileName, currentDirectory, getCanonicalFileName); } + function isFileMissingOnHost(hostSourceFile) { + return typeof hostSourceFile === "number"; + } + function isFilePresentOnHost(hostSourceFile) { + return !!hostSourceFile.sourceFile; + } function fileExists(fileName) { var path = toPath(fileName); - var hostSourceFileInfo = sourceFilesCache.get(path); - if (hostSourceFileInfo !== undefined) { - return !ts.isString(hostSourceFileInfo); + // If file is missing on host from cache, we can definitely say file doesnt exist + // otherwise we need to ensure from the disk + if (isFileMissingOnHost(sourceFilesCache.get(path))) { + return true; } return directoryStructureHost.fileExists(fileName); } function getVersionedSourceFileByPath(fileName, path, languageVersion, onError, shouldCreateNewSourceFile) { var hostSourceFile = sourceFilesCache.get(path); // No source file on the host - if (ts.isString(hostSourceFile)) { + if (isFileMissingOnHost(hostSourceFile)) { return undefined; } // Create new source file if requested or the versions dont match - if (!hostSourceFile || shouldCreateNewSourceFile || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { + if (!hostSourceFile || shouldCreateNewSourceFile || !isFilePresentOnHost(hostSourceFile) || hostSourceFile.version.toString() !== hostSourceFile.sourceFile.version) { var sourceFile = getNewSourceFile(); if (hostSourceFile) { if (shouldCreateNewSourceFile) { hostSourceFile.version++; } if (sourceFile) { + // Set the source file and create file watcher now that file was present on the disk hostSourceFile.sourceFile = sourceFile; sourceFile.version = hostSourceFile.version.toString(); if (!hostSourceFile.fileWatcher) { - hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); + hostSourceFile.fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path); } } else { // There is no source file on host any more, close the watch, missing file paths will track it - hostSourceFile.fileWatcher.close(); - sourceFilesCache.set(path, hostSourceFile.version.toString()); + if (isFilePresentOnHost(hostSourceFile)) { + hostSourceFile.fileWatcher.close(); + } + sourceFilesCache.set(path, hostSourceFile.version); } } else { - var fileWatcher = void 0; if (sourceFile) { - sourceFile.version = "1"; - fileWatcher = watchFilePath(host, fileName, onSourceFileChange, path, writeLog); - sourceFilesCache.set(path, { sourceFile: sourceFile, version: 1, fileWatcher: fileWatcher }); + sourceFile.version = initialVersion.toString(); + var fileWatcher = watchFilePath(host, fileName, onSourceFileChange, ts.PollingInterval.Low, path); + sourceFilesCache.set(path, { sourceFile: sourceFile, version: initialVersion, fileWatcher: fileWatcher }); } else { - sourceFilesCache.set(path, "0"); + sourceFilesCache.set(path, initialVersion); } } return sourceFile; @@ -77570,19 +79371,21 @@ var ts; return text !== undefined ? ts.createSourceFile(fileName, text, languageVersion) : undefined; } } - function removeSourceFile(path) { + function nextSourceFileVersion(path) { var hostSourceFile = sourceFilesCache.get(path); if (hostSourceFile !== undefined) { - if (!ts.isString(hostSourceFile)) { - hostSourceFile.fileWatcher.close(); - resolutionCache.invalidateResolutionOfFile(path); + if (isFileMissingOnHost(hostSourceFile)) { + // The next version, lets set it as presence unknown file + sourceFilesCache.set(path, { version: Number(hostSourceFile) + 1 }); + } + else { + hostSourceFile.version++; } - sourceFilesCache.delete(path); } } function getSourceVersion(path) { var hostSourceFile = sourceFilesCache.get(path); - return !hostSourceFile || ts.isString(hostSourceFile) ? undefined : hostSourceFile.version.toString(); + return !hostSourceFile || isFileMissingOnHost(hostSourceFile) ? undefined : hostSourceFile.version.toString(); } function onReleaseOldSourceFile(oldSourceFile, _oldOptions) { var hostSourceFileInfo = sourceFilesCache.get(oldSourceFile.path); @@ -77592,10 +79395,13 @@ var ts; // there was version update and new source file was created. if (hostSourceFileInfo) { // record the missing file paths so they can be removed later if watchers arent tracking them - if (ts.isString(hostSourceFileInfo)) { + if (isFileMissingOnHost(hostSourceFileInfo)) { (missingFilePathsRequestedForRelease || (missingFilePathsRequestedForRelease = [])).push(oldSourceFile.path); } else if (hostSourceFileInfo.sourceFile === oldSourceFile) { + if (hostSourceFileInfo.fileWatcher) { + hostSourceFileInfo.fileWatcher.close(); + } sourceFilesCache.delete(oldSourceFile.path); resolutionCache.removeResolutionsOfFile(oldSourceFile.path); } @@ -77666,27 +79472,11 @@ var ts; } function onSourceFileChange(fileName, eventKind, path) { updateCachedSystemWithFile(fileName, path, eventKind); - var hostSourceFile = sourceFilesCache.get(path); - if (hostSourceFile) { - // Update the cache - if (eventKind === ts.FileWatcherEventKind.Deleted) { - resolutionCache.invalidateResolutionOfFile(path); - if (!ts.isString(hostSourceFile)) { - hostSourceFile.fileWatcher.close(); - sourceFilesCache.set(path, (++hostSourceFile.version).toString()); - } - } - else { - // Deleted file created - if (ts.isString(hostSourceFile)) { - sourceFilesCache.delete(path); - } - else { - // file changed - just update the version - hostSourceFile.version++; - } - } + // Update the source file cache + if (eventKind === ts.FileWatcherEventKind.Deleted && sourceFilesCache.get(path)) { + resolutionCache.invalidateResolutionOfFile(path); } + nextSourceFileVersion(path); // Update the program scheduleProgramUpdate(); } @@ -77696,10 +79486,10 @@ var ts; } } function watchDirectory(directory, cb, flags) { - return watchDirectoryWorker(host, directory, cb, flags, writeLog); + return watchDirectoryWorker(host, directory, cb, flags); } function watchMissingFilePath(missingFilePath) { - return watchFilePath(host, missingFilePath, onMissingFileChange, missingFilePath, writeLog); + return watchFilePath(host, missingFilePath, onMissingFileChange, ts.PollingInterval.Medium, missingFilePath); } function onMissingFileChange(fileName, eventKind, missingFilePath) { updateCachedSystemWithFile(fileName, missingFilePath, eventKind); @@ -77707,7 +79497,7 @@ var ts; missingFilesMap.get(missingFilePath).close(); missingFilesMap.delete(missingFilePath); // Delete the entry in the source files cache so that new source file is created - removeSourceFile(missingFilePath); + nextSourceFileVersion(missingFilePath); // When a missing file is created, we should update the graph. scheduleProgramUpdate(); } @@ -77725,16 +79515,10 @@ var ts; ts.Debug.assert(!!configFileName); var fileOrDirectoryPath = toPath(fileOrDirectory); // Since the file existance changed, update the sourceFiles cache - var result = cachedDirectoryStructureHost && cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); - // Instead of deleting the file, mark it as changed instead - // Many times node calls add/remove/file when watching directories recursively - var hostSourceFile = sourceFilesCache.get(fileOrDirectoryPath); - if (hostSourceFile && !ts.isString(hostSourceFile) && (result ? result.fileExists : directoryStructureHost.fileExists(fileOrDirectory))) { - hostSourceFile.version++; - } - else { - removeSourceFile(fileOrDirectoryPath); + if (cachedDirectoryStructureHost) { + cachedDirectoryStructureHost.addOrDeleteFileOrDirectory(fileOrDirectory, fileOrDirectoryPath); } + nextSourceFileVersion(fileOrDirectoryPath); // If the the added or created file or directory is not supported file name, ignore the file // But when watched directory is added/removed, we need to reload the file list if (fileOrDirectoryPath !== directory && ts.hasExtension(fileOrDirectoryPath) && !ts.isSupportedSourceFileName(fileOrDirectory, compilerOptions)) { @@ -77837,6 +79621,13 @@ var ts; category: ts.Diagnostics.Command_line_Options, description: ts.Diagnostics.Stylize_errors_and_messages_using_color_and_context_experimental }, + { + name: "preserveWatchOutput", + type: "boolean", + showInSimplifiedHelpView: false, + category: ts.Diagnostics.Command_line_Options, + description: ts.Diagnostics.Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen, + }, { name: "watch", shortName: "w", @@ -77918,9 +79709,10 @@ var ts; "es2017.string": "lib.es2017.string.d.ts", "es2017.intl": "lib.es2017.intl.d.ts", "es2017.typedarrays": "lib.es2017.typedarrays.d.ts", + "es2018.promise": "lib.es2018.promise.d.ts", + "es2018.regexp": "lib.es2018.regexp.d.ts", "esnext.array": "lib.esnext.array.d.ts", "esnext.asynciterable": "lib.esnext.asynciterable.d.ts", - "esnext.promise": "lib.esnext.promise.d.ts", }), }, showInSimplifiedHelpView: true, @@ -78782,7 +80574,7 @@ var ts; var result = {}; for (var _i = 0, _a = node.properties; _i < _a.length; _i++) { var element = _a[_i]; - if (element.kind !== 265 /* PropertyAssignment */) { + if (element.kind !== 268 /* PropertyAssignment */) { errors.push(ts.createDiagnosticForNodeInSourceFile(sourceFile, element, ts.Diagnostics.Property_assignment_expected)); continue; } @@ -78857,13 +80649,13 @@ var ts; case 8 /* NumericLiteral */: reportInvalidOptionValue(option && option.type !== "number"); return Number(valueExpression.text); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: if (valueExpression.operator !== 38 /* MinusToken */ || valueExpression.operand.kind !== 8 /* NumericLiteral */) { break; // not valid JSON syntax } reportInvalidOptionValue(option && option.type !== "number"); return -Number(valueExpression.operand.text); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: reportInvalidOptionValue(option && option.type !== "object"); var objectLiteralExpression = valueExpression; // Currently having element option declaration in the tsconfig with type "object" @@ -78880,7 +80672,7 @@ var ts; return convertObjectLiteralExpressionToJson(objectLiteralExpression, /* knownOptions*/ undefined, /*extraKeyDiagnosticMessage */ undefined, /*parentOption*/ undefined); } - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: reportInvalidOptionValue(option && option.type !== "list"); return convertArrayLiteralExpressionToJson(valueExpression.elements, option && option.element); } @@ -79385,7 +81177,7 @@ var ts; ts.convertTypeAcquisitionFromJson = convertTypeAcquisitionFromJson; function getDefaultCompilerOptions(configFileName) { var options = ts.getBaseFileName(configFileName) === "jsconfig.json" - ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true } + ? { allowJs: true, maxNodeModuleJsDepth: 2, allowSyntheticDefaultImports: true, skipLibCheck: true, noEmit: true } : {}; return options; } @@ -79572,7 +81364,7 @@ var ts; function getFileNamesFromConfigSpecs(spec, basePath, options, host, extraFileExtensions) { if (extraFileExtensions === void 0) { extraFileExtensions = []; } basePath = ts.normalizePath(basePath); - var keyMapper = host.useCaseSensitiveFileNames ? caseSensitiveKeyMapper : caseInsensitiveKeyMapper; + var keyMapper = host.useCaseSensitiveFileNames ? ts.identity : ts.toLowerCase; // Literal file names (provided via the "files" array in tsconfig.json) are stored in a // file map with a possibly case insensitive key. We use this map later when when including // wildcard paths. @@ -79762,22 +81554,6 @@ var ts; wildcardFiles.delete(lowerPriorityPath); } } - /** - * Gets a case sensitive key. - * - * @param key The original key. - */ - function caseSensitiveKeyMapper(key) { - return key; - } - /** - * Gets a case insensitive key. - * - * @param key The original key. - */ - function caseInsensitiveKeyMapper(key) { - return key.toLowerCase(); - } /** * Produces a cleaned version of compiler options with personally identifiying info (aka, paths) removed. * Also converts enum values back to strings. @@ -79788,7 +81564,7 @@ var ts; for (var key in opts) { if (opts.hasOwnProperty(key)) { var type = getOptionFromName(key); - if (type !== undefined) { + if (type !== undefined) { // Ignore unknown options out[key] = getOptionValueWithEmptyStrings(opts[key], type); } } @@ -79798,11 +81574,11 @@ var ts; ts.convertCompilerOptionsForTelemetry = convertCompilerOptionsForTelemetry; function getOptionValueWithEmptyStrings(value, option) { switch (option.type) { - case "object":// "paths". Can't get any useful information from the value since we blank out strings, so just return "". + case "object": // "paths". Can't get any useful information from the value since we blank out strings, so just return "". return ""; - case "string":// Could be any arbitrary string -- use empty string instead. + case "string": // Could be any arbitrary string -- use empty string instead. return ""; - case "number":// Allow numbers, but be sure to check it's actually a number. + case "number": // Allow numbers, but be sure to check it's actually a number. return typeof value === "number" ? value : ""; case "boolean": return typeof value === "boolean" ? value : ""; @@ -80067,36 +81843,36 @@ var ts; })(SemanticMeaning = ts.SemanticMeaning || (ts.SemanticMeaning = {})); function getMeaningFromDeclaration(node) { switch (node.kind) { - case 147 /* Parameter */: - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 266 /* ShorthandPropertyAssignment */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 264 /* CatchClause */: - case 257 /* JsxAttribute */: + case 148 /* Parameter */: + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 269 /* ShorthandPropertyAssignment */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 267 /* CatchClause */: + case 260 /* JsxAttribute */: return 1 /* Value */; - case 146 /* TypeParameter */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 164 /* TypeLiteral */: + case 147 /* TypeParameter */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 165 /* TypeLiteral */: return 2 /* Type */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: // If it has no name node, it shares the name with the value declaration below it. return node.name === undefined ? 1 /* Value */ | 2 /* Type */ : 2 /* Type */; - case 268 /* EnumMember */: - case 230 /* ClassDeclaration */: + case 271 /* EnumMember */: + case 233 /* ClassDeclaration */: return 1 /* Value */ | 2 /* Type */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.isAmbientModule(node)) { return 4 /* Namespace */ | 1 /* Value */; } @@ -80106,26 +81882,26 @@ var ts; else { return 4 /* Namespace */; } - case 233 /* EnumDeclaration */: - case 242 /* NamedImports */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 239 /* ImportDeclaration */: - case 244 /* ExportAssignment */: - case 245 /* ExportDeclaration */: + case 236 /* EnumDeclaration */: + case 245 /* NamedImports */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 242 /* ImportDeclaration */: + case 247 /* ExportAssignment */: + case 248 /* ExportDeclaration */: return 7 /* All */; // An external module can be a Value - case 269 /* SourceFile */: + case 272 /* SourceFile */: return 4 /* Namespace */ | 1 /* Value */; } return 7 /* All */; } ts.getMeaningFromDeclaration = getMeaningFromDeclaration; function getMeaningFromLocation(node) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return 1 /* Value */; } - else if (node.parent.kind === 244 /* ExportAssignment */) { + else if (node.parent.kind === 247 /* ExportAssignment */) { return 7 /* All */; } else if (isInRightSideOfInternalImportEqualsDeclaration(node)) { @@ -80150,19 +81926,14 @@ var ts; } ts.getMeaningFromLocation = getMeaningFromLocation; function getMeaningFromRightHandSideOfImportEquals(node) { - ts.Debug.assert(node.kind === 71 /* Identifier */); // import a = |b|; // Namespace // import a = |b.c|; // Value, type, namespace // import a = |b.c|.d; // Namespace - if (node.parent.kind === 144 /* QualifiedName */ && - node.parent.right === node && - node.parent.parent.kind === 238 /* ImportEqualsDeclaration */) { - return 1 /* Value */ | 2 /* Type */ | 4 /* Namespace */; - } - return 4 /* Namespace */; + var name = node.kind === 145 /* QualifiedName */ ? node : ts.isQualifiedName(node.parent) && node.parent.right === node ? node.parent : undefined; + return name && name.parent.kind === 241 /* ImportEqualsDeclaration */ ? 7 /* All */ : 4 /* Namespace */; } function isInRightSideOfInternalImportEqualsDeclaration(node) { - while (node.parent.kind === 144 /* QualifiedName */) { + while (node.parent.kind === 145 /* QualifiedName */) { node = node.parent; } return ts.isInternalModuleImportEqualsDeclaration(node.parent) && node.parent.moduleReference === node; @@ -80174,27 +81945,27 @@ var ts; function isQualifiedNameNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 144 /* QualifiedName */) { - while (root.parent && root.parent.kind === 144 /* QualifiedName */) { + if (root.parent.kind === 145 /* QualifiedName */) { + while (root.parent && root.parent.kind === 145 /* QualifiedName */) { root = root.parent; } isLastClause = root.right === node; } - return root.parent.kind === 160 /* TypeReference */ && !isLastClause; + return root.parent.kind === 161 /* TypeReference */ && !isLastClause; } function isPropertyAccessNamespaceReference(node) { var root = node; var isLastClause = true; - if (root.parent.kind === 180 /* PropertyAccessExpression */) { - while (root.parent && root.parent.kind === 180 /* PropertyAccessExpression */) { + if (root.parent.kind === 183 /* PropertyAccessExpression */) { + while (root.parent && root.parent.kind === 183 /* PropertyAccessExpression */) { root = root.parent; } isLastClause = root.name === node; } - if (!isLastClause && root.parent.kind === 202 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 263 /* HeritageClause */) { + if (!isLastClause && root.parent.kind === 205 /* ExpressionWithTypeArguments */ && root.parent.parent.kind === 266 /* HeritageClause */) { var decl = root.parent.parent.parent; - return (decl.kind === 230 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || - (decl.kind === 231 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); + return (decl.kind === 233 /* ClassDeclaration */ && root.parent.parent.token === 108 /* ImplementsKeyword */) || + (decl.kind === 234 /* InterfaceDeclaration */ && root.parent.parent.token === 85 /* ExtendsKeyword */); } return false; } @@ -80205,23 +81976,23 @@ var ts; switch (node.kind) { case 99 /* ThisKeyword */: return !ts.isExpressionNode(node); - case 170 /* ThisType */: + case 173 /* ThisType */: return true; } switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return true; - case 202 /* ExpressionWithTypeArguments */: + case 205 /* ExpressionWithTypeArguments */: return !ts.isExpressionWithTypeArgumentsInClassExtendsClause(node.parent); } return false; } function isCallExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 182 /* CallExpression */); + return isCallOrNewExpressionTarget(node, 185 /* CallExpression */); } ts.isCallExpressionTarget = isCallExpressionTarget; function isNewExpressionTarget(node) { - return isCallOrNewExpressionTarget(node, 183 /* NewExpression */); + return isCallOrNewExpressionTarget(node, 186 /* NewExpression */); } ts.isNewExpressionTarget = isNewExpressionTarget; function isCallOrNewExpressionTarget(node, kind) { @@ -80234,7 +82005,7 @@ var ts; ts.climbPastPropertyAccess = climbPastPropertyAccess; function getTargetLabel(referenceNode, labelName) { while (referenceNode) { - if (referenceNode.kind === 223 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { + if (referenceNode.kind === 226 /* LabeledStatement */ && referenceNode.label.escapedText === labelName) { return referenceNode.label; } referenceNode = referenceNode.parent; @@ -80243,30 +82014,27 @@ var ts; } ts.getTargetLabel = getTargetLabel; function isJumpStatementTarget(node) { - return node.kind === 71 /* Identifier */ && - (node.parent.kind === 219 /* BreakStatement */ || node.parent.kind === 218 /* ContinueStatement */) && - node.parent.label === node; + return node.kind === 71 /* Identifier */ && ts.isBreakOrContinueStatement(node.parent) && node.parent.label === node; } ts.isJumpStatementTarget = isJumpStatementTarget; function isLabelOfLabeledStatement(node) { - return node.kind === 71 /* Identifier */ && - node.parent.kind === 223 /* LabeledStatement */ && - node.parent.label === node; + return node.kind === 71 /* Identifier */ && ts.isLabeledStatement(node.parent) && node.parent.label === node; } + ts.isLabelOfLabeledStatement = isLabelOfLabeledStatement; function isLabelName(node) { return isLabelOfLabeledStatement(node) || isJumpStatementTarget(node); } ts.isLabelName = isLabelName; function isRightSideOfQualifiedName(node) { - return node.parent.kind === 144 /* QualifiedName */ && node.parent.right === node; + return node.parent.kind === 145 /* QualifiedName */ && node.parent.right === node; } ts.isRightSideOfQualifiedName = isRightSideOfQualifiedName; function isRightSideOfPropertyAccess(node) { - return node && node.parent && node.parent.kind === 180 /* PropertyAccessExpression */ && node.parent.name === node; + return node && node.parent && node.parent.kind === 183 /* PropertyAccessExpression */ && node.parent.name === node; } ts.isRightSideOfPropertyAccess = isRightSideOfPropertyAccess; function isNameOfModuleDeclaration(node) { - return node.parent.kind === 234 /* ModuleDeclaration */ && node.parent.name === node; + return node.parent.kind === 237 /* ModuleDeclaration */ && node.parent.name === node; } ts.isNameOfModuleDeclaration = isNameOfModuleDeclaration; function isNameOfFunctionDeclaration(node) { @@ -80276,22 +82044,22 @@ var ts; ts.isNameOfFunctionDeclaration = isNameOfFunctionDeclaration; function isLiteralNameOfPropertyDeclarationOrIndexAccess(node) { switch (node.parent.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 265 /* PropertyAssignment */: - case 268 /* EnumMember */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 234 /* ModuleDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 268 /* PropertyAssignment */: + case 271 /* EnumMember */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 237 /* ModuleDeclaration */: return ts.getNameOfDeclaration(node.parent) === node; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: return node.parent.argumentExpression === node; - case 145 /* ComputedPropertyName */: + case 146 /* ComputedPropertyName */: return true; - case 174 /* LiteralType */: - return node.parent.parent.kind === 172 /* IndexedAccessType */; + case 177 /* LiteralType */: + return node.parent.parent.kind === 175 /* IndexedAccessType */; } } ts.isLiteralNameOfPropertyDeclarationOrIndexAccess = isLiteralNameOfPropertyDeclarationOrIndexAccess; @@ -80301,7 +82069,7 @@ var ts; } ts.isExpressionOfExternalModuleImportEqualsDeclaration = isExpressionOfExternalModuleImportEqualsDeclaration; function getContainerNode(node) { - if (node.kind === 288 /* JSDocTypedefTag */) { + if (node.kind === 291 /* JSDocTypedefTag */) { // This doesn't just apply to the node immediately under the comment, but to everything in its parent's scope. // node.parent = the JSDoc comment, node.parent.parent = the node having the comment. // Then we get parent again in the loop. @@ -80313,17 +82081,17 @@ var ts; return undefined; } switch (node.kind) { - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return node; } } @@ -80331,48 +82099,48 @@ var ts; ts.getContainerNode = getContainerNode; function getNodeKind(node) { switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: return ts.isExternalModule(node) ? "module" /* moduleElement */ : "script" /* scriptElement */; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return "module" /* moduleElement */; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: return "class" /* classElement */; - case 231 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; - case 232 /* TypeAliasDeclaration */: return "type" /* typeElement */; - case 233 /* EnumDeclaration */: return "enum" /* enumElement */; - case 227 /* VariableDeclaration */: + case 234 /* InterfaceDeclaration */: return "interface" /* interfaceElement */; + case 235 /* TypeAliasDeclaration */: return "type" /* typeElement */; + case 236 /* EnumDeclaration */: return "enum" /* enumElement */; + case 230 /* VariableDeclaration */: return getKindOfVariableDeclaration(node); - case 177 /* BindingElement */: + case 180 /* BindingElement */: return getKindOfVariableDeclaration(ts.getRootDeclaration(node)); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return "function" /* functionElement */; - case 154 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; - case 155 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 155 /* GetAccessor */: return "getter" /* memberGetAccessorElement */; + case 156 /* SetAccessor */: return "setter" /* memberSetAccessorElement */; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return "method" /* memberFunctionElement */; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return "property" /* memberVariableElement */; - case 158 /* IndexSignature */: return "index" /* indexSignatureElement */; - case 157 /* ConstructSignature */: return "construct" /* constructSignatureElement */; - case 156 /* CallSignature */: return "call" /* callSignatureElement */; - case 153 /* Constructor */: return "constructor" /* constructorImplementationElement */; - case 146 /* TypeParameter */: return "type parameter" /* typeParameterElement */; - case 268 /* EnumMember */: return "enum member" /* enumMemberElement */; - case 147 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; - case 238 /* ImportEqualsDeclaration */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 247 /* ExportSpecifier */: - case 241 /* NamespaceImport */: + case 159 /* IndexSignature */: return "index" /* indexSignatureElement */; + case 158 /* ConstructSignature */: return "construct" /* constructSignatureElement */; + case 157 /* CallSignature */: return "call" /* callSignatureElement */; + case 154 /* Constructor */: return "constructor" /* constructorImplementationElement */; + case 147 /* TypeParameter */: return "type parameter" /* typeParameterElement */; + case 271 /* EnumMember */: return "enum member" /* enumMemberElement */; + case 148 /* Parameter */: return ts.hasModifier(node, 92 /* ParameterPropertyModifier */) ? "property" /* memberVariableElement */ : "parameter" /* parameterElement */; + case 241 /* ImportEqualsDeclaration */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 250 /* ExportSpecifier */: + case 244 /* NamespaceImport */: return "alias" /* alias */; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return "type" /* typeElement */; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: var kind = ts.getSpecialPropertyAssignmentKind(node); var right = node.right; switch (kind) { @@ -80389,6 +82157,8 @@ var ts; case 5 /* Property */: // static method / property return ts.isFunctionExpression(right) ? "method" /* memberFunctionElement */ : "property" /* memberVariableElement */; + case 6 /* Prototype */: + return "local class" /* localClassElement */; default: { ts.assertTypeIsNever(kind); return "" /* unknown */; @@ -80413,7 +82183,7 @@ var ts; return true; case 71 /* Identifier */: // 'this' as a parameter - return ts.identifierIsThisKeyword(node) && node.parent.kind === 147 /* Parameter */; + return ts.identifierIsThisKeyword(node) && node.parent.kind === 148 /* Parameter */; default: return false; } @@ -80462,42 +82232,42 @@ var ts; return false; } switch (n.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 179 /* ObjectLiteralExpression */: - case 175 /* ObjectBindingPattern */: - case 164 /* TypeLiteral */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 236 /* CaseBlock */: - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 182 /* ObjectLiteralExpression */: + case 178 /* ObjectBindingPattern */: + case 165 /* TypeLiteral */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 239 /* CaseBlock */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return nodeEndsWith(n, 18 /* CloseBraceToken */, sourceFile); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return isCompletedNode(n.block, sourceFile); - case 183 /* NewExpression */: + case 186 /* NewExpression */: if (!n.arguments) { return true; } // falls through - case 182 /* CallExpression */: - case 186 /* ParenthesizedExpression */: - case 169 /* ParenthesizedType */: + case 185 /* CallExpression */: + case 189 /* ParenthesizedExpression */: + case 172 /* ParenthesizedType */: return nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile); - case 161 /* FunctionType */: - case 162 /* ConstructorType */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: return isCompletedNode(n.type, sourceFile); - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 157 /* ConstructSignature */: - case 156 /* CallSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 158 /* ConstructSignature */: + case 157 /* CallSignature */: + case 191 /* ArrowFunction */: if (n.body) { return isCompletedNode(n.body, sourceFile); } @@ -80507,65 +82277,65 @@ var ts; // Even though type parameters can be unclosed, we can get away with // having at least a closing paren. return hasChildOfKind(n, 20 /* CloseParenToken */, sourceFile); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return n.body && isCompletedNode(n.body, sourceFile); - case 212 /* IfStatement */: + case 215 /* IfStatement */: if (n.elseStatement) { return isCompletedNode(n.elseStatement, sourceFile); } return isCompletedNode(n.thenStatement, sourceFile); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: return isCompletedNode(n.expression, sourceFile) || hasChildOfKind(n, 25 /* SemicolonToken */, sourceFile); - case 178 /* ArrayLiteralExpression */: - case 176 /* ArrayBindingPattern */: - case 181 /* ElementAccessExpression */: - case 145 /* ComputedPropertyName */: - case 166 /* TupleType */: + case 181 /* ArrayLiteralExpression */: + case 179 /* ArrayBindingPattern */: + case 184 /* ElementAccessExpression */: + case 146 /* ComputedPropertyName */: + case 167 /* TupleType */: return nodeEndsWith(n, 22 /* CloseBracketToken */, sourceFile); - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: if (n.type) { return isCompletedNode(n.type, sourceFile); } return hasChildOfKind(n, 22 /* CloseBracketToken */, sourceFile); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // there is no such thing as terminator token for CaseClause/DefaultClause so for simplicity always consider them non-completed return false; - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: return isCompletedNode(n.statement, sourceFile); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // rough approximation: if DoStatement has While keyword - then if node is completed is checking the presence of ')'; return hasChildOfKind(n, 106 /* WhileKeyword */, sourceFile) ? nodeEndsWith(n, 20 /* CloseParenToken */, sourceFile) : isCompletedNode(n.statement, sourceFile); - case 163 /* TypeQuery */: + case 164 /* TypeQuery */: return isCompletedNode(n.exprName, sourceFile); - case 190 /* TypeOfExpression */: - case 189 /* DeleteExpression */: - case 191 /* VoidExpression */: - case 198 /* YieldExpression */: - case 199 /* SpreadElement */: + case 193 /* TypeOfExpression */: + case 192 /* DeleteExpression */: + case 194 /* VoidExpression */: + case 201 /* YieldExpression */: + case 202 /* SpreadElement */: var unaryWordExpression = n; return isCompletedNode(unaryWordExpression.expression, sourceFile); - case 184 /* TaggedTemplateExpression */: + case 187 /* TaggedTemplateExpression */: return isCompletedNode(n.template, sourceFile); - case 197 /* TemplateExpression */: + case 200 /* TemplateExpression */: var lastSpan = ts.lastOrUndefined(n.templateSpans); return isCompletedNode(lastSpan, sourceFile); - case 206 /* TemplateSpan */: + case 209 /* TemplateSpan */: return ts.nodeIsPresent(n.literal); - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: return ts.nodeIsPresent(n.moduleSpecifier); - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: return isCompletedNode(n.operand, sourceFile); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: return isCompletedNode(n.right, sourceFile); - case 196 /* ConditionalExpression */: + case 199 /* ConditionalExpression */: return isCompletedNode(n.whenFalse, sourceFile); default: return true; @@ -80618,12 +82388,7 @@ var ts; // be parented by the container of the SyntaxList, not the SyntaxList itself. // In order to find the list item index, we first need to locate SyntaxList itself and then search // for the position of the relevant node (or comma). - var syntaxList = ts.forEach(node.parent.getChildren(), function (c) { - // find syntax list that covers the span of the node - if (ts.isSyntaxList(c) && c.pos <= node.pos && c.end >= node.end) { - return c; - } - }); + var syntaxList = ts.find(node.parent.getChildren(), function (c) { return ts.isSyntaxList(c) && rangeContainsRange(c, node); }); // Either we didn't find an appropriate list, or the list must contain us. ts.Debug.assert(!syntaxList || ts.contains(syntaxList.getChildren(), node)); return syntaxList; @@ -80739,19 +82504,11 @@ var ts; var result = find(startNode || sourceFile); ts.Debug.assert(!(result && isWhiteSpaceOnlyJsxText(result))); return result; - function findRightmostToken(n) { - if (ts.isToken(n)) { - return n; - } - var children = n.getChildren(); - var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } function find(n) { - if (ts.isToken(n)) { + if (isNonWhitespaceToken(n)) { return n; } - var children = n.getChildren(); + var children = n.getChildren(sourceFile); for (var i = 0; i < children.length; i++) { var child = children[i]; // Note that the span of a node's tokens is [node.getStart(...), node.end). @@ -80767,7 +82524,7 @@ var ts; if (lookInPreviousChild) { // actual start of the node is past the position - previous token should be at the end of previous child var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ i); - return candidate && findRightmostToken(candidate); + return candidate && findRightmostToken(candidate, sourceFile); } else { // candidate should be in this node @@ -80775,32 +82532,43 @@ var ts; } } } - ts.Debug.assert(startNode !== undefined || n.kind === 269 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); + ts.Debug.assert(startNode !== undefined || n.kind === 272 /* SourceFile */ || ts.isJSDocCommentContainingNode(n)); // Here we know that none of child token nodes embrace the position, // the only known case is when position is at the end of the file. // Try to find the rightmost token in the file without filtering. // Namely we are skipping the check: 'position < node.end' if (children.length) { var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); - return candidate && findRightmostToken(candidate); - } - } - /** - * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. - */ - function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { - for (var i = exclusiveStartPosition - 1; i >= 0; i--) { - var child = children[i]; - if (isWhiteSpaceOnlyJsxText(child)) { - ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); - } - else if (nodeHasTokens(children[i])) { - return children[i]; - } + return candidate && findRightmostToken(candidate, sourceFile); } } } ts.findPrecedingToken = findPrecedingToken; + function isNonWhitespaceToken(n) { + return ts.isToken(n) && !isWhiteSpaceOnlyJsxText(n); + } + function findRightmostToken(n, sourceFile) { + if (isNonWhitespaceToken(n)) { + return n; + } + var children = n.getChildren(sourceFile); + var candidate = findRightmostChildNodeWithTokens(children, /*exclusiveStartPosition*/ children.length); + return candidate && findRightmostToken(candidate, sourceFile); + } + /** + * Finds the rightmost child to the left of `children[exclusiveStartPosition]` which is a non-all-whitespace token or has constituent tokens. + */ + function findRightmostChildNodeWithTokens(children, exclusiveStartPosition) { + for (var i = exclusiveStartPosition - 1; i >= 0; i--) { + var child = children[i]; + if (isWhiteSpaceOnlyJsxText(child)) { + ts.Debug.assert(i > 0, "`JsxText` tokens should not be the first child of `JsxElement | JsxSelfClosingElement`"); + } + else if (nodeHasTokens(children[i])) { + return children[i]; + } + } + } function isInString(sourceFile, position, previousToken) { if (previousToken === void 0) { previousToken = findPrecedingToken(position, sourceFile); } if (previousToken && ts.isStringTextContainingNode(previousToken)) { @@ -80836,17 +82604,17 @@ var ts; return true; } //
{ |
or
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
{ // | // } < /div> - if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 260 /* JsxExpression */) { + if (token && token.kind === 18 /* CloseBraceToken */ && token.parent.kind === 263 /* JsxExpression */) { return true; } //
|
- if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 253 /* JsxClosingElement */) { + if (token.kind === 27 /* LessThanToken */ && token.parent.kind === 256 /* JsxClosingElement */) { return true; } return false; @@ -80855,12 +82623,107 @@ var ts; function isWhiteSpaceOnlyJsxText(node) { return ts.isJsxText(node) && node.containsOnlyWhiteSpaces; } - ts.isWhiteSpaceOnlyJsxText = isWhiteSpaceOnlyJsxText; function isInTemplateString(sourceFile, position) { var token = getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false); return ts.isTemplateLiteralKind(token.kind) && position > token.getStart(sourceFile); } ts.isInTemplateString = isInTemplateString; + function findPrecedingMatchingToken(token, matchingTokenKind, sourceFile) { + var tokenKind = token.kind; + var remainingMatchingTokens = 0; + while (true) { + token = findPrecedingToken(token.getFullStart(), sourceFile); + if (!token) { + return undefined; + } + if (token.kind === matchingTokenKind) { + if (remainingMatchingTokens === 0) { + return token; + } + remainingMatchingTokens--; + } + else if (token.kind === tokenKind) { + remainingMatchingTokens++; + } + } + } + ts.findPrecedingMatchingToken = findPrecedingMatchingToken; + function isPossiblyTypeArgumentPosition(token, sourceFile) { + // This function determines if the node could be type argument position + // Since during editing, when type argument list is not complete, + // the tree could be of any shape depending on the tokens parsed before current node, + // scanning of the previous identifier followed by "<" before current node would give us better result + // Note that we also balance out the already provided type arguments, arrays, object literals while doing so + var remainingLessThanTokens = 0; + while (token) { + switch (token.kind) { + case 27 /* LessThanToken */: + // Found the beginning of the generic argument expression + token = findPrecedingToken(token.getFullStart(), sourceFile); + var tokenIsIdentifier = token && ts.isIdentifier(token); + if (!remainingLessThanTokens || !tokenIsIdentifier) { + return tokenIsIdentifier; + } + remainingLessThanTokens--; + break; + case 47 /* GreaterThanGreaterThanGreaterThanToken */: + remainingLessThanTokens = +3; + break; + case 46 /* GreaterThanGreaterThanToken */: + remainingLessThanTokens = +2; + break; + case 29 /* GreaterThanToken */: + remainingLessThanTokens++; + break; + case 18 /* CloseBraceToken */: + // This can be object type, skip untill we find the matching open brace token + // Skip untill the matching open brace token + token = findPrecedingMatchingToken(token, 17 /* OpenBraceToken */, sourceFile); + if (!token) + return false; + break; + case 20 /* CloseParenToken */: + // This can be object type, skip untill we find the matching open brace token + // Skip untill the matching open brace token + token = findPrecedingMatchingToken(token, 19 /* OpenParenToken */, sourceFile); + if (!token) + return false; + break; + case 22 /* CloseBracketToken */: + // This can be object type, skip untill we find the matching open brace token + // Skip untill the matching open brace token + token = findPrecedingMatchingToken(token, 21 /* OpenBracketToken */, sourceFile); + if (!token) + return false; + break; + // Valid tokens in a type name. Skip. + case 26 /* CommaToken */: + case 36 /* EqualsGreaterThanToken */: + case 71 /* Identifier */: + case 9 /* StringLiteral */: + case 8 /* NumericLiteral */: + case 101 /* TrueKeyword */: + case 86 /* FalseKeyword */: + case 103 /* TypeOfKeyword */: + case 85 /* ExtendsKeyword */: + case 128 /* KeyOfKeyword */: + case 23 /* DotToken */: + case 49 /* BarToken */: + case 55 /* QuestionToken */: + case 56 /* ColonToken */: + break; + default: + if (ts.isTypeNode(token)) { + break; + } + // Invalid token in type + return false; + } + token = findPrecedingToken(token.getFullStart(), sourceFile); + } + return false; + } + ts.isPossiblyTypeArgumentPosition = isPossiblyTypeArgumentPosition; /** * Returns true if the cursor at position in sourceFile is within a comment. * @@ -80908,10 +82771,10 @@ var ts; } ts.getNodeModifiers = getNodeModifiers; function getTypeArgumentOrTypeParameterList(node) { - if (node.kind === 160 /* TypeReference */ || node.kind === 182 /* CallExpression */) { + if (node.kind === 161 /* TypeReference */ || node.kind === 185 /* CallExpression */) { return node.typeArguments; } - if (ts.isFunctionLike(node) || node.kind === 230 /* ClassDeclaration */ || node.kind === 231 /* InterfaceDeclaration */) { + if (ts.isFunctionLike(node) || node.kind === 233 /* ClassDeclaration */ || node.kind === 234 /* InterfaceDeclaration */) { return node.typeParameters; } return undefined; @@ -80963,18 +82826,18 @@ var ts; } ts.cloneCompilerOptions = cloneCompilerOptions; function isArrayLiteralOrObjectLiteralDestructuringPattern(node) { - if (node.kind === 178 /* ArrayLiteralExpression */ || - node.kind === 179 /* ObjectLiteralExpression */) { + if (node.kind === 181 /* ArrayLiteralExpression */ || + node.kind === 182 /* ObjectLiteralExpression */) { // [a,b,c] from: // [a, b, c] = someExpression; - if (node.parent.kind === 195 /* BinaryExpression */ && + if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.left === node && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return true; } // [a, b, c] from: // for([a, b, c] of expression) - if (node.parent.kind === 217 /* ForOfStatement */ && + if (node.parent.kind === 220 /* ForOfStatement */ && node.parent.initializer === node) { return true; } @@ -80982,7 +82845,7 @@ var ts; // [x, [a, b, c] ] = someExpression // or // {x, a: {a, b, c} } = someExpression - if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 265 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { + if (isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.kind === 268 /* PropertyAssignment */ ? node.parent.parent : node.parent)) { return true; } } @@ -81016,19 +82879,27 @@ var ts; return ts.createTextSpanFromBounds(range.pos, range.end); } ts.createTextSpanFromRange = createTextSpanFromRange; + function createTextChangeFromStartLength(start, length, newText) { + return createTextChange(ts.createTextSpan(start, length), newText); + } + ts.createTextChangeFromStartLength = createTextChangeFromStartLength; + function createTextChange(span, newText) { + return { span: span, newText: newText }; + } + ts.createTextChange = createTextChange; ts.typeKeywords = [ 119 /* AnyKeyword */, 122 /* BooleanKeyword */, - 127 /* KeyOfKeyword */, - 130 /* NeverKeyword */, + 128 /* KeyOfKeyword */, + 131 /* NeverKeyword */, 95 /* NullKeyword */, - 133 /* NumberKeyword */, - 134 /* ObjectKeyword */, - 136 /* StringKeyword */, - 137 /* SymbolKeyword */, + 134 /* NumberKeyword */, + 135 /* ObjectKeyword */, + 137 /* StringKeyword */, + 138 /* SymbolKeyword */, 105 /* VoidKeyword */, - 139 /* UndefinedKeyword */, - 140 /* UniqueKeyword */, + 140 /* UndefinedKeyword */, + 141 /* UniqueKeyword */, ]; function isTypeKeyword(kind) { return ts.contains(ts.typeKeywords, kind); @@ -81076,7 +82947,7 @@ var ts; /* @internal */ (function (ts) { function isFirstDeclarationOfSymbolParameter(symbol) { - return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 147 /* Parameter */; + return symbol.declarations && symbol.declarations.length > 0 && symbol.declarations[0].kind === 148 /* Parameter */; } ts.isFirstDeclarationOfSymbolParameter = isFirstDeclarationOfSymbolParameter; var displayPartWriter = getDisplayPartWriter(); @@ -81269,7 +83140,7 @@ var ts; ts.signatureToDisplayParts = signatureToDisplayParts; function isImportOrExportSpecifierName(location) { return location.parent && - (location.parent.kind === 243 /* ImportSpecifier */ || location.parent.kind === 247 /* ExportSpecifier */) && + (location.parent.kind === 246 /* ImportSpecifier */ || location.parent.kind === 250 /* ExportSpecifier */) && location.parent.propertyName === location; } ts.isImportOrExportSpecifierName = isImportOrExportSpecifierName; @@ -81356,32 +83227,30 @@ var ts; */ /* @internal */ function suppressLeadingAndTrailingTrivia(node) { - ts.Debug.assert(node !== undefined); - suppressLeading(node); - suppressTrailing(node); - function suppressLeading(node) { - ts.addEmitFlags(node, 512 /* NoLeadingComments */); - var firstChild = ts.forEachChild(node, function (child) { return child; }); - if (firstChild) { - suppressLeading(firstChild); - } - } - function suppressTrailing(node) { - ts.addEmitFlags(node, 1024 /* NoTrailingComments */); - var lastChild = undefined; - ts.forEachChild(node, function (child) { return (lastChild = child, undefined); }, function (children) { - // As an optimization, jump straight to the end of the list. - if (children.length) { - lastChild = ts.last(children); - } - return undefined; - }); - if (lastChild) { - suppressTrailing(lastChild); - } + ts.Debug.assertDefined(node); + suppress(node, 512 /* NoLeadingComments */, getFirstChild); + suppress(node, 1024 /* NoTrailingComments */, getLastChild); + function suppress(node, flag, getChild) { + ts.addEmitFlags(node, flag); + var child = getChild(node); + if (child) + suppress(child, flag, getChild); } } ts.suppressLeadingAndTrailingTrivia = suppressLeadingAndTrailingTrivia; + function getFirstChild(node) { + return node.forEachChild(function (child) { return child; }); + } + function getLastChild(node) { + var lastChild; + node.forEachChild(function (child) { lastChild = child; }, function (children) { + // As an optimization, jump straight to the end of the list. + if (children.length) { + lastChild = ts.last(children); + } + }); + return lastChild; + } })(ts || (ts = {})); var ts; (function (ts) { @@ -81483,10 +83352,10 @@ var ts; } break; case 119 /* AnyKeyword */: - case 136 /* StringKeyword */: - case 133 /* NumberKeyword */: + case 137 /* StringKeyword */: + case 134 /* NumberKeyword */: case 122 /* BooleanKeyword */: - case 137 /* SymbolKeyword */: + case 138 /* SymbolKeyword */: if (angleBracketStack > 0 && !syntacticClassifierAbsent) { // If it looks like we're could be in something generic, don't classify this // as a keyword. We may just get overwritten by the syntactic classifier, @@ -81595,7 +83464,7 @@ var ts; case 13 /* NoSubstitutionTemplateLiteral */: return 4 /* InTemplateHeadOrNoSubstitutionTemplate */; default: - throw ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); + return ts.Debug.fail("Only 'NoSubstitutionTemplateLiteral's and 'TemplateTail's can be unterminated; got SyntaxKind #" + token); } } return lastOnTemplateStack === 14 /* TemplateHead */ ? 6 /* InTemplateSubstitutionPosition */ : undefined; @@ -81672,7 +83541,7 @@ var ts; } switch (keyword2) { case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 123 /* ConstructorKeyword */: case 115 /* StaticKeyword */: return true; // Allow things like "public get", "public constructor" and "public static". @@ -81702,7 +83571,7 @@ var ts; case 0 /* None */: return { prefix: "" }; default: - throw ts.Debug.assertNever(lexState); + return ts.Debug.assertNever(lexState); } } function isBinaryExpressionOperatorToken(token) { @@ -81811,10 +83680,10 @@ var ts; // That means we're calling back into the host around every 1.2k of the file we process. // Lib.d.ts has similar numbers. switch (kind) { - case 234 /* ModuleDeclaration */: - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: + case 237 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: cancellationToken.throwIfCancellationRequested(); } } @@ -82025,16 +83894,16 @@ var ts; pushClassification(tag.tagName.pos, tag.tagName.end - tag.tagName.pos, 18 /* docCommentTagName */); // e.g. "param" pos = tag.tagName.end; switch (tag.kind) { - case 284 /* JSDocParameterTag */: + case 287 /* JSDocParameterTag */: processJSDocParameterTag(tag); break; - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: processJSDocTemplateTag(tag); break; - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: processElement(tag.typeExpression); break; - case 285 /* JSDocReturnTag */: + case 288 /* JSDocReturnTag */: processElement(tag.typeExpression); break; } @@ -82121,22 +83990,22 @@ var ts; } function tryClassifyJsxElementName(token) { switch (token.parent && token.parent.kind) { - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: if (token.parent.tagName === token) { return 19 /* jsxOpenTagName */; } break; - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (token.parent.tagName === token) { return 20 /* jsxCloseTagName */; } break; - case 251 /* JsxSelfClosingElement */: + case 254 /* JsxSelfClosingElement */: if (token.parent.tagName === token) { return 21 /* jsxSelfClosingTagName */; } break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: if (token.parent.name === token) { return 22 /* jsxAttribute */; } @@ -82164,17 +84033,17 @@ var ts; if (token) { if (tokenKind === 58 /* EqualsToken */) { // the '=' in a variable declaration is special cased here. - if (token.parent.kind === 227 /* VariableDeclaration */ || - token.parent.kind === 150 /* PropertyDeclaration */ || - token.parent.kind === 147 /* Parameter */ || - token.parent.kind === 257 /* JsxAttribute */) { + if (token.parent.kind === 230 /* VariableDeclaration */ || + token.parent.kind === 151 /* PropertyDeclaration */ || + token.parent.kind === 148 /* Parameter */ || + token.parent.kind === 260 /* JsxAttribute */) { return 5 /* operator */; } } - if (token.parent.kind === 195 /* BinaryExpression */ || - token.parent.kind === 193 /* PrefixUnaryExpression */ || - token.parent.kind === 194 /* PostfixUnaryExpression */ || - token.parent.kind === 196 /* ConditionalExpression */) { + if (token.parent.kind === 198 /* BinaryExpression */ || + token.parent.kind === 196 /* PrefixUnaryExpression */ || + token.parent.kind === 197 /* PostfixUnaryExpression */ || + token.parent.kind === 199 /* ConditionalExpression */) { return 5 /* operator */; } } @@ -82184,7 +84053,7 @@ var ts; return 4 /* numericLiteral */; } else if (tokenKind === 9 /* StringLiteral */) { - return token.parent.kind === 257 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; + return token.parent.kind === 260 /* JsxAttribute */ ? 24 /* jsxAttributeStringLiteralValue */ : 6 /* stringLiteral */; } else if (tokenKind === 12 /* RegularExpressionLiteral */) { // TODO: we should get another classification type for these literals. @@ -82200,32 +84069,32 @@ var ts; else if (tokenKind === 71 /* Identifier */) { if (token) { switch (token.parent.kind) { - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: if (token.parent.name === token) { return 11 /* className */; } return; - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: if (token.parent.name === token) { return 15 /* typeParameterName */; } return; - case 231 /* InterfaceDeclaration */: + case 234 /* InterfaceDeclaration */: if (token.parent.name === token) { return 13 /* interfaceName */; } return; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: if (token.parent.name === token) { return 12 /* enumName */; } return; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (token.parent.name === token) { return 14 /* moduleName */; } return; - case 147 /* Parameter */: + case 148 /* Parameter */: if (token.parent.name === token) { return ts.isThisIdentifier(token) ? 3 /* keyword */ : 17 /* parameterName */; } @@ -82261,6 +84130,9 @@ var ts; (function (Completions) { var PathCompletions; (function (PathCompletions) { + function createPathCompletion(name, kind, span) { + return { name: name, kind: kind, span: span }; + } function getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) { var literalValue = ts.normalizeSlashes(node.text); var scriptPath = node.getSourceFile().path; @@ -82350,7 +84222,7 @@ var ts; } } ts.forEachKey(foundFiles, function (foundFile) { - result.push(createCompletionEntryForModule(foundFile, "script" /* scriptElement */, span)); + result.push(createPathCompletion(foundFile, "script" /* scriptElement */, span)); }); } // If possible, get folder completion as well @@ -82359,7 +84231,7 @@ var ts; for (var _a = 0, directories_1 = directories; _a < directories_1.length; _a++) { var directory = directories_1[_a]; var directoryName = ts.getBaseFileName(ts.normalizePath(directory)); - result.push(createCompletionEntryForModule(directoryName, "directory" /* directory */, span)); + result.push(createPathCompletion(directoryName, "directory" /* directory */, span)); } } } @@ -82386,7 +84258,7 @@ var ts; var _loop_7 = function (name, kind) { // Path mappings may provide a duplicate way to get to something we've already added, so don't add again. if (!result.some(function (entry) { return entry.name === name; })) { - result.push(createCompletionEntryForModule(name, kind, span)); + result.push(createPathCompletion(name, kind, span)); } }; for (var _i = 0, _a = getCompletionsForPathMapping(path, patterns, fragment, baseUrl, fileExtensions, host); _i < _a.length; _i++) { @@ -82407,7 +84279,7 @@ var ts; getCompletionEntriesFromTypings(host, compilerOptions, scriptPath, span, result); for (var _c = 0, _d = enumeratePotentialNonRelativeModules(fragment, scriptPath, compilerOptions, typeChecker, host); _c < _d.length; _c++) { var moduleName = _d[_c]; - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); } return result; } @@ -82546,7 +84418,7 @@ var ts; try { typeRoots = ts.getEffectiveTypeRoots(options, host); } - catch (_b) { } + catch ( /* Wrap in try catch because getEffectiveTypeRoots touches the filesystem */_b) { /* Wrap in try catch because getEffectiveTypeRoots touches the filesystem */ } if (typeRoots) { for (var _c = 0, typeRoots_2 = typeRoots; _c < typeRoots_2.length; _c++) { var root = typeRoots_2[_c]; @@ -82578,7 +84450,7 @@ var ts; } function pushResult(moduleName) { if (!seen.has(moduleName)) { - result.push(createCompletionEntryForModule(moduleName, "external module name" /* externalModuleName */, span)); + result.push(createPathCompletion(moduleName, "external module name" /* externalModuleName */, span)); seen.set(moduleName, true); } } @@ -82640,9 +84512,6 @@ var ts; } } } - function createCompletionEntryForModule(name, kind, replacementSpan) { - return { name: name, kind: kind, kindModifiers: "" /* none */, sortText: name, replacementSpan: replacementSpan }; - } // Replace everything after the last directory seperator that appears function getDirectoryFragmentTextSpan(text, textStart) { var index = text.lastIndexOf(ts.directorySeparator); @@ -82659,7 +84528,7 @@ var ts; return false; } function normalizeAndPreserveTrailingSlash(path) { - if (path === "./" || path === ".\\") { + if (ts.normalizeSlashes(path) === "./") { // normalizePath turns "./" into "". "" + "/" would then be a rooted path instead of a relative one, so avoid this particular case. // There is no problem for adding "/" to a non-empty string -- it's only a problem at the beginning. return ""; @@ -82697,7 +84566,7 @@ var ts; try { return ts.directoryProbablyExists(path, host); } - catch (_a) { } + catch ( /*ignore*/_a) { /*ignore*/ } return undefined; } function tryIOAndConsumeErrors(host, toApply) { @@ -82708,7 +84577,7 @@ var ts; try { return toApply && toApply.apply(host, args); } - catch (_a) { } + catch ( /*ignore*/_a) { /*ignore*/ } return undefined; } })(PathCompletions = Completions.PathCompletions || (Completions.PathCompletions = {})); @@ -82731,13 +84600,13 @@ var ts; function getCompletionsAtPosition(host, typeChecker, log, compilerOptions, sourceFile, position, allSourceFiles, options) { if (ts.isInReferenceComment(sourceFile, position)) { var entries = Completions.PathCompletions.getTripleSlashReferenceCompletion(sourceFile, position, compilerOptions, host); - return entries && pathCompletionsInfo(entries); + return entries && convertPathCompletions(entries); } var contextToken = ts.findPrecedingToken(position, sourceFile); if (ts.isInString(sourceFile, position, contextToken)) { - return !contextToken || !ts.isStringLiteral(contextToken) && !ts.isNoSubstitutionTemplateLiteral(contextToken) + return !contextToken || !ts.isStringLiteralLike(contextToken) ? undefined - : getStringLiteralCompletionEntries(sourceFile, contextToken, position, typeChecker, compilerOptions, host, log); + : convertStringLiteralCompletions(getStringLiteralCompletionEntries(sourceFile, contextToken, position, typeChecker, compilerOptions, host), sourceFile, typeChecker, log); } if (contextToken && ts.isBreakOrContinueStatement(contextToken.parent) && (contextToken.kind === 72 /* BreakKeyword */ || contextToken.kind === 77 /* ContinueKeyword */ || contextToken.kind === 71 /* Identifier */)) { @@ -82759,15 +84628,44 @@ var ts; case 3 /* JsDocParameterName */: return jsdocCompletionInfo(ts.JsDoc.getJSDocParameterNameCompletions(completionData.tag)); default: - throw ts.Debug.assertNever(completionData); + return ts.Debug.assertNever(completionData); } } Completions.getCompletionsAtPosition = getCompletionsAtPosition; + function convertStringLiteralCompletions(completion, sourceFile, checker, log) { + if (completion === undefined) { + return undefined; + } + switch (completion.kind) { + case 0 /* Paths */: + return convertPathCompletions(completion.paths); + case 1 /* Properties */: { + var entries = []; + getCompletionEntriesFromSymbols(completion.symbols, entries, sourceFile, sourceFile, checker, 6 /* ESNext */, log, 4 /* String */); // Target will not be used, so arbitrary + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; + } + case 2 /* Types */: { + var entries = completion.types.map(function (type) { return ({ name: type.value, kindModifiers: "" /* none */, kind: "var" /* variableElement */, sortText: "0" }); }); + return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; + } + default: + return ts.Debug.assertNever(completion); + } + } + function convertPathCompletions(pathCompletions) { + var isGlobalCompletion = false; // We don't want the editor to offer any other completions, such as snippets, inside a comment. + var isNewIdentifierLocation = true; // The user may type in a path that doesn't yet exist, creating a "new identifier" with respect to the collection of identifiers the server is aware of. + var entries = pathCompletions.map(function (_a) { + var name = _a.name, kind = _a.kind, span = _a.span; + return ({ name: name, kind: kind, kindModifiers: "" /* none */, sortText: "0", replacementSpan: span }); + }); + return { isGlobalCompletion: isGlobalCompletion, isMemberCompletion: false, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + } function jsdocCompletionInfo(entries) { return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } function completionInfoFromData(sourceFile, typeChecker, compilerOptions, log, completionData, includeInsertTextCompletions) { - var symbols = completionData.symbols, completionKind = completionData.completionKind, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer; + var symbols = completionData.symbols, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer; if (sourceFile.languageVariant === 1 /* JSX */ && location && location.parent && ts.isJsxClosingElement(location.parent)) { // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. @@ -82802,7 +84700,7 @@ var ts; if (keywordFilters !== 0 /* None */ || !isMemberCompletion) { ts.addRange(entries, getKeywordCompletions(keywordFilters)); } - return { isGlobalCompletion: completionKind === 1 /* Global */, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; + return { isGlobalCompletion: isInSnippetScope, isMemberCompletion: isMemberCompletion, isNewIdentifierLocation: isNewIdentifierLocation, entries: entries }; } function isMemberCompletionKind(kind) { switch (kind) { @@ -82928,141 +84826,6 @@ var ts; return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; } } - function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host, log) { - switch (node.parent.kind) { - case 174 /* LiteralType */: - switch (node.parent.parent.kind) { - case 160 /* TypeReference */: - // TODO: GH#21168 - return undefined; - case 172 /* IndexedAccessType */: - // Get all apparent property names - // i.e. interface Foo { - // foo: string; - // bar: string; - // } - // let x: Foo["/*completion position*/"] - var type = typeChecker.getTypeFromTypeNode(node.parent.parent.objectType); - return getStringLiteralCompletionEntriesFromElementAccessOrIndexedAccess(node, sourceFile, type, typeChecker, compilerOptions.target, log); - default: - return undefined; - } - case 265 /* PropertyAssignment */: - if (node.parent.parent.kind === 179 /* ObjectLiteralExpression */ && - node.parent.name === node) { - // Get quoted name of properties of the object literal expression - // i.e. interface ConfigFiles { - // 'jspm:dev': string - // } - // let files: ConfigFiles = { - // '/*completion position*/' - // } - // - // function foo(c: ConfigFiles) {} - // foo({ - // '/*completion position*/' - // }); - return getStringLiteralCompletionEntriesFromPropertyAssignment(node.parent, sourceFile, typeChecker, compilerOptions.target, log); - } - return fromContextualType(); - case 181 /* ElementAccessExpression */: { - var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression; - if (node === argumentExpression) { - // Get all names of properties on the expression - // i.e. interface A { - // 'prop1': string - // } - // let a: A; - // a['/*completion position*/'] - var type = typeChecker.getTypeAtLocation(expression); - return getStringLiteralCompletionEntriesFromElementAccessOrIndexedAccess(node, sourceFile, type, typeChecker, compilerOptions.target, log); - } - break; - } - case 182 /* CallExpression */: - case 183 /* NewExpression */: - if (!ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) && !ts.isImportCall(node.parent)) { - var argumentInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); - // Get string literal completions from specialized signatures of the target - // i.e. declare function f(a: 'A'); - // f("/*completion position*/") - return argumentInfo ? getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) : fromContextualType(); - } - // falls through - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: - case 249 /* ExternalModuleReference */: - // Get all known external module names or complete a path to a module - // i.e. import * as ns from "/*completion position*/"; - // var y = import("/*completion position*/"); - // import x = require("/*completion position*/"); - // var y = require("/*completion position*/"); - // export * from "/*completion position*/"; - return pathCompletionsInfo(Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker)); - default: - return fromContextualType(); - } - function fromContextualType() { - // Get completion for string literal from string literal type - // i.e. var x: "hi" | "hello" = "/*completion position*/" - return getStringLiteralCompletionEntriesFromType(getContextualTypeFromParent(node, typeChecker), typeChecker); - } - } - function pathCompletionsInfo(entries) { - return { - // We don't want the editor to offer any other completions, such as snippets, inside a comment. - isGlobalCompletion: false, - isMemberCompletion: false, - // The user may type in a path that doesn't yet exist, creating a "new identifier" - // with respect to the collection of identifiers the server is aware of. - isNewIdentifierLocation: true, - entries: entries, - }; - } - function getStringLiteralCompletionEntriesFromPropertyAssignment(element, sourceFile, typeChecker, target, log) { - var type = typeChecker.getContextualType(element.parent); - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, element, sourceFile, typeChecker, target, log, 4 /* String */); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - } - function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo, typeChecker) { - var candidates = []; - var entries = []; - var uniques = ts.createMap(); - typeChecker.getResolvedSignature(argumentInfo.invocation, candidates, argumentInfo.argumentCount); - for (var _i = 0, candidates_1 = candidates; _i < candidates_1.length; _i++) { - var candidate = candidates_1[_i]; - addStringLiteralCompletionsFromType(typeChecker.getParameterType(candidate, argumentInfo.argumentIndex), entries, typeChecker, uniques); - } - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: true, entries: entries }; - } - return undefined; - } - function getStringLiteralCompletionEntriesFromElementAccessOrIndexedAccess(stringLiteralNode, sourceFile, type, typeChecker, target, log) { - var entries = []; - if (type) { - getCompletionEntriesFromSymbols(type.getApparentProperties(), entries, stringLiteralNode, sourceFile, typeChecker, target, log, 4 /* String */); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: true, entries: entries }; - } - } - return undefined; - } - function getStringLiteralCompletionEntriesFromType(type, typeChecker) { - if (type) { - var entries = []; - addStringLiteralCompletionsFromType(type, entries, typeChecker); - if (entries.length) { - return { isGlobalCompletion: false, isMemberCompletion: false, isNewIdentifierLocation: false, entries: entries }; - } - } - return undefined; - } function getLabelStatementCompletions(node) { var entries = []; var uniques = ts.createMap(); @@ -83087,32 +84850,105 @@ var ts; } return entries; } - function addStringLiteralCompletionsFromType(type, result, typeChecker, uniques) { + var StringLiteralCompletionKind; + (function (StringLiteralCompletionKind) { + StringLiteralCompletionKind[StringLiteralCompletionKind["Paths"] = 0] = "Paths"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Properties"] = 1] = "Properties"; + StringLiteralCompletionKind[StringLiteralCompletionKind["Types"] = 2] = "Types"; + })(StringLiteralCompletionKind || (StringLiteralCompletionKind = {})); + function getStringLiteralCompletionEntries(sourceFile, node, position, typeChecker, compilerOptions, host) { + switch (node.parent.kind) { + case 177 /* LiteralType */: + switch (node.parent.parent.kind) { + case 161 /* TypeReference */: + return { kind: 2 /* Types */, types: getStringLiteralTypes(typeChecker.getTypeArgumentConstraint(node.parent), typeChecker) }; + case 175 /* IndexedAccessType */: + // Get all apparent property names + // i.e. interface Foo { + // foo: string; + // bar: string; + // } + // let x: Foo["/*completion position*/"] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeFromTypeNode(node.parent.parent.objectType).getApparentProperties() }; + default: + return undefined; + } + case 268 /* PropertyAssignment */: + if (ts.isObjectLiteralExpression(node.parent.parent) && node.parent.name === node) { + // Get quoted name of properties of the object literal expression + // i.e. interface ConfigFiles { + // 'jspm:dev': string + // } + // let files: ConfigFiles = { + // '/*completion position*/' + // } + // + // function foo(c: ConfigFiles) {} + // foo({ + // '/*completion position*/' + // }); + var type = typeChecker.getContextualType(node.parent.parent); + return { kind: 1 /* Properties */, symbols: type && type.getApparentProperties() }; + } + return fromContextualType(); + case 184 /* ElementAccessExpression */: { + var _a = node.parent, expression = _a.expression, argumentExpression = _a.argumentExpression; + if (node === argumentExpression) { + // Get all names of properties on the expression + // i.e. interface A { + // 'prop1': string + // } + // let a: A; + // a['/*completion position*/'] + return { kind: 1 /* Properties */, symbols: typeChecker.getTypeAtLocation(expression).getApparentProperties() }; + } + return undefined; + } + case 185 /* CallExpression */: + case 186 /* NewExpression */: + if (!ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) && !ts.isImportCall(node.parent)) { + var argumentInfo_1 = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile); + // Get string literal completions from specialized signatures of the target + // i.e. declare function f(a: 'A'); + // f("/*completion position*/") + if (argumentInfo_1) { + var candidates = []; + typeChecker.getResolvedSignature(argumentInfo_1.invocation, candidates, argumentInfo_1.argumentCount); + var uniques_1 = ts.createMap(); + return { kind: 2 /* Types */, types: ts.flatMap(candidates, function (candidate) { return getStringLiteralTypes(typeChecker.getParameterType(candidate, argumentInfo_1.argumentIndex), typeChecker, uniques_1); }) }; + } + return fromContextualType(); + } + // falls through (is `require("")` or `import("")`) + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: + case 252 /* ExternalModuleReference */: + // Get all known external module names or complete a path to a module + // i.e. import * as ns from "/*completion position*/"; + // var y = import("/*completion position*/"); + // import x = require("/*completion position*/"); + // var y = require("/*completion position*/"); + // export * from "/*completion position*/"; + return { kind: 0 /* Paths */, paths: Completions.PathCompletions.getStringLiteralCompletionsFromModuleNames(sourceFile, node, compilerOptions, host, typeChecker) }; + default: + return fromContextualType(); + } + function fromContextualType() { + // Get completion for string literal from string literal type + // i.e. var x: "hi" | "hello" = "/*completion position*/" + return { kind: 2 /* Types */, types: getStringLiteralTypes(getContextualTypeFromParent(node, typeChecker), typeChecker) }; + } + } + function getStringLiteralTypes(type, typeChecker, uniques) { if (uniques === void 0) { uniques = ts.createMap(); } if (type && type.flags & 32768 /* TypeParameter */) { - type = typeChecker.getBaseConstraintOfType(type); - } - if (!type) { - return; - } - if (type.flags & 131072 /* Union */) { - for (var _i = 0, _a = type.types; _i < _a.length; _i++) { - var t = _a[_i]; - addStringLiteralCompletionsFromType(t, result, typeChecker, uniques); - } - } - else if (type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */)) { - var name = type.value; - if (!uniques.has(name)) { - uniques.set(name, true); - result.push({ - name: name, - kindModifiers: "" /* none */, - kind: "var" /* variableElement */, - sortText: "0" - }); - } + type = type.getConstraint(); } + return type && type.flags & 131072 /* Union */ + ? ts.flatMap(type.types, function (t) { return getStringLiteralTypes(t, typeChecker, uniques); }) + : type && type.flags & 32 /* StringLiteral */ && !(type.flags & 256 /* EnumLiteral */) && ts.addToSeen(uniques, type.value) + ? [type] + : ts.emptyArray; } function getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, _a, allSourceFiles) { var name = _a.name, source = _a.source; @@ -83193,36 +85029,10 @@ var ts; : { codeActions: undefined, sourceDisplay: undefined }; } function getCodeActionsAndSourceDisplayForImport(symbolOriginInfo, symbol, program, checker, host, compilerOptions, sourceFile, previousToken, formatContext, getCanonicalFileName, allSourceFiles) { - var moduleSymbol = symbolOriginInfo.moduleSymbol, isDefaultExport = symbolOriginInfo.isDefaultExport; + var moduleSymbol = symbolOriginInfo.moduleSymbol; var exportedSymbol = ts.skipAlias(symbol.exportSymbol || symbol, checker); - var moduleSymbols = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); - ts.Debug.assert(ts.contains(moduleSymbols, moduleSymbol)); - var sourceDisplay = [ts.textPart(ts.first(ts.codefix.getModuleSpecifiersForNewImport(program, sourceFile, moduleSymbols, compilerOptions, getCanonicalFileName, host)))]; - var codeActions = ts.codefix.getCodeActionForImport(moduleSymbols, { - host: host, - program: program, - checker: checker, - compilerOptions: compilerOptions, - sourceFile: sourceFile, - formatContext: formatContext, - symbolName: getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), - getCanonicalFileName: getCanonicalFileName, - symbolToken: ts.tryCast(previousToken, ts.isIdentifier), - kind: isDefaultExport ? 1 /* Default */ : 0 /* Named */, - }).slice(0, 1); // Only take the first code action - return { sourceDisplay: sourceDisplay, codeActions: codeActions }; - } - function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { - var result = []; - ts.codefix.forEachExternalModule(checker, allSourceFiles, function (module) { - for (var _i = 0, _a = checker.getExportsOfModule(module); _i < _a.length; _i++) { - var exported = _a[_i]; - if (ts.skipAlias(exported, checker) === exportedSymbol) { - result.push(module); - } - } - }); - return result; + var _a = ts.codefix.getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, getSymbolName(symbol, symbolOriginInfo, compilerOptions.target), host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, previousToken), moduleSpecifier = _a.moduleSpecifier, codeAction = _a.codeAction; + return { sourceDisplay: [ts.textPart(moduleSpecifier)], codeActions: [codeAction] }; } function getCompletionEntrySymbol(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles) { var completion = getSymbolCompletionFromEntryId(typeChecker, log, compilerOptions, sourceFile, position, entryId, allSourceFiles); @@ -83239,52 +85049,65 @@ var ts; var CompletionKind; (function (CompletionKind) { CompletionKind[CompletionKind["ObjectPropertyDeclaration"] = 0] = "ObjectPropertyDeclaration"; - /** Note that sometimes we access completions from global scope, but use "None" instead of this. See isGlobalCompletionScope. */ CompletionKind[CompletionKind["Global"] = 1] = "Global"; CompletionKind[CompletionKind["PropertyAccess"] = 2] = "PropertyAccess"; CompletionKind[CompletionKind["MemberLike"] = 3] = "MemberLike"; CompletionKind[CompletionKind["String"] = 4] = "String"; CompletionKind[CompletionKind["None"] = 5] = "None"; })(CompletionKind || (CompletionKind = {})); - function getRecommendedCompletion(currentToken, checker) { - var ty = getContextualType(currentToken, checker); + function getRecommendedCompletion(currentToken, position, sourceFile, checker) { + var ty = getContextualType(currentToken, position, sourceFile, checker); var symbol = ty && ty.symbol; // Don't include make a recommended completion for an abstract class return symbol && (symbol.flags & 384 /* Enum */ || symbol.flags & 32 /* Class */ && !ts.isAbstractConstructorSymbol(symbol)) ? getFirstSymbolInChain(symbol, currentToken, checker) : undefined; } - function getContextualType(currentToken, checker) { + function getContextualType(currentToken, position, sourceFile, checker) { var parent = currentToken.parent; switch (currentToken.kind) { case 71 /* Identifier */: return getContextualTypeFromParent(currentToken, checker); case 58 /* EqualsToken */: - return ts.isVariableDeclaration(parent) ? checker.getContextualType(parent.initializer) : - ts.isBinaryExpression(parent) ? checker.getTypeAtLocation(parent.left) : undefined; + switch (parent.kind) { + case 230 /* VariableDeclaration */: + return checker.getContextualType(parent.initializer); + case 198 /* BinaryExpression */: + return checker.getTypeAtLocation(parent.left); + case 260 /* JsxAttribute */: + return checker.getContextualTypeForJsxAttribute(parent); + default: + return undefined; + } case 94 /* NewKeyword */: return checker.getContextualType(parent); case 73 /* CaseKeyword */: - return getSwitchedType(ts.cast(currentToken.parent, ts.isCaseClause), checker); + return getSwitchedType(ts.cast(parent, ts.isCaseClause), checker); + case 17 /* OpenBraceToken */: + return ts.isJsxExpression(parent) && parent.parent.kind !== 253 /* JsxElement */ ? checker.getContextualTypeForJsxAttribute(parent.parent) : undefined; default: - return isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) - // completion at `x ===/**/` should be for the right side - ? checker.getTypeAtLocation(parent.left) - : checker.getContextualType(currentToken); + var argInfo = ts.SignatureHelp.getImmediatelyContainingArgumentInfo(currentToken, position, sourceFile); + return argInfo + // At `,`, treat this as the next argument after the comma. + ? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (currentToken.kind === 26 /* CommaToken */ ? 1 : 0)) + : isEqualityOperatorKind(currentToken.kind) && ts.isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind) + // completion at `x ===/**/` should be for the right side + ? checker.getTypeAtLocation(parent.left) + : checker.getContextualType(currentToken); } } function getContextualTypeFromParent(node, checker) { var parent = node.parent; switch (parent.kind) { - case 183 /* NewExpression */: + case 186 /* NewExpression */: return checker.getContextualType(parent); - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var _a = parent, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; return isEqualityOperatorKind(operatorToken.kind) ? checker.getTypeAtLocation(node === right ? left : right) : checker.getContextualType(node); } - case 261 /* CaseClause */: + case 264 /* CaseClause */: return parent.expression === node ? getSwitchedType(parent, checker) : undefined; default: return checker.getContextualType(node); @@ -83297,10 +85120,10 @@ var ts; var chain = checker.getAccessibleSymbolChain(symbol, enclosingDeclaration, /*meaning*/ 67108863 /* All */, /*useOnlyExternalAliasing*/ false); if (chain) return ts.first(chain); - return isModuleSymbol(symbol.parent) ? symbol : symbol.parent && getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker); + return symbol.parent && (isModuleSymbol(symbol.parent) ? symbol : getFirstSymbolInChain(symbol.parent, enclosingDeclaration, checker)); } function isModuleSymbol(symbol) { - return symbol.declarations.some(function (d) { return d.kind === 269 /* SourceFile */; }); + return symbol.declarations.some(function (d) { return d.kind === 272 /* SourceFile */; }); } function getCompletionData(typeChecker, log, sourceFile, position, allSourceFiles, options, target) { var start = ts.timestamp(); @@ -83312,6 +85135,7 @@ var ts; var insideComment = ts.isInComment(sourceFile, position, currentToken); log("getCompletionData: Is inside comment: " + (ts.timestamp() - start)); var insideJsDocTagTypeExpression = false; + var isInSnippetScope = false; if (insideComment) { if (ts.hasDocComment(sourceFile, position)) { if (sourceFile.text.charCodeAt(position - 1) === 64 /* at */) { @@ -83350,11 +85174,11 @@ var ts; if (tag.tagName.pos <= position && position <= tag.tagName.end) { return { kind: 1 /* JsDocTagName */ }; } - if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 271 /* JSDocTypeExpression */) { + if (isTagWithTypeExpression(tag) && tag.typeExpression && tag.typeExpression.kind === 274 /* JSDocTypeExpression */) { currentToken = ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ true); if (!currentToken || (!ts.isDeclarationName(currentToken) && - (currentToken.parent.kind !== 289 /* JSDocPropertyTag */ || + (currentToken.parent.kind !== 292 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken))) { // Use as type location if inside tag's type expression insideJsDocTagTypeExpression = isCurrentlyEditingNode(tag.typeExpression); @@ -83404,11 +85228,11 @@ var ts; if (contextToken.kind === 23 /* DotToken */) { isRightOfDot = true; switch (parent.kind) { - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: propertyAccessToConvert = parent; node = propertyAccessToConvert.expression; break; - case 144 /* QualifiedName */: + case 145 /* QualifiedName */: node = parent.left; break; default: @@ -83421,32 +85245,47 @@ var ts; // // If the tagname is a property access expression, we will then walk up to the top most of property access expression. // Then, try to get a JSX container and its associated attributes type. - if (parent && parent.kind === 180 /* PropertyAccessExpression */) { + if (parent && parent.kind === 183 /* PropertyAccessExpression */) { contextToken = parent; parent = parent.parent; } + // Fix location + if (currentToken.parent === location) { + switch (currentToken.kind) { + case 29 /* GreaterThanToken */: + if (currentToken.parent.kind === 253 /* JsxElement */ || currentToken.parent.kind === 255 /* JsxOpeningElement */) { + location = currentToken; + } + break; + case 41 /* SlashToken */: + if (currentToken.parent.kind === 254 /* JsxSelfClosingElement */) { + location = currentToken; + } + break; + } + } switch (parent.kind) { - case 253 /* JsxClosingElement */: + case 256 /* JsxClosingElement */: if (contextToken.kind === 41 /* SlashToken */) { isStartingCloseTag = true; location = contextToken; } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (!(parent.left.flags & 32768 /* ThisNodeHasError */)) { // It has a left-hand side, so we're not in an opening JSX tag. break; } // falls through - case 251 /* JsxSelfClosingElement */: - case 250 /* JsxElement */: - case 252 /* JsxOpeningElement */: + case 254 /* JsxSelfClosingElement */: + case 253 /* JsxElement */: + case 255 /* JsxOpeningElement */: if (contextToken.kind === 27 /* LessThanToken */) { isRightOfOpenTag = true; location = contextToken; } break; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: switch (previousToken.kind) { case 58 /* EqualsToken */: isJsxInitializer = true; @@ -83470,9 +85309,9 @@ var ts; getTypeScriptMemberSymbols(); } else if (isRightOfOpenTag) { - var tagSymbols = typeChecker.getJsxIntrinsicTagNames(); + var tagSymbols = ts.Debug.assertEachDefined(typeChecker.getJsxIntrinsicTagNamesAt(location), "getJsxIntrinsicTagNames() should all be defined"); if (tryGetGlobalSymbols()) { - symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & (107455 /* Value */ | 2097152 /* Alias */)); })); + symbols = tagSymbols.concat(symbols.filter(function (s) { return !!(s.flags & (67216319 /* Value */ | 2097152 /* Alias */)); })); } else { symbols = tagSymbols; @@ -83482,7 +85321,7 @@ var ts; else if (isStartingCloseTag) { var tagName = contextToken.parent.parent.openingElement.tagName; var tagSymbol = typeChecker.getSymbolAtLocation(tagName); - if (!typeChecker.isUnknownSymbol(tagSymbol)) { + if (tagSymbol) { symbols = [tagSymbol]; } completionKind = 3 /* MemberLike */; @@ -83496,15 +85335,15 @@ var ts; } } log("getCompletionData: Semantic work: " + (ts.timestamp() - semanticStart)); - var recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, typeChecker); - return { kind: 0 /* Data */, symbols: symbols, completionKind: completionKind, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer }; + var recommendedCompletion = previousToken && getRecommendedCompletion(previousToken, position, sourceFile, typeChecker); + return { kind: 0 /* Data */, symbols: symbols, completionKind: completionKind, isInSnippetScope: isInSnippetScope, propertyAccessToConvert: propertyAccessToConvert, isNewIdentifierLocation: isNewIdentifierLocation, location: location, keywordFilters: keywordFilters, symbolToOriginInfoMap: symbolToOriginInfoMap, recommendedCompletion: recommendedCompletion, previousToken: previousToken, isJsxInitializer: isJsxInitializer }; function isTagWithTypeExpression(tag) { switch (tag.kind) { - case 284 /* JSDocParameterTag */: - case 289 /* JSDocPropertyTag */: - case 285 /* JSDocReturnTag */: - case 286 /* JSDocTypeTag */: - case 288 /* JSDocTypedefTag */: + case 287 /* JSDocParameterTag */: + case 292 /* JSDocPropertyTag */: + case 288 /* JSDocReturnTag */: + case 289 /* JSDocTypeTag */: + case 291 /* JSDocTypedefTag */: return true; } } @@ -83514,16 +85353,17 @@ var ts; // Since this is qualified name check its a type node location var isTypeLocation = insideJsDocTagTypeExpression || ts.isPartOfTypeNode(node.parent); var isRhsOfImportDeclaration = ts.isInRightSideOfInternalImportEqualsDeclaration(node); + var allowTypeOrValue = isRhsOfImportDeclaration || (!isTypeLocation && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile)); if (ts.isEntityName(node)) { var symbol = typeChecker.getSymbolAtLocation(node); if (symbol) { symbol = ts.skipAlias(symbol, typeChecker); if (symbol.flags & (1536 /* Module */ | 384 /* Enum */)) { // Extract module or enum members - var exportedSymbols = typeChecker.getExportsOfModule(symbol); + var exportedSymbols = ts.Debug.assertEachDefined(typeChecker.getExportsOfModule(symbol), "getExportsOfModule() should all be defined"); var isValidValueAccess_1 = function (symbol) { return typeChecker.isValidPropertyAccess((node.parent), symbol.name); }; var isValidTypeAccess_1 = function (symbol) { return symbolCanBeReferencedAtTypeLocation(symbol); }; - var isValidAccess = isRhsOfImportDeclaration ? + var isValidAccess = allowTypeOrValue ? // Any kind is allowed when dotting off namespace in internal import equals declaration function (symbol) { return isValidTypeAccess_1(symbol) || isValidValueAccess_1(symbol); } : isTypeLocation ? isValidTypeAccess_1 : isValidValueAccess_1; @@ -83534,7 +85374,7 @@ var ts; } } // If the module is merged with a value, we must get the type of the class and add its propertes (for inherited static methods). - if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 269 /* SourceFile */ && d.kind !== 234 /* ModuleDeclaration */ && d.kind !== 233 /* EnumDeclaration */; })) { + if (!isTypeLocation && symbol.declarations.some(function (d) { return d.kind !== 272 /* SourceFile */ && d.kind !== 237 /* ModuleDeclaration */ && d.kind !== 236 /* EnumDeclaration */; })) { addTypeProperties(typeChecker.getTypeOfSymbolAtLocation(symbol, node)); } return; @@ -83585,9 +85425,6 @@ var ts; keywordFilters = 2 /* ConstructorParameterKeywords */; return true; } - if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { - keywordFilters = 3 /* FunctionLikeBodyKeywords */; - } if (classLikeContainer = tryGetClassLikeCompletionContainer(contextToken)) { // cursor inside class declaration getGetClassLikeCompletionSymbols(classLikeContainer); @@ -83595,7 +85432,7 @@ var ts; } if (jsxContainer = tryGetContainingJsxElement(contextToken)) { var attrsType = void 0; - if ((jsxContainer.kind === 251 /* JsxSelfClosingElement */) || (jsxContainer.kind === 252 /* JsxOpeningElement */)) { + if ((jsxContainer.kind === 254 /* JsxSelfClosingElement */) || (jsxContainer.kind === 255 /* JsxOpeningElement */)) { // Cursor is inside a JSX self-closing element or opening element attrsType = typeChecker.getAllAttributesTypeFromJsxOpeningLikeElement(jsxContainer); if (attrsType) { @@ -83606,8 +85443,11 @@ var ts; } } } + if (tryGetFunctionLikeBodyCompletionContainer(contextToken)) { + keywordFilters = 3 /* FunctionLikeBodyKeywords */; + } // Get all entities in the current scope. - completionKind = 5 /* None */; + completionKind = 1 /* Global */; isNewIdentifierLocation = isNewIdentifierDefinitionLocation(contextToken); if (previousToken !== contextToken) { ts.Debug.assert(!!previousToken, "Expected 'contextToken' to be defined when different from 'previousToken'."); @@ -83641,13 +85481,11 @@ var ts; previousToken.getStart() : position; var scopeNode = getScopeNode(contextToken, adjustedPosition, sourceFile) || sourceFile; - if (isGlobalCompletionScope(scopeNode)) { - completionKind = 1 /* Global */; - } - var symbolMeanings = 793064 /* Type */ | 107455 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; - symbols = typeChecker.getSymbolsInScope(scopeNode, symbolMeanings); + isInSnippetScope = isSnippetScope(scopeNode); + var symbolMeanings = 67901928 /* Type */ | 67216319 /* Value */ | 1920 /* Namespace */ | 2097152 /* Alias */; + symbols = ts.Debug.assertEachDefined(typeChecker.getSymbolsInScope(scopeNode, symbolMeanings), "getSymbolsInScope() should all be defined"); // Need to insert 'this.' before properties of `this` type, so only do that if `includeInsertTextCompletions` - if (options.includeInsertTextCompletions && scopeNode.kind !== 269 /* SourceFile */) { + if (options.includeInsertTextCompletions && scopeNode.kind !== 272 /* SourceFile */) { var thisType = typeChecker.tryGetThisTypeAt(scopeNode); if (thisType) { for (var _i = 0, _a = getPropertiesForCompletion(thisType, typeChecker, /*isForAccess*/ true); _i < _a.length; _i++) { @@ -83663,20 +85501,21 @@ var ts; filterGlobalCompletion(symbols); return true; } - function isGlobalCompletionScope(scopeNode) { + function isSnippetScope(scopeNode) { switch (scopeNode.kind) { - case 269 /* SourceFile */: - case 197 /* TemplateExpression */: - case 260 /* JsxExpression */: - case 208 /* Block */: + case 272 /* SourceFile */: + case 200 /* TemplateExpression */: + case 263 /* JsxExpression */: + case 211 /* Block */: return true; default: return ts.isStatement(scopeNode); } } function filterGlobalCompletion(symbols) { - var isTypeCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); - if (isTypeCompletion) + var isTypeOnlyCompletion = insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (ts.isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken)); + var allowTypes = isTypeOnlyCompletion || !isContextTokenValueLocation(contextToken) && ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile); + if (isTypeOnlyCompletion) keywordFilters = 4 /* TypeKeywords */; ts.filterMutate(symbols, function (symbol) { if (!ts.isSourceFile(location)) { @@ -83689,34 +85528,37 @@ var ts; if (ts.isInRightSideOfInternalImportEqualsDeclaration(location)) { return !!(symbol.flags & 1920 /* Namespace */); } - if (isTypeCompletion) { + if (allowTypes) { // Its a type, but you can reach it by namespace.type as well - return symbolCanBeReferencedAtTypeLocation(symbol); + var symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol); + if (symbolAllowedAsType || isTypeOnlyCompletion) { + return symbolAllowedAsType; + } } } // expressions are value space (which includes the value namespaces) - return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 107455 /* Value */); + return !!(ts.getCombinedLocalAndExportSymbolFlags(symbol) & 67216319 /* Value */); }); } function isContextTokenValueLocation(contextToken) { return contextToken && contextToken.kind === 103 /* TypeOfKeyword */ && - contextToken.parent.kind === 163 /* TypeQuery */; + (contextToken.parent.kind === 164 /* TypeQuery */ || ts.isTypeOfExpression(contextToken.parent)); } function isContextTokenTypeLocation(contextToken) { if (contextToken) { var parentKind = contextToken.parent.kind; switch (contextToken.kind) { case 56 /* ColonToken */: - return parentKind === 150 /* PropertyDeclaration */ || - parentKind === 149 /* PropertySignature */ || - parentKind === 147 /* Parameter */ || - parentKind === 227 /* VariableDeclaration */ || + return parentKind === 151 /* PropertyDeclaration */ || + parentKind === 150 /* PropertySignature */ || + parentKind === 148 /* Parameter */ || + parentKind === 230 /* VariableDeclaration */ || ts.isFunctionLikeKind(parentKind); case 58 /* EqualsToken */: - return parentKind === 232 /* TypeAliasDeclaration */; + return parentKind === 235 /* TypeAliasDeclaration */; case 118 /* AsKeyword */: - return parentKind === 203 /* AsExpression */; + return parentKind === 206 /* AsExpression */; } } return false; @@ -83725,7 +85567,7 @@ var ts; symbol = symbol.exportSymbol || symbol; // This is an alias, follow what it aliases symbol = ts.skipAlias(symbol, typeChecker); - if (symbol.flags & 793064 /* Type */) { + if (symbol.flags & 67901928 /* Type */) { return true; } if (symbol.flags & 1536 /* Module */) { @@ -83741,6 +85583,9 @@ var ts; for (var _i = 0, _a = typeChecker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { var symbol = _a[_i]; // Don't add a completion for a re-export, only for the original. + // The actual import fix might end up coming from a re-export -- we don't compute that until getting completion details. + // This is just to avoid adding duplicate completion entries. + // // If `symbol.parent !== ...`, this comes from an `export * from "foo"` re-export. Those don't create new symbols. // If `some(...)`, this comes from an `export { foo } from "foo"` re-export, which creates a new symbol (thus isn't caught by the first check). if (typeChecker.getMergedSymbol(symbol.parent) !== typeChecker.resolveExternalModuleSymbol(moduleSymbol) @@ -83805,11 +85650,11 @@ var ts; return true; } if (contextToken.kind === 29 /* GreaterThanToken */ && contextToken.parent) { - if (contextToken.parent.kind === 252 /* JsxOpeningElement */) { + if (contextToken.parent.kind === 255 /* JsxOpeningElement */) { return true; } - if (contextToken.parent.kind === 253 /* JsxClosingElement */ || contextToken.parent.kind === 251 /* JsxSelfClosingElement */) { - return contextToken.parent.parent && contextToken.parent.parent.kind === 250 /* JsxElement */; + if (contextToken.parent.kind === 256 /* JsxClosingElement */ || contextToken.parent.kind === 254 /* JsxSelfClosingElement */) { + return contextToken.parent.parent && contextToken.parent.parent.kind === 253 /* JsxElement */; } } return false; @@ -83819,40 +85664,40 @@ var ts; var containingNodeKind = previousToken.parent.kind; switch (previousToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 182 /* CallExpression */ // func( a, | - || containingNodeKind === 153 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ - || containingNodeKind === 183 /* NewExpression */ // new C(a, | - || containingNodeKind === 178 /* ArrayLiteralExpression */ // [a, | - || containingNodeKind === 195 /* BinaryExpression */ // const x = (a, | - || containingNodeKind === 161 /* FunctionType */; // var x: (s: string, list| + return containingNodeKind === 185 /* CallExpression */ // func( a, | + || containingNodeKind === 154 /* Constructor */ // constructor( a, | /* public, protected, private keywords are allowed here, so show completion */ + || containingNodeKind === 186 /* NewExpression */ // new C(a, | + || containingNodeKind === 181 /* ArrayLiteralExpression */ // [a, | + || containingNodeKind === 198 /* BinaryExpression */ // const x = (a, | + || containingNodeKind === 162 /* FunctionType */; // var x: (s: string, list| case 19 /* OpenParenToken */: - return containingNodeKind === 182 /* CallExpression */ // func( | - || containingNodeKind === 153 /* Constructor */ // constructor( | - || containingNodeKind === 183 /* NewExpression */ // new C(a| - || containingNodeKind === 186 /* ParenthesizedExpression */ // const x = (a| - || containingNodeKind === 169 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ + return containingNodeKind === 185 /* CallExpression */ // func( | + || containingNodeKind === 154 /* Constructor */ // constructor( | + || containingNodeKind === 186 /* NewExpression */ // new C(a| + || containingNodeKind === 189 /* ParenthesizedExpression */ // const x = (a| + || containingNodeKind === 172 /* ParenthesizedType */; // function F(pred: (a| /* this can become an arrow function, where 'a' is the argument */ case 21 /* OpenBracketToken */: - return containingNodeKind === 178 /* ArrayLiteralExpression */ // [ | - || containingNodeKind === 158 /* IndexSignature */ // [ | : string ] - || containingNodeKind === 145 /* ComputedPropertyName */; // [ | /* this can become an index signature */ - case 128 /* ModuleKeyword */: // module | - case 129 /* NamespaceKeyword */:// namespace | + return containingNodeKind === 181 /* ArrayLiteralExpression */ // [ | + || containingNodeKind === 159 /* IndexSignature */ // [ | : string ] + || containingNodeKind === 146 /* ComputedPropertyName */; // [ | /* this can become an index signature */ + case 129 /* ModuleKeyword */: // module | + case 130 /* NamespaceKeyword */: // namespace | return true; case 23 /* DotToken */: - return containingNodeKind === 234 /* ModuleDeclaration */; // module A.| + return containingNodeKind === 237 /* ModuleDeclaration */; // module A.| case 17 /* OpenBraceToken */: - return containingNodeKind === 230 /* ClassDeclaration */; // class A{ | + return containingNodeKind === 233 /* ClassDeclaration */; // class A{ | case 58 /* EqualsToken */: - return containingNodeKind === 227 /* VariableDeclaration */ // const x = a| - || containingNodeKind === 195 /* BinaryExpression */; // x = a| + return containingNodeKind === 230 /* VariableDeclaration */ // const x = a| + || containingNodeKind === 198 /* BinaryExpression */; // x = a| case 14 /* TemplateHead */: - return containingNodeKind === 197 /* TemplateExpression */; // `aa ${| + return containingNodeKind === 200 /* TemplateExpression */; // `aa ${| case 15 /* TemplateMiddle */: - return containingNodeKind === 206 /* TemplateSpan */; // `aa ${10} dd ${| + return containingNodeKind === 209 /* TemplateSpan */; // `aa ${10} dd ${| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */; // class A{ public | + return containingNodeKind === 151 /* PropertyDeclaration */; // class A{ public | } // Previous token may have been a keyword that was converted to an identifier. switch (previousToken.getText()) { @@ -83895,7 +85740,7 @@ var ts; completionKind = 0 /* ObjectPropertyDeclaration */; var typeMembers; var existingMembers; - if (objectLikeContainer.kind === 179 /* ObjectLiteralExpression */) { + if (objectLikeContainer.kind === 182 /* ObjectLiteralExpression */) { // We are completing on contextual types, but may also include properties // other than those within the declared type. isNewIdentifierLocation = true; @@ -83906,23 +85751,23 @@ var ts; existingMembers = objectLikeContainer.properties; } else { - ts.Debug.assert(objectLikeContainer.kind === 175 /* ObjectBindingPattern */); + ts.Debug.assert(objectLikeContainer.kind === 178 /* ObjectBindingPattern */); // We are *only* completing on properties from the type being destructured. isNewIdentifierLocation = false; var rootDeclaration = ts.getRootDeclaration(objectLikeContainer.parent); if (!ts.isVariableLike(rootDeclaration)) - throw ts.Debug.fail("Root declaration is not variable-like."); + return ts.Debug.fail("Root declaration is not variable-like."); // We don't want to complete using the type acquired by the shape // of the binding pattern; we are only interested in types acquired // through type declaration or inference. // Also proceed if rootDeclaration is a parameter and if its containing function expression/arrow function is contextually typed - // type of parameter will flow in from the contextual type of the function - var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 217 /* ForOfStatement */; - if (!canGetType && rootDeclaration.kind === 147 /* Parameter */) { + var canGetType = ts.hasInitializer(rootDeclaration) || ts.hasType(rootDeclaration) || rootDeclaration.parent.parent.kind === 220 /* ForOfStatement */; + if (!canGetType && rootDeclaration.kind === 148 /* Parameter */) { if (ts.isExpression(rootDeclaration.parent)) { canGetType = !!typeChecker.getContextualType(rootDeclaration.parent); } - else if (rootDeclaration.parent.kind === 152 /* MethodDeclaration */ || rootDeclaration.parent.kind === 155 /* SetAccessor */) { + else if (rootDeclaration.parent.kind === 153 /* MethodDeclaration */ || rootDeclaration.parent.kind === 156 /* SetAccessor */) { canGetType = ts.isExpression(rootDeclaration.parent.parent) && !!typeChecker.getContextualType(rootDeclaration.parent.parent); } } @@ -83937,7 +85782,7 @@ var ts; } if (typeMembers && typeMembers.length > 0) { // Add filtered items to the completion list - symbols = filterObjectMembersList(typeMembers, existingMembers); + symbols = filterObjectMembersList(typeMembers, ts.Debug.assertDefined(existingMembers)); } return true; } @@ -83957,9 +85802,9 @@ var ts; * @returns true if 'symbols' was successfully populated; false otherwise. */ function tryGetImportOrExportClauseCompletionSymbols(namedImportsOrExports) { - var declarationKind = namedImportsOrExports.kind === 242 /* NamedImports */ ? - 239 /* ImportDeclaration */ : - 245 /* ExportDeclaration */; + var declarationKind = namedImportsOrExports.kind === 245 /* NamedImports */ ? + 242 /* ImportDeclaration */ : + 248 /* ExportDeclaration */; var importOrExportDeclaration = ts.getAncestor(namedImportsOrExports, declarationKind); var moduleSpecifier = importOrExportDeclaration.moduleSpecifier; if (!moduleSpecifier) { @@ -84031,7 +85876,7 @@ var ts; if (contextToken) { switch (contextToken.kind) { case 17 /* OpenBraceToken */: // const x = { | - case 26 /* CommaToken */:// const x = { a: 0, | + case 26 /* CommaToken */: // const x = { a: 0, | var parent = contextToken.parent; if (ts.isObjectLiteralExpression(parent) || ts.isObjectBindingPattern(parent)) { return parent; @@ -84049,10 +85894,10 @@ var ts; if (contextToken) { switch (contextToken.kind) { case 17 /* OpenBraceToken */: // import { | - case 26 /* CommaToken */:// import { a as 0, | + case 26 /* CommaToken */: // import { a as 0, | switch (contextToken.parent.kind) { - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return contextToken.parent; } } @@ -84077,7 +85922,7 @@ var ts; function tryGetClassLikeCompletionContainer(contextToken) { if (contextToken) { switch (contextToken.kind) { - case 17 /* OpenBraceToken */:// class c { | + case 17 /* OpenBraceToken */: // class c { | if (ts.isClassLike(contextToken.parent)) { return contextToken.parent; } @@ -84110,7 +85955,7 @@ var ts; } } // class c { method() { } | method2() { } } - if (location && location.kind === 290 /* SyntaxList */ && ts.isClassLike(location.parent)) { + if (location && location.kind === 293 /* SyntaxList */ && ts.isClassLike(location.parent)) { return location.parent; } return undefined; @@ -84155,14 +86000,14 @@ var ts; case 28 /* LessThanSlashToken */: case 41 /* SlashToken */: case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 258 /* JsxAttributes */: - case 257 /* JsxAttribute */: - case 259 /* JsxSpreadAttribute */: - if (parent && (parent.kind === 251 /* JsxSelfClosingElement */ || parent.kind === 252 /* JsxOpeningElement */)) { + case 183 /* PropertyAccessExpression */: + case 261 /* JsxAttributes */: + case 260 /* JsxAttribute */: + case 262 /* JsxSpreadAttribute */: + if (parent && (parent.kind === 254 /* JsxSelfClosingElement */ || parent.kind === 255 /* JsxOpeningElement */)) { return parent; } - else if (parent.kind === 257 /* JsxAttribute */) { + else if (parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84174,7 +86019,7 @@ var ts; // its parent is a JsxExpression, whose parent is a JsxAttribute, // whose parent is a JsxOpeningLikeElement case 9 /* StringLiteral */: - if (parent && ((parent.kind === 257 /* JsxAttribute */) || (parent.kind === 259 /* JsxSpreadAttribute */))) { + if (parent && ((parent.kind === 260 /* JsxAttribute */) || (parent.kind === 262 /* JsxSpreadAttribute */))) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84184,8 +86029,8 @@ var ts; break; case 18 /* CloseBraceToken */: if (parent && - parent.kind === 260 /* JsxExpression */ && - parent.parent && parent.parent.kind === 257 /* JsxAttribute */) { + parent.kind === 263 /* JsxExpression */ && + parent.parent && parent.parent.kind === 260 /* JsxAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84193,7 +86038,7 @@ var ts; // each JsxAttribute can have initializer as JsxExpression return parent.parent.parent.parent; } - if (parent && parent.kind === 259 /* JsxSpreadAttribute */) { + if (parent && parent.kind === 262 /* JsxSpreadAttribute */) { // Currently we parse JsxOpeningLikeElement as: // JsxOpeningLikeElement // attributes: JsxAttributes @@ -84212,59 +86057,59 @@ var ts; var containingNodeKind = contextToken.parent.kind; switch (contextToken.kind) { case 26 /* CommaToken */: - return containingNodeKind === 227 /* VariableDeclaration */ || - containingNodeKind === 228 /* VariableDeclarationList */ || - containingNodeKind === 209 /* VariableStatement */ || - containingNodeKind === 233 /* EnumDeclaration */ || // enum a { foo, | + return containingNodeKind === 230 /* VariableDeclaration */ || + containingNodeKind === 231 /* VariableDeclarationList */ || + containingNodeKind === 212 /* VariableStatement */ || + containingNodeKind === 236 /* EnumDeclaration */ || // enum a { foo, | isFunctionLikeButNotConstructor(containingNodeKind) || - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A= contextToken.pos); case 23 /* DotToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [.| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [.| case 56 /* ColonToken */: - return containingNodeKind === 177 /* BindingElement */; // var {x :html| + return containingNodeKind === 180 /* BindingElement */; // var {x :html| case 21 /* OpenBracketToken */: - return containingNodeKind === 176 /* ArrayBindingPattern */; // var [x| + return containingNodeKind === 179 /* ArrayBindingPattern */; // var [x| case 19 /* OpenParenToken */: - return containingNodeKind === 264 /* CatchClause */ || + return containingNodeKind === 267 /* CatchClause */ || isFunctionLikeButNotConstructor(containingNodeKind); case 17 /* OpenBraceToken */: - return containingNodeKind === 233 /* EnumDeclaration */ || // enum a { | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface a { | - containingNodeKind === 164 /* TypeLiteral */; // const x : { | + return containingNodeKind === 236 /* EnumDeclaration */ || // enum a { | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface a { | + containingNodeKind === 165 /* TypeLiteral */; // const x : { | case 25 /* SemicolonToken */: - return containingNodeKind === 149 /* PropertySignature */ && + return containingNodeKind === 150 /* PropertySignature */ && contextToken.parent && contextToken.parent.parent && - (contextToken.parent.parent.kind === 231 /* InterfaceDeclaration */ || // interface a { f; | - contextToken.parent.parent.kind === 164 /* TypeLiteral */); // const x : { a; | + (contextToken.parent.parent.kind === 234 /* InterfaceDeclaration */ || // interface a { f; | + contextToken.parent.parent.kind === 165 /* TypeLiteral */); // const x : { a; | case 27 /* LessThanToken */: - return containingNodeKind === 230 /* ClassDeclaration */ || // class A< | - containingNodeKind === 200 /* ClassExpression */ || // var C = class D< | - containingNodeKind === 231 /* InterfaceDeclaration */ || // interface A< | - containingNodeKind === 232 /* TypeAliasDeclaration */ || // type List< | + return containingNodeKind === 233 /* ClassDeclaration */ || // class A< | + containingNodeKind === 203 /* ClassExpression */ || // var C = class D< | + containingNodeKind === 234 /* InterfaceDeclaration */ || // interface A< | + containingNodeKind === 235 /* TypeAliasDeclaration */ || // type List< | ts.isFunctionLikeKind(containingNodeKind); case 115 /* StaticKeyword */: - return containingNodeKind === 150 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); + return containingNodeKind === 151 /* PropertyDeclaration */ && !ts.isClassLike(contextToken.parent.parent); case 24 /* DotDotDotToken */: - return containingNodeKind === 147 /* Parameter */ || + return containingNodeKind === 148 /* Parameter */ || (contextToken.parent && contextToken.parent.parent && - contextToken.parent.parent.kind === 176 /* ArrayBindingPattern */); // var [...z| + contextToken.parent.parent.kind === 179 /* ArrayBindingPattern */); // var [...z| case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - return containingNodeKind === 147 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); + return containingNodeKind === 148 /* Parameter */ && !ts.isConstructorDeclaration(contextToken.parent.parent); case 118 /* AsKeyword */: - return containingNodeKind === 243 /* ImportSpecifier */ || - containingNodeKind === 247 /* ExportSpecifier */ || - containingNodeKind === 241 /* NamespaceImport */; + return containingNodeKind === 246 /* ImportSpecifier */ || + containingNodeKind === 250 /* ExportSpecifier */ || + containingNodeKind === 244 /* NamespaceImport */; case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: if (isFromClassElementDeclaration(contextToken)) { return false; } @@ -84278,7 +86123,7 @@ var ts; case 110 /* LetKeyword */: case 76 /* ConstKeyword */: case 116 /* YieldKeyword */: - case 138 /* TypeKeyword */:// type htm| + case 139 /* TypeKeyword */: // type htm| return true; } // If the previous token is keyword correspoding to class member completion keyword @@ -84324,7 +86169,7 @@ var ts; && !(ts.isClassLike(contextToken.parent) && (contextToken !== previousToken || position > previousToken.end)); } function isFunctionLikeButNotConstructor(kind) { - return ts.isFunctionLikeKind(kind) && kind !== 153 /* Constructor */; + return ts.isFunctionLikeKind(kind) && kind !== 154 /* Constructor */; } function isDotOfNumericLiteral(contextToken) { if (contextToken.kind === 8 /* NumericLiteral */) { @@ -84353,10 +86198,7 @@ var ts; var name = element.propertyName || element.name; existingImportsOrExports.set(name.escapedText, true); } - if (existingImportsOrExports.size === 0) { - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" /* Default */; }); - } - return ts.filter(exportsOfModule, function (e) { return e.escapedName !== "default" /* Default */ && !existingImportsOrExports.get(e.escapedName); }); + return exportsOfModule.filter(function (e) { return e.escapedName !== "default" /* Default */ && !existingImportsOrExports.get(e.escapedName); }); } /** * Filters out completion suggestions for named imports or exports. @@ -84365,19 +86207,19 @@ var ts; * do not occur at the current position and have not otherwise been typed. */ function filterObjectMembersList(contextualMemberSymbols, existingMembers) { - if (!existingMembers || existingMembers.length === 0) { + if (existingMembers.length === 0) { return contextualMemberSymbols; } var existingMemberNames = ts.createUnderscoreEscapedMap(); for (var _i = 0, existingMembers_1 = existingMembers; _i < existingMembers_1.length; _i++) { var m = existingMembers_1[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 265 /* PropertyAssignment */ && - m.kind !== 266 /* ShorthandPropertyAssignment */ && - m.kind !== 177 /* BindingElement */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 268 /* PropertyAssignment */ && + m.kind !== 269 /* ShorthandPropertyAssignment */ && + m.kind !== 180 /* BindingElement */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -84385,7 +86227,7 @@ var ts; continue; } var existingName = void 0; - if (m.kind === 177 /* BindingElement */ && m.propertyName) { + if (m.kind === 180 /* BindingElement */ && m.propertyName) { // include only identifiers in completion list if (m.propertyName.kind === 71 /* Identifier */) { existingName = m.propertyName.escapedText; @@ -84396,11 +86238,11 @@ var ts; // NOTE: if one only performs this step when m.name is an identifier, // things like '__proto__' are not filtered out. var name = ts.getNameOfDeclaration(m); - existingName = ts.getEscapedTextOfIdentifierOrLiteral(name); + existingName = ts.isPropertyNameLiteral(name) ? ts.getEscapedTextOfIdentifierOrLiteral(name) : undefined; } existingMemberNames.set(existingName, true); } - return ts.filter(contextualMemberSymbols, function (m) { return !existingMemberNames.get(m.escapedName); }); + return contextualMemberSymbols.filter(function (m) { return !existingMemberNames.get(m.escapedName); }); } /** * Filters out completion suggestions for class elements. @@ -84412,10 +86254,10 @@ var ts; for (var _i = 0, existingMembers_2 = existingMembers; _i < existingMembers_2.length; _i++) { var m = existingMembers_2[_i]; // Ignore omitted expressions for missing members - if (m.kind !== 150 /* PropertyDeclaration */ && - m.kind !== 152 /* MethodDeclaration */ && - m.kind !== 154 /* GetAccessor */ && - m.kind !== 155 /* SetAccessor */) { + if (m.kind !== 151 /* PropertyDeclaration */ && + m.kind !== 153 /* MethodDeclaration */ && + m.kind !== 155 /* GetAccessor */ && + m.kind !== 156 /* SetAccessor */) { continue; } // If this is the current item we are editing right now, do not filter it out @@ -84470,11 +86312,11 @@ var ts; if (isCurrentlyEditingNode(attr)) { continue; } - if (attr.kind === 257 /* JsxAttribute */) { + if (attr.kind === 260 /* JsxAttribute */) { seenNames.set(attr.name.escapedText, true); } } - return ts.filter(symbols, function (a) { return !seenNames.get(a.escapedName); }); + return symbols.filter(function (a) { return !seenNames.get(a.escapedName); }); } function isCurrentlyEditingNode(node) { return node.getStart() <= position && position <= node.getEnd(); @@ -84500,10 +86342,10 @@ var ts; // TODO: GH#18169 return { name: JSON.stringify(name), needsConvertPropertyAccess: false }; case 2 /* PropertyAccess */: - case 5 /* None */: case 1 /* Global */: // Don't add a completion for a name starting with a space. See https://github.com/Microsoft/TypeScript/pull/20547 return name.charCodeAt(0) === 32 /* space */ ? undefined : { name: name, needsConvertPropertyAccess: true }; + case 5 /* None */: case 4 /* String */: return validIdentiferResult; default: @@ -84514,7 +86356,7 @@ var ts; var _keywordCompletions = []; var allKeywordsCompletions = ts.memoize(function () { var res = []; - for (var i = 72 /* FirstKeyword */; i <= 143 /* LastKeyword */; i++) { + for (var i = 72 /* FirstKeyword */; i <= 144 /* LastKeyword */; i++) { res.push({ name: ts.tokenToString(i), kind: "keyword" /* keyword */, @@ -84530,7 +86372,7 @@ var ts; switch (keywordFilter) { case 0 /* None */: // "undefined" is a global variable, so don't need a keyword completion for it. - return kind !== 139 /* UndefinedKeyword */; + return kind !== 140 /* UndefinedKeyword */; case 1 /* ClassElementKeywords */: return isClassMemberCompletionKeyword(kind); case 2 /* ConstructorParameterKeywords */: @@ -84552,9 +86394,9 @@ var ts; case 117 /* AbstractKeyword */: case 115 /* StaticKeyword */: case 123 /* ConstructorKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 125 /* GetKeyword */: - case 135 /* SetKeyword */: + case 136 /* SetKeyword */: case 120 /* AsyncKeyword */: return true; } @@ -84567,7 +86409,7 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; } } @@ -84579,13 +86421,13 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: case 123 /* ConstructorKeyword */: case 115 /* StaticKeyword */: case 117 /* AbstractKeyword */: case 125 /* GetKeyword */: - case 135 /* SetKeyword */: - case 139 /* UndefinedKeyword */: + case 136 /* SetKeyword */: + case 140 /* UndefinedKeyword */: return false; } return true; @@ -84637,14 +86479,14 @@ var ts; */ function getPropertiesForCompletion(type, checker, isForAccess) { if (!(type.flags & 131072 /* Union */)) { - return type.getApparentProperties(); + return ts.Debug.assertEachDefined(type.getApparentProperties(), "getApparentProperties() should all be defined"); } var types = type.types; // If we're providing completions for an object literal, skip primitive, array-like, or callable types since those shouldn't be implemented by object literals. var filteredTypes = isForAccess ? types : types.filter(function (memberType) { return !(memberType.flags & 16382 /* Primitive */ || checker.isArrayLikeType(memberType) || ts.typeHasCallOrConstructSignatures(memberType, checker)); }); - return checker.getAllPossiblePropertiesOfTypes(filteredTypes); + return ts.Debug.assertEachDefined(checker.getAllPossiblePropertiesOfTypes(filteredTypes), "getAllPossiblePropertiesOfTypes() should all be defined"); } })(Completions = ts.Completions || (ts.Completions = {})); })(ts || (ts = {})); @@ -84676,30 +86518,17 @@ var ts; } function getSemanticDocumentHighlights(position, node, program, cancellationToken, sourceFilesToSearch) { var referenceEntries = ts.FindAllReferences.getReferenceEntriesForNode(position, node, program, sourceFilesToSearch, cancellationToken); - return referenceEntries && convertReferencedSymbols(referenceEntries); - } - function convertReferencedSymbols(referenceEntries) { - var fileNameToDocumentHighlights = ts.createMap(); - for (var _i = 0, referenceEntries_1 = referenceEntries; _i < referenceEntries_1.length; _i++) { - var entry = referenceEntries_1[_i]; - var _a = ts.FindAllReferences.toHighlightSpan(entry), fileName = _a.fileName, span_12 = _a.span; - var highlightSpans = fileNameToDocumentHighlights.get(fileName); - if (!highlightSpans) { - fileNameToDocumentHighlights.set(fileName, highlightSpans = []); - } - highlightSpans.push(span_12); - } - return ts.arrayFrom(fileNameToDocumentHighlights.entries(), function (_a) { + if (!referenceEntries) + return undefined; + var map = ts.arrayToMultiMap(referenceEntries.map(ts.FindAllReferences.toHighlightSpan), function (e) { return e.fileName; }, function (e) { return e.span; }); + return ts.arrayFrom(map.entries(), function (_a) { var fileName = _a[0], highlightSpans = _a[1]; return ({ fileName: fileName, highlightSpans: highlightSpans }); }); } function getSyntacticDocumentHighlights(node, sourceFile) { var highlightSpans = getHighlightSpans(node, sourceFile); - if (!highlightSpans || highlightSpans.length === 0) { - return undefined; - } - return [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; + return highlightSpans && [{ fileName: sourceFile.fileName, highlightSpans: highlightSpans }]; } function getHighlightSpans(node, sourceFile) { switch (node.kind) { @@ -84728,15 +86557,20 @@ var ts; case 81 /* DoKeyword */: return useParent(node.parent, function (n) { return ts.isIterationStatement(n, /*lookInLabeledStatements*/ true); }, getLoopBreakContinueOccurrences); case 123 /* ConstructorKeyword */: - return useParent(node.parent, ts.isConstructorDeclaration, getConstructorOccurrences); + return getFromAllDeclarations(ts.isConstructorDeclaration, [123 /* ConstructorKeyword */]); case 125 /* GetKeyword */: - case 135 /* SetKeyword */: - return useParent(node.parent, ts.isAccessor, getGetAndSetOccurrences); + case 136 /* SetKeyword */: + return getFromAllDeclarations(ts.isAccessor, [125 /* GetKeyword */, 136 /* SetKeyword */]); default: return ts.isModifierKind(node.kind) && (ts.isDeclaration(node.parent) || ts.isVariableStatement(node.parent)) ? highlightSpans(getModifierOccurrences(node.kind, node.parent)) : undefined; } + function getFromAllDeclarations(nodeTest, keywords) { + return useParent(node.parent, nodeTest, function (decl) { return ts.mapDefined(decl.symbol.declarations, function (d) { + return nodeTest(d) ? ts.find(d.getChildren(sourceFile), function (c) { return ts.contains(keywords, c.kind); }) : undefined; + }); }); + } function useParent(node, nodeTest, getNodes) { return nodeTest(node) ? highlightSpans(getNodes(node, sourceFile)) : undefined; } @@ -84749,30 +86583,15 @@ var ts; * into function boundaries and try-blocks with catch-clauses. */ function aggregateOwnedThrowStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (ts.isThrowStatement(node)) { - statementAccumulator.push(node); - } - else if (ts.isTryStatement(node)) { - if (node.catchClause) { - aggregate(node.catchClause); - } - else { - // Exceptions thrown within a try block lacking a catch clause - // are "owned" in the current context. - aggregate(node.tryBlock); - } - if (node.finallyBlock) { - aggregate(node.finallyBlock); - } - } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } + if (ts.isThrowStatement(node)) { + return [node]; } + else if (ts.isTryStatement(node)) { + // Exceptions thrown within a try block lacking a catch clause are "owned" in the current context. + return ts.concatenate(node.catchClause ? aggregateOwnedThrowStatements(node.catchClause) : node.tryBlock && aggregateOwnedThrowStatements(node.tryBlock), aggregateOwnedThrowStatements(node.finallyBlock)); + } + // Do not cross function boundaries. + return ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateOwnedThrowStatements); } /** * For lack of a better name, this function takes a throw statement and returns the @@ -84783,33 +86602,30 @@ var ts; var child = throwStatement; while (child.parent) { var parent = child.parent; - if (ts.isFunctionBlock(parent) || parent.kind === 269 /* SourceFile */) { + if (ts.isFunctionBlock(parent) || parent.kind === 272 /* SourceFile */) { return parent; } // A throw-statement is only owned by a try-statement if the try-statement has // a catch clause, and if the throw-statement occurs within the try block. - if (parent.kind === 225 /* TryStatement */) { - var tryStatement = parent; - if (tryStatement.tryBlock === child && tryStatement.catchClause) { - return child; - } + if (ts.isTryStatement(parent) && parent.tryBlock === child && parent.catchClause) { + return child; } child = parent; } return undefined; } function aggregateAllBreakAndContinueStatements(node) { - var statementAccumulator = []; - aggregate(node); - return statementAccumulator; - function aggregate(node) { - if (node.kind === 219 /* BreakStatement */ || node.kind === 218 /* ContinueStatement */) { - statementAccumulator.push(node); + return ts.isBreakOrContinueStatement(node) ? [node] : ts.isFunctionLike(node) ? undefined : flatMapChildren(node, aggregateAllBreakAndContinueStatements); + } + function flatMapChildren(node, cb) { + var result = []; + node.forEachChild(function (child) { + var value = cb(child); + if (value !== undefined) { + result.push.apply(result, ts.toArray(value)); } - else if (!ts.isFunctionLike(node)) { - ts.forEachChild(node, aggregate); - } - } + }); + return result; } function ownsBreakOrContinueStatement(owner, statement) { var actualOwner = getBreakOrContinueOwner(statement); @@ -84818,17 +86634,17 @@ var ts; function getBreakOrContinueOwner(statement) { return ts.findAncestor(statement, function (node) { switch (node.kind) { - case 222 /* SwitchStatement */: - if (statement.kind === 218 /* ContinueStatement */) { + case 225 /* SwitchStatement */: + if (statement.kind === 221 /* ContinueStatement */) { return false; } // falls through - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - return !statement.label || isLabeledBy(node, statement.label.text); + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + return !statement.label || isLabeledBy(node, statement.label.escapedText); default: // Don't cross function boundaries. // TODO: GH#20090 @@ -84837,10 +86653,6 @@ var ts; }); } function getModifierOccurrences(modifier, declaration) { - // Make sure we only highlight the keyword when it makes sense to do so. - if (!isLegalModifier(modifier, declaration)) { - return undefined; - } var modifierFlag = ts.modifierToFlag(modifier); return ts.mapDefined(getNodesToSearchForModifier(declaration, modifierFlag), function (node) { if (ts.getModifierFlags(node) & modifierFlag) { @@ -84851,24 +86663,28 @@ var ts; }); } function getNodesToSearchForModifier(declaration, modifierFlag) { + // Types of node whose children might have modifiers. var container = declaration.parent; switch (container.kind) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 208 /* Block */: - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 211 /* Block */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // Container is either a class declaration or the declaration is a classDeclaration - if (modifierFlag & 128 /* Abstract */) { + if (modifierFlag & 128 /* Abstract */ && ts.isClassDeclaration(declaration)) { return declaration.members.concat([declaration]); } else { return container.statements; } - case 153 /* Constructor */: - return container.parameters.concat(container.parent.members); - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 232 /* FunctionDeclaration */: { + return container.parameters.concat((ts.isClassLike(container.parent) ? container.parent.members : [])); + } + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: var nodes = container.members; // If we're an accessibility modifier, we're in an instance member and should search // the constructor's parameter list for instance members as well. @@ -84883,33 +86699,7 @@ var ts; } return nodes; default: - ts.Debug.fail("Invalid container kind."); - } - } - function isLegalModifier(modifier, declaration) { - var container = declaration.parent; - switch (modifier) { - case 112 /* PrivateKeyword */: - case 113 /* ProtectedKeyword */: - case 114 /* PublicKeyword */: - switch (container.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - return true; - case 153 /* Constructor */: - return declaration.kind === 147 /* Parameter */; - default: - return false; - } - case 115 /* StaticKeyword */: - return container.kind === 230 /* ClassDeclaration */ || container.kind === 200 /* ClassExpression */; - case 84 /* ExportKeyword */: - case 124 /* DeclareKeyword */: - return container.kind === 235 /* ModuleBlock */ || container.kind === 269 /* SourceFile */; - case 117 /* AbstractKeyword */: - return container.kind === 230 /* ClassDeclaration */ || declaration.kind === 230 /* ClassDeclaration */; - default: - return false; + ts.Debug.assertNever(container, "Invalid container kind."); } } function pushKeywordIf(keywordList, token) { @@ -84923,33 +86713,11 @@ var ts; } return false; } - function getGetAndSetOccurrences(accessorDeclaration) { - var keywords = []; - tryPushAccessorKeyword(accessorDeclaration.symbol, 154 /* GetAccessor */); - tryPushAccessorKeyword(accessorDeclaration.symbol, 155 /* SetAccessor */); - return keywords; - function tryPushAccessorKeyword(accessorSymbol, accessorKind) { - var accessor = ts.getDeclarationOfKind(accessorSymbol, accessorKind); - if (accessor) { - ts.forEach(accessor.getChildren(), function (child) { return pushKeywordIf(keywords, child, 125 /* GetKeyword */, 135 /* SetKeyword */); }); - } - } - } - function getConstructorOccurrences(constructorDeclaration) { - var declarations = constructorDeclaration.symbol.getDeclarations(); - var keywords = []; - ts.forEach(declarations, function (declaration) { - ts.forEach(declaration.getChildren(), function (token) { - return pushKeywordIf(keywords, token, 123 /* ConstructorKeyword */); - }); - }); - return keywords; - } function getLoopBreakContinueOccurrences(loopNode) { var keywords = []; if (pushKeywordIf(keywords, loopNode.getFirstToken(), 88 /* ForKeyword */, 106 /* WhileKeyword */, 81 /* DoKeyword */)) { // If we succeeded and got a do-while loop, then start looking for a 'while' keyword. - if (loopNode.kind === 213 /* DoStatement */) { + if (loopNode.kind === 216 /* DoStatement */) { var loopTokens = loopNode.getChildren(); for (var i = loopTokens.length - 1; i >= 0; i--) { if (pushKeywordIf(keywords, loopTokens[i], 106 /* WhileKeyword */)) { @@ -84958,8 +86726,7 @@ var ts; } } } - var breaksAndContinues = aggregateAllBreakAndContinueStatements(loopNode.statement); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(loopNode.statement), function (statement) { if (ownsBreakOrContinueStatement(loopNode, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */, 77 /* ContinueKeyword */); } @@ -84970,13 +86737,13 @@ var ts; var owner = getBreakOrContinueOwner(breakOrContinueStatement); if (owner) { switch (owner.kind) { - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 213 /* DoStatement */: - case 214 /* WhileStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 216 /* DoStatement */: + case 217 /* WhileStatement */: return getLoopBreakContinueOccurrences(owner); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: return getSwitchCaseDefaultOccurrences(owner); } } @@ -84988,8 +86755,7 @@ var ts; // Go through each clause in the switch statement, collecting the 'case'/'default' keywords. ts.forEach(switchStatement.caseBlock.clauses, function (clause) { pushKeywordIf(keywords, clause.getFirstToken(), 73 /* CaseKeyword */, 79 /* DefaultKeyword */); - var breaksAndContinues = aggregateAllBreakAndContinueStatements(clause); - ts.forEach(breaksAndContinues, function (statement) { + ts.forEach(aggregateAllBreakAndContinueStatements(clause), function (statement) { if (ownsBreakOrContinueStatement(switchStatement, statement)) { pushKeywordIf(keywords, statement.getFirstToken(), 72 /* BreakKeyword */); } @@ -85009,36 +86775,36 @@ var ts; } return keywords; } - function getThrowOccurrences(throwStatement) { + function getThrowOccurrences(throwStatement, sourceFile) { var owner = getThrowStatementOwner(throwStatement); if (!owner) { return undefined; } var keywords = []; ts.forEach(aggregateOwnedThrowStatements(owner), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); // If the "owner" is a function, then we equate 'return' and 'throw' statements in their // ability to "jump out" of the function, and include occurrences for both. if (ts.isFunctionBlock(owner)) { ts.forEachReturnStatement(owner, function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); } return keywords; } - function getReturnOccurrences(returnStatement) { + function getReturnOccurrences(returnStatement, sourceFile) { var func = ts.getContainingFunction(returnStatement); if (!func) { return undefined; } var keywords = []; ts.forEachReturnStatement(ts.cast(func.body, ts.isBlock), function (returnStatement) { - pushKeywordIf(keywords, returnStatement.getFirstToken(), 96 /* ReturnKeyword */); + keywords.push(ts.findChildOfKind(returnStatement, 96 /* ReturnKeyword */, sourceFile)); }); // Include 'throw' statements that do not occur within a try block. ts.forEach(aggregateOwnedThrowStatements(func.body), function (throwStatement) { - pushKeywordIf(keywords, throwStatement.getFirstToken(), 100 /* ThrowKeyword */); + keywords.push(ts.findChildOfKind(throwStatement, 100 /* ThrowKeyword */, sourceFile)); }); return keywords; } @@ -85102,12 +86868,7 @@ var ts; * Note: 'node' cannot be a SourceFile. */ function isLabeledBy(node, labelName) { - for (var owner = node.parent; owner.kind === 223 /* LabeledStatement */; owner = owner.parent) { - if (owner.label.escapedText === labelName) { - return true; - } - } - return false; + return !!ts.findAncestor(node.parent, function (owner) { return !ts.isLabeledStatement(owner) ? "quit" : owner.label.escapedText === labelName; }); } })(DocumentHighlights = ts.DocumentHighlights || (ts.DocumentHighlights = {})); })(ts || (ts = {})); @@ -85284,10 +87045,10 @@ var ts; } cancellationToken.throwIfCancellationRequested(); switch (direct.kind) { - case 182 /* CallExpression */: + case 185 /* CallExpression */: if (!isAvailableThroughGlobal) { var parent = direct.parent; - if (exportKind === 2 /* ExportEquals */ && parent.kind === 227 /* VariableDeclaration */) { + if (exportKind === 2 /* ExportEquals */ && parent.kind === 230 /* VariableDeclaration */) { var name = parent.name; if (name.kind === 71 /* Identifier */) { directImports.push(name); @@ -85298,24 +87059,26 @@ var ts; addIndirectUser(direct.getSourceFile()); } break; - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: handleNamespaceImport(direct, direct.name, ts.hasModifier(direct, 1 /* Export */)); break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var namedBindings = direct.importClause && direct.importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImport(direct, namedBindings.name); } else if (ts.isDefaultImport(direct)) { var sourceFileLike = getSourceFileLikeForImportDeclaration(direct); - addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + if (!isAvailableThroughGlobal) { + addIndirectUser(sourceFileLike); // Add a check for indirect uses to handle synthetic default imports + } directImports.push(direct); } else { directImports.push(direct); } break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: if (!direct.exportClause) { // This is `export * from "foo"`, so imports of this module may import the export too. handleDirectImports(getContainingModuleSymbol(direct, checker)); @@ -85336,7 +87099,7 @@ var ts; } else if (!isAvailableThroughGlobal) { var sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration); - ts.Debug.assert(sourceFileLike.kind === 269 /* SourceFile */ || sourceFileLike.kind === 234 /* ModuleDeclaration */); + ts.Debug.assert(sourceFileLike.kind === 272 /* SourceFile */ || sourceFileLike.kind === 237 /* ModuleDeclaration */); if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) { addIndirectUsers(sourceFileLike); } @@ -85391,7 +87154,7 @@ var ts; } return { importSearches: importSearches, singleReferences: singleReferences }; function handleImport(decl) { - if (decl.kind === 238 /* ImportEqualsDeclaration */) { + if (decl.kind === 241 /* ImportEqualsDeclaration */) { if (isExternalModuleImportEquals(decl)) { handleNamespaceImportLike(decl.name); } @@ -85405,7 +87168,7 @@ var ts; if (decl.moduleSpecifier.kind !== 9 /* StringLiteral */) { return; } - if (decl.kind === 245 /* ExportDeclaration */) { + if (decl.kind === 248 /* ExportDeclaration */) { searchForNamedImport(decl.exportClause); return; } @@ -85414,7 +87177,7 @@ var ts; return; } var namedBindings = importClause.namedBindings; - if (namedBindings && namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings && namedBindings.kind === 244 /* NamespaceImport */) { handleNamespaceImportLike(namedBindings.name); return; } @@ -85460,13 +87223,13 @@ var ts; if (propertyName) { // This is `import { foo as bar } from "./a"` or `export { foo as bar } from "./a"`. `foo` isn't a local in the file, so just add it as a single reference. singleReferences.push(propertyName); - if (!isForRename) { + if (!isForRename) { // If renaming `foo`, don't touch `bar`, just `foo`. // Search locally for `bar`. addSearch(name, checker.getSymbolAtLocation(name)); } } else { - var localSymbol = element.kind === 247 /* ExportSpecifier */ && element.propertyName + var localSymbol = element.kind === 250 /* ExportSpecifier */ && element.propertyName ? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol. : checker.getSymbolAtLocation(name); addSearch(name, localSymbol); @@ -85482,7 +87245,7 @@ var ts; function findNamespaceReExports(sourceFileLike, name, checker) { var namespaceImportSymbol = checker.getSymbolAtLocation(name); return forEachPossibleImportOrExportStatement(sourceFileLike, function (statement) { - if (statement.kind !== 245 /* ExportDeclaration */) + if (statement.kind !== 248 /* ExportDeclaration */) return; var _a = statement, exportClause = _a.exportClause, moduleSpecifier = _a.moduleSpecifier; if (moduleSpecifier || !exportClause) @@ -85501,7 +87264,7 @@ var ts; for (var _i = 0, sourceFiles_4 = sourceFiles; _i < sourceFiles_4.length; _i++) { var referencingFile = sourceFiles_4[_i]; var searchSourceFile = searchModuleSymbol.valueDeclaration; - if (searchSourceFile.kind === 269 /* SourceFile */) { + if (searchSourceFile.kind === 272 /* SourceFile */) { for (var _a = 0, _b = referencingFile.referencedFiles; _a < _b.length; _a++) { var ref = _b[_a]; if (program.getSourceFileFromReference(referencingFile, ref) === searchSourceFile) { @@ -85548,7 +87311,7 @@ var ts; } /** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */ function forEachPossibleImportOrExportStatement(sourceFileLike, action) { - return ts.forEach(sourceFileLike.kind === 269 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { + return ts.forEach(sourceFileLike.kind === 272 /* SourceFile */ ? sourceFileLike.statements : sourceFileLike.body.statements, function (statement) { return action(statement) || (isAmbientModuleDeclaration(statement) && ts.forEach(statement.body && statement.body.statements, action)); }); } @@ -85563,18 +87326,18 @@ var ts; else { forEachPossibleImportOrExportStatement(sourceFile, function (statement) { switch (statement.kind) { - case 245 /* ExportDeclaration */: - case 239 /* ImportDeclaration */: { + case 248 /* ExportDeclaration */: + case 242 /* ImportDeclaration */: { var decl = statement; if (decl.moduleSpecifier && decl.moduleSpecifier.kind === 9 /* StringLiteral */) { action(decl, decl.moduleSpecifier); } break; } - case 238 /* ImportEqualsDeclaration */: { + case 241 /* ImportEqualsDeclaration */: { var decl = statement; var moduleReference = decl.moduleReference; - if (moduleReference.kind === 249 /* ExternalModuleReference */ && + if (moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */) { action(decl, moduleReference.expression); } @@ -85587,11 +87350,11 @@ var ts; function importerFromModuleSpecifier(moduleSpecifier) { var decl = moduleSpecifier.parent; switch (decl.kind) { - case 182 /* CallExpression */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 185 /* CallExpression */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return decl; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return decl.parent; default: ts.Debug.fail("Unexpected module specifier parent: " + decl.kind); @@ -85609,7 +87372,7 @@ var ts; function getExport() { var parent = node.parent; if (symbol.exportSymbol) { - if (parent.kind === 180 /* PropertyAccessExpression */) { + if (parent.kind === 183 /* PropertyAccessExpression */) { // When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use. // So check that we are at the declaration. return symbol.declarations.some(function (d) { return d === parent; }) && ts.isBinaryExpression(parent.parent) @@ -85635,12 +87398,15 @@ var ts; return exportInfo(symbol, getExportKindForDeclaration(exportNode)); } } + // If we are in `export = a;` or `export default a;`, `parent` is the export assignment. else if (ts.isExportAssignment(parent)) { return getExportAssignmentExport(parent); } + // If we are in `export = class A {};` (or `export = class A {};`) at `A`, `parent.parent` is the export assignment. else if (ts.isExportAssignment(parent.parent)) { return getExportAssignmentExport(parent.parent); } + // Similar for `module.exports =` and `exports.A =`. else if (ts.isBinaryExpression(parent)) { return getSpecialPropertyExport(parent, /*useLhsSymbol*/ true); } @@ -85650,8 +87416,7 @@ var ts; } function getExportAssignmentExport(ex) { // Get the symbol for the `export =` node; its parent is the module it's the export of. - var exportingModuleSymbol = ex.symbol.parent; - ts.Debug.assert(!!exportingModuleSymbol); + var exportingModuleSymbol = ts.Debug.assertDefined(ex.symbol.parent, "Expected export symbol to have a parent"); var exportKind = ex.isExportEquals ? 2 /* ExportEquals */ : 1 /* Default */; return { kind: 1 /* Export */, symbol: symbol, exportInfo: { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } }; } @@ -85667,7 +87432,11 @@ var ts; default: return undefined; } - var sym = useLhsSymbol ? checker.getSymbolAtLocation(node.left.name) : symbol; + var sym = useLhsSymbol ? checker.getSymbolAtLocation(ts.cast(node.left, ts.isPropertyAccessExpression).name) : symbol; + // Better detection for GH#20803 + if (sym && !(checker.getMergedSymbol(sym.parent).flags & 1536 /* Module */)) { + ts.Debug.fail("Special property assignment kind does not have a module as its parent. Assignment is " + ts.Debug.showSymbol(sym) + ", parent is " + ts.Debug.showSymbol(sym.parent)); + } return sym && exportInfo(sym, kind); } } @@ -85705,24 +87474,24 @@ var ts; FindAllReferences.getImportOrExportSymbol = getImportOrExportSymbol; function getExportEqualsLocalSymbol(importedSymbol, checker) { if (importedSymbol.flags & 2097152 /* Alias */) { - return checker.getImmediateAliasedSymbol(importedSymbol); + return ts.Debug.assertDefined(checker.getImmediateAliasedSymbol(importedSymbol)); } var decl = importedSymbol.valueDeclaration; - if (ts.isExportAssignment(decl)) { - return decl.expression.symbol; + if (ts.isExportAssignment(decl)) { // `export = class {}` + return ts.Debug.assertDefined(decl.expression.symbol); } - else if (ts.isBinaryExpression(decl)) { - return decl.right.symbol; + else if (ts.isBinaryExpression(decl)) { // `module.exports = class {}` + return ts.Debug.assertDefined(decl.right.symbol); } - ts.Debug.fail(); + return ts.Debug.fail(); } // If a reference is a class expression, the exported node would be its parent. // If a reference is a variable declaration, the exported node would be the variable statement. function getExportNode(parent, node) { - if (parent.kind === 227 /* VariableDeclaration */) { + if (parent.kind === 230 /* VariableDeclaration */) { var p = parent; return p.name !== node ? undefined : - p.parent.kind === 264 /* CatchClause */ ? undefined : p.parent.parent.kind === 209 /* VariableStatement */ ? p.parent.parent : undefined; + p.parent.kind === 267 /* CatchClause */ ? undefined : p.parent.parent.kind === 212 /* VariableStatement */ ? p.parent.parent : undefined; } else { return parent; @@ -85731,15 +87500,15 @@ var ts; function isNodeImport(node) { var parent = node.parent; switch (parent.kind) { - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: return parent.name === node && isExternalModuleImportEquals(parent) ? { isNamedImport: false } : undefined; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: // For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`. return parent.propertyName ? undefined : { isNamedImport: true }; - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: ts.Debug.assert(parent.name === node); return { isNamedImport: false }; default: @@ -85747,7 +87516,10 @@ var ts; } } function getExportInfo(exportSymbol, exportKind, checker) { - var exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation. + var moduleSymbol = exportSymbol.parent; + if (!moduleSymbol) + return undefined; // This can happen if an `export` is not at the top-level (which is a compile error). + var exportingModuleSymbol = checker.getMergedSymbol(moduleSymbol); // Need to get merged symbol in case there's an augmentation. // `export` may appear in a namespace. In that case, just rely on global search. return ts.isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol: exportingModuleSymbol, exportKind: exportKind } : undefined; } @@ -85778,22 +87550,22 @@ var ts; return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol); } function getSourceFileLikeForImportDeclaration(node) { - if (node.kind === 182 /* CallExpression */) { + if (node.kind === 185 /* CallExpression */) { return node.getSourceFile(); } var parent = node.parent; - if (parent.kind === 269 /* SourceFile */) { + if (parent.kind === 272 /* SourceFile */) { return parent; } - ts.Debug.assert(parent.kind === 235 /* ModuleBlock */ && isAmbientModuleDeclaration(parent.parent)); - return parent.parent; + ts.Debug.assert(parent.kind === 238 /* ModuleBlock */); + return ts.cast(parent.parent, isAmbientModuleDeclaration); } function isAmbientModuleDeclaration(node) { - return node.kind === 234 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; + return node.kind === 237 /* ModuleDeclaration */ && node.name.kind === 9 /* StringLiteral */; } function isExternalModuleImportEquals(_a) { var moduleReference = _a.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; + return moduleReference.kind === 252 /* ExternalModuleReference */ && moduleReference.expression.kind === 9 /* StringLiteral */; } })(FindAllReferences = ts.FindAllReferences || (ts.FindAllReferences = {})); })(ts || (ts = {})); @@ -85808,12 +87580,13 @@ var ts; } FindAllReferences.nodeEntry = nodeEntry; function findReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position) { - var referencedSymbols = findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position); + var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + var referencedSymbols = FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, /*options*/ {}); var checker = program.getTypeChecker(); return !referencedSymbols || !referencedSymbols.length ? undefined : ts.mapDefined(referencedSymbols, function (_a) { var definition = _a.definition, references = _a.references; // Only include referenced symbols that have a valid definition. - return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker), references: references.map(toReferenceEntry) }; + return definition && { definition: definitionToReferencedSymbolDefinitionInfo(definition, checker, node), references: references.map(toReferenceEntry) }; }); } FindAllReferences.findReferencedSymbols = findReferencedSymbols; @@ -85826,13 +87599,13 @@ var ts; } FindAllReferences.getImplementationsAtPosition = getImplementationsAtPosition; function getImplementationReferenceEntries(program, cancellationToken, sourceFiles, node, position) { - if (node.kind === 269 /* SourceFile */) { + if (node.kind === 272 /* SourceFile */) { return undefined; } var checker = program.getTypeChecker(); // If invoked directly on a shorthand property assignment, then return // the declaration of the symbol being assigned (not the symbol being assigned to). - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var result_4 = []; FindAllReferences.Core.getReferenceEntriesForShorthandPropertyAssignment(node, checker, function (node) { return result_4.push(nodeEntry(node)); }); return result_4; @@ -85849,8 +87622,8 @@ var ts; } } function findReferencedEntries(program, cancellationToken, sourceFiles, sourceFile, position, options) { - var x = flattenEntries(findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options)); - return ts.map(x, toReferenceEntry); + var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return ts.map(flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)), toReferenceEntry); } FindAllReferences.findReferencedEntries = findReferencedEntries; function getReferenceEntriesForNode(position, node, program, sourceFiles, cancellationToken, options) { @@ -85858,46 +87631,41 @@ var ts; return flattenEntries(FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options)); } FindAllReferences.getReferenceEntriesForNode = getReferenceEntriesForNode; - function findAllReferencedSymbols(program, cancellationToken, sourceFiles, sourceFile, position, options) { - var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - return FindAllReferences.Core.getReferencedSymbolsForNode(position, node, program, sourceFiles, cancellationToken, options); - } function flattenEntries(referenceSymbols) { return referenceSymbols && ts.flatMap(referenceSymbols, function (r) { return r.references; }); } - function definitionToReferencedSymbolDefinitionInfo(def, checker) { + function definitionToReferencedSymbolDefinitionInfo(def, checker, originalNode) { var info = (function () { switch (def.type) { case "symbol": { - var symbol = def.symbol, node_3 = def.node; - var _a = getDefinitionKindAndDisplayParts(symbol, node_3, checker), displayParts_1 = _a.displayParts, kind_1 = _a.kind; + var symbol = def.symbol; + var _a = getDefinitionKindAndDisplayParts(symbol, checker, originalNode), displayParts_1 = _a.displayParts, kind_1 = _a.kind; var name_4 = displayParts_1.map(function (p) { return p.text; }).join(""); - return { node: node_3, name: name_4, kind: kind_1, displayParts: displayParts_1 }; + return { node: symbol.declarations ? ts.getNameOfDeclaration(ts.first(symbol.declarations)) || ts.first(symbol.declarations) : originalNode, name: name_4, kind: kind_1, displayParts: displayParts_1 }; } case "label": { - var node_4 = def.node; - return { node: node_4, name: node_4.text, kind: "label" /* label */, displayParts: [ts.displayPart(node_4.text, ts.SymbolDisplayPartKind.text)] }; + var node_3 = def.node; + return { node: node_3, name: node_3.text, kind: "label" /* label */, displayParts: [ts.displayPart(node_3.text, ts.SymbolDisplayPartKind.text)] }; } case "keyword": { - var node_5 = def.node; - var name_5 = ts.tokenToString(node_5.kind); - return { node: node_5, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; + var node_4 = def.node; + var name_5 = ts.tokenToString(node_4.kind); + return { node: node_4, name: name_5, kind: "keyword" /* keyword */, displayParts: [{ text: name_5, kind: "keyword" /* keyword */ }] }; } case "this": { - var node_6 = def.node; - var symbol = checker.getSymbolAtLocation(node_6); - var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_6.getSourceFile(), ts.getContainerNode(node_6), node_6).displayParts; - return { node: node_6, name: "this", kind: "var" /* variableElement */, displayParts: displayParts_2 }; + var node_5 = def.node; + var symbol = checker.getSymbolAtLocation(node_5); + var displayParts_2 = symbol && ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node_5.getSourceFile(), ts.getContainerNode(node_5), node_5).displayParts; + return { node: node_5, name: "this", kind: "var" /* variableElement */, displayParts: displayParts_2 }; } case "string": { - var node_7 = def.node; - return { node: node_7, name: node_7.text, kind: "var" /* variableElement */, displayParts: [ts.displayPart(ts.getTextOfNode(node_7), ts.SymbolDisplayPartKind.stringLiteral)] }; + var node_6 = def.node; + return { node: node_6, name: node_6.text, kind: "var" /* variableElement */, displayParts: [ts.displayPart(ts.getTextOfNode(node_6), ts.SymbolDisplayPartKind.stringLiteral)] }; } + default: + return ts.Debug.assertNever(def); } })(); - if (!info) { - return undefined; - } var node = info.node, name = info.name, kind = info.kind, displayParts = info.displayParts; var sourceFile = node.getSourceFile(); return { @@ -85910,8 +87678,10 @@ var ts; displayParts: displayParts }; } - function getDefinitionKindAndDisplayParts(symbol, node, checker) { - var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, node.getSourceFile(), ts.getContainerNode(node), node), displayParts = _a.displayParts, symbolKind = _a.symbolKind; + function getDefinitionKindAndDisplayParts(symbol, checker, node) { + var meaning = FindAllReferences.Core.getIntersectingMeaningFromDeclarations(node, symbol); + var enclosingDeclaration = ts.firstOrUndefined(symbol.declarations) || node; + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(checker, symbol, enclosingDeclaration.getSourceFile(), enclosingDeclaration, enclosingDeclaration, meaning), displayParts = _a.displayParts, symbolKind = _a.symbolKind; return { displayParts: displayParts, kind: symbolKind }; } function toReferenceEntry(entry) { @@ -85942,15 +87712,15 @@ var ts; function implementationKindDisplayParts(node, checker) { var symbol = checker.getSymbolAtLocation(ts.isDeclaration(node) && node.name ? node.name : node); if (symbol) { - return getDefinitionKindAndDisplayParts(symbol, node, checker); + return getDefinitionKindAndDisplayParts(symbol, checker, node); } - else if (node.kind === 179 /* ObjectLiteralExpression */) { + else if (node.kind === 182 /* ObjectLiteralExpression */) { return { kind: "interface" /* interfaceElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("object literal"), ts.punctuationPart(20 /* CloseParenToken */)] }; } - else if (node.kind === 200 /* ClassExpression */) { + else if (node.kind === 203 /* ClassExpression */) { return { kind: "local class" /* localClassElement */, displayParts: [ts.punctuationPart(19 /* OpenParenToken */), ts.textPart("anonymous local class"), ts.punctuationPart(20 /* CloseParenToken */)] @@ -86025,16 +87795,16 @@ var ts; } Core.getReferencedSymbolsForNode = getReferencedSymbolsForNode; function isModuleReferenceLocation(node) { - if (node.kind !== 9 /* StringLiteral */ && node.kind !== 13 /* NoSubstitutionTemplateLiteral */) { + if (!ts.isStringLiteralLike(node)) { return false; } switch (node.parent.kind) { - case 234 /* ModuleDeclaration */: - case 249 /* ExternalModuleReference */: - case 239 /* ImportDeclaration */: - case 245 /* ExportDeclaration */: + case 237 /* ModuleDeclaration */: + case 252 /* ExternalModuleReference */: + case 242 /* ImportDeclaration */: + case 248 /* ExportDeclaration */: return true; - case 182 /* CallExpression */: + case 185 /* CallExpression */: return ts.isRequireCall(node.parent, /*checkArgumentIsStringLiteral*/ false) || ts.isImportCall(node.parent); default: return false; @@ -86057,20 +87827,17 @@ var ts; for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var decl = _a[_i]; switch (decl.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: // Don't include the source file itself. (This may not be ideal behavior, but awkward to include an entire file as a reference.) break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: references.push({ type: "node", node: decl.name }); break; default: ts.Debug.fail("Expected a module symbol to be declared by a SourceFile or ModuleDeclaration."); } } - return [{ - definition: { type: "symbol", symbol: symbol, node: symbol.valueDeclaration }, - references: references - }]; + return [{ definition: { type: "symbol", symbol: symbol }, references: references }]; } /** getReferencedSymbols for special node kinds. */ function getReferencedSymbolsSpecial(node, sourceFiles, cancellationToken) { @@ -86078,17 +87845,15 @@ var ts; return getAllReferencesForKeyword(sourceFiles, node.kind, cancellationToken); } // Labels - if (ts.isLabelName(node)) { - if (ts.isJumpStatementTarget(node)) { - var labelDefinition = ts.getTargetLabel(node.parent, node.text); - // if we have a label definition, look within its statement for references, if not, then - // the label is undefined and we have no results.. - return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); - } - else { - // it is a label definition and not a target, search within the parent labeledStatement - return getLabelReferencesInNode(node.parent, node); - } + if (ts.isJumpStatementTarget(node)) { + var labelDefinition = ts.getTargetLabel(node.parent, node.text); + // if we have a label definition, look within its statement for references, if not, then + // the label is undefined and we have no results.. + return labelDefinition && getLabelReferencesInNode(labelDefinition.parent, labelDefinition); + } + else if (ts.isLabelOfLabeledStatement(node)) { + // it is a label definition and not a target, search within the parent labeledStatement + return getLabelReferencesInNode(node.parent, node); } if (ts.isThis(node)) { return getReferencesForThisKeyword(node, sourceFiles, cancellationToken); @@ -86100,14 +87865,14 @@ var ts; } /** Core find-all-references algorithm for a normal symbol. */ function getReferencedSymbolsForSymbol(symbol, node, sourceFiles, checker, cancellationToken, options) { - symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker); + symbol = skipPastExportOrImportSpecifierOrUnion(symbol, node, checker) || symbol; // Compute the meaning from the location and the symbol it references - var searchMeaning = getIntersectingMeaningFromDeclarations(ts.getMeaningFromLocation(node), symbol.declarations); + var searchMeaning = getIntersectingMeaningFromDeclarations(node, symbol); var result = []; var state = new State(sourceFiles, getSpecialSearchKind(node), checker, cancellationToken, searchMeaning, options, result); if (node.kind === 79 /* DefaultKeyword */) { - addReference(node, symbol, node, state); - searchForImportsOfExport(node, symbol, { exportingModuleSymbol: symbol.parent, exportKind: 1 /* Default */ }, state); + addReference(node, symbol, state); + searchForImportsOfExport(node, symbol, { exportingModuleSymbol: ts.Debug.assertDefined(symbol.parent, "Expected export symbol to have a parent"), exportKind: 1 /* Default */ }, state); } else { var search = state.createSearch(node, symbol, /*comingFrom*/ undefined, { allSearchSymbols: populateSearchSymbolSet(symbol, node, checker, options.implementations) }); @@ -86154,10 +87919,15 @@ var ts; } // If the symbol is declared as part of a declaration like `{ type: "a" } | { type: "b" }`, use the property on the union type to get more references. return ts.firstDefined(symbol.declarations, function (decl) { + if (!decl.parent) { + // Assertions for GH#21814. We should be handling SourceFile symbols in `getReferencedSymbolsForModule` instead of getting here. + ts.Debug.assert(decl.kind === 272 /* SourceFile */); + ts.Debug.fail("Unexpected symbol at " + ts.Debug.showSyntaxKind(node) + ": " + ts.Debug.showSymbol(symbol)); + } return ts.isTypeLiteralNode(decl.parent) && ts.isUnionTypeNode(decl.parent.parent) ? checker.getPropertyOfType(checker.getTypeFromTypeNode(decl.parent.parent), symbol.name) : undefined; - }) || symbol; + }); } var SpecialSearchKind; (function (SpecialSearchKind) { @@ -86205,7 +87975,11 @@ var ts; this.symbolIdToReferences = []; // Source file ID → symbol ID → Whether the symbol has been searched for in the source file. this.sourceFileToSeenSymbols = []; + this.includedSourceFiles = ts.arrayToSet(sourceFiles, function (s) { return s.fileName; }); } + State.prototype.includesSourceFile = function (sourceFile) { + return this.includedSourceFiles.has(sourceFile.fileName); + }; /** Gets every place to look for references of an exported symbols. See `ImportsResult` in `importTracker.ts` for more documentation. */ State.prototype.getImportSearches = function (exportSymbol, exportInfo) { if (!this.importTracker) @@ -86219,11 +87993,11 @@ var ts; // Note: getLocalSymbolForExportDefault handles `export default class C {}`, but not `export default C` or `export { C as default }`. // The other two forms seem to be handled downstream (e.g. in `skipPastExportOrImportSpecifier`), so special-casing the first form // here appears to be intentional). - var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, _b = searchOptions.allSearchSymbols, allSearchSymbols = _b === void 0 ? undefined : _b; + var _a = searchOptions.text, text = _a === void 0 ? ts.stripQuotes(ts.unescapeLeadingUnderscores((ts.getLocalSymbolForExportDefault(symbol) || symbol).escapedName)) : _a, allSearchSymbols = searchOptions.allSearchSymbols; var escapedText = ts.escapeLeadingUnderscores(text); var parents = this.options.implementations && getParentSymbolsOfPropertyAccess(location, symbol, this.checker); return { - location: location, symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, + symbol: symbol, comingFrom: comingFrom, text: text, escapedText: escapedText, parents: parents, includes: function (referenceSymbol) { return allSearchSymbols ? ts.contains(allSearchSymbols, referenceSymbol) : referenceSymbol === symbol; }, }; }; @@ -86231,12 +88005,12 @@ var ts; * Callback to add references for a particular searched symbol. * This initializes a reference group, so only call this if you will add at least one reference. */ - State.prototype.referenceAdder = function (searchSymbol, searchLocation) { + State.prototype.referenceAdder = function (searchSymbol) { var symbolId = ts.getSymbolId(searchSymbol); var references = this.symbolIdToReferences[symbolId]; if (!references) { references = this.symbolIdToReferences[symbolId] = []; - this.result.push({ definition: { type: "symbol", symbol: searchSymbol, node: searchLocation }, references: references }); + this.result.push({ definition: { type: "symbol", symbol: searchSymbol }, references: references }); } return function (node) { return references.push(FindAllReferences.nodeEntry(node)); }; }; @@ -86261,7 +88035,7 @@ var ts; var _a = state.getImportSearches(exportSymbol, exportInfo), importSearches = _a.importSearches, singleReferences = _a.singleReferences, indirectUsers = _a.indirectUsers; // For `import { foo as bar }` just add the reference to `foo`, and don't otherwise search in the file. if (singleReferences.length) { - var addRef = state.referenceAdder(exportSymbol, exportLocation); + var addRef = state.referenceAdder(exportSymbol); for (var _i = 0, singleReferences_1 = singleReferences; _i < singleReferences_1.length; _i++) { var singleRef = singleReferences_1[_i]; addRef(singleRef); @@ -86297,7 +88071,10 @@ var ts; function searchForImportedSymbol(symbol, state) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - getReferencesInSourceFile(declaration.getSourceFile(), state.createSearch(declaration, symbol, 0 /* Import */), state); + var exportingFile = declaration.getSourceFile(); + if (state.includesSourceFile(exportingFile)) { + getReferencesInSourceFile(exportingFile, state.createSearch(declaration, symbol, 0 /* Import */), state); + } } } /** Search for all occurences of an identifier in a source file (and filter out the ones that match). */ @@ -86311,9 +88088,9 @@ var ts; checker.getPropertySymbolOfDestructuringAssignment(location); } function getObjectBindingElementWithoutPropertyName(symbol) { - var bindingElement = ts.getDeclarationOfKind(symbol, 177 /* BindingElement */); + var bindingElement = ts.getDeclarationOfKind(symbol, 180 /* BindingElement */); if (bindingElement && - bindingElement.parent.kind === 175 /* ObjectBindingPattern */ && + bindingElement.parent.kind === 178 /* ObjectBindingPattern */ && !bindingElement.propertyName) { return bindingElement; } @@ -86343,7 +88120,7 @@ var ts; // If this is the symbol of a named function expression or named class expression, // then named references are limited to its own scope. var declarations = symbol.declarations, flags = symbol.flags, parent = symbol.parent, valueDeclaration = symbol.valueDeclaration; - if (valueDeclaration && (valueDeclaration.kind === 187 /* FunctionExpression */ || valueDeclaration.kind === 200 /* ClassExpression */)) { + if (valueDeclaration && (valueDeclaration.kind === 190 /* FunctionExpression */ || valueDeclaration.kind === 203 /* ClassExpression */)) { return valueDeclaration; } if (!declarations) { @@ -86353,7 +88130,7 @@ var ts; if (flags & (4 /* Property */ | 8192 /* Method */)) { var privateDeclaration = ts.find(declarations, function (d) { return ts.hasModifier(d, 8 /* Private */); }); if (privateDeclaration) { - return ts.getAncestor(privateDeclaration, 230 /* ClassDeclaration */); + return ts.getAncestor(privateDeclaration, 233 /* ClassDeclaration */); } // Else this is a public property and could be accessed from anywhere. return undefined; @@ -86382,7 +88159,7 @@ var ts; // Different declarations have different containers, bail out return undefined; } - if (!container || container.kind === 269 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { + if (!container || container.kind === 272 /* SourceFile */ && !ts.isExternalOrCommonJsModule(container)) { // This is a global variable and not an external module, any declaration defined // within this scope is visible outside the file return undefined; @@ -86397,6 +88174,17 @@ var ts; // So we must search the whole source file. (Because we will mark the source file as seen, we we won't return to it when searching for imports.) return exposedByParent ? scope.getSourceFile() : scope; } + /** Used as a quick check for whether a symbol is used at all in a file (besides its definition). */ + function isSymbolReferencedInFile(definition, checker, sourceFile) { + var symbol = checker.getSymbolAtLocation(definition); + if (!symbol) + return true; // Be lenient with invalid code. + return getPossibleSymbolReferencePositions(sourceFile, symbol.name).some(function (position) { + var token = ts.tryCast(ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true), ts.isIdentifier); + return token && token !== definition && token.escapedText === definition.escapedText && checker.getSymbolAtLocation(token) === symbol; + }); + } + Core.isSymbolReferencedInFile = isSymbolReferencedInFile; function getPossibleSymbolReferencePositions(sourceFile, symbolName, container) { if (container === void 0) { container = sourceFile; } var positions = []; @@ -86427,18 +88215,13 @@ var ts; return positions; } function getLabelReferencesInNode(container, targetLabel) { - var references = []; var sourceFile = container.getSourceFile(); var labelName = targetLabel.text; - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, labelName, container); - for (var _i = 0, possiblePositions_1 = possiblePositions; _i < possiblePositions_1.length; _i++) { - var position = possiblePositions_1[_i]; + var references = ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, labelName, container), function (position) { var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); // Only pick labels that are either the target label, or have a target that is the target label - if (node && (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel))) { - references.push(FindAllReferences.nodeEntry(node)); - } - } + return node && (node === targetLabel || (ts.isJumpStatementTarget(node) && ts.getTargetLabel(node, labelName) === targetLabel)) ? FindAllReferences.nodeEntry(node) : undefined; + }); return [{ definition: { type: "label", node: targetLabel }, references: references }]; } function isValidReferencePosition(node, searchSymbolName) { @@ -86458,24 +88241,15 @@ var ts; } } function getAllReferencesForKeyword(sourceFiles, keywordKind, cancellationToken) { - var references = []; - for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { - var sourceFile = sourceFiles_6[_i]; + var references = ts.flatMap(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); - addReferencesForKeywordInFile(sourceFile, keywordKind, ts.tokenToString(keywordKind), references); - } + return ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, ts.tokenToString(keywordKind), sourceFile), function (position) { + var referenceLocation = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); + return referenceLocation.kind === keywordKind ? FindAllReferences.nodeEntry(referenceLocation) : undefined; + }); + }); return references.length ? [{ definition: { type: "keyword", node: references[0].node }, references: references }] : undefined; } - function addReferencesForKeywordInFile(sourceFile, kind, searchText, references) { - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, searchText, sourceFile); - for (var _i = 0, possiblePositions_2 = possiblePositions; _i < possiblePositions_2.length; _i++) { - var position = possiblePositions_2[_i]; - var referenceLocation = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); - if (referenceLocation.kind === kind) { - references.push(FindAllReferences.nodeEntry(referenceLocation)); - } - } - } function getReferencesInSourceFile(sourceFile, search, state) { state.cancellationToken.throwIfCancellationRequested(); return getReferencesInContainer(sourceFile, sourceFile, search, state); @@ -86533,7 +88307,7 @@ var ts; } switch (state.specialSearchKind) { case 0 /* None */: - addReference(referenceLocation, relatedSymbol, search.location, state); + addReference(referenceLocation, relatedSymbol, state); break; case 1 /* Constructor */: addConstructorReferences(referenceLocation, sourceFile, search, state); @@ -86563,7 +88337,7 @@ var ts; addRef(); } if (!state.options.isForRename && state.markSeenReExportRHS(name)) { - addReference(name, referenceSymbol, name, state); + addReference(name, referenceSymbol, state); } } else { @@ -86580,14 +88354,16 @@ var ts; } // At `export { x } from "foo"`, also search for the imported symbol `"foo".x`. if (search.comingFrom !== 1 /* Export */ && exportDeclaration.moduleSpecifier && !propertyName) { - searchForImportedSymbol(state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier), state); + var imported = state.checker.getExportSpecifierLocalTargetSymbol(exportSpecifier); + if (imported) + searchForImportedSymbol(imported, state); } function addRef() { - addReference(referenceLocation, localSymbol, search.location, state); + addReference(referenceLocation, localSymbol, state); } } function getLocalSymbolForExportSpecifier(referenceLocation, referenceSymbol, exportSpecifier, checker) { - return isExportSpecifierAlias(referenceLocation, exportSpecifier) ? checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) : referenceSymbol; + return isExportSpecifierAlias(referenceLocation, exportSpecifier) && checker.getExportSpecifierLocalTargetSymbol(exportSpecifier) || referenceSymbol; } function isExportSpecifierAlias(referenceLocation, exportSpecifier) { var parent = exportSpecifier.parent, propertyName = exportSpecifier.propertyName, name = exportSpecifier.name; @@ -86628,11 +88404,11 @@ var ts; * position of property accessing, the referenceEntry of such position will be handled in the first case. */ if (!(flags & 33554432 /* Transient */) && search.includes(shorthandValueSymbol)) { - addReference(ts.getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, search.location, state); + addReference(ts.getNameOfDeclaration(valueDeclaration), shorthandValueSymbol, state); } } - function addReference(referenceLocation, relatedSymbol, searchLocation, state) { - var addRef = state.referenceAdder(relatedSymbol, searchLocation); + function addReference(referenceLocation, relatedSymbol, state) { + var addRef = state.referenceAdder(relatedSymbol); if (state.options.implementations) { addImplementationReferences(referenceLocation, addRef, state); } @@ -86643,11 +88419,11 @@ var ts; /** Adds references when a constructor is used with `new this()` in its own class and `super()` calls in subclasses. */ function addConstructorReferences(referenceLocation, sourceFile, search, state) { if (ts.isNewExpressionTarget(referenceLocation)) { - addReference(referenceLocation, search.symbol, search.location, state); + addReference(referenceLocation, search.symbol, state); } - var pusher = function () { return state.referenceAdder(search.symbol, search.location); }; + var pusher = function () { return state.referenceAdder(search.symbol); }; if (ts.isClassLike(referenceLocation.parent)) { - ts.Debug.assert(referenceLocation.parent.name === referenceLocation); + ts.Debug.assert(referenceLocation.kind === 79 /* DefaultKeyword */ || referenceLocation.parent.name === referenceLocation); // This is the class declaration containing the constructor. findOwnConstructorReferences(search.symbol, sourceFile, pusher()); } @@ -86660,11 +88436,11 @@ var ts; } } function addClassStaticThisReferences(referenceLocation, search, state) { - addReference(referenceLocation, search.symbol, search.location, state); - if (ts.isClassLike(referenceLocation.parent)) { + addReference(referenceLocation, search.symbol, state); + if (!state.options.isForRename && ts.isClassLike(referenceLocation.parent)) { ts.Debug.assert(referenceLocation.parent.name === referenceLocation); // This is the class declaration. - addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol, search.location)); + addStaticThisReferences(referenceLocation.parent, state.referenceAdder(search.symbol)); } } function addStaticThisReferences(classLike, pusher) { @@ -86694,12 +88470,12 @@ var ts; for (var _i = 0, _a = classSymbol.members.get("__constructor" /* Constructor */).declarations; _i < _a.length; _i++) { var decl = _a[_i]; var ctrKeyword = ts.findChildOfKind(decl, 123 /* ConstructorKeyword */, sourceFile); - ts.Debug.assert(decl.kind === 153 /* Constructor */ && !!ctrKeyword); + ts.Debug.assert(decl.kind === 154 /* Constructor */ && !!ctrKeyword); addNode(ctrKeyword); } classSymbol.exports.forEach(function (member) { var decl = member.valueDeclaration; - if (decl && decl.kind === 152 /* MethodDeclaration */) { + if (decl && decl.kind === 153 /* MethodDeclaration */) { var body = decl.body; if (body) { forEachDescendantOfKind(body, 99 /* ThisKeyword */, function (thisKeyword) { @@ -86720,7 +88496,7 @@ var ts; } for (var _i = 0, _a = ctr.declarations; _i < _a.length; _i++) { var decl = _a[_i]; - ts.Debug.assert(decl.kind === 153 /* Constructor */); + ts.Debug.assert(decl.kind === 154 /* Constructor */); var body = decl.body; if (body) { forEachDescendantOfKind(body, 97 /* SuperKeyword */, function (node) { @@ -86740,7 +88516,7 @@ var ts; if (refNode.kind !== 71 /* Identifier */) { return; } - if (refNode.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (refNode.parent.kind === 269 /* ShorthandPropertyAssignment */) { // Go ahead and dereference the shorthand assignment by going to its definition getReferenceEntriesForShorthandPropertyAssignment(refNode, state.checker, addReference); } @@ -86759,7 +88535,7 @@ var ts; } else if (ts.isFunctionLike(parent) && parent.type === containingTypeReference && parent.body) { var body = parent.body; - if (body.kind === 208 /* Block */) { + if (body.kind === 211 /* Block */) { ts.forEachReturnStatement(body, function (returnStatement) { if (returnStatement.expression && isImplementationExpression(returnStatement.expression)) { addReference(returnStatement.expression); @@ -86789,7 +88565,7 @@ var ts; return result; } function getContainingTypeReference(node) { - var topLevelTypeReference = undefined; + var topLevelTypeReference; while (node) { if (ts.isTypeNode(node)) { topLevelTypeReference = node; @@ -86800,12 +88576,12 @@ var ts; } function getContainingClassIfInHeritageClause(node) { if (node && node.parent) { - if (node.kind === 202 /* ExpressionWithTypeArguments */ - && node.parent.kind === 263 /* HeritageClause */ + if (node.kind === 205 /* ExpressionWithTypeArguments */ + && node.parent.kind === 266 /* HeritageClause */ && ts.isClassLike(node.parent.parent)) { return node.parent.parent; } - else if (node.kind === 71 /* Identifier */ || node.kind === 180 /* PropertyAccessExpression */) { + else if (node.kind === 71 /* Identifier */ || node.kind === 183 /* PropertyAccessExpression */) { return getContainingClassIfInHeritageClause(node.parent); } } @@ -86816,13 +88592,13 @@ var ts; */ function isImplementationExpression(node) { switch (node.kind) { - case 186 /* ParenthesizedExpression */: + case 189 /* ParenthesizedExpression */: return isImplementationExpression(node.expression); - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 179 /* ObjectLiteralExpression */: - case 200 /* ClassExpression */: - case 178 /* ArrayLiteralExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 182 /* ObjectLiteralExpression */: + case 203 /* ClassExpression */: + case 181 /* ArrayLiteralExpression */: return true; default: return false; @@ -86876,7 +88652,7 @@ var ts; } return searchTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { if (parentIsInterface) { return ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), searchTypeReference); } @@ -86904,64 +88680,59 @@ var ts; // Whether 'super' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; default: return undefined; } - var references = []; var sourceFile = searchSpaceNode.getSourceFile(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode); - for (var _i = 0, possiblePositions_3 = possiblePositions; _i < possiblePositions_3.length; _i++) { - var position = possiblePositions_3[_i]; + var references = ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, "super", searchSpaceNode), function (position) { var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); if (!node || node.kind !== 97 /* SuperKeyword */) { - continue; + return; } var container = ts.getSuperContainer(node, /*stopOnFunctions*/ false); // If we have a 'super' container, we must have an enclosing class. // Now make sure the owning class is the same as the search-space // and has the same static qualifier as the original 'super's owner. - if (container && (32 /* Static */ & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol) { - references.push(FindAllReferences.nodeEntry(node)); - } - } - return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol, node: superKeyword }, references: references }]; + return container && (32 /* Static */ & ts.getModifierFlags(container)) === staticFlag && container.parent.symbol === searchSpaceNode.symbol ? FindAllReferences.nodeEntry(node) : undefined; + }); + return [{ definition: { type: "symbol", symbol: searchSpaceNode.symbol }, references: references }]; } function getReferencesForThisKeyword(thisOrSuperKeyword, sourceFiles, cancellationToken) { var searchSpaceNode = ts.getThisContainer(thisOrSuperKeyword, /* includeArrowFunctions */ false); // Whether 'this' occurs in a static context within a class. var staticFlag = 32 /* Static */; switch (searchSpaceNode.kind) { - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: if (ts.isObjectLiteralMethod(searchSpaceNode)) { break; } // falls through - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: staticFlag &= ts.getModifierFlags(searchSpaceNode); searchSpaceNode = searchSpaceNode.parent; // re-assign to be the owning class break; - case 269 /* SourceFile */: + case 272 /* SourceFile */: if (ts.isExternalModule(searchSpaceNode)) { return undefined; } // falls through - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: break; // Computed properties in classes are not handled here because references to this are illegal, // so there is no point finding references to them. @@ -86969,81 +88740,65 @@ var ts; return undefined; } var references = []; - var possiblePositions; - if (searchSpaceNode.kind === 269 /* SourceFile */) { - ts.forEach(sourceFiles, function (sourceFile) { - cancellationToken.throwIfCancellationRequested(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this"); - getThisReferencesInFile(sourceFile, sourceFile, possiblePositions, references); - }); - } - else { - var sourceFile = searchSpaceNode.getSourceFile(); - possiblePositions = getPossibleSymbolReferencePositions(sourceFile, "this", searchSpaceNode); - getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, references); + for (var _i = 0, _a = searchSpaceNode.kind === 272 /* SourceFile */ ? sourceFiles : [searchSpaceNode.getSourceFile()]; _i < _a.length; _i++) { + var sourceFile = _a[_i]; + cancellationToken.throwIfCancellationRequested(); + var positions = getPossibleSymbolReferencePositions(sourceFile, "this", ts.isSourceFile(searchSpaceNode) ? sourceFile : searchSpaceNode); + getThisReferencesInFile(sourceFile, searchSpaceNode.kind === 272 /* SourceFile */ ? sourceFile : searchSpaceNode, positions, staticFlag, references); } return [{ definition: { type: "this", node: thisOrSuperKeyword }, references: references }]; - function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, result) { - ts.forEach(possiblePositions, function (position) { - var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (!node || !ts.isThis(node)) { - return; - } - var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); - switch (searchSpaceNode.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - if (searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 200 /* ClassExpression */: - case 230 /* ClassDeclaration */: - // Make sure the container belongs to the same class - // and has the appropriate static modifier from the original container. - if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - case 269 /* SourceFile */: - if (container.kind === 269 /* SourceFile */ && !ts.isExternalModule(container)) { - result.push(FindAllReferences.nodeEntry(node)); - } - break; - } - }); - } + } + function getThisReferencesInFile(sourceFile, searchSpaceNode, possiblePositions, staticFlag, result) { + ts.forEach(possiblePositions, function (position) { + var node = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); + if (!node || !ts.isThis(node)) { + return; + } + var container = ts.getThisContainer(node, /* includeArrowFunctions */ false); + switch (searchSpaceNode.kind) { + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + if (searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + if (ts.isObjectLiteralMethod(searchSpaceNode) && searchSpaceNode.symbol === container.symbol) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 203 /* ClassExpression */: + case 233 /* ClassDeclaration */: + // Make sure the container belongs to the same class + // and has the appropriate static modifier from the original container. + if (container.parent && searchSpaceNode.symbol === container.parent.symbol && (ts.getModifierFlags(container) & 32 /* Static */) === staticFlag) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + case 272 /* SourceFile */: + if (container.kind === 272 /* SourceFile */ && !ts.isExternalModule(container)) { + result.push(FindAllReferences.nodeEntry(node)); + } + break; + } + }); } function getReferencesForStringLiteral(node, sourceFiles, cancellationToken) { - var references = []; - for (var _i = 0, sourceFiles_7 = sourceFiles; _i < sourceFiles_7.length; _i++) { - var sourceFile = sourceFiles_7[_i]; + var references = ts.flatMap(sourceFiles, function (sourceFile) { cancellationToken.throwIfCancellationRequested(); - var possiblePositions = getPossibleSymbolReferencePositions(sourceFile, node.text); - getReferencesForStringLiteralInFile(sourceFile, node.text, possiblePositions, references); - } + return ts.mapDefined(getPossibleSymbolReferencePositions(sourceFile, node.text), function (position) { + var ref = ts.tryCast(ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false), ts.isStringLiteral); + return ref && ref.text === node.text ? FindAllReferences.nodeEntry(ref, /*isInString*/ true) : undefined; + }); + }); return [{ definition: { type: "string", node: node }, references: references }]; - function getReferencesForStringLiteralInFile(sourceFile, searchText, possiblePositions, references) { - for (var _i = 0, possiblePositions_4 = possiblePositions; _i < possiblePositions_4.length; _i++) { - var position = possiblePositions_4[_i]; - var node_8 = ts.getTouchingWord(sourceFile, position, /*includeJsDocComment*/ false); - if (node_8 && node_8.kind === 9 /* StringLiteral */ && node_8.text === searchText) { - references.push(FindAllReferences.nodeEntry(node_8, /*isInString*/ true)); - } - } - } } // For certain symbol kinds, we need to include other symbols in the search set. // This is not needed when searching for re-exports. @@ -87055,7 +88810,7 @@ var ts; // If the location is name of property symbol from object literal destructuring pattern // Search the property symbol // for ( { property: p2 } of elems) { } - if (containingObjectLiteralElement.kind !== 266 /* ShorthandPropertyAssignment */) { + if (containingObjectLiteralElement.kind !== 269 /* ShorthandPropertyAssignment */) { var propertySymbol = getPropertySymbolOfDestructuringAssignment(location, checker); if (propertySymbol) { result.push(propertySymbol); @@ -87148,7 +88903,7 @@ var ts; getPropertySymbolFromTypeReference(ts.getClassExtendsHeritageClauseElement(declaration)); ts.forEach(ts.getClassImplementsHeritageClauseElements(declaration), getPropertySymbolFromTypeReference); } - else if (declaration.kind === 231 /* InterfaceDeclaration */) { + else if (declaration.kind === 234 /* InterfaceDeclaration */) { ts.forEach(ts.getInterfaceBaseTypeNodes(declaration), getPropertySymbolFromTypeReference); } }); @@ -87234,7 +88989,7 @@ var ts; } } function getNameFromObjectLiteralElement(node) { - if (node.name.kind === 145 /* ComputedPropertyName */) { + if (node.name.kind === 146 /* ComputedPropertyName */) { var nameExpression = node.name.expression; // treat computed property names where expression is string/numeric literal as just string/numeric literal if (ts.isStringOrNumericLiteral(nameExpression)) { @@ -87260,7 +89015,9 @@ var ts; * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) * do not intersect in any of the three spaces. */ - function getIntersectingMeaningFromDeclarations(meaning, declarations) { + function getIntersectingMeaningFromDeclarations(node, symbol) { + var meaning = ts.getMeaningFromLocation(node); + var declarations = symbol.declarations; if (declarations) { var lastIterationMeaning = void 0; do { @@ -87281,6 +89038,7 @@ var ts; } return meaning; } + Core.getIntersectingMeaningFromDeclarations = getIntersectingMeaningFromDeclarations; function isImplementation(node) { if (!node) { return false; @@ -87288,7 +89046,7 @@ var ts; else if (ts.isVariableLike(node) && ts.hasInitializer(node)) { return true; } - else if (node.kind === 227 /* VariableDeclaration */) { + else if (node.kind === 230 /* VariableDeclaration */) { var parentStatement = getParentStatementOfVariableDeclaration(node); return parentStatement && ts.hasModifier(parentStatement, 2 /* Ambient */); } @@ -87297,18 +89055,18 @@ var ts; } else { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: return true; } } return false; } function getParentStatementOfVariableDeclaration(node) { - if (node.parent && node.parent.parent && node.parent.parent.kind === 209 /* VariableStatement */) { - ts.Debug.assert(node.parent.kind === 228 /* VariableDeclarationList */); + if (node.parent && node.parent.parent && node.parent.parent.kind === 212 /* VariableStatement */) { + ts.Debug.assert(node.parent.kind === 231 /* VariableDeclarationList */); return node.parent.parent; } } @@ -87384,9 +89142,8 @@ var ts; } // Labels if (ts.isJumpStatementTarget(node)) { - var labelName = node.text; - var label = ts.getTargetLabel(node.parent, labelName); - return label ? [createDefinitionInfoFromName(label, "label" /* label */, labelName, /*containerName*/ undefined)] : undefined; + var label = ts.getTargetLabel(node.parent, node.text); + return label ? [createDefinitionInfoFromName(label, "label" /* label */, node.text, /*containerName*/ undefined)] : undefined; } var typeChecker = program.getTypeChecker(); var calledDeclaration = tryGetSignatureDeclaration(typeChecker, node); @@ -87414,7 +89171,7 @@ var ts; // go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition // is performed at the location of property access, we would like to go to definition of the property in the short-hand // assignment. This case and others are handled by the following code. - if (node.parent.kind === 266 /* ShorthandPropertyAssignment */) { + if (node.parent.kind === 269 /* ShorthandPropertyAssignment */) { var shorthandSymbol = typeChecker.getShorthandAssignmentValueSymbol(symbol.valueDeclaration); if (!shorthandSymbol) { return []; @@ -87504,10 +89261,7 @@ var ts; // Check if position is on triple slash reference. var comment = findReferenceInPosition(sourceFile.referencedFiles, position) || findReferenceInPosition(sourceFile.typeReferenceDirectives, position); if (comment) { - return { - definitions: definitions, - textSpan: ts.createTextSpanFromBounds(comment.pos, comment.end) - }; + return { definitions: definitions, textSpan: ts.createTextSpanFromRange(comment) }; } var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); var textSpan = ts.createTextSpan(node.getStart(), node.getWidth()); @@ -87527,11 +89281,11 @@ var ts; return true; } switch (declaration.kind) { - case 240 /* ImportClause */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 241 /* ImportEqualsDeclaration */: return true; - case 243 /* ImportSpecifier */: - return declaration.parent.kind === 242 /* NamedImports */; + case 246 /* ImportSpecifier */: + return declaration.parent.kind === 245 /* NamedImports */; default: return false; } @@ -87542,7 +89296,7 @@ var ts; function getConstructSignatureDefinition() { // Applicable only if we are in a new expression, or we are on a constructor declaration // and in either case the symbol has a construct signature definition, i.e. class - if (ts.isNewExpressionTarget(node) || node.kind === 123 /* ConstructorKeyword */ && symbol.flags & 32 /* Class */) { + if (symbol.flags & 32 /* Class */ && (ts.isNewExpressionTarget(node) || node.kind === 123 /* ConstructorKeyword */)) { var cls = ts.find(symbol.declarations, ts.isClassLike) || ts.Debug.fail("Expected declaration to have at least one class-like declaration"); return getSignatureDefinition(cls.members, /*selectConstructors*/ true); } @@ -87564,10 +89318,11 @@ var ts; } function isSignatureDeclaration(node) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 154 /* Constructor */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: return true; default: return false; @@ -87685,6 +89440,7 @@ var ts; "see", "since", "static", + "template", "throws", "type", "typedef", @@ -87716,9 +89472,9 @@ var ts; JsDoc.getJsDocCommentsFromDeclarations = getJsDocCommentsFromDeclarations; function getCommentHavingNodes(declaration) { switch (declaration.kind) { - case 289 /* JSDocPropertyTag */: + case 292 /* JSDocPropertyTag */: return [declaration]; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return [declaration.parent]; default: return ts.getJSDocCommentsAndTags(declaration); @@ -87739,15 +89495,15 @@ var ts; function getCommentText(tag) { var comment = tag.comment; switch (tag.kind) { - case 282 /* JSDocAugmentsTag */: + case 285 /* JSDocAugmentsTag */: return withNode(tag.class); - case 287 /* JSDocTemplateTag */: + case 290 /* JSDocTemplateTag */: return withList(tag.typeParameters); - case 286 /* JSDocTypeTag */: + case 289 /* JSDocTypeTag */: return withNode(tag.typeExpression); - case 288 /* JSDocTypedefTag */: - case 289 /* JSDocPropertyTag */: - case 284 /* JSDocParameterTag */: + case 291 /* JSDocTypedefTag */: + case 292 /* JSDocPropertyTag */: + case 287 /* JSDocParameterTag */: var name = tag.name; return name ? withNode(name) : comment; default: @@ -87903,9 +89659,7 @@ var ts; var docParams = ""; for (var i = 0; i < parameters.length; i++) { var currentName = parameters[i].name; - var paramName = currentName.kind === 71 /* Identifier */ ? - currentName.escapedText : - "param" + i; + var paramName = currentName.kind === 71 /* Identifier */ ? currentName.escapedText : "param" + i; if (isJavaScriptFile) { docParams += indentationStr + " * @param {any} " + paramName + newLine; } @@ -87932,20 +89686,20 @@ var ts; function getCommentOwnerInfo(tokenAtPos) { for (var commentOwner = tokenAtPos; commentOwner; commentOwner = commentOwner.parent) { switch (commentOwner.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: + case 152 /* MethodSignature */: var parameters = commentOwner.parameters; return { commentOwner: commentOwner, parameters: parameters }; - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 149 /* PropertySignature */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 232 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 150 /* PropertySignature */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 235 /* TypeAliasDeclaration */: return { commentOwner: commentOwner }; - case 209 /* VariableStatement */: { + case 212 /* VariableStatement */: { var varStatement = commentOwner; var varDeclarations = varStatement.declarationList.declarations; var parameters_1 = varDeclarations.length === 1 && varDeclarations[0].initializer @@ -87953,14 +89707,14 @@ var ts; : undefined; return { commentOwner: commentOwner, parameters: parameters_1 }; } - case 269 /* SourceFile */: + case 272 /* SourceFile */: return undefined; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // If in walking up the tree, we hit a a nested namespace declaration, // then we must be somewhere within a dotted namespace name; however we don't // want to give back a JSDoc template for the 'b' or 'c' in 'namespace a.b.c { }'. - return commentOwner.parent.kind === 234 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; - case 195 /* BinaryExpression */: { + return commentOwner.parent.kind === 237 /* ModuleDeclaration */ ? undefined : { commentOwner: commentOwner }; + case 198 /* BinaryExpression */: { var be = commentOwner; if (ts.getSpecialPropertyAssignmentKind(be) === 0 /* None */) { return undefined; @@ -87980,17 +89734,17 @@ var ts; * @returns the parameters of a signature found on the RHS if one exists; otherwise 'emptyArray'. */ function getParametersFromRightHandSideOfAssignment(rightHandSide) { - while (rightHandSide.kind === 186 /* ParenthesizedExpression */) { + while (rightHandSide.kind === 189 /* ParenthesizedExpression */) { rightHandSide = rightHandSide.expression; } switch (rightHandSide.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return rightHandSide.parameters; - case 200 /* ClassExpression */: + case 203 /* ClassExpression */: for (var _i = 0, _a = rightHandSide.members; _i < _a.length; _i++) { var member = _a[_i]; - if (member.kind === 153 /* Constructor */) { + if (member.kind === 154 /* Constructor */) { return member.parameters; } } @@ -88000,16 +89754,88 @@ var ts; } })(JsDoc = ts.JsDoc || (ts.JsDoc = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + function stringToInt(str) { + var n = parseInt(str, 10); + if (isNaN(n)) { + throw new Error("Error in parseInt(" + JSON.stringify(str) + ")"); + } + return n; + } + var isPrereleaseRegex = /^(.*)-next.\d+/; + var prereleaseSemverRegex = /^(\d+)\.(\d+)\.0-next.(\d+)$/; + var semverRegex = /^(\d+)\.(\d+)\.(\d+)$/; + var Semver = /** @class */ (function () { + function Semver(major, minor, patch, + /** + * If true, this is `major.minor.0-next.patch`. + * If false, this is `major.minor.patch`. + */ + isPrerelease) { + this.major = major; + this.minor = minor; + this.patch = patch; + this.isPrerelease = isPrerelease; + } + Semver.parse = function (semver) { + var isPrerelease = isPrereleaseRegex.test(semver); + var result = Semver.tryParse(semver, isPrerelease); + if (!result) { + throw new Error("Unexpected semver: " + semver + " (isPrerelease: " + isPrerelease + ")"); + } + return result; + }; + Semver.fromRaw = function (_a) { + var major = _a.major, minor = _a.minor, patch = _a.patch, isPrerelease = _a.isPrerelease; + return new Semver(major, minor, patch, isPrerelease); + }; + // This must parse the output of `versionString`. + Semver.tryParse = function (semver, isPrerelease) { + // Per the semver spec : + // "A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes." + var rgx = isPrerelease ? prereleaseSemverRegex : semverRegex; + var match = rgx.exec(semver); + return match ? new Semver(stringToInt(match[1]), stringToInt(match[2]), stringToInt(match[3]), isPrerelease) : undefined; + }; + Object.defineProperty(Semver.prototype, "versionString", { + get: function () { + return this.isPrerelease ? this.major + "." + this.minor + ".0-next." + this.patch : this.major + "." + this.minor + "." + this.patch; + }, + enumerable: true, + configurable: true + }); + Semver.prototype.equals = function (sem) { + return this.major === sem.major && this.minor === sem.minor && this.patch === sem.patch && this.isPrerelease === sem.isPrerelease; + }; + Semver.prototype.greaterThan = function (sem) { + return this.major > sem.major || this.major === sem.major + && (this.minor > sem.minor || this.minor === sem.minor + && (!this.isPrerelease && sem.isPrerelease || this.isPrerelease === sem.isPrerelease + && this.patch > sem.patch)); + }; + return Semver; + }()); + ts.Semver = Semver; +})(ts || (ts = {})); // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// /// /// +/// /* @internal */ var ts; (function (ts) { var JsTyping; (function (JsTyping) { + /* @internal */ + function isTypingUpToDate(cachedTyping, availableTypingVersions) { + var availableVersion = ts.Semver.parse(ts.getProperty(availableTypingVersions, "ts" + ts.versionMajorMinor) || ts.getProperty(availableTypingVersions, "latest")); + return !availableVersion.greaterThan(cachedTyping.version); + } + JsTyping.isTypingUpToDate = isTypingUpToDate; /* @internal */ JsTyping.nodeCoreModuleList = [ "buffer", "querystring", "events", "http", "cluster", @@ -88038,11 +89864,11 @@ var ts; * @param fileNames are the file names that belong to the same project * @param projectRootPath is the path to the project root directory * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations + * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions * @param typeAcquisition is used to customize the typing acquisition process * @param compilerOptions are used as a source for typing inference */ - function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports) { + function discoverTypings(host, log, fileNames, projectRootPath, safeList, packageNameToTypingLocation, typeAcquisition, unresolvedImports, typesRegistry) { if (!typeAcquisition || !typeAcquisition.enable) { return { cachedTypingPaths: [], newTypingNames: [], filesToWatch: [] }; } @@ -88079,9 +89905,9 @@ var ts; addInferredTypings(module, "Inferred typings from unresolved imports"); } // Add the cached typing locations for inferred typings that are already installed - packageNameToTypingLocation.forEach(function (typingLocation, name) { - if (inferredTypings.has(name) && inferredTypings.get(name) === undefined) { - inferredTypings.set(name, typingLocation); + packageNameToTypingLocation.forEach(function (typing, name) { + if (inferredTypings.has(name) && inferredTypings.get(name) === undefined && isTypingUpToDate(typing, typesRegistry.get(name))) { + inferredTypings.set(name, typing.typingLocation); } }); // Remove typings that the user has added to the exclude list @@ -88256,7 +90082,7 @@ var ts; case 6 /* NameContainsNonURISafeCharacters */: return "Package name '" + typing + "' contains non URI safe characters"; case 0 /* Ok */: - throw ts.Debug.fail(); // Shouldn't have called this. + return ts.Debug.fail(); // Shouldn't have called this. default: ts.Debug.assertNever(result); } @@ -88282,8 +90108,8 @@ var ts; }); }; // Search the declarations in all files and output matched NavigateToItem into array of NavigateToItem[] - for (var _i = 0, sourceFiles_8 = sourceFiles; _i < sourceFiles_8.length; _i++) { - var sourceFile = sourceFiles_8[_i]; + for (var _i = 0, sourceFiles_6 = sourceFiles; _i < sourceFiles_6.length; _i++) { + var sourceFile = sourceFiles_6[_i]; _loop_8(sourceFile); } rawItems.sort(compareNavigateToItems); @@ -88321,9 +90147,9 @@ var ts; } function shouldKeepItem(declaration, checker) { switch (declaration.kind) { - case 240 /* ImportClause */: - case 243 /* ImportSpecifier */: - case 238 /* ImportEqualsDeclaration */: + case 243 /* ImportClause */: + case 246 /* ImportSpecifier */: + case 241 /* ImportEqualsDeclaration */: var importer = checker.getSymbolAtLocation(declaration.name); var imported = checker.getAliasedSymbol(importer); return importer.escapedName !== imported.escapedName; @@ -88343,41 +90169,35 @@ var ts; return true; } function tryAddSingleDeclarationName(declaration, containers) { - if (declaration) { - var name = ts.getNameOfDeclaration(declaration); - if (name) { - var text = ts.getTextOfIdentifierOrLiteral(name); - if (text !== undefined) { - containers.unshift(text); - } - else if (name.kind === 145 /* ComputedPropertyName */) { - return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); - } - else { - // Don't know how to add this. - return false; - } - } + var name = ts.getNameOfDeclaration(declaration); + if (name && ts.isPropertyNameLiteral(name)) { + containers.unshift(ts.getTextOfIdentifierOrLiteral(name)); + return true; + } + else if (name && name.kind === 146 /* ComputedPropertyName */) { + return tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ true); + } + else { + // Don't know how to add this. + return false; } - return true; } // Only added the names of computed properties if they're simple dotted expressions, like: // // [X.Y.Z]() { } function tryAddComputedPropertyName(expression, containers, includeLastPortion) { - var text = ts.getTextOfIdentifierOrLiteral(expression); - if (text !== undefined) { + if (ts.isPropertyNameLiteral(expression)) { + var text = ts.getTextOfIdentifierOrLiteral(expression); if (includeLastPortion) { containers.unshift(text); } return true; } - if (expression.kind === 180 /* PropertyAccessExpression */) { - var propertyAccess = expression; + if (ts.isPropertyAccessExpression(expression)) { if (includeLastPortion) { - containers.unshift(propertyAccess.name.text); + containers.unshift(expression.name.text); } - return tryAddComputedPropertyName(propertyAccess.expression, containers, /*includeLastPortion*/ true); + return tryAddComputedPropertyName(expression.expression, containers, /*includeLastPortion*/ true); } return false; } @@ -88386,7 +90206,7 @@ var ts; // First, if we started with a computed property name, then add all but the last // portion into the container array. var name = ts.getNameOfDeclaration(declaration); - if (name.kind === 145 /* ComputedPropertyName */) { + if (name.kind === 146 /* ComputedPropertyName */) { if (!tryAddComputedPropertyName(name.expression, containers, /*includeLastPortion*/ false)) { return undefined; } @@ -88567,7 +90387,7 @@ var ts; return; } switch (node.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: // Get parameter properties, and treat them as being on the *same* level as the constructor, not under it. var ctr = node; addNodeWithRecursiveChild(ctr, ctr.body); @@ -88579,21 +90399,21 @@ var ts; } } break; - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 151 /* MethodSignature */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 152 /* MethodSignature */: if (!ts.hasDynamicName(node)) { addNodeWithRecursiveChild(node, node.body); } break; - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: if (!ts.hasDynamicName(node)) { addLeafNode(node); } break; - case 240 /* ImportClause */: + case 243 /* ImportClause */: var importClause = node; // Handle default import case e.g.: // import d from "mod"; @@ -88605,7 +90425,7 @@ var ts; // import {a, b as B} from "mod"; var namedBindings = importClause.namedBindings; if (namedBindings) { - if (namedBindings.kind === 241 /* NamespaceImport */) { + if (namedBindings.kind === 244 /* NamespaceImport */) { addLeafNode(namedBindings); } else { @@ -88616,8 +90436,8 @@ var ts; } } break; - case 177 /* BindingElement */: - case 227 /* VariableDeclaration */: + case 180 /* BindingElement */: + case 230 /* VariableDeclaration */: var _d = node, name = _d.name, initializer = _d.initializer; if (ts.isBindingPattern(name)) { addChildrenRecursively(name); @@ -88638,12 +90458,12 @@ var ts; addNodeWithRecursiveChild(node, initializer); } break; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: addNodeWithRecursiveChild(node, node.body); break; - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: startNode(node); for (var _e = 0, _f = node.members; _e < _f.length; _e++) { var member = _f[_e]; @@ -88653,9 +90473,9 @@ var ts; } endNode(); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: startNode(node); for (var _g = 0, _h = node.members; _g < _h.length; _g++) { var member = _h[_g]; @@ -88663,23 +90483,24 @@ var ts; } endNode(); break; - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case 247 /* ExportSpecifier */: - case 238 /* ImportEqualsDeclaration */: - case 158 /* IndexSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 232 /* TypeAliasDeclaration */: + case 250 /* ExportSpecifier */: + case 241 /* ImportEqualsDeclaration */: + case 159 /* IndexSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 235 /* TypeAliasDeclaration */: addLeafNode(node); break; - case 195 /* BinaryExpression */: { + case 198 /* BinaryExpression */: { var special = ts.getSpecialPropertyAssignmentKind(node); switch (special) { case 1 /* ExportsProperty */: case 2 /* ModuleExports */: case 3 /* PrototypeProperty */: + case 6 /* Prototype */: addNodeWithRecursiveChild(node, node.right); break; case 4 /* ThisProperty */: @@ -88695,7 +90516,7 @@ var ts; if (ts.hasJSDocNodes(node)) { ts.forEach(node.jsDoc, function (jsDoc) { ts.forEach(jsDoc.tags, function (tag) { - if (tag.kind === 288 /* JSDocTypedefTag */) { + if (tag.kind === 291 /* JSDocTypedefTag */) { addLeafNode(tag); } }); @@ -88752,12 +90573,12 @@ var ts; return false; } switch (a.kind) { - case 150 /* PropertyDeclaration */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 151 /* PropertyDeclaration */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: return ts.hasModifier(a, 32 /* Static */) === ts.hasModifier(b, 32 /* Static */); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: return areSameModule(a, b); default: return true; @@ -88766,7 +90587,7 @@ var ts; // We use 1 NavNode to represent 'A.B.C', but there are multiple source nodes. // Only merge module nodes that have the same chain. Don't merge 'A.B.C' with 'A'! function areSameModule(a, b) { - return a.body.kind === b.body.kind && (a.body.kind !== 234 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); + return a.body.kind === b.body.kind && (a.body.kind !== 237 /* ModuleDeclaration */ || areSameModule(a.body, b.body)); } /** Merge source into target. Source should be thrown away after this is called. */ function merge(target, source) { @@ -88796,7 +90617,7 @@ var ts; * So `new()` can still come before an `aardvark` method. */ function tryGetName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var declName = ts.getNameOfDeclaration(node); @@ -88804,18 +90625,18 @@ var ts; return ts.unescapeLeadingUnderscores(ts.getPropertyNameForPropertyNameNode(declName)); } switch (node.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 200 /* ClassExpression */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 203 /* ClassExpression */: return getFunctionOrClassName(node); - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return undefined; } } function getItemName(node) { - if (node.kind === 234 /* ModuleDeclaration */) { + if (node.kind === 237 /* ModuleDeclaration */) { return getModuleName(node); } var name = ts.getNameOfDeclaration(node); @@ -88826,16 +90647,16 @@ var ts; } } switch (node.kind) { - case 269 /* SourceFile */: + case 272 /* SourceFile */: var sourceFile = node; return ts.isExternalModule(sourceFile) ? "\"" + ts.escapeString(ts.getBaseFileName(ts.removeFileExtension(ts.normalizePath(sourceFile.fileName)))) + "\"" : ""; - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -88843,15 +90664,15 @@ var ts; // (eg: "app\n.onactivated"), so we should remove the whitespace for readabiltiy in the // navigation bar. return getFunctionOrClassName(node); - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 157 /* ConstructSignature */: + case 158 /* ConstructSignature */: return "new()"; - case 156 /* CallSignature */: + case 157 /* CallSignature */: return "()"; - case 158 /* IndexSignature */: + case 159 /* IndexSignature */: return "[]"; - case 288 /* JSDocTypedefTag */: + case 291 /* JSDocTypedefTag */: return getJSDocTypedefTagName(node); default: return ""; @@ -88863,7 +90684,7 @@ var ts; } else { var parentNode = node.parent && node.parent.parent; - if (parentNode && parentNode.kind === 209 /* VariableStatement */) { + if (parentNode && parentNode.kind === 212 /* VariableStatement */) { if (parentNode.declarationList.declarations.length > 0) { var nameIdentifier = parentNode.declarationList.declarations[0].name; if (nameIdentifier.kind === 71 /* Identifier */) { @@ -88892,24 +90713,24 @@ var ts; return topLevel; function isTopLevel(item) { switch (navigationBarNodeKind(item)) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 233 /* EnumDeclaration */: - case 231 /* InterfaceDeclaration */: - case 234 /* ModuleDeclaration */: - case 269 /* SourceFile */: - case 232 /* TypeAliasDeclaration */: - case 288 /* JSDocTypedefTag */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 236 /* EnumDeclaration */: + case 234 /* InterfaceDeclaration */: + case 237 /* ModuleDeclaration */: + case 272 /* SourceFile */: + case 235 /* TypeAliasDeclaration */: + case 291 /* JSDocTypedefTag */: return true; - case 153 /* Constructor */: - case 152 /* MethodDeclaration */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 227 /* VariableDeclaration */: + case 154 /* Constructor */: + case 153 /* MethodDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 230 /* VariableDeclaration */: return hasSomeImportantChild(item); - case 188 /* ArrowFunction */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: return isTopLevelFunctionDeclaration(item); default: return false; @@ -88919,10 +90740,10 @@ var ts; return false; } switch (navigationBarNodeKind(item.parent)) { - case 235 /* ModuleBlock */: - case 269 /* SourceFile */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: + case 238 /* ModuleBlock */: + case 272 /* SourceFile */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: return true; default: return hasSomeImportantChild(item); @@ -88931,7 +90752,7 @@ var ts; function hasSomeImportantChild(item) { return ts.forEach(item.children, function (child) { var childKind = navigationBarNodeKind(child); - return childKind !== 227 /* VariableDeclaration */ && childKind !== 177 /* BindingElement */; + return childKind !== 230 /* VariableDeclaration */ && childKind !== 180 /* BindingElement */; }); } } @@ -88987,7 +90808,7 @@ var ts; // Otherwise, we need to aggregate each identifier to build up the qualified name. var result = []; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); - while (moduleDeclaration.body && moduleDeclaration.body.kind === 234 /* ModuleDeclaration */) { + while (moduleDeclaration.body && moduleDeclaration.body.kind === 237 /* ModuleDeclaration */) { moduleDeclaration = moduleDeclaration.body; result.push(ts.getTextOfIdentifierOrLiteral(moduleDeclaration.name)); } @@ -88998,18 +90819,16 @@ var ts; * We store 'A' as associated with a NavNode, and use getModuleName to traverse down again. */ function getInteriorModule(decl) { - return decl.body.kind === 234 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; + return decl.body.kind === 237 /* ModuleDeclaration */ ? getInteriorModule(decl.body) : decl; } function isComputedProperty(member) { - return !member.name || member.name.kind === 145 /* ComputedPropertyName */; + return !member.name || member.name.kind === 146 /* ComputedPropertyName */; } function getNodeSpan(node) { - return node.kind === 269 /* SourceFile */ - ? ts.createTextSpanFromBounds(node.getFullStart(), node.getEnd()) - : ts.createTextSpanFromNode(node, curSourceFile); + return node.kind === 272 /* SourceFile */ ? ts.createTextSpanFromRange(node) : ts.createTextSpanFromNode(node, curSourceFile); } function getModifiers(node) { - if (node.parent && node.parent.kind === 227 /* VariableDeclaration */) { + if (node.parent && node.parent.kind === 230 /* VariableDeclaration */) { node = node.parent; } return ts.getNodeModifiers(node); @@ -89018,16 +90837,20 @@ var ts; if (node.name && ts.getFullWidth(node.name) > 0) { return ts.declarationNameToString(node.name); } - else if (node.parent.kind === 227 /* VariableDeclaration */) { + // See if it is a var initializer. If so, use the var name. + else if (node.parent.kind === 230 /* VariableDeclaration */) { return ts.declarationNameToString(node.parent.name); } - else if (node.parent.kind === 195 /* BinaryExpression */ && + // See if it is of the form " = function(){...}". If so, use the text from the left-hand side. + else if (node.parent.kind === 198 /* BinaryExpression */ && node.parent.operatorToken.kind === 58 /* EqualsToken */) { return nodeText(node.parent.left).replace(whiteSpaceRegex, ""); } - else if (node.parent.kind === 265 /* PropertyAssignment */ && node.parent.name) { + // See if it is a property assignment, and if so use the property name + else if (node.parent.kind === 268 /* PropertyAssignment */ && node.parent.name) { return nodeText(node.parent.name); } + // Default exports are named "default" else if (ts.getModifierFlags(node) & 512 /* Default */) { return "default"; } @@ -89037,9 +90860,9 @@ var ts; } function isFunctionOrClassExpression(node) { switch (node.kind) { - case 188 /* ArrowFunction */: - case 187 /* FunctionExpression */: - case 200 /* ClassExpression */: + case 191 /* ArrowFunction */: + case 190 /* FunctionExpression */: + case 203 /* ClassExpression */: return true; default: return false; @@ -89049,6 +90872,230 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var OrganizeImports; + (function (OrganizeImports) { + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ + function organizeImports(sourceFile, formatContext, host, program) { + var changeTracker = ts.textChanges.ChangeTracker.fromContext({ host: host, formatContext: formatContext }); + // All of the old ImportDeclarations in the file, in syntactic order. + var topLevelImportDecls = sourceFile.statements.filter(ts.isImportDeclaration); + organizeImportsWorker(topLevelImportDecls); + for (var _i = 0, _a = sourceFile.statements.filter(ts.isAmbientModule); _i < _a.length; _i++) { + var ambientModule = _a[_i]; + var ambientModuleBody = getModuleBlock(ambientModule); + var ambientModuleImportDecls = ambientModuleBody.statements.filter(ts.isImportDeclaration); + organizeImportsWorker(ambientModuleImportDecls); + } + return changeTracker.getChanges(); + function organizeImportsWorker(oldImportDecls) { + if (ts.length(oldImportDecls) === 0) { + return; + } + var oldImportGroups = ts.group(oldImportDecls, function (importDecl) { return getExternalModuleName(importDecl.moduleSpecifier); }); + var sortedImportGroups = ts.stableSort(oldImportGroups, function (group1, group2) { return compareModuleSpecifiers(group1[0].moduleSpecifier, group2[0].moduleSpecifier); }); + var newImportDecls = ts.flatMap(sortedImportGroups, function (importGroup) { + return getExternalModuleName(importGroup[0].moduleSpecifier) + ? coalesceImports(removeUnusedImports(importGroup, sourceFile, program)) + : importGroup; + }); + // Delete or replace the first import. + if (newImportDecls.length === 0) { + changeTracker.deleteNode(sourceFile, oldImportDecls[0]); + } + else { + // Note: Delete the surrounding trivia because it will have been retained in newImportDecls. + changeTracker.replaceNodeWithNodes(sourceFile, oldImportDecls[0], newImportDecls, { + useNonAdjustedStartPosition: false, + useNonAdjustedEndPosition: false, + suffix: ts.getNewLineOrDefaultFromHost(host, formatContext.options), + }); + } + // Delete any subsequent imports. + for (var i = 1; i < oldImportDecls.length; i++) { + changeTracker.deleteNode(sourceFile, oldImportDecls[i]); + } + } + } + OrganizeImports.organizeImports = organizeImports; + function getModuleBlock(moduleDecl) { + var body = moduleDecl.body; + return body && !ts.isIdentifier(body) && (ts.isModuleBlock(body) ? body : getModuleBlock(body)); + } + function removeUnusedImports(oldImports, sourceFile, program) { + var typeChecker = program.getTypeChecker(); + var jsxNamespace = typeChecker.getJsxNamespace(); + var jsxContext = sourceFile.languageVariant === 1 /* JSX */ && program.getCompilerOptions().jsx; + var usedImports = []; + for (var _i = 0, oldImports_1 = oldImports; _i < oldImports_1.length; _i++) { + var importDecl = oldImports_1[_i]; + var importClause = importDecl.importClause; + if (!importClause) { + // Imports without import clauses are assumed to be included for their side effects and are not removed. + usedImports.push(importDecl); + continue; + } + var name = importClause.name, namedBindings = importClause.namedBindings; + // Default import + if (name && !isDeclarationUsed(name)) { + name = undefined; + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + // Namespace import + if (!isDeclarationUsed(namedBindings.name)) { + namedBindings = undefined; + } + } + else { + // List of named imports + var newElements = namedBindings.elements.filter(function (e) { return isDeclarationUsed(e.propertyName || e.name); }); + if (newElements.length < namedBindings.elements.length) { + namedBindings = newElements.length + ? ts.updateNamedImports(namedBindings, newElements) + : undefined; + } + } + } + if (name || namedBindings) { + usedImports.push(updateImportDeclarationAndClause(importDecl, name, namedBindings)); + } + } + return usedImports; + function isDeclarationUsed(identifier) { + // The JSX factory symbol is always used. + return jsxContext && (identifier.text === jsxNamespace) || ts.FindAllReferences.Core.isSymbolReferencedInFile(identifier, typeChecker, sourceFile); + } + } + function getExternalModuleName(specifier) { + return ts.isStringLiteral(specifier) || ts.isNoSubstitutionTemplateLiteral(specifier) + ? specifier.text + : undefined; + } + /* @internal */ // Internal for testing + /** + * @param importGroup a list of ImportDeclarations, all with the same module name. + */ + function coalesceImports(importGroup) { + if (importGroup.length === 0) { + return importGroup; + } + var _a = getCategorizedImports(importGroup), importWithoutClause = _a.importWithoutClause, defaultImports = _a.defaultImports, namespaceImports = _a.namespaceImports, namedImports = _a.namedImports; + var coalescedImports = []; + if (importWithoutClause) { + coalescedImports.push(importWithoutClause); + } + // Normally, we don't combine default and namespace imports, but it would be silly to + // produce two import declarations in this special case. + if (defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) { + // Add the namespace import to the existing default ImportDeclaration. + var defaultImport = defaultImports[0]; + coalescedImports.push(updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)); + return coalescedImports; + } + var sortedNamespaceImports = ts.stableSort(namespaceImports, function (i1, i2) { + return compareIdentifiers(i1.importClause.namedBindings.name, i2.importClause.namedBindings.name); + }); + for (var _i = 0, sortedNamespaceImports_1 = sortedNamespaceImports; _i < sortedNamespaceImports_1.length; _i++) { + var namespaceImport = sortedNamespaceImports_1[_i]; + // Drop the name, if any + coalescedImports.push(updateImportDeclarationAndClause(namespaceImport, /*name*/ undefined, namespaceImport.importClause.namedBindings)); + } + if (defaultImports.length === 0 && namedImports.length === 0) { + return coalescedImports; + } + var newDefaultImport; + var newImportSpecifiers = []; + if (defaultImports.length === 1) { + newDefaultImport = defaultImports[0].importClause.name; + } + else { + for (var _b = 0, defaultImports_1 = defaultImports; _b < defaultImports_1.length; _b++) { + var defaultImport = defaultImports_1[_b]; + newImportSpecifiers.push(ts.createImportSpecifier(ts.createIdentifier("default"), defaultImport.importClause.name)); + } + } + newImportSpecifiers.push.apply(newImportSpecifiers, ts.flatMap(namedImports, function (i) { return i.importClause.namedBindings.elements; })); + var sortedImportSpecifiers = ts.stableSort(newImportSpecifiers, function (s1, s2) { + return compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name) || + compareIdentifiers(s1.name, s2.name); + }); + var importDecl = defaultImports.length > 0 + ? defaultImports[0] + : namedImports[0]; + var newNamedImports = sortedImportSpecifiers.length === 0 + ? undefined + : namedImports.length === 0 + ? ts.createNamedImports(sortedImportSpecifiers) + : ts.updateNamedImports(namedImports[0].importClause.namedBindings, sortedImportSpecifiers); + coalescedImports.push(updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)); + return coalescedImports; + /* + * Returns entire import declarations because they may already have been rewritten and + * may lack parent pointers. The desired parts can easily be recovered based on the + * categorization. + * + * NB: There may be overlap between `defaultImports` and `namespaceImports`/`namedImports`. + */ + function getCategorizedImports(importGroup) { + var importWithoutClause; + var defaultImports = []; + var namespaceImports = []; + var namedImports = []; + for (var _i = 0, importGroup_1 = importGroup; _i < importGroup_1.length; _i++) { + var importDeclaration = importGroup_1[_i]; + if (importDeclaration.importClause === undefined) { + // Only the first such import is interesting - the others are redundant. + // Note: Unfortunately, we will lose trivia that was on this node. + importWithoutClause = importWithoutClause || importDeclaration; + continue; + } + var _a = importDeclaration.importClause, name = _a.name, namedBindings = _a.namedBindings; + if (name) { + defaultImports.push(importDeclaration); + } + if (namedBindings) { + if (ts.isNamespaceImport(namedBindings)) { + namespaceImports.push(importDeclaration); + } + else { + namedImports.push(importDeclaration); + } + } + } + return { + importWithoutClause: importWithoutClause, + defaultImports: defaultImports, + namespaceImports: namespaceImports, + namedImports: namedImports, + }; + } + function compareIdentifiers(s1, s2) { + return ts.compareStringsCaseSensitive(s1.text, s2.text); + } + } + OrganizeImports.coalesceImports = coalesceImports; + function updateImportDeclarationAndClause(importDeclaration, name, namedBindings) { + return ts.updateImportDeclaration(importDeclaration, importDeclaration.decorators, importDeclaration.modifiers, ts.updateImportClause(importDeclaration.importClause, name, namedBindings), importDeclaration.moduleSpecifier); + } + /* internal */ // Exported for testing + function compareModuleSpecifiers(m1, m2) { + var name1 = getExternalModuleName(m1); + var name2 = getExternalModuleName(m2); + return ts.compareBooleans(name1 === undefined, name2 === undefined) || + ts.compareBooleans(ts.isExternalModuleNameRelative(name1), ts.isExternalModuleNameRelative(name2)) || + ts.compareStringsCaseSensitive(name1, name2); + } + OrganizeImports.compareModuleSpecifiers = compareModuleSpecifiers; + })(OrganizeImports = ts.OrganizeImports || (ts.OrganizeImports = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var OutliningElementsCollector; (function (OutliningElementsCollector) { @@ -89088,8 +91135,8 @@ var ts; continue; } if (!result[1]) { - var span_13 = ts.createTextSpanFromBounds(sourceFile.text.indexOf("//", currentLineStart), lineEnd); - regions.push(createOutliningSpan(span_13, span_13, /*autoCollapse*/ false, result[2] || "#region")); + var span_12 = ts.createTextSpanFromBounds(sourceFile.text.indexOf("//", currentLineStart), lineEnd); + regions.push(createOutliningSpan(span_12, span_12, /*autoCollapse*/ false, result[2] || "#region")); } else { var region = regions.pop(); @@ -89143,24 +91190,24 @@ var ts; } function getOutliningSpanForNode(n, sourceFile) { switch (n.kind) { - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(n)) { - return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 188 /* ArrowFunction */); + return spanForNode(n.parent, /*autoCollapse*/ n.parent.kind !== 191 /* ArrowFunction */); } // Check if the block is standalone, or 'attached' to some parent statement. // If the latter, we want to collapse the block, but consider its hint span // to be the entire span of the parent. switch (n.parent.kind) { - case 213 /* DoStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 214 /* WhileStatement */: - case 221 /* WithStatement */: - case 264 /* CatchClause */: + case 216 /* DoStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 217 /* WhileStatement */: + case 224 /* WithStatement */: + case 267 /* CatchClause */: return spanForNode(n.parent); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // Could be the try-block, or the finally-block. var tryStatement = n.parent; if (tryStatement.tryBlock === n) { @@ -89175,16 +91222,16 @@ var ts; // the span of the block, independent of any parent span. return createOutliningSpan(ts.createTextSpanFromNode(n, sourceFile)); } - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanForNode(n.parent); - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 236 /* CaseBlock */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 239 /* CaseBlock */: return spanForNode(n); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return spanForObjectOrArrayLiteral(n); - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return spanForObjectOrArrayLiteral(n, 21 /* OpenBracketToken */); } function spanForObjectOrArrayLiteral(node, open) { @@ -89328,10 +91375,10 @@ var ts; // But we would match 'FooAttribute' (since 'Attribute' starts with 'a'). var wordSpans = getWordSpans(candidate); for (var _i = 0, wordSpans_1 = wordSpans; _i < wordSpans_1.length; _i++) { - var span_14 = wordSpans_1[_i]; - if (partStartsWith(candidate, span_14, chunk.text, /*ignoreCase:*/ true)) { + var span_13 = wordSpans_1[_i]; + if (partStartsWith(candidate, span_13, chunk.text, /*ignoreCase:*/ true)) { return createPatternMatch(PatternMatchKind.substring, punctuationStripped, - /*isCaseSensitive:*/ partStartsWith(candidate, span_14, chunk.text, /*ignoreCase:*/ false)); + /*isCaseSensitive:*/ partStartsWith(candidate, span_13, chunk.text, /*ignoreCase:*/ false)); } } } @@ -89433,7 +91480,7 @@ var ts; // // Only if all words have some sort of match is the pattern considered matched. var subWordTextChunks = segment.subWordTextChunks; - var matches = undefined; + var matches; for (var _i = 0, subWordTextChunks_1 = subWordTextChunks; _i < subWordTextChunks_1.length; _i++) { var subWordTextChunk = subWordTextChunks_1[_i]; // Try to match the candidate with this word @@ -89481,8 +91528,8 @@ var ts; // and I will both match in UI. var currentCandidate = 0; var currentChunkSpan = 0; - var firstMatch = undefined; - var contiguous = undefined; + var firstMatch; + var contiguous; while (true) { // Let's consider our termination cases if (currentChunkSpan === chunkCharacterSpans.length) { @@ -89782,11 +91829,18 @@ var ts; function preProcessFile(sourceText, readImportFiles, detectJavaScriptImports) { if (readImportFiles === void 0) { readImportFiles = true; } if (detectJavaScriptImports === void 0) { detectJavaScriptImports = false; } - var referencedFiles = []; - var typeReferenceDirectives = []; + var pragmaContext = { + languageVersion: 1 /* ES5 */, + pragmas: undefined, + checkJsDirective: undefined, + referencedFiles: [], + typeReferenceDirectives: [], + amdDependencies: [], + hasNoDefaultLib: undefined, + moduleName: undefined + }; var importedFiles = []; var ambientExternalModules; - var isNoDefaultLib = false; var braceNesting = 0; // assume that text represent an external module if it contains at least one top level import/export // ambient modules that are found inside external modules are interpreted as module augmentations @@ -89801,23 +91855,6 @@ var ts; } return token; } - function processTripleSlashDirectives() { - var commentRanges = ts.getLeadingCommentRanges(sourceText, 0); - ts.forEach(commentRanges, function (commentRange) { - var comment = sourceText.substring(commentRange.pos, commentRange.end); - var referencePathMatchResult = ts.getFileReferenceFromReferencePath(comment, commentRange); - if (referencePathMatchResult) { - isNoDefaultLib = referencePathMatchResult.isNoDefaultLib; - var fileReference = referencePathMatchResult.fileReference; - if (fileReference) { - var collection = referencePathMatchResult.isTypeReferenceDirective - ? typeReferenceDirectives - : referencedFiles; - collection.push(fileReference); - } - } - }); - } function getFileReference() { var fileName = ts.scanner.getTokenValue(); var pos = ts.scanner.getTokenPos(); @@ -89846,7 +91883,7 @@ var ts; if (token === 124 /* DeclareKeyword */) { // declare module "mod" token = nextToken(); - if (token === 128 /* ModuleKeyword */) { + if (token === 129 /* ModuleKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { recordAmbientExternalModule(); @@ -89879,7 +91916,7 @@ var ts; else { if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import d from "mod"; @@ -89910,7 +91947,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import {a as A} from "mod"; @@ -89926,7 +91963,7 @@ var ts; token = nextToken(); if (token === 71 /* Identifier */ || ts.isKeyword(token)) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // import * as NS from "mod" @@ -89956,7 +91993,7 @@ var ts; } if (token === 18 /* CloseBraceToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export {a as A} from "mod"; @@ -89968,7 +92005,7 @@ var ts; } else if (token === 39 /* AsteriskToken */) { token = nextToken(); - if (token === 141 /* FromKeyword */) { + if (token === 142 /* FromKeyword */) { token = nextToken(); if (token === 9 /* StringLiteral */) { // export * from "mod" @@ -89993,7 +92030,7 @@ var ts; } function tryConsumeRequireCall(skipCurrentToken) { var token = skipCurrentToken ? nextToken() : ts.scanner.getToken(); - if (token === 132 /* RequireKeyword */) { + if (token === 133 /* RequireKeyword */) { token = nextToken(); if (token === 19 /* OpenParenToken */) { token = nextToken(); @@ -90078,7 +92115,8 @@ var ts; if (readImportFiles) { processImports(); } - processTripleSlashDirectives(); + ts.processCommentPragmas(pragmaContext, sourceText); + ts.processPragmasIntoFields(pragmaContext, ts.noop); if (externalModule) { // for external modules module all nested ambient modules are augmentations if (ambientExternalModules) { @@ -90088,7 +92126,7 @@ var ts; importedFiles.push(decl.ref); } } - return { referencedFiles: referencedFiles, typeReferenceDirectives: typeReferenceDirectives, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: undefined }; + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: undefined }; } else { // for global scripts ambient modules still can have augmentations - look for ambient modules with depth > 0 @@ -90107,7 +92145,7 @@ var ts; } } } - return { referencedFiles: referencedFiles, typeReferenceDirectives: typeReferenceDirectives, importedFiles: importedFiles, isLibFile: isNoDefaultLib, ambientExternalModules: ambientModuleNames }; + return { referencedFiles: pragmaContext.referencedFiles, typeReferenceDirectives: pragmaContext.typeReferenceDirectives, importedFiles: importedFiles, isLibFile: pragmaContext.hasNoDefaultLib, ambientExternalModules: ambientModuleNames }; } } ts.preProcessFile = preProcessFile; @@ -90138,23 +92176,18 @@ var ts; var symbol = typeChecker.getSymbolAtLocation(node); // Only allow a symbol to be renamed if it actually has at least one declaration. if (symbol) { - var declarations = symbol.getDeclarations(); + var declarations = symbol.declarations; if (declarations && declarations.length > 0) { // Disallow rename for elements that are defined in the standard TypeScript library. - if (ts.some(declarations, isDefinedInLibraryFile)) { + if (declarations.some(isDefinedInLibraryFile)) { return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } // Cannot rename `default` as in `import { default as foo } from "./someModule"; - if (node.kind === 71 /* Identifier */ && - node.originalKeywordKind === 79 /* DefaultKeyword */ && - symbol.parent.flags & 1536 /* Module */) { + if (ts.isIdentifier(node) && node.originalKeywordKind === 79 /* DefaultKeyword */ && symbol.parent.flags & 1536 /* Module */) { return undefined; } var kind = ts.SymbolDisplay.getSymbolKind(typeChecker, symbol, node); - if (!kind) { - return undefined; - } - var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 145 /* ComputedPropertyName */) + var specifierName = (ts.isImportOrExportSpecifierName(node) || ts.isStringOrNumericLiteral(node) && node.parent.kind === 146 /* ComputedPropertyName */) ? ts.stripQuotes(ts.getTextOfIdentifierOrLiteral(node)) : undefined; var displayName = specifierName || typeChecker.symbolToString(symbol); @@ -90162,12 +92195,11 @@ var ts; return getRenameInfoSuccess(displayName, fullDisplayName, kind, ts.SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile); } } - else if (node.kind === 9 /* StringLiteral */) { + else if (ts.isStringLiteral(node)) { if (isDefinedInLibraryFile(node)) { return getRenameInfoError(ts.Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library); } - var displayName = ts.stripQuotes(node.text); - return getRenameInfoSuccess(displayName, displayName, "var" /* variableElement */, "" /* none */, node, sourceFile); + return getRenameInfoSuccess(node.text, node.text, "var" /* variableElement */, "" /* none */, node, sourceFile); } } function getRenameInfoSuccess(displayName, fullDisplayName, kind, kindModifiers, node, sourceFile) { @@ -90258,17 +92290,13 @@ var ts; } SignatureHelp.getSignatureHelpItems = getSignatureHelpItems; function createJavaScriptSignatureHelpItems(argumentInfo, program) { - if (argumentInfo.invocation.kind !== 182 /* CallExpression */) { + if (argumentInfo.invocation.kind !== 185 /* CallExpression */) { return undefined; } // See if we can find some symbol with the call expression name that has call signatures. var callExpression = argumentInfo.invocation; var expression = callExpression.expression; - var name = expression.kind === 71 /* Identifier */ - ? expression - : expression.kind === 180 /* PropertyAccessExpression */ - ? expression.name - : undefined; + var name = ts.isIdentifier(expression) ? expression : ts.isPropertyAccessExpression(expression) ? expression.name : undefined; if (!name || !name.escapedText) { return undefined; } @@ -90344,25 +92372,25 @@ var ts; var argumentsSpan = getApplicableSpanForArguments(list, sourceFile); return { kind: kind, invocation: invocation, argumentsSpan: argumentsSpan, argumentIndex: argumentIndex, argumentCount: argumentCount }; } - else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 13 /* NoSubstitutionTemplateLiteral */ && node.parent.kind === 187 /* TaggedTemplateExpression */) { // Check if we're actually inside the template; // otherwise we'll fall out and return undefined. if (ts.isInsideTemplateLiteral(node, position)) { return getArgumentListInfoForTemplate(node.parent, /*argumentIndex*/ 0, sourceFile); } } - else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.kind === 14 /* TemplateHead */ && node.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateExpression = node.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); var argumentIndex = ts.isInsideTemplateLiteral(node, position) ? 0 : 1; return getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile); } - else if (node.parent.kind === 206 /* TemplateSpan */ && node.parent.parent.parent.kind === 184 /* TaggedTemplateExpression */) { + else if (node.parent.kind === 209 /* TemplateSpan */ && node.parent.parent.parent.kind === 187 /* TaggedTemplateExpression */) { var templateSpan = node.parent; var templateExpression = templateSpan.parent; var tagExpression = templateExpression.parent; - ts.Debug.assert(templateExpression.kind === 197 /* TemplateExpression */); + ts.Debug.assert(templateExpression.kind === 200 /* TemplateExpression */); // If we're just after a template tail, don't show signature help. if (node.kind === 16 /* TemplateTail */ && !ts.isInsideTemplateLiteral(node, position)) { return undefined; @@ -90403,9 +92431,8 @@ var ts; // that trailing comma in the list, and we'll have generated the appropriate // arg index. var argumentIndex = 0; - var listChildren = argumentsList.getChildren(); - for (var _i = 0, listChildren_1 = listChildren; _i < listChildren_1.length; _i++) { - var child = listChildren_1[_i]; + for (var _i = 0, _a = argumentsList.getChildren(); _i < _a.length; _i++) { + var child = _a[_i]; if (child === node) { break; } @@ -90461,9 +92488,7 @@ var ts; } function getArgumentListInfoForTemplate(tagExpression, argumentIndex, sourceFile) { // argumentCount is either 1 or (numSpans + 1) to account for the template strings array argument. - var argumentCount = tagExpression.template.kind === 13 /* NoSubstitutionTemplateLiteral */ - ? 1 - : tagExpression.template.templateSpans.length + 1; + var argumentCount = ts.isNoSubstitutionTemplateLiteral(tagExpression.template) ? 1 : tagExpression.template.templateSpans.length + 1; if (argumentIndex !== 0) { ts.Debug.assertLessThan(argumentIndex, argumentCount); } @@ -90500,7 +92525,7 @@ var ts; // | | // This is because a Missing node has no width. However, what we actually want is to include trivia // leading up to the next token in case the user is about to type in a TemplateMiddle or TemplateTail. - if (template.kind === 197 /* TemplateExpression */) { + if (template.kind === 200 /* TemplateExpression */) { var lastSpan = ts.lastOrUndefined(template.templateSpans); if (lastSpan.literal.getFullWidth() === 0) { applicableSpanEnd = ts.skipTrivia(sourceFile.text, applicableSpanEnd, /*stopAfterLineBreak*/ false); @@ -90509,7 +92534,7 @@ var ts; return ts.createTextSpan(applicableSpanStart, applicableSpanEnd - applicableSpanStart); } function getContainingArgumentInfo(node, position, sourceFile) { - for (var n = node; n.kind !== 269 /* SourceFile */; n = n.parent) { + for (var n = node; n.kind !== 272 /* SourceFile */; n = n.parent) { if (ts.isFunctionBlock(n)) { return undefined; } @@ -90632,14 +92657,75 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + function computeSuggestionDiagnostics(sourceFile, program) { + program.getSemanticDiagnostics(sourceFile); + var checker = program.getDiagnosticsProducingTypeChecker(); + var diags = []; + if (sourceFile.commonJsModuleIndicator) { + diags.push(ts.createDiagnosticForNode(sourceFile.commonJsModuleIndicator, ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module)); + } + var isJsFile = ts.isSourceFileJavaScript(sourceFile); + function check(node) { + switch (node.kind) { + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + if (isJsFile) { + var symbol = node.symbol; + if (symbol.members && (symbol.members.size > 0)) { + diags.push(ts.createDiagnosticForNode(ts.isVariableDeclaration(node.parent) ? node.parent.name : node, ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration)); + } + } + break; + } + if (!isJsFile && ts.codefix.parameterShouldGetTypeFromJSDoc(node)) { + diags.push(ts.createDiagnosticForNode(node.name || node, ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types)); + } + node.forEachChild(check); + } + check(sourceFile); + if (ts.getAllowSyntheticDefaultImports(program.getCompilerOptions())) { + for (var _i = 0, _a = sourceFile.imports; _i < _a.length; _i++) { + var importNode = _a[_i]; + var name = importNameForConvertToDefaultImport(importNode.parent); + if (!name) + continue; + var module = ts.getResolvedModule(sourceFile, importNode.text); + var resolvedFile = module && program.getSourceFile(module.resolvedFileName); + if (resolvedFile && resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals) { + diags.push(ts.createDiagnosticForNode(name, ts.Diagnostics.Import_may_be_converted_to_a_default_import)); + } + } + } + return diags.concat(checker.getSuggestionDiagnostics(sourceFile)); + } + ts.computeSuggestionDiagnostics = computeSuggestionDiagnostics; + function importNameForConvertToDefaultImport(node) { + if (ts.isExternalModuleReference(node)) { + return node.parent.name; + } + if (ts.isImportDeclaration(node)) { + var importClause = node.importClause, moduleSpecifier = node.moduleSpecifier; + return importClause && !importClause.name && importClause.namedBindings.kind === 244 /* NamespaceImport */ && ts.isStringLiteral(moduleSpecifier) + ? importClause.namedBindings.name + : undefined; + } + } +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var SymbolDisplay; (function (SymbolDisplay) { // TODO(drosen): use contextual SemanticMeaning. function getSymbolKind(typeChecker, symbol, location) { + var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); + if (result !== "" /* unknown */) { + return result; + } var flags = ts.getCombinedLocalAndExportSymbolFlags(symbol); if (flags & 32 /* Class */) { - return ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */) ? + return ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */) ? "local class" /* localClassElement */ : "class" /* classElement */; } if (flags & 384 /* Enum */) @@ -90650,17 +92736,14 @@ var ts; return "interface" /* interfaceElement */; if (flags & 262144 /* TypeParameter */) return "type parameter" /* typeParameterElement */; - var result = getSymbolKindOfConstructorPropertyMethodAccessorFunctionOrVar(typeChecker, symbol, location); - if (result === "" /* unknown */) { - if (flags & 262144 /* TypeParameter */) - return "type parameter" /* typeParameterElement */; - if (flags & 8 /* EnumMember */) - return "enum member" /* enumMemberElement */; - if (flags & 2097152 /* Alias */) - return "alias" /* alias */; - if (flags & 1536 /* Module */) - return "module" /* moduleElement */; - } + if (flags & 262144 /* TypeParameter */) + return "type parameter" /* typeParameterElement */; + if (flags & 8 /* EnumMember */) + return "enum member" /* enumMemberElement */; + if (flags & 2097152 /* Alias */) + return "alias" /* alias */; + if (flags & 1536 /* Module */) + return "module" /* moduleElement */; return result; } SymbolDisplay.getSymbolKind = getSymbolKind; @@ -90722,9 +92805,11 @@ var ts; // If we requested completions after `x.` at the top-level, we may be at a source file location. switch (location.parent && location.parent.kind) { // If we've typed a character of the attribute name, will be 'JsxAttribute', else will be 'JsxOpeningElement'. - case 252 /* JsxOpeningElement */: + case 255 /* JsxOpeningElement */: + case 253 /* JsxElement */: + case 254 /* JsxSelfClosingElement */: return location.kind === 71 /* Identifier */ ? "property" /* memberVariableElement */ : "JSX attribute" /* jsxAttribute */; - case 257 /* JsxAttribute */: + case 260 /* JsxAttribute */: return "JSX attribute" /* jsxAttribute */; default: return "property" /* memberVariableElement */; @@ -90763,7 +92848,7 @@ var ts; } var signature = void 0; type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol.exportSymbol || symbol, location); - if (location.parent && location.parent.kind === 180 /* PropertyAccessExpression */) { + if (location.parent && location.parent.kind === 183 /* PropertyAccessExpression */) { var right = location.parent.name; // Either the location is on the right of a property access, or on the left and the right is missing if (right === location || (right && right.getFullWidth() === 0)) { @@ -90784,7 +92869,7 @@ var ts; if (callExpressionLike) { var candidateSignatures = []; signature = typeChecker.getResolvedSignature(callExpressionLike, candidateSignatures); - var useConstructSignatures = callExpressionLike.kind === 183 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); + var useConstructSignatures = callExpressionLike.kind === 186 /* NewExpression */ || (ts.isCallExpression(callExpressionLike) && callExpressionLike.expression.kind === 97 /* SuperKeyword */); var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures(); if (!ts.contains(allSignatures, signature.target) && !ts.contains(allSignatures, signature)) { // Get the first signature if there is one -- allSignatures may contain @@ -90839,7 +92924,7 @@ var ts; } } else if ((ts.isNameOfFunctionDeclaration(location) && !(symbolFlags & 98304 /* Accessor */)) || // name of function declaration - (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 153 /* Constructor */)) { + (location.kind === 123 /* ConstructorKeyword */ && location.parent.kind === 154 /* Constructor */)) { // At constructor keyword of constructor declaration // get the signature from the declaration and write it var functionDeclaration_1 = location.parent; // Use function declaration to write the signatures only if the symbol corresponding to this declaration @@ -90847,21 +92932,21 @@ var ts; return declaration === (location.kind === 123 /* ConstructorKeyword */ ? functionDeclaration_1.parent : functionDeclaration_1); }); if (locationIsSymbolDeclaration) { - var allSignatures = functionDeclaration_1.kind === 153 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); + var allSignatures = functionDeclaration_1.kind === 154 /* Constructor */ ? type.getNonNullableType().getConstructSignatures() : type.getNonNullableType().getCallSignatures(); if (!typeChecker.isImplementationOfOverload(functionDeclaration_1)) { signature = typeChecker.getSignatureFromDeclaration(functionDeclaration_1); } else { signature = allSignatures[0]; } - if (functionDeclaration_1.kind === 153 /* Constructor */) { + if (functionDeclaration_1.kind === 154 /* Constructor */) { // show (constructor) Type(...) signature symbolKind = "constructor" /* constructorImplementationElement */; addPrefixForAnyFunctionOrVar(type.symbol, symbolKind); } else { // (function/method) symbol(..signature) - addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 156 /* CallSignature */ && + addPrefixForAnyFunctionOrVar(functionDeclaration_1.kind === 157 /* CallSignature */ && !(type.symbol.flags & 2048 /* TypeLiteral */ || type.symbol.flags & 4096 /* ObjectLiteral */) ? type.symbol : symbol, symbolKind); } addSignatureDisplayParts(signature, allSignatures); @@ -90871,7 +92956,7 @@ var ts; } if (symbolFlags & 32 /* Class */ && !hasAddedSymbolInfo && !isThisExpression) { addAliasPrefixIfNecessary(); - if (ts.getDeclarationOfKind(symbol, 200 /* ClassExpression */)) { + if (ts.getDeclarationOfKind(symbol, 203 /* ClassExpression */)) { // Special case for class expressions because we would like to indicate that // the class name is local to the class body (similar to function expression) // (local class) class @@ -90894,7 +92979,7 @@ var ts; } if (symbolFlags & 524288 /* TypeAlias */) { prefixNextMeaning(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); writeTypeParametersOfSymbol(symbol, sourceFile); @@ -90915,9 +93000,9 @@ var ts; } if (symbolFlags & 1536 /* Module */) { prefixNextMeaning(); - var declaration = ts.getDeclarationOfKind(symbol, 234 /* ModuleDeclaration */); + var declaration = ts.getDeclarationOfKind(symbol, 237 /* ModuleDeclaration */); var isNamespace = declaration && declaration.name && declaration.name.kind === 71 /* Identifier */; - displayParts.push(ts.keywordPart(isNamespace ? 129 /* NamespaceKeyword */ : 128 /* ModuleKeyword */)); + displayParts.push(ts.keywordPart(isNamespace ? 130 /* NamespaceKeyword */ : 129 /* ModuleKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(symbol); } @@ -90936,28 +93021,28 @@ var ts; } else { // Method/function type parameter - var decl = ts.getDeclarationOfKind(symbol, 146 /* TypeParameter */); + var decl = ts.getDeclarationOfKind(symbol, 147 /* TypeParameter */); ts.Debug.assert(decl !== undefined); var declaration = decl.parent; if (declaration) { if (ts.isFunctionLikeKind(declaration.kind)) { addInPrefix(); var signature = typeChecker.getSignatureFromDeclaration(declaration); - if (declaration.kind === 157 /* ConstructSignature */) { + if (declaration.kind === 158 /* ConstructSignature */) { displayParts.push(ts.keywordPart(94 /* NewKeyword */)); displayParts.push(ts.spacePart()); } - else if (declaration.kind !== 156 /* CallSignature */ && declaration.name) { + else if (declaration.kind !== 157 /* CallSignature */ && declaration.name) { addFullSymbolName(declaration.symbol); } ts.addRange(displayParts, ts.signatureToDisplayParts(typeChecker, signature, sourceFile, 32 /* WriteTypeArgumentsOfSignature */)); } - else if (declaration.kind === 232 /* TypeAliasDeclaration */) { + else if (declaration.kind === 235 /* TypeAliasDeclaration */) { // Type alias type parameter // For example // type list = T[]; // Both T will go through same code path addInPrefix(); - displayParts.push(ts.keywordPart(138 /* TypeKeyword */)); + displayParts.push(ts.keywordPart(139 /* TypeKeyword */)); displayParts.push(ts.spacePart()); addFullSymbolName(declaration.symbol); writeTypeParametersOfSymbol(declaration.symbol, sourceFile); @@ -90969,7 +93054,7 @@ var ts; symbolKind = "enum member" /* enumMemberElement */; addPrefixForAnyFunctionOrVar(symbol, "enum member"); var declaration = symbol.declarations[0]; - if (declaration.kind === 268 /* EnumMember */) { + if (declaration.kind === 271 /* EnumMember */) { var constantValue = typeChecker.getConstantValue(declaration); if (constantValue !== undefined) { displayParts.push(ts.spacePart()); @@ -90998,12 +93083,12 @@ var ts; } } switch (symbol.declarations[0].kind) { - case 237 /* NamespaceExportDeclaration */: + case 240 /* NamespaceExportDeclaration */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(129 /* NamespaceKeyword */)); + displayParts.push(ts.keywordPart(130 /* NamespaceKeyword */)); break; - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: displayParts.push(ts.keywordPart(84 /* ExportKeyword */)); displayParts.push(ts.spacePart()); displayParts.push(ts.keywordPart(symbol.declarations[0].isExportEquals ? 58 /* EqualsToken */ : 79 /* DefaultKeyword */)); @@ -91014,13 +93099,13 @@ var ts; displayParts.push(ts.spacePart()); addFullSymbolName(symbol); ts.forEach(symbol.declarations, function (declaration) { - if (declaration.kind === 238 /* ImportEqualsDeclaration */) { + if (declaration.kind === 241 /* ImportEqualsDeclaration */) { var importEqualsDeclaration = declaration; if (ts.isExternalModuleImportEqualsDeclaration(importEqualsDeclaration)) { displayParts.push(ts.spacePart()); displayParts.push(ts.operatorPart(58 /* EqualsToken */)); displayParts.push(ts.spacePart()); - displayParts.push(ts.keywordPart(132 /* RequireKeyword */)); + displayParts.push(ts.keywordPart(133 /* RequireKeyword */)); displayParts.push(ts.punctuationPart(19 /* OpenParenToken */)); displayParts.push(ts.displayPart(ts.getTextOfNode(ts.getExternalModuleImportEqualsDeclarationExpression(importEqualsDeclaration)), ts.SymbolDisplayPartKind.stringLiteral)); displayParts.push(ts.punctuationPart(20 /* CloseParenToken */)); @@ -91092,10 +93177,10 @@ var ts; // For some special property access expressions like `exports.foo = foo` or `module.exports.foo = foo` // there documentation comments might be attached to the right hand side symbol of their declarations. // The pattern of such special property access is that the parent symbol is the symbol of the file. - if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 269 /* SourceFile */; })) { + if (symbol.parent && ts.forEach(symbol.parent.declarations, function (declaration) { return declaration.kind === 272 /* SourceFile */; })) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; - if (!declaration.parent || declaration.parent.kind !== 195 /* BinaryExpression */) { + if (!declaration.parent || declaration.parent.kind !== 198 /* BinaryExpression */) { continue; } var rhsSymbol = typeChecker.getSymbolAtLocation(declaration.parent.right); @@ -91200,16 +93285,16 @@ var ts; } return ts.forEach(symbol.declarations, function (declaration) { // Function expressions are local - if (declaration.kind === 187 /* FunctionExpression */) { + if (declaration.kind === 190 /* FunctionExpression */) { return true; } - if (declaration.kind !== 227 /* VariableDeclaration */ && declaration.kind !== 229 /* FunctionDeclaration */) { + if (declaration.kind !== 230 /* VariableDeclaration */ && declaration.kind !== 232 /* FunctionDeclaration */) { return false; } // If the parent is not sourceFile or module block it is local variable for (var parent = declaration.parent; !ts.isFunctionBlock(parent); parent = parent.parent) { // Reached source file or module block - if (parent.kind === 269 /* SourceFile */ || parent.kind === 235 /* ModuleBlock */) { + if (parent.kind === 272 /* SourceFile */ || parent.kind === 238 /* ModuleBlock */) { return false; } } @@ -91519,10 +93604,10 @@ var ts; function shouldRescanJsxIdentifier(node) { if (node.parent) { switch (node.parent.kind) { - case 257 /* JsxAttribute */: - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 260 /* JsxAttribute */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: // May parse an identifier like `module-layout`; that will be scanned as a keyword at first, but we should parse the whole thing to get an identifier. return ts.isKeyword(node.kind) || node.kind === 71 /* Identifier */; } @@ -91699,7 +93784,7 @@ var ts; (function (formatting) { function getAllRules() { var allTokens = []; - for (var token = 0 /* FirstToken */; token <= 143 /* LastToken */; token++) { + for (var token = 0 /* FirstToken */; token <= 144 /* LastToken */; token++) { allTokens.push(token); } function anyTokenExcept() { @@ -91711,9 +93796,9 @@ var ts; } var anyToken = { tokens: allTokens, isSpecific: false }; var anyTokenIncludingMultilineComments = tokenRangeFrom(allTokens.concat([3 /* MultiLineCommentTrivia */])); - var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 143 /* LastKeyword */); + var keywords = tokenRangeFromRange(72 /* FirstKeyword */, 144 /* LastKeyword */); var binaryOperators = tokenRangeFromRange(27 /* FirstBinaryOperator */, 70 /* LastBinaryOperator */); - var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 143 /* OfKeyword */, 118 /* AsKeyword */, 126 /* IsKeyword */]; + var binaryKeywordOperators = [92 /* InKeyword */, 93 /* InstanceOfKeyword */, 144 /* OfKeyword */, 118 /* AsKeyword */, 127 /* IsKeyword */]; var unaryPrefixOperators = [43 /* PlusPlusToken */, 44 /* MinusMinusToken */, 52 /* TildeToken */, 51 /* ExclamationToken */]; var unaryPrefixExpressions = [ 8 /* NumericLiteral */, 71 /* Identifier */, 19 /* OpenParenToken */, 21 /* OpenBracketToken */, @@ -91775,6 +93860,8 @@ var ts; rule("SpaceBetweenCloseBraceAndElse", 18 /* CloseBraceToken */, 82 /* ElseKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("SpaceBetweenCloseBraceAndWhile", 18 /* CloseBraceToken */, 106 /* WhileKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), rule("NoSpaceBetweenEmptyBraceBrackets", 17 /* OpenBraceToken */, 18 /* CloseBraceToken */, [isNonJsxSameLineTokenContext, isObjectContext], 8 /* Delete */), + // Add a space after control dec context if the next character is an open bracket ex: 'if (false)[a, b] = [1, 2];' -> 'if (false) [a, b] = [1, 2];' + rule("SpaceAfterConditionalClosingParen", 20 /* CloseParenToken */, 21 /* OpenBracketToken */, [isControlDeclContext], 2 /* Space */), rule("NoSpaceBetweenFunctionKeywordAndStar", 89 /* FunctionKeyword */, 39 /* AsteriskToken */, [isFunctionDeclarationOrFunctionExpressionContext], 8 /* Delete */), rule("SpaceAfterStarInGeneratorDeclaration", 39 /* AsteriskToken */, [71 /* Identifier */, 19 /* OpenParenToken */], [isFunctionDeclarationOrFunctionExpressionContext], 2 /* Space */), rule("SpaceAfterFunctionInFuncDecl", 89 /* FunctionKeyword */, anyToken, [isFunctionDeclContext], 2 /* Space */), @@ -91784,7 +93871,7 @@ var ts; // Though, we do extra check on the context to make sure we are dealing with get/set node. Example: // get x() {} // set x(val) {} - rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 135 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), + rule("SpaceAfterGetSetInMember", [125 /* GetKeyword */, 136 /* SetKeyword */], 71 /* Identifier */, [isFunctionDeclContext], 2 /* Space */), rule("NoSpaceBetweenYieldKeywordAndStar", 116 /* YieldKeyword */, 39 /* AsteriskToken */, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 8 /* Delete */), rule("SpaceBetweenYieldOrYieldStarAndOperand", [116 /* YieldKeyword */, 39 /* AsteriskToken */], anyToken, [isNonJsxSameLineTokenContext, isYieldOrYieldStarWithOperand], 2 /* Space */), rule("NoSpaceBetweenReturnAndSemicolon", 96 /* ReturnKeyword */, 25 /* SemicolonToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), @@ -91808,7 +93895,7 @@ var ts; rule("NoSpaceAfterEqualInJsxAttribute", 58 /* EqualsToken */, anyToken, [isJsxAttributeContext, isNonJsxSameLineTokenContext], 8 /* Delete */), // TypeScript-specific rules // Use of module as a function call. e.g.: import m2 = module("m2"); - rule("NoSpaceAfterModuleImport", [128 /* ModuleKeyword */, 132 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), + rule("NoSpaceAfterModuleImport", [129 /* ModuleKeyword */, 133 /* RequireKeyword */], 19 /* OpenParenToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), // Add a space around certain TypeScript keywords rule("SpaceAfterCertainTypeScriptKeywords", [ 117 /* AbstractKeyword */, @@ -91822,19 +93909,20 @@ var ts; 108 /* ImplementsKeyword */, 91 /* ImportKeyword */, 109 /* InterfaceKeyword */, - 128 /* ModuleKeyword */, - 129 /* NamespaceKeyword */, + 129 /* ModuleKeyword */, + 130 /* NamespaceKeyword */, 112 /* PrivateKeyword */, 114 /* PublicKeyword */, 113 /* ProtectedKeyword */, - 131 /* ReadonlyKeyword */, - 135 /* SetKeyword */, + 132 /* ReadonlyKeyword */, + 136 /* SetKeyword */, 115 /* StaticKeyword */, - 138 /* TypeKeyword */, - 141 /* FromKeyword */, - 127 /* KeyOfKeyword */, + 139 /* TypeKeyword */, + 142 /* FromKeyword */, + 128 /* KeyOfKeyword */, + 126 /* InferKeyword */, ], anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), - rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 141 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), + rule("SpaceBeforeCertainTypeScriptKeywords", anyToken, [85 /* ExtendsKeyword */, 108 /* ImplementsKeyword */, 142 /* FromKeyword */], [isNonJsxSameLineTokenContext], 2 /* Space */), // Treat string literals in module names as identifiers, and add a space between the literal and the opening Brace braces, e.g.: module "m2" { rule("SpaceAfterModuleName", 9 /* StringLiteral */, 17 /* OpenBraceToken */, [isModuleDeclContext], 2 /* Space */), // Lambda expressions @@ -91866,7 +93954,7 @@ var ts; 112 /* PrivateKeyword */, 113 /* ProtectedKeyword */, 125 /* GetKeyword */, - 135 /* SetKeyword */, + 136 /* SetKeyword */, 21 /* OpenBracketToken */, 39 /* AsteriskToken */, ], [isEndOfDecoratorContextOnSameLine], 2 /* Space */), @@ -91949,6 +94037,8 @@ var ts; rule("NoSpaceBeforeOpenBracket", anyTokenExcept(120 /* AsyncKeyword */, 73 /* CaseKeyword */), 21 /* OpenBracketToken */, [isNonJsxSameLineTokenContext], 8 /* Delete */), rule("NoSpaceAfterCloseBracket", 22 /* CloseBracketToken */, anyToken, [isNonJsxSameLineTokenContext, isNotBeforeBlockInFunctionDeclarationContext], 8 /* Delete */), rule("SpaceAfterSemicolon", 25 /* SemicolonToken */, anyToken, [isNonJsxSameLineTokenContext], 2 /* Space */), + // Remove extra space between for and await + rule("SpaceBetweenForAndAwaitKeyword", 88 /* ForKeyword */, 121 /* AwaitKeyword */, [isNonJsxSameLineTokenContext], 2 /* Space */), // Add a space between statements. All keywords except (do,else,case) has open/close parens after them. // So, we have a rule to add a space for [),Any], [do,Any], [else,Any], and [case,Any] rule("SpaceBetweenStatements", [20 /* CloseParenToken */, 81 /* DoKeyword */, 82 /* ElseKeyword */, 73 /* CaseKeyword */], anyToken, [isNonJsxSameLineTokenContext, isNonJsxElementOrFragmentContext, isNotForContext], 2 /* Space */), @@ -91997,44 +94087,45 @@ var ts; return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; }; } function isForContext(context) { - return context.contextNode.kind === 215 /* ForStatement */; + return context.contextNode.kind === 218 /* ForStatement */; } function isNotForContext(context) { return !isForContext(context); } function isBinaryOpContext(context) { switch (context.contextNode.kind) { - case 195 /* BinaryExpression */: - case 196 /* ConditionalExpression */: - case 203 /* AsExpression */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 159 /* TypePredicate */: - case 167 /* UnionType */: - case 168 /* IntersectionType */: + case 198 /* BinaryExpression */: + case 199 /* ConditionalExpression */: + case 170 /* ConditionalType */: + case 206 /* AsExpression */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 160 /* TypePredicate */: + case 168 /* UnionType */: + case 169 /* IntersectionType */: return true; // equals in binding elements: function foo([[x, y] = [1, 2]]) - case 177 /* BindingElement */: + case 180 /* BindingElement */: // equals in type X = ... - case 232 /* TypeAliasDeclaration */: + case 235 /* TypeAliasDeclaration */: // equal in import a = module('a'); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // equal in let a = 0; - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: // equal in p = 0; - case 147 /* Parameter */: - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 148 /* Parameter */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return context.currentTokenSpan.kind === 58 /* EqualsToken */ || context.nextTokenSpan.kind === 58 /* EqualsToken */; // "in" keyword in for (let x in []) { } - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // "in" keyword in [P in keyof T]: T[P] - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: return context.currentTokenSpan.kind === 92 /* InKeyword */ || context.nextTokenSpan.kind === 92 /* InKeyword */; // Technically, "of" is not a binary operator, but format it the same way as "in" - case 217 /* ForOfStatement */: - return context.currentTokenSpan.kind === 143 /* OfKeyword */ || context.nextTokenSpan.kind === 143 /* OfKeyword */; + case 220 /* ForOfStatement */: + return context.currentTokenSpan.kind === 144 /* OfKeyword */ || context.nextTokenSpan.kind === 144 /* OfKeyword */; } return false; } @@ -92046,20 +94137,23 @@ var ts; } function isTypeAnnotationContext(context) { var contextKind = context.contextNode.kind; - return contextKind === 150 /* PropertyDeclaration */ || - contextKind === 149 /* PropertySignature */ || - contextKind === 147 /* Parameter */ || - contextKind === 227 /* VariableDeclaration */ || + return contextKind === 151 /* PropertyDeclaration */ || + contextKind === 150 /* PropertySignature */ || + contextKind === 148 /* Parameter */ || + contextKind === 230 /* VariableDeclaration */ || ts.isFunctionLikeKind(contextKind); } function isConditionalOperatorContext(context) { - return context.contextNode.kind === 196 /* ConditionalExpression */; + return context.contextNode.kind === 199 /* ConditionalExpression */ || + context.contextNode.kind === 170 /* ConditionalType */; } function isSameLineTokenOrBeforeBlockContext(context) { return context.TokensAreOnSameLine() || isBeforeBlockContext(context); } function isBraceWrappedContext(context) { - return context.contextNode.kind === 175 /* ObjectBindingPattern */ || isSingleLineBlockContext(context); + return context.contextNode.kind === 178 /* ObjectBindingPattern */ || + context.contextNode.kind === 176 /* MappedType */ || + isSingleLineBlockContext(context); } // This check is done before an open brace in a control construct, a function, or a typescript block declaration function isBeforeMultilineBlockContext(context) { @@ -92084,70 +94178,70 @@ var ts; return true; } switch (node.kind) { - case 208 /* Block */: - case 236 /* CaseBlock */: - case 179 /* ObjectLiteralExpression */: - case 235 /* ModuleBlock */: + case 211 /* Block */: + case 239 /* CaseBlock */: + case 182 /* ObjectLiteralExpression */: + case 238 /* ModuleBlock */: return true; } return false; } function isFunctionDeclContext(context) { switch (context.contextNode.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: // case SyntaxKind.MemberFunctionDeclaration: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: // case SyntaxKind.MethodSignature: - case 156 /* CallSignature */: - case 187 /* FunctionExpression */: - case 153 /* Constructor */: - case 188 /* ArrowFunction */: + case 157 /* CallSignature */: + case 190 /* FunctionExpression */: + case 154 /* Constructor */: + case 191 /* ArrowFunction */: // case SyntaxKind.ConstructorDeclaration: // case SyntaxKind.SimpleArrowFunctionExpression: // case SyntaxKind.ParenthesizedArrowFunctionExpression: - case 231 /* InterfaceDeclaration */:// This one is not truly a function, but for formatting purposes, it acts just like one + case 234 /* InterfaceDeclaration */: // This one is not truly a function, but for formatting purposes, it acts just like one return true; } return false; } function isFunctionDeclarationOrFunctionExpressionContext(context) { - return context.contextNode.kind === 229 /* FunctionDeclaration */ || context.contextNode.kind === 187 /* FunctionExpression */; + return context.contextNode.kind === 232 /* FunctionDeclaration */ || context.contextNode.kind === 190 /* FunctionExpression */; } function isTypeScriptDeclWithBlockContext(context) { return nodeIsTypeScriptDeclWithBlockContext(context.contextNode); } function nodeIsTypeScriptDeclWithBlockContext(node) { switch (node.kind) { - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 164 /* TypeLiteral */: - case 234 /* ModuleDeclaration */: - case 245 /* ExportDeclaration */: - case 246 /* NamedExports */: - case 239 /* ImportDeclaration */: - case 242 /* NamedImports */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 165 /* TypeLiteral */: + case 237 /* ModuleDeclaration */: + case 248 /* ExportDeclaration */: + case 249 /* NamedExports */: + case 242 /* ImportDeclaration */: + case 245 /* NamedImports */: return true; } return false; } function isAfterCodeBlockContext(context) { switch (context.currentTokenParent.kind) { - case 230 /* ClassDeclaration */: - case 234 /* ModuleDeclaration */: - case 233 /* EnumDeclaration */: - case 264 /* CatchClause */: - case 235 /* ModuleBlock */: - case 222 /* SwitchStatement */: + case 233 /* ClassDeclaration */: + case 237 /* ModuleDeclaration */: + case 236 /* EnumDeclaration */: + case 267 /* CatchClause */: + case 238 /* ModuleBlock */: + case 225 /* SwitchStatement */: return true; - case 208 /* Block */: { + case 211 /* Block */: { var blockParent = context.currentTokenParent.parent; // In a codefix scenario, we can't rely on parents being set. So just always return true. - if (!blockParent || blockParent.kind !== 188 /* ArrowFunction */ && blockParent.kind !== 187 /* FunctionExpression */) { + if (!blockParent || blockParent.kind !== 191 /* ArrowFunction */ && blockParent.kind !== 190 /* FunctionExpression */) { return true; } } @@ -92156,31 +94250,31 @@ var ts; } function isControlDeclContext(context) { switch (context.contextNode.kind) { - case 212 /* IfStatement */: - case 222 /* SwitchStatement */: - case 215 /* ForStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 214 /* WhileStatement */: - case 225 /* TryStatement */: - case 213 /* DoStatement */: - case 221 /* WithStatement */: + case 215 /* IfStatement */: + case 225 /* SwitchStatement */: + case 218 /* ForStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 217 /* WhileStatement */: + case 228 /* TryStatement */: + case 216 /* DoStatement */: + case 224 /* WithStatement */: // TODO // case SyntaxKind.ElseClause: - case 264 /* CatchClause */: + case 267 /* CatchClause */: return true; default: return false; } } function isObjectContext(context) { - return context.contextNode.kind === 179 /* ObjectLiteralExpression */; + return context.contextNode.kind === 182 /* ObjectLiteralExpression */; } function isFunctionCallContext(context) { - return context.contextNode.kind === 182 /* CallExpression */; + return context.contextNode.kind === 185 /* CallExpression */; } function isNewContext(context) { - return context.contextNode.kind === 183 /* NewExpression */; + return context.contextNode.kind === 186 /* NewExpression */; } function isFunctionCallOrNewContext(context) { return isFunctionCallContext(context) || isNewContext(context); @@ -92192,25 +94286,25 @@ var ts; return context.nextTokenSpan.kind !== 22 /* CloseBracketToken */; } function isArrowFunctionContext(context) { - return context.contextNode.kind === 188 /* ArrowFunction */; + return context.contextNode.kind === 191 /* ArrowFunction */; } function isNonJsxSameLineTokenContext(context) { return context.TokensAreOnSameLine() && context.contextNode.kind !== 10 /* JsxText */; } function isNonJsxElementOrFragmentContext(context) { - return context.contextNode.kind !== 250 /* JsxElement */ && context.contextNode.kind !== 254 /* JsxFragment */; + return context.contextNode.kind !== 253 /* JsxElement */ && context.contextNode.kind !== 257 /* JsxFragment */; } function isJsxExpressionContext(context) { - return context.contextNode.kind === 260 /* JsxExpression */ || context.contextNode.kind === 259 /* JsxSpreadAttribute */; + return context.contextNode.kind === 263 /* JsxExpression */ || context.contextNode.kind === 262 /* JsxSpreadAttribute */; } function isNextTokenParentJsxAttribute(context) { - return context.nextTokenParent.kind === 257 /* JsxAttribute */; + return context.nextTokenParent.kind === 260 /* JsxAttribute */; } function isJsxAttributeContext(context) { - return context.contextNode.kind === 257 /* JsxAttribute */; + return context.contextNode.kind === 260 /* JsxAttribute */; } function isJsxSelfClosingElementContext(context) { - return context.contextNode.kind === 251 /* JsxSelfClosingElement */; + return context.contextNode.kind === 254 /* JsxSelfClosingElement */; } function isNotBeforeBlockInFunctionDeclarationContext(context) { return !isFunctionDeclContext(context) && !isBeforeBlockContext(context); @@ -92225,45 +94319,45 @@ var ts; while (ts.isExpressionNode(node)) { node = node.parent; } - return node.kind === 148 /* Decorator */; + return node.kind === 149 /* Decorator */; } function isStartOfVariableDeclarationList(context) { - return context.currentTokenParent.kind === 228 /* VariableDeclarationList */ && + return context.currentTokenParent.kind === 231 /* VariableDeclarationList */ && context.currentTokenParent.getStart(context.sourceFile) === context.currentTokenSpan.pos; } function isNotFormatOnEnter(context) { return context.formattingRequestKind !== 2 /* FormatOnEnter */; } function isModuleDeclContext(context) { - return context.contextNode.kind === 234 /* ModuleDeclaration */; + return context.contextNode.kind === 237 /* ModuleDeclaration */; } function isObjectTypeContext(context) { - return context.contextNode.kind === 164 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; + return context.contextNode.kind === 165 /* TypeLiteral */; // && context.contextNode.parent.kind !== SyntaxKind.InterfaceDeclaration; } function isConstructorSignatureContext(context) { - return context.contextNode.kind === 157 /* ConstructSignature */; + return context.contextNode.kind === 158 /* ConstructSignature */; } function isTypeArgumentOrParameterOrAssertion(token, parent) { if (token.kind !== 27 /* LessThanToken */ && token.kind !== 29 /* GreaterThanToken */) { return false; } switch (parent.kind) { - case 160 /* TypeReference */: - case 185 /* TypeAssertionExpression */: - case 232 /* TypeAliasDeclaration */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 202 /* ExpressionWithTypeArguments */: + case 161 /* TypeReference */: + case 188 /* TypeAssertionExpression */: + case 235 /* TypeAliasDeclaration */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 205 /* ExpressionWithTypeArguments */: return true; default: return false; @@ -92274,16 +94368,16 @@ var ts; isTypeArgumentOrParameterOrAssertion(context.nextTokenSpan, context.nextTokenParent); } function isTypeAssertionContext(context) { - return context.contextNode.kind === 185 /* TypeAssertionExpression */; + return context.contextNode.kind === 188 /* TypeAssertionExpression */; } function isVoidOpContext(context) { - return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 191 /* VoidExpression */; + return context.currentTokenSpan.kind === 105 /* VoidKeyword */ && context.currentTokenParent.kind === 194 /* VoidExpression */; } function isYieldOrYieldStarWithOperand(context) { - return context.contextNode.kind === 198 /* YieldExpression */ && context.contextNode.expression !== undefined; + return context.contextNode.kind === 201 /* YieldExpression */ && context.contextNode.expression !== undefined; } function isNonNullAssertionContext(context) { - return context.contextNode.kind === 204 /* NonNullExpression */; + return context.contextNode.kind === 207 /* NonNullExpression */; } })(formatting = ts.formatting || (ts.formatting = {})); })(ts || (ts = {})); @@ -92335,12 +94429,12 @@ var ts; return map; } function getRuleBucketIndex(row, column) { - ts.Debug.assert(row <= 143 /* LastKeyword */ && column <= 143 /* LastKeyword */, "Must compute formatting context from tokens"); + ts.Debug.assert(row <= 144 /* LastKeyword */ && column <= 144 /* LastKeyword */, "Must compute formatting context from tokens"); return (row * mapRowLength) + column; } var maskBitSize = 5; var mask = 31; // MaskBitSize bits - var mapRowLength = 143 /* LastToken */ + 1; + var mapRowLength = 144 /* LastToken */ + 1; var RulesPosition; (function (RulesPosition) { RulesPosition[RulesPosition["IgnoreRulesSpecific"] = 0] = "IgnoreRulesSpecific"; @@ -92522,17 +94616,17 @@ var ts; // i.e. parent is class declaration with the list of members and node is one of members. function isListElement(parent, node) { switch (parent.kind) { - case 230 /* ClassDeclaration */: - case 231 /* InterfaceDeclaration */: + case 233 /* ClassDeclaration */: + case 234 /* InterfaceDeclaration */: return ts.rangeContainsRange(parent.members, node); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: var body = parent.body; - return body && body.kind === 235 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); - case 269 /* SourceFile */: - case 208 /* Block */: - case 235 /* ModuleBlock */: + return body && body.kind === 238 /* ModuleBlock */ && ts.rangeContainsRange(body.statements, node); + case 272 /* SourceFile */: + case 211 /* Block */: + case 238 /* ModuleBlock */: return ts.rangeContainsRange(parent.statements, node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return ts.rangeContainsRange(parent.block.statements, node); } return false; @@ -92755,19 +94849,19 @@ var ts; return node.modifiers[0].kind; } switch (node.kind) { - case 230 /* ClassDeclaration */: return 75 /* ClassKeyword */; - case 231 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; - case 229 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; - case 233 /* EnumDeclaration */: return 233 /* EnumDeclaration */; - case 154 /* GetAccessor */: return 125 /* GetKeyword */; - case 155 /* SetAccessor */: return 135 /* SetKeyword */; - case 152 /* MethodDeclaration */: + case 233 /* ClassDeclaration */: return 75 /* ClassKeyword */; + case 234 /* InterfaceDeclaration */: return 109 /* InterfaceKeyword */; + case 232 /* FunctionDeclaration */: return 89 /* FunctionKeyword */; + case 236 /* EnumDeclaration */: return 236 /* EnumDeclaration */; + case 155 /* GetAccessor */: return 125 /* GetKeyword */; + case 156 /* SetAccessor */: return 136 /* SetKeyword */; + case 153 /* MethodDeclaration */: if (node.asteriskToken) { return 39 /* AsteriskToken */; } // falls through - case 150 /* PropertyDeclaration */: - case 147 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 148 /* Parameter */: return ts.getNameOfDeclaration(node).kind; } } @@ -92812,15 +94906,15 @@ var ts; case 41 /* SlashToken */: case 29 /* GreaterThanToken */: switch (container.kind) { - case 252 /* JsxOpeningElement */: - case 253 /* JsxClosingElement */: - case 251 /* JsxSelfClosingElement */: + case 255 /* JsxOpeningElement */: + case 256 /* JsxClosingElement */: + case 254 /* JsxSelfClosingElement */: return false; } break; case 21 /* OpenBracketToken */: case 22 /* CloseBracketToken */: - if (container.kind !== 173 /* MappedType */) { + if (container.kind !== 176 /* MappedType */) { return false; } break; @@ -92912,7 +95006,7 @@ var ts; consumeTokenAndAdvanceScanner(tokenInfo, node, parentDynamicIndentation, child); return inheritedIndentation; } - var effectiveParentStartLine = child.kind === 148 /* Decorator */ ? childStartLine : undecoratedParentStartLine; + var effectiveParentStartLine = child.kind === 149 /* Decorator */ ? childStartLine : undecoratedParentStartLine; var childIndentation = computeIndentation(child, childStartLine, childIndentationAmount, node, parentDynamicIndentation, effectiveParentStartLine); processNode(child, childContextNode, childStartLine, undecoratedChildStartLine, childIndentation.indentation, childIndentation.delta); if (child.kind === 10 /* JsxText */) { @@ -92920,7 +95014,7 @@ var ts; indentMultilineCommentOrJsxText(range, childIndentation.indentation, /*firstLineIsIndented*/ true, /*indentFinalLine*/ false); } childContextNode = node; - if (isFirstListItem && parent.kind === 178 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { + if (isFirstListItem && parent.kind === 181 /* ArrayLiteralExpression */ && inheritedIndentation === -1 /* Unknown */) { inheritedIndentation = childIndentation.indentation; } return inheritedIndentation; @@ -93227,17 +95321,14 @@ var ts; var endLine = sourceFile.getLineAndCharacterOfPosition(originalRange.end).line; trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange); } - function newTextChange(start, len, newText) { - return { span: ts.createTextSpan(start, len), newText: newText }; - } function recordDelete(start, len) { if (len) { - edits.push(newTextChange(start, len, "")); + edits.push(ts.createTextChangeFromStartLength(start, len, "")); } } function recordReplace(start, len, newText) { if (len || newText) { - edits.push(newTextChange(start, len, newText)); + edits.push(ts.createTextChangeFromStartLength(start, len, newText)); } } function applyRuleEdits(rule, previousRange, previousStartLine, currentRange, currentStartLine) { @@ -93334,12 +95425,12 @@ var ts; formatting.getRangeOfEnclosingComment = getRangeOfEnclosingComment; function getOpenTokenForList(node, list) { switch (node.kind) { - case 153 /* Constructor */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 188 /* ArrowFunction */: + case 154 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 191 /* ArrowFunction */: if (node.typeParameters === list) { return 27 /* LessThanToken */; } @@ -93347,8 +95438,8 @@ var ts; return 19 /* OpenParenToken */; } break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -93356,7 +95447,7 @@ var ts; return 19 /* OpenParenToken */; } break; - case 160 /* TypeReference */: + case 161 /* TypeReference */: if (node.typeArguments === list) { return 27 /* LessThanToken */; } @@ -93473,7 +95564,7 @@ var ts; if (options.indentStyle === ts.IndentStyle.Block) { return getBlockIndent(sourceFile, position, options); } - if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 195 /* BinaryExpression */) { + if (precedingToken.kind === 26 /* CommaToken */ && precedingToken.parent.kind !== 198 /* BinaryExpression */) { // previous token is comma that separates items in list - find the previous item and try to derive indentation from it var actualIndentation = getActualIndentationForListItemBeforeComma(precedingToken, sourceFile, options); if (actualIndentation !== -1 /* Unknown */) { @@ -93629,7 +95720,7 @@ var ts; // - parent is SourceFile - by default immediate children of SourceFile are not indented except when user indents them manually // - parent and child are not on the same line var useActualIndentation = (ts.isDeclaration(current) || ts.isStatementButNotDeclaration(current)) && - (parent.kind === 269 /* SourceFile */ || !parentAndChildShareLine); + (parent.kind === 272 /* SourceFile */ || !parentAndChildShareLine); if (!useActualIndentation) { return -1 /* Unknown */; } @@ -93677,7 +95768,7 @@ var ts; } SmartIndenter.isArgumentAndStartLineOverlapsExpressionBeingCalled = isArgumentAndStartLineOverlapsExpressionBeingCalled; function childStartsOnTheSameLineWithElseInIfStatement(parent, child, childStartLine, sourceFile) { - if (parent.kind === 212 /* IfStatement */ && parent.elseStatement === child) { + if (parent.kind === 215 /* IfStatement */ && parent.elseStatement === child) { var elseKeyword = ts.findChildOfKind(parent, 82 /* ElseKeyword */, sourceFile); ts.Debug.assert(elseKeyword !== undefined); var elseKeywordStartLine = getStartLineAndCharacterForNode(elseKeyword, sourceFile).line; @@ -93692,37 +95783,37 @@ var ts; function getContainingList(node, sourceFile) { if (node.parent) { switch (node.parent.kind) { - case 160 /* TypeReference */: + case 161 /* TypeReference */: return getListIfStartEndIsInListRange(node.parent.typeArguments, node.getStart(sourceFile), node.getEnd()); - case 179 /* ObjectLiteralExpression */: + case 182 /* ObjectLiteralExpression */: return node.parent.properties; - case 178 /* ArrayLiteralExpression */: + case 181 /* ArrayLiteralExpression */: return node.parent.elements; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 153 /* Constructor */: - case 162 /* ConstructorType */: - case 157 /* ConstructSignature */: { + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 154 /* Constructor */: + case 163 /* ConstructorType */: + case 158 /* ConstructSignature */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeParameters, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.parameters, start, node.getEnd()); } - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: return getListIfStartEndIsInListRange(node.parent.typeParameters, node.getStart(sourceFile), node.getEnd()); - case 183 /* NewExpression */: - case 182 /* CallExpression */: { + case 186 /* NewExpression */: + case 185 /* CallExpression */: { var start = node.getStart(sourceFile); return getListIfStartEndIsInListRange(node.parent.typeArguments, start, node.getEnd()) || getListIfStartEndIsInListRange(node.parent.arguments, start, node.getEnd()); } - case 228 /* VariableDeclarationList */: + case 231 /* VariableDeclarationList */: return getListIfStartEndIsInListRange(node.parent.declarations, node.getStart(sourceFile), node.getEnd()); - case 242 /* NamedImports */: - case 246 /* NamedExports */: + case 245 /* NamedImports */: + case 249 /* NamedExports */: return getListIfStartEndIsInListRange(node.parent.elements, node.getStart(sourceFile), node.getEnd()); } } @@ -93762,10 +95853,10 @@ var ts; function getStartingExpression(node) { while (true) { switch (node.kind) { - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 180 /* PropertyAccessExpression */: - case 181 /* ElementAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 183 /* PropertyAccessExpression */: + case 184 /* ElementAccessExpression */: node = node.expression; break; default: @@ -93829,52 +95920,52 @@ var ts; SmartIndenter.findFirstNonWhitespaceColumn = findFirstNonWhitespaceColumn; function nodeContentIsAlwaysIndented(kind) { switch (kind) { - case 211 /* ExpressionStatement */: - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 233 /* EnumDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 178 /* ArrayLiteralExpression */: - case 208 /* Block */: - case 235 /* ModuleBlock */: - case 179 /* ObjectLiteralExpression */: - case 164 /* TypeLiteral */: - case 173 /* MappedType */: - case 166 /* TupleType */: - case 236 /* CaseBlock */: - case 262 /* DefaultClause */: - case 261 /* CaseClause */: - case 186 /* ParenthesizedExpression */: - case 180 /* PropertyAccessExpression */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 209 /* VariableStatement */: - case 227 /* VariableDeclaration */: - case 244 /* ExportAssignment */: - case 220 /* ReturnStatement */: - case 196 /* ConditionalExpression */: - case 176 /* ArrayBindingPattern */: - case 175 /* ObjectBindingPattern */: - case 252 /* JsxOpeningElement */: - case 255 /* JsxOpeningFragment */: - case 251 /* JsxSelfClosingElement */: - case 260 /* JsxExpression */: - case 151 /* MethodSignature */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 147 /* Parameter */: - case 161 /* FunctionType */: - case 162 /* ConstructorType */: - case 169 /* ParenthesizedType */: - case 184 /* TaggedTemplateExpression */: - case 192 /* AwaitExpression */: - case 246 /* NamedExports */: - case 242 /* NamedImports */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 265 /* PropertyAssignment */: - case 150 /* PropertyDeclaration */: + case 214 /* ExpressionStatement */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 236 /* EnumDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 181 /* ArrayLiteralExpression */: + case 211 /* Block */: + case 238 /* ModuleBlock */: + case 182 /* ObjectLiteralExpression */: + case 165 /* TypeLiteral */: + case 176 /* MappedType */: + case 167 /* TupleType */: + case 239 /* CaseBlock */: + case 265 /* DefaultClause */: + case 264 /* CaseClause */: + case 189 /* ParenthesizedExpression */: + case 183 /* PropertyAccessExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 212 /* VariableStatement */: + case 230 /* VariableDeclaration */: + case 247 /* ExportAssignment */: + case 223 /* ReturnStatement */: + case 199 /* ConditionalExpression */: + case 179 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 255 /* JsxOpeningElement */: + case 258 /* JsxOpeningFragment */: + case 254 /* JsxSelfClosingElement */: + case 263 /* JsxExpression */: + case 152 /* MethodSignature */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 148 /* Parameter */: + case 162 /* FunctionType */: + case 163 /* ConstructorType */: + case 172 /* ParenthesizedType */: + case 187 /* TaggedTemplateExpression */: + case 195 /* AwaitExpression */: + case 249 /* NamedExports */: + case 245 /* NamedImports */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 268 /* PropertyAssignment */: + case 151 /* PropertyDeclaration */: return true; } return false; @@ -93882,29 +95973,29 @@ var ts; function nodeWillIndentChild(parent, child, indentByDefault) { var childKind = child ? child.kind : 0 /* Unknown */; switch (parent.kind) { - case 213 /* DoStatement */: - case 214 /* WhileStatement */: - case 216 /* ForInStatement */: - case 217 /* ForOfStatement */: - case 215 /* ForStatement */: - case 212 /* IfStatement */: - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 188 /* ArrowFunction */: - case 153 /* Constructor */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - return childKind !== 208 /* Block */; - case 245 /* ExportDeclaration */: - return childKind !== 246 /* NamedExports */; - case 239 /* ImportDeclaration */: - return childKind !== 240 /* ImportClause */ || - (!!child.namedBindings && child.namedBindings.kind !== 242 /* NamedImports */); - case 250 /* JsxElement */: - return childKind !== 253 /* JsxClosingElement */; - case 254 /* JsxFragment */: - return childKind !== 256 /* JsxClosingFragment */; + case 216 /* DoStatement */: + case 217 /* WhileStatement */: + case 219 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 218 /* ForStatement */: + case 215 /* IfStatement */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 191 /* ArrowFunction */: + case 154 /* Constructor */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + return childKind !== 211 /* Block */; + case 248 /* ExportDeclaration */: + return childKind !== 249 /* NamedExports */; + case 242 /* ImportDeclaration */: + return childKind !== 243 /* ImportClause */ || + (!!child.namedBindings && child.namedBindings.kind !== 245 /* NamedImports */); + case 253 /* JsxElement */: + return childKind !== 256 /* JsxClosingElement */; + case 257 /* JsxFragment */: + return childKind !== 259 /* JsxClosingFragment */; } // No explicit rule for given nodes so the result will follow the default value argument return indentByDefault; @@ -93912,29 +96003,17 @@ var ts; SmartIndenter.nodeWillIndentChild = nodeWillIndentChild; function isControlFlowEndingStatement(kind, parent) { switch (kind) { - case 220 /* ReturnStatement */: - case 224 /* ThrowStatement */: - switch (parent.kind) { - case 208 /* Block */: - var grandParent = parent.parent; - switch (grandParent && grandParent.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - // We may want to write inner functions after this. - return false; - default: - return true; - } - case 261 /* CaseClause */: - case 262 /* DefaultClause */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: - return true; - default: - throw ts.Debug.fail(); + case 223 /* ReturnStatement */: + case 227 /* ThrowStatement */: { + if (parent.kind !== 211 /* Block */) { + return true; } - case 218 /* ContinueStatement */: - case 219 /* BreakStatement */: + var grandParent = parent.parent; + // In a function, we may want to write inner functions after this. + return !(grandParent && grandParent.kind === 190 /* FunctionExpression */ || grandParent.kind === 232 /* FunctionDeclaration */); + } + case 221 /* ContinueStatement */: + case 222 /* BreakStatement */: return true; default: return false; @@ -93957,7 +96036,7 @@ var ts; var ts; (function (ts) { var textChanges; - (function (textChanges) { + (function (textChanges_1) { /** * Currently for simplicity we store recovered positions on the node itself. * It can be changed to side-table later if we decide that current design is too invasive. @@ -93984,7 +96063,7 @@ var ts; (function (Position) { Position[Position["FullStart"] = 0] = "FullStart"; Position[Position["Start"] = 1] = "Start"; - })(Position = textChanges.Position || (textChanges.Position = {})); + })(Position = textChanges_1.Position || (textChanges_1.Position = {})); function skipWhitespacesAndLineBreaks(text, start) { return ts.skipTrivia(text, start, /*stopAfterLineBreak*/ false, /*stopAtComments*/ true); } @@ -94000,6 +96079,10 @@ var ts; } return false; } + textChanges_1.useNonAdjustedPositions = { + useNonAdjustedStartPosition: true, + useNonAdjustedEndPosition: true, + }; var ChangeKind; (function (ChangeKind) { ChangeKind[ChangeKind["Remove"] = 0] = "Remove"; @@ -94009,10 +96092,10 @@ var ts; function getSeparatorCharacter(separator) { return ts.tokenToString(separator.kind); } - textChanges.getSeparatorCharacter = getSeparatorCharacter; + textChanges_1.getSeparatorCharacter = getSeparatorCharacter; function getAdjustedStartPosition(sourceFile, node, options, position) { if (options.useNonAdjustedStartPosition) { - return node.getFullStart(); + return node.getStart(sourceFile); } var fullStart = node.getFullStart(); var start = node.getStart(sourceFile); @@ -94039,7 +96122,7 @@ var ts; adjustedStartPosition = skipWhitespacesAndLineBreaks(sourceFile.text, adjustedStartPosition); return ts.getStartPositionOfLine(ts.getLineOfLocalPosition(sourceFile, adjustedStartPosition), sourceFile); } - textChanges.getAdjustedStartPosition = getAdjustedStartPosition; + textChanges_1.getAdjustedStartPosition = getAdjustedStartPosition; function getAdjustedEndPosition(sourceFile, node, options) { if (options.useNonAdjustedEndPosition || ts.isExpression(node)) { return node.getEnd(); @@ -94050,12 +96133,12 @@ var ts; ? newEnd : end; } - textChanges.getAdjustedEndPosition = getAdjustedEndPosition; + textChanges_1.getAdjustedEndPosition = getAdjustedEndPosition; /** * Checks if 'candidate' argument is a legal separator in the list that contains 'node' as an element */ function isSeparator(node, candidate) { - return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 179 /* ObjectLiteralExpression */)); + return candidate && node.parent && (candidate.kind === 26 /* CommaToken */ || (candidate.kind === 25 /* SemicolonToken */ && node.parent.kind === 182 /* ObjectLiteralExpression */)); } function spaces(count) { var s = ""; @@ -94065,18 +96148,17 @@ var ts; return s; } var ChangeTracker = /** @class */ (function () { - function ChangeTracker(newLine, formatContext, validator) { - this.newLine = newLine; + /** Public for tests only. Other callers should use `ChangeTracker.with`. */ + function ChangeTracker(newLineCharacter, formatContext) { + this.newLineCharacter = newLineCharacter; this.formatContext = formatContext; - this.validator = validator; this.changes = []; this.deletedNodesInLists = []; // Stores ids of nodes in lists that we already deleted. Used to avoid deleting `, ` twice in `a, b`. // Map from class id to nodes to insert at the start this.nodesInsertedAtClassStarts = ts.createMap(); - this.newLineCharacter = ts.getNewLineCharacter({ newLine: newLine }); } ChangeTracker.fromContext = function (context) { - return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options) === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */, context.formatContext); + return new ChangeTracker(ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options), context.formatContext); }; ChangeTracker.with = function (context, cb) { var tracker = ChangeTracker.fromContext(context); @@ -94087,6 +96169,7 @@ var ts; this.changes.push({ kind: ChangeKind.Remove, sourceFile: sourceFile, range: range }); return this; }; + /** Warning: This deletes comments too. See `copyComments` in `convertFunctionToEs6Class`. */ ChangeTracker.prototype.deleteNode = function (sourceFile, node, options) { if (options === void 0) { options = {}; } var startPosition = getAdjustedStartPosition(sourceFile, node, options, Position.FullStart); @@ -94146,54 +96229,52 @@ var ts; } return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceRange = function (sourceFile, range, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, range: range, options: options, node: newNode }); return this; }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNode = function (sourceFile, oldNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, oldNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): default should probably be useNonAdjustedPositions ChangeTracker.prototype.replaceNodeRange = function (sourceFile, startNode, endNode, newNode, options) { if (options === void 0) { options = {}; } - var startPosition = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); - var endPosition = getAdjustedEndPosition(sourceFile, endNode, options); - return this.replaceWithSingle(sourceFile, startPosition, endPosition, newNode, options); + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRange(sourceFile, { pos: pos, end: end }, newNode, options); }; - ChangeTracker.prototype.replaceWithSingle = function (sourceFile, startPosition, endPosition, newNode, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithSingleNode, - sourceFile: sourceFile, - options: options, - node: newNode, - range: { pos: startPosition, end: endPosition } - }); + ChangeTracker.prototype.replaceRangeWithNodes = function (sourceFile, range, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, range: range, options: options, nodes: newNodes }); return this; }; - ChangeTracker.prototype.replaceWithMultiple = function (sourceFile, startPosition, endPosition, newNodes, options) { - this.changes.push({ - kind: ChangeKind.ReplaceWithMultipleNodes, - sourceFile: sourceFile, - options: options, - nodes: newNodes, - range: { pos: startPosition, end: endPosition } - }); - return this; + ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, oldNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, oldNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; - ChangeTracker.prototype.replaceNodeWithNodes = function (sourceFile, oldNode, newNodes) { - this.replaceWithMultiple(sourceFile, oldNode.getStart(sourceFile), oldNode.getEnd(), newNodes, { nodeSeparator: this.newLineCharacter }); - }; - ChangeTracker.prototype.replaceNodesWithNodes = function (sourceFile, oldNodes, newNodes) { - this.replaceWithMultiple(sourceFile, ts.first(oldNodes).getStart(sourceFile), ts.last(oldNodes).getEnd(), newNodes, { nodeSeparator: this.newLineCharacter }); + ChangeTracker.prototype.replaceNodeRangeWithNodes = function (sourceFile, startNode, endNode, newNodes, options) { + if (options === void 0) { options = textChanges_1.useNonAdjustedPositions; } + var pos = getAdjustedStartPosition(sourceFile, startNode, options, Position.Start); + var end = getAdjustedEndPosition(sourceFile, endNode, options); + return this.replaceRangeWithNodes(sourceFile, { pos: pos, end: end }, newNodes, options); }; ChangeTracker.prototype.insertNodeAt = function (sourceFile, pos, newNode, options) { if (options === void 0) { options = {}; } this.changes.push({ kind: ChangeKind.ReplaceWithSingleNode, sourceFile: sourceFile, options: options, node: newNode, range: { pos: pos, end: pos } }); return this; }; + ChangeTracker.prototype.insertNodesAt = function (sourceFile, pos, newNodes, options) { + if (options === void 0) { options = {}; } + this.changes.push({ kind: ChangeKind.ReplaceWithMultipleNodes, sourceFile: sourceFile, options: options, nodes: newNodes, range: { pos: pos, end: pos } }); + }; ChangeTracker.prototype.insertNodeAtTopOfFile = function (sourceFile, newNode, blankLineBetween) { var pos = getInsertionPositionAtSourceFileTop(sourceFile); this.insertNodeAt(sourceFile, pos, newNode, { @@ -94203,25 +96284,37 @@ var ts; }; ChangeTracker.prototype.insertNodeBefore = function (sourceFile, before, newNode, blankLineBetween) { if (blankLineBetween === void 0) { blankLineBetween = false; } - var startPosition = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); - return this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); + var pos = getAdjustedStartPosition(sourceFile, before, {}, Position.Start); + return this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, this.getOptionsForInsertNodeBefore(before, blankLineBetween)); }; ChangeTracker.prototype.insertModifierBefore = function (sourceFile, modifier, before) { var pos = before.getStart(sourceFile); - this.replaceWithSingle(sourceFile, pos, pos, ts.createToken(modifier), { suffix: " " }); + this.replaceRange(sourceFile, { pos: pos, end: pos }, ts.createToken(modifier), { suffix: " " }); }; - ChangeTracker.prototype.changeIdentifierToPropertyAccess = function (sourceFile, prefix, node) { - var startPosition = getAdjustedStartPosition(sourceFile, node, {}, Position.Start); - this.replaceWithSingle(sourceFile, startPosition, startPosition, ts.createPropertyAccess(ts.createIdentifier(prefix), ""), {}); + /** Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node. */ + ChangeTracker.prototype.insertTypeAnnotation = function (sourceFile, node, type) { + var end = (ts.isFunctionLike(node) + // If no `)`, is an arrow function `x => x`, so use the end of the first parameter + ? ts.findChildOfKind(node, 20 /* CloseParenToken */, sourceFile) || ts.first(node.parameters) + : node.kind !== 230 /* VariableDeclaration */ && node.questionToken ? node.questionToken : node.name).end; + this.insertNodeAt(sourceFile, end, type, { prefix: ": " }); + }; + ChangeTracker.prototype.insertTypeParameters = function (sourceFile, node, typeParameters) { + // If no `(`, is an arrow function `x => x`, so use the pos of the first parameter + var start = (ts.findChildOfKind(node, 19 /* OpenParenToken */, sourceFile) || ts.first(node.parameters)).getStart(sourceFile); + this.insertNodesAt(sourceFile, start, typeParameters, { prefix: "<", suffix: ">" }); }; ChangeTracker.prototype.getOptionsForInsertNodeBefore = function (before, doubleNewlines) { if (ts.isStatement(before) || ts.isClassElement(before)) { return { suffix: doubleNewlines ? this.newLineCharacter + this.newLineCharacter : this.newLineCharacter }; } - else if (ts.isVariableDeclaration(before)) { + else if (ts.isVariableDeclaration(before)) { // insert `x = 1, ` into `const x = 1, y = 2; return { suffix: ", " }; } - throw ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it + else if (ts.isParameter(before)) { + return {}; + } + return ts.Debug.failBadSyntaxKind(before); // We haven't handled this kind of node yet -- add it }; ChangeTracker.prototype.insertNodeAtConstructorStart = function (sourceFile, ctr, newStatement) { var firstStatement = ts.firstOrUndefined(ctr.body.statements); @@ -94245,8 +96338,8 @@ var ts; this.replaceNode(sourceFile, ctr.body, ts.createBlock(statements, /*multiLine*/ true), { useNonAdjustedEndPosition: true }); }; ChangeTracker.prototype.insertNodeAtEndOfScope = function (sourceFile, scope, newNode) { - var startPosition = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); - this.replaceWithSingle(sourceFile, startPosition, startPosition, newNode, { + var pos = getAdjustedStartPosition(sourceFile, scope.getLastToken(), {}, Position.Start); + this.replaceRange(sourceFile, { pos: pos, end: pos }, newNode, { prefix: ts.isLineBreak(sourceFile.text.charCodeAt(scope.getLastToken().pos)) ? this.newLineCharacter : this.newLineCharacter + this.newLineCharacter, suffix: this.newLineCharacter }); @@ -94270,9 +96363,9 @@ var ts; }; ChangeTracker.prototype.insertNodeAfter = function (sourceFile, after, newNode) { if (ts.isStatementButNotDeclaration(after) || - after.kind === 150 /* PropertyDeclaration */ || - after.kind === 149 /* PropertySignature */ || - after.kind === 151 /* MethodSignature */) { + after.kind === 151 /* PropertyDeclaration */ || + after.kind === 150 /* PropertySignature */ || + after.kind === 152 /* MethodSignature */) { // check if previous statement ends with semicolon // if not - insert semicolon to preserve the code from changing the meaning due to ASI if (sourceFile.text.charCodeAt(after.end - 1) !== 59 /* semicolon */) { @@ -94286,7 +96379,7 @@ var ts; } } var endPosition = getAdjustedEndPosition(sourceFile, after, {}); - return this.replaceWithSingle(sourceFile, endPosition, endPosition, newNode, this.getInsertNodeAfterOptions(after)); + return this.replaceRange(sourceFile, { pos: endPosition, end: endPosition }, newNode, this.getInsertNodeAfterOptions(after)); }; ChangeTracker.prototype.getInsertNodeAfterOptions = function (node) { if (ts.isClassDeclaration(node) || ts.isModuleDeclaration(node)) { @@ -94298,7 +96391,10 @@ var ts; else if (ts.isVariableDeclaration(node)) { return { prefix: ", " }; } - throw ts.Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it + else if (ts.isParameter(node)) { + return {}; + } + return ts.Debug.failBadSyntaxKind(node); // We haven't handled this kind of node yet -- add it }; /** * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, @@ -94443,114 +96539,89 @@ var ts; var _this = this; this.nodesInsertedAtClassStarts.forEach(function (_a) { var sourceFile = _a.sourceFile, cls = _a.cls, members = _a.members; - var newCls = cls.kind === 230 /* ClassDeclaration */ + var newCls = cls.kind === 233 /* ClassDeclaration */ ? ts.updateClassDeclaration(cls, cls.decorators, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members) : ts.updateClassExpression(cls, cls.modifiers, cls.name, cls.typeParameters, cls.heritageClauses, members); _this.replaceNode(sourceFile, cls, newCls, { useNonAdjustedEndPosition: true }); }); }; - ChangeTracker.prototype.getChanges = function () { - var _this = this; + /** + * Note: after calling this, the TextChanges object must be discarded! + * @param validate only for tests + * The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions, + * so we can only call this once and can't get the non-formatted text separately. + */ + ChangeTracker.prototype.getChanges = function (validate) { this.finishInsertNodeAtClassStart(); - var changesPerFile = ts.createMap(); - // group changes per file - for (var _i = 0, _a = this.changes; _i < _a.length; _i++) { - var c = _a[_i]; - var changesInFile = changesPerFile.get(c.sourceFile.path); - if (!changesInFile) { - changesPerFile.set(c.sourceFile.path, changesInFile = []); - } - changesInFile.push(c); - } - // convert changes - var fileChangesList = []; - changesPerFile.forEach(function (changesInFile) { - var sourceFile = changesInFile[0].sourceFile; - var fileTextChanges = { fileName: sourceFile.fileName, textChanges: [] }; - for (var _i = 0, _a = ChangeTracker.normalize(changesInFile); _i < _a.length; _i++) { - var c = _a[_i]; - fileTextChanges.textChanges.push({ - span: _this.computeSpan(c, sourceFile), - newText: _this.computeNewText(c, sourceFile) - }); - } - fileChangesList.push(fileTextChanges); - }); - return fileChangesList; - }; - ChangeTracker.prototype.computeSpan = function (change, _sourceFile) { - return ts.createTextSpanFromBounds(change.range.pos, change.range.end); - }; - ChangeTracker.prototype.computeNewText = function (change, sourceFile) { - var _this = this; - if (change.kind === ChangeKind.Remove) { - // deletion case - return ""; - } - var options = change.options || {}; - var text; - var pos = change.range.pos; - var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - if (change.kind === ChangeKind.ReplaceWithMultipleNodes) { - var parts = change.nodes.map(function (n) { return _this.getFormattedTextOfNode(n, sourceFile, pos, options); }); - text = parts.join(change.options.nodeSeparator); - } - else { - ts.Debug.assert(change.kind === ChangeKind.ReplaceWithSingleNode, "change.kind === ReplaceWithSingleNode"); - text = this.getFormattedTextOfNode(change.node, sourceFile, pos, options); - } - // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line - text = (posStartsLine || options.indentation !== undefined) ? text : text.replace(/^\s+/, ""); - return (options.prefix || "") + text + (options.suffix || ""); - }; - ChangeTracker.prototype.getFormattedTextOfNode = function (node, sourceFile, pos, options) { - var nonformattedText = getNonformattedText(node, sourceFile, this.newLine); - if (this.validator) { - this.validator(nonformattedText); - } - var formatOptions = this.formatContext.options; - var posStartsLine = ts.getLineStartPositionForPosition(pos, sourceFile) === pos; - var initialIndentation = options.indentation !== undefined - ? options.indentation - : (options.useIndentationFromFile !== false) - ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, posStartsLine || (options.prefix === this.newLineCharacter)) - : 0; - var delta = options.delta !== undefined - ? options.delta - : ts.formatting.SmartIndenter.shouldIndentChildNode(node) - ? (formatOptions.indentSize || 0) - : 0; - return applyFormatting(nonformattedText, sourceFile, initialIndentation, delta, this.formatContext); - }; - ChangeTracker.normalize = function (changes) { - // order changes by start position - var normalized = ts.stableSort(changes, function (a, b) { return a.range.pos - b.range.pos; }); - // verify that change intervals do not overlap, except possibly at end points. - for (var i = 0; i < normalized.length - 2; i++) { - ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos); - } - return normalized; + return changesToText.getTextChangesFromChanges(this.changes, this.newLineCharacter, this.formatContext, validate); }; return ChangeTracker; }()); - textChanges.ChangeTracker = ChangeTracker; - function getNonformattedText(node, sourceFile, newLine) { - var options = { newLine: newLine, target: sourceFile && sourceFile.languageVersion }; - var writer = new Writer(ts.getNewLineCharacter(options)); - var printer = ts.createPrinter(options, writer); - printer.writeNode(4 /* Unspecified */, node, sourceFile, writer); - return { text: writer.getText(), node: assignPositionsToNode(node) }; - } - function applyFormatting(nonFormattedText, sourceFile, initialIndentation, delta, formatContext) { - var lineMap = ts.computeLineStarts(nonFormattedText.text); - var file = { - text: nonFormattedText.text, - lineMap: lineMap, - getLineAndCharacterOfPosition: function (pos) { return ts.computeLineAndCharacterOfPosition(lineMap, pos); } - }; - var changes = ts.formatting.formatNodeGivenIndentation(nonFormattedText.node, file, sourceFile.languageVariant, initialIndentation, delta, formatContext); - return applyChanges(nonFormattedText.text, changes); - } + textChanges_1.ChangeTracker = ChangeTracker; + var changesToText; + (function (changesToText) { + function getTextChangesFromChanges(changes, newLineCharacter, formatContext, validate) { + return ts.group(changes, function (c) { return c.sourceFile.path; }).map(function (changesInFile) { + var sourceFile = changesInFile[0].sourceFile; + // order changes by start position + var normalized = ts.stableSort(changesInFile, function (a, b) { return a.range.pos - b.range.pos; }); + var _loop_10 = function (i) { + ts.Debug.assert(normalized[i].range.end <= normalized[i + 1].range.pos, "Changes overlap", function () { + return JSON.stringify(normalized[i].range) + " and " + JSON.stringify(normalized[i + 1].range); + }); + }; + // verify that change intervals do not overlap, except possibly at end points. + for (var i = 0; i < normalized.length - 2; i++) { + _loop_10(i); + } + var textChanges = normalized.map(function (c) { + return ts.createTextChange(ts.createTextSpanFromRange(c.range), computeNewText(c, sourceFile, newLineCharacter, formatContext, validate)); + }); + return { fileName: sourceFile.fileName, textChanges: textChanges }; + }); + } + changesToText.getTextChangesFromChanges = getTextChangesFromChanges; + function computeNewText(change, sourceFile, newLineCharacter, formatContext, validate) { + if (change.kind === ChangeKind.Remove) { + return ""; + } + var _a = change.options, options = _a === void 0 ? {} : _a, pos = change.range.pos; + var format = function (n) { return getFormattedTextOfNode(n, sourceFile, pos, options, newLineCharacter, formatContext, validate); }; + var text = change.kind === ChangeKind.ReplaceWithMultipleNodes + ? change.nodes.map(function (n) { return ts.removeSuffix(format(n), newLineCharacter); }).join(newLineCharacter) + : format(change.node); + // strip initial indentation (spaces or tabs) if text will be inserted in the middle of the line + var noIndent = (options.preserveLeadingWhitespace || options.indentation !== undefined || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) ? text : text.replace(/^\s+/, ""); + return (options.prefix || "") + noIndent + (options.suffix || ""); + } + /** Note: this may mutate `nodeIn`. */ + function getFormattedTextOfNode(nodeIn, sourceFile, pos, options, newLineCharacter, formatContext, validate) { + var _a = getNonformattedText(nodeIn, sourceFile, newLineCharacter), node = _a.node, text = _a.text; + if (validate) + validate(node, text); + var formatOptions = formatContext.options; + var initialIndentation = options.indentation !== undefined + ? options.indentation + : (options.useIndentationFromFile !== false) + ? ts.formatting.SmartIndenter.getIndentation(pos, sourceFile, formatOptions, options.prefix === newLineCharacter || ts.getLineStartPositionForPosition(pos, sourceFile) === pos) + : 0; + var delta = options.delta !== undefined + ? options.delta + : ts.formatting.SmartIndenter.shouldIndentChildNode(nodeIn) + ? (formatOptions.indentSize || 0) + : 0; + var file = { text: text, getLineAndCharacterOfPosition: function (pos) { return ts.getLineAndCharacterOfPosition(this, pos); } }; + var changes = ts.formatting.formatNodeGivenIndentation(node, file, sourceFile.languageVariant, initialIndentation, delta, formatContext); + return applyChanges(text, changes); + } + /** Note: output node may be mutated input node. */ + function getNonformattedText(node, sourceFile, newLineCharacter) { + var writer = new Writer(newLineCharacter); + var newLine = newLineCharacter === "\n" ? 1 /* LineFeed */ : 0 /* CarriageReturnLineFeed */; + ts.createPrinter({ newLine: newLine }, writer).writeNode(4 /* Unspecified */, node, sourceFile, writer); + return { text: writer.getText(), node: assignPositionsToNode(node) }; + } + })(changesToText || (changesToText = {})); function applyChanges(text, changes) { for (var i = changes.length - 1; i >= 0; i--) { var change = changes[i]; @@ -94558,7 +96629,7 @@ var ts; } return text; } - textChanges.applyChanges = applyChanges; + textChanges_1.applyChanges = applyChanges; function isTrivia(s) { return ts.skipTrivia(s, 0) === s.length; } @@ -94820,16 +96891,9 @@ var ts; return createCombinedCodeActions(changes, commands.length === 0 ? undefined : commands); } codefix.codeFixAll = codeFixAll; - function codeFixAllWithTextChanges(context, errorCodes, use) { - var changes = []; - eachDiagnostic(context, errorCodes, function (diag) { return use(changes, diag); }); - changes.sort(function (a, b) { return b.span.start - a.span.start; }); - return createCombinedCodeActions([createFileTextChanges(context.sourceFile.fileName, changes)]); - } - codefix.codeFixAllWithTextChanges = codeFixAllWithTextChanges; function eachDiagnostic(_a, errorCodes, cb) { var program = _a.program, sourceFile = _a.sourceFile; - for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile); _i < _b.length; _i++) { + for (var _i = 0, _b = program.getSemanticDiagnostics(sourceFile).concat(ts.computeSuggestionDiagnostics(sourceFile, program)); _i < _b.length; _i++) { var diag = _b[_i]; if (ts.contains(errorCodes, diag.code)) { cb(diag); @@ -94895,6 +96959,806 @@ var ts; })(ts || (ts = {})); /* @internal */ var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "annotateWithTypeFromJSDoc"; + var errorCodes = [ts.Diagnostics.JSDoc_types_may_be_moved_to_TypeScript_types.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var decl = getDeclaration(context.sourceFile, context.span.start); + if (!decl) + return; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Annotate_with_type_from_JSDoc); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, decl); }); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var decl = getDeclaration(diag.file, diag.start); + if (decl) + doChange(changes, diag.file, decl); + }); }, + }); + function getDeclaration(file, pos) { + var name = ts.getTokenAtPosition(file, pos, /*includeJsDocComment*/ false); + // For an arrow function with no name, 'name' lands on the first parameter. + return ts.tryCast(ts.isParameter(name.parent) ? name.parent.parent : name.parent, parameterShouldGetTypeFromJSDoc); + } + function parameterShouldGetTypeFromJSDoc(node) { + return isDeclarationWithType(node) && hasUsableJSDoc(node); + } + codefix.parameterShouldGetTypeFromJSDoc = parameterShouldGetTypeFromJSDoc; + function hasUsableJSDoc(decl) { + return ts.isFunctionLikeDeclaration(decl) + ? decl.parameters.some(hasUsableJSDoc) || (!decl.type && !!ts.getJSDocReturnType(decl)) + : !decl.type && !!ts.getJSDocType(decl); + } + function doChange(changes, sourceFile, decl) { + if (ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); }))) { + if (!decl.typeParameters) { + var typeParameters = ts.getJSDocTypeParameterDeclarations(decl); + if (typeParameters) + changes.insertTypeParameters(sourceFile, decl, typeParameters); + } + var needParens = ts.isArrowFunction(decl) && !ts.findChildOfKind(decl, 19 /* OpenParenToken */, sourceFile); + if (needParens) + changes.insertNodeBefore(sourceFile, ts.first(decl.parameters), ts.createToken(19 /* OpenParenToken */)); + for (var _i = 0, _a = decl.parameters; _i < _a.length; _i++) { + var param = _a[_i]; + if (!param.type) { + var paramType = ts.getJSDocType(param); + if (paramType) + changes.insertTypeAnnotation(sourceFile, param, transformJSDocType(paramType)); + } + } + if (needParens) + changes.insertNodeAfter(sourceFile, ts.last(decl.parameters), ts.createToken(20 /* CloseParenToken */)); + if (!decl.type) { + var returnType = ts.getJSDocReturnType(decl); + if (returnType) + changes.insertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType)); + } + } + else { + var jsdocType = ts.Debug.assertDefined(ts.getJSDocType(decl)); // If not defined, shouldn't have been an error to fix + ts.Debug.assert(!decl.type); // If defined, shouldn't have been an error to fix. + changes.insertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType)); + } + } + function isDeclarationWithType(node) { + return ts.isFunctionLikeDeclaration(node) || + node.kind === 230 /* VariableDeclaration */ || + node.kind === 150 /* PropertySignature */ || + node.kind === 151 /* PropertyDeclaration */; + } + function transformJSDocType(node) { + switch (node.kind) { + case 275 /* JSDocAllType */: + case 276 /* JSDocUnknownType */: + return ts.createTypeReferenceNode("any", ts.emptyArray); + case 279 /* JSDocOptionalType */: + return transformJSDocOptionalType(node); + case 278 /* JSDocNonNullableType */: + return transformJSDocType(node.type); + case 277 /* JSDocNullableType */: + return transformJSDocNullableType(node); + case 281 /* JSDocVariadicType */: + return transformJSDocVariadicType(node); + case 280 /* JSDocFunctionType */: + return transformJSDocFunctionType(node); + case 161 /* TypeReference */: + return transformJSDocTypeReference(node); + default: + var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); + ts.setEmitFlags(visited, 1 /* SingleLine */); + return visited; + } + } + function transformJSDocOptionalType(node) { + return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("undefined", ts.emptyArray)]); + } + function transformJSDocNullableType(node) { + return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("null", ts.emptyArray)]); + } + function transformJSDocVariadicType(node) { + return ts.createArrayTypeNode(ts.visitNode(node.type, transformJSDocType)); + } + function transformJSDocFunctionType(node) { + return ts.createFunctionTypeNode(ts.emptyArray, node.parameters.map(transformJSDocParameter), node.type); + } + function transformJSDocParameter(node) { + var index = node.parent.parameters.indexOf(node); + var isRest = node.type.kind === 281 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; + var name = node.name || (isRest ? "rest" : "arg" + index); + var dotdotdot = isRest ? ts.createToken(24 /* DotDotDotToken */) : node.dotDotDotToken; + return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); + } + function transformJSDocTypeReference(node) { + var name = node.typeName; + var args = node.typeArguments; + if (ts.isIdentifier(node.typeName)) { + if (ts.isJSDocIndexSignature(node)) { + return transformJSDocIndexSignature(node); + } + var text = node.typeName.text; + switch (node.typeName.text) { + case "String": + case "Boolean": + case "Object": + case "Number": + text = text.toLowerCase(); + break; + case "array": + case "date": + case "promise": + text = text[0].toUpperCase() + text.slice(1); + break; + } + name = ts.createIdentifier(text); + if ((text === "Array" || text === "Promise") && !node.typeArguments) { + args = ts.createNodeArray([ts.createTypeReferenceNode("any", ts.emptyArray)]); + } + else { + args = ts.visitNodes(node.typeArguments, transformJSDocType); + } + } + return ts.createTypeReferenceNode(name, args); + } + function transformJSDocIndexSignature(node) { + var index = ts.createParameter( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "n" : "s", + /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 134 /* NumberKeyword */ ? "number" : "string", []), + /*initializer*/ undefined); + var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); + ts.setEmitFlags(indexSignature, 1 /* SingleLine */); + return indexSignature; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "convertFunctionToEs6Class"; + var errorCodes = [ts.Diagnostics.This_constructor_function_may_be_converted_to_a_class_declaration.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, context.sourceFile, context.span.start, context.program.getTypeChecker()); }); + return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_function_to_an_ES2015_class), changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, err) { return doChange(changes, err.file, err.start, context.program.getTypeChecker()); }); }, + }); + function doChange(changes, sourceFile, position, checker) { + var deletedNodes = []; + var deletes = []; + var ctorSymbol = checker.getSymbolAtLocation(ts.getTokenAtPosition(sourceFile, position, /*includeJsDocComment*/ false)); + if (!ctorSymbol || !(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { + // Bad input + return undefined; + } + var ctorDeclaration = ctorSymbol.valueDeclaration; + var precedingNode; + var newClassDeclaration; + switch (ctorDeclaration.kind) { + case 232 /* FunctionDeclaration */: + precedingNode = ctorDeclaration; + deleteNode(ctorDeclaration); + newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); + break; + case 230 /* VariableDeclaration */: + precedingNode = ctorDeclaration.parent.parent; + if (ctorDeclaration.parent.declarations.length === 1) { + deleteNode(precedingNode); + } + else { + deleteNode(ctorDeclaration, /*inList*/ true); + } + newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); + break; + } + if (!newClassDeclaration) { + return undefined; + } + copyComments(ctorDeclaration, newClassDeclaration, sourceFile); + // Because the preceding node could be touched, we need to insert nodes before delete nodes. + changes.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); + for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { + var deleteCallback = deletes_1[_i]; + deleteCallback(); + } + function deleteNode(node, inList) { + if (inList === void 0) { inList = false; } + if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { + // Parent node has already been deleted; do nothing + return; + } + deletedNodes.push(node); + if (inList) { + deletes.push(function () { return changes.deleteNodeInList(sourceFile, node); }); + } + else { + deletes.push(function () { return changes.deleteNode(sourceFile, node); }); + } + } + function createClassElementsFromSymbol(symbol) { + var memberElements = []; + // all instance members are stored in the "member" array of symbol + if (symbol.members) { + symbol.members.forEach(function (member) { + var memberElement = createClassElement(member, /*modifiers*/ undefined); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + // all static members are stored in the "exports" array of symbol + if (symbol.exports) { + symbol.exports.forEach(function (member) { + var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); + if (memberElement) { + memberElements.push(memberElement); + } + }); + } + return memberElements; + function shouldConvertDeclaration(_target, source) { + // Right now the only thing we can convert are function expressions - other values shouldn't get + // transformed. We can update this once ES public class properties are available. + return ts.isFunctionLike(source); + } + function createClassElement(symbol, modifiers) { + // both properties and methods are bound as property symbols + if (!(symbol.flags & 4 /* Property */)) { + return; + } + var memberDeclaration = symbol.valueDeclaration; + var assignmentBinaryExpression = memberDeclaration.parent; + if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { + return; + } + // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end + var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 214 /* ExpressionStatement */ + ? assignmentBinaryExpression.parent : assignmentBinaryExpression; + deleteNode(nodeToDelete); + if (!assignmentBinaryExpression.right) { + return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, + /*type*/ undefined, /*initializer*/ undefined); + } + switch (assignmentBinaryExpression.right.kind) { + case 190 /* FunctionExpression */: { + var functionExpression = assignmentBinaryExpression.right; + var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120 /* AsyncKeyword */)); + var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); + copyComments(assignmentBinaryExpression, method, sourceFile); + return method; + } + case 191 /* ArrowFunction */: { + var arrowFunction = assignmentBinaryExpression.right; + var arrowFunctionBody = arrowFunction.body; + var bodyBlock = void 0; + // case 1: () => { return [1,2,3] } + if (arrowFunctionBody.kind === 211 /* Block */) { + bodyBlock = arrowFunctionBody; + } + // case 2: () => [1,2,3] + else { + bodyBlock = ts.createBlock([ts.createReturn(arrowFunctionBody)]); + } + var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120 /* AsyncKeyword */)); + var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, + /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); + copyComments(assignmentBinaryExpression, method, sourceFile); + return method; + } + default: { + // Don't try to declare members in JavaScript files + if (ts.isSourceFileJavaScript(sourceFile)) { + return; + } + var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, + /*type*/ undefined, assignmentBinaryExpression.right); + copyComments(assignmentBinaryExpression.parent, prop, sourceFile); + return prop; + } + } + } + } + function createClassFromVariableDeclaration(node) { + var initializer = node.initializer; + if (!initializer || initializer.kind !== 190 /* FunctionExpression */) { + return undefined; + } + if (node.name.kind !== 71 /* Identifier */) { + return undefined; + } + var memberElements = createClassElementsFromSymbol(initializer.symbol); + if (initializer.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); + } + var modifiers = getModifierKindFromSource(precedingNode, 84 /* ExportKeyword */); + var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } + function createClassFromFunctionDeclaration(node) { + var memberElements = createClassElementsFromSymbol(ctorSymbol); + if (node.body) { + memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); + } + var modifiers = getModifierKindFromSource(node, 84 /* ExportKeyword */); + var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, + /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); + // Don't call copyComments here because we'll already leave them in place + return cls; + } + } + function copyComments(sourceNode, targetNode, sourceFile) { + ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { + if (kind === 3 /* MultiLineCommentTrivia */) { + // Remove leading /* + pos += 2; + // Remove trailing */ + end -= 2; + } + else { + // Remove leading // + pos += 2; + } + ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); + }); + } + function getModifierKindFromSource(source, kind) { + return ts.filter(source.modifiers, function (modifier) { return modifier.kind === kind; }); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + codefix.registerCodeFix({ + errorCodes: [ts.Diagnostics.File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module.code], + getCodeActions: function (context) { + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); + var sourceFile = context.sourceFile, program = context.program; + var changes = ts.textChanges.ChangeTracker.with(context, function (changes) { + var moduleExportsChangedToDefault = convertFileToEs6Module(sourceFile, program.getTypeChecker(), changes, program.getCompilerOptions().target); + if (moduleExportsChangedToDefault) { + for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { + var importingFile = _a[_i]; + fixImportOfModuleExports(importingFile, sourceFile, changes); + } + } + }); + // No support for fix-all since this applies to the whole file at once anyway. + return [{ description: description, changes: changes, fixId: undefined }]; + }, + }); + function fixImportOfModuleExports(importingFile, exportingFile, changes) { + for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { + var moduleSpecifier = _a[_i]; + var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); + if (!imported || imported.resolvedFileName !== exportingFile.fileName) { + continue; + } + var parent = moduleSpecifier.parent; + switch (parent.kind) { + case 252 /* ExternalModuleReference */: { + var importEq = parent.parent; + changes.replaceNode(importingFile, importEq, makeImport(importEq.name, /*namedImports*/ undefined, moduleSpecifier.text)); + break; + } + case 185 /* CallExpression */: { + var call = parent; + if (ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ false)) { + changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); + } + break; + } + } + } + } + /** @returns Whether we converted a `module.exports =` to a default export. */ + function convertFileToEs6Module(sourceFile, checker, changes, target) { + var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; + var exports = collectExportRenames(sourceFile, checker, identifiers); + convertExportsAccesses(sourceFile, exports, changes); + var moduleExportsChangedToDefault = false; + for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { + var statement = _a[_i]; + var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); + moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; + } + return moduleExportsChangedToDefault; + } + function collectExportRenames(sourceFile, checker, identifiers) { + var res = ts.createMap(); + forEachExportReference(sourceFile, function (node) { + var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; + if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) + || checker.resolveName(node.name.text, node, 67216319 /* Value */, /*excludeGlobals*/ true))) { + // Unconditionally add an underscore in case `text` is a keyword. + res.set(text, makeUniqueName("_" + text, identifiers)); + } + }); + return res; + } + function convertExportsAccesses(sourceFile, exports, changes) { + forEachExportReference(sourceFile, function (node, isAssignmentLhs) { + if (isAssignmentLhs) { + return; + } + var text = node.name.text; + changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); + }); + } + function forEachExportReference(sourceFile, cb) { + sourceFile.forEachChild(function recur(node) { + if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { + var parent = node.parent; + cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58 /* EqualsToken */); + } + node.forEachChild(recur); + }); + } + function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { + switch (statement.kind) { + case 212 /* VariableStatement */: + convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); + return false; + case 214 /* ExpressionStatement */: { + var expression = statement.expression; + switch (expression.kind) { + case 185 /* CallExpression */: { + if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteral*/ true)) { + // For side-effecting require() call, just make a side-effecting import. + changes.replaceNode(sourceFile, statement, makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0].text)); + } + return false; + } + case 198 /* BinaryExpression */: { + var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; + return operatorToken.kind === 58 /* EqualsToken */ && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); + } + } + } + // falls through + default: + return false; + } + } + function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { + var declarationList = statement.declarationList; + var foundImport = false; + var newNodes = ts.flatMap(declarationList.declarations, function (decl) { + var name = decl.name, initializer = decl.initializer; + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { + // `const alias = module.exports;` can be removed. + foundImport = true; + return []; + } + if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); + } + else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteral*/ true)) { + foundImport = true; + return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); + } + else { + // Move it out to its own variable statement. + return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); + } + }); + if (foundImport) { + // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + } + /** Converts `const name = require("moduleSpecifier").propertyName` */ + function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: { + // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` + var tmp = makeUniqueName(propertyName, identifiers); + return [ + makeSingleImport(tmp, propertyName, moduleSpecifier), + makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + // `const a = require("b").c` --> `import { c as a } from "./b"; + return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; + default: + ts.Debug.assertNever(name); + } + } + function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { + if (!ts.isPropertyAccessExpression(left)) { + return false; + } + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { + if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { + // `const alias = module.exports;` or `module.exports = alias;` can be removed. + changes.deleteNode(sourceFile, statement); + } + else { + var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; + var changedToDefaultExport = false; + if (!newNodes) { + (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); + } + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + return changedToDefaultExport; + } + } + else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { + convertNamedExport(sourceFile, statement, left.name, right, changes, exports); + } + return false; + var _a; + } + /** + * Convert `module.exports = { ... }` to individual exports.. + * We can't always do this if the module has interesting members -- then it will be a default export instead. + */ + function tryChangeModuleExportsObject(object) { + return ts.mapAllOrFail(object.properties, function (prop) { + switch (prop.kind) { + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. + case 269 /* ShorthandPropertyAssignment */: + case 270 /* SpreadAssignment */: + return undefined; + case 268 /* PropertyAssignment */: + return !ts.isIdentifier(prop.name) ? undefined : convertExportsDotXEquals(prop.name.text, prop.initializer); + case 153 /* MethodDeclaration */: + return !ts.isIdentifier(prop.name) ? undefined : functionExpressionToDeclaration(prop.name.text, [ts.createToken(84 /* ExportKeyword */)], prop); + default: + ts.Debug.assertNever(prop); + } + }); + } + function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { + // If "originalKeywordKind" was set, this is e.g. `exports. + var text = propertyName.text; + var rename = exports.get(text); + if (rename !== undefined) { + /* + const _class = 0; + export { _class as class }; + */ + var newNodes = [ + makeConst(/*modifiers*/ undefined, rename, right), + makeExportDeclaration([ts.createExportSpecifier(rename, text)]), + ]; + changes.replaceNodeWithNodes(sourceFile, statement, newNodes); + } + else { + changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); + } + } + function convertModuleExportsToExportDefault(exported, checker) { + var modifiers = [ts.createToken(84 /* ExportKeyword */), ts.createToken(79 /* DefaultKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: { + // `module.exports = function f() {}` --> `export default function f() {}` + var fn = exported; + return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; + } + case 203 /* ClassExpression */: { + // `module.exports = class C {}` --> `export default class C {}` + var cls = exported; + return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; + } + case 185 /* CallExpression */: + if (ts.isRequireCall(exported, /*checkArgumentIsStringLiteral*/ true)) { + return convertReExportAll(exported.arguments[0], checker); + } + // falls through + default: + // `module.exports = 0;` --> `export default 0;` + return [[ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, exported)], true]; + } + } + function convertReExportAll(reExported, checker) { + // `module.exports = require("x");` ==> `export * from "x"; export { default } from "x";` + var moduleSpecifier = reExported.text; + var moduleSymbol = checker.getSymbolAtLocation(reExported); + var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; + return exports.has("export=") + ? [[reExportDefault(moduleSpecifier)], true] + : !exports.has("default") + ? [[reExportStar(moduleSpecifier)], false] + // If there's some non-default export, must include both `export *` and `export default`. + : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; + } + function reExportStar(moduleSpecifier) { + return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier); + } + function reExportDefault(moduleSpecifier) { + return makeExportDeclaration([ts.createExportSpecifier(/*propertyName*/ undefined, "default")], moduleSpecifier); + } + function convertExportsDotXEquals(name, exported) { + var modifiers = [ts.createToken(84 /* ExportKeyword */)]; + switch (exported.kind) { + case 190 /* FunctionExpression */: { + var expressionName = exported.name; + if (expressionName && expressionName.text !== name) { + // `exports.f = function g() {}` -> `export const f = function g() {}` + return exportConst(); + } + } + // falls through + case 191 /* ArrowFunction */: + // `exports.f = function() {}` --> `export function f() {}` + return functionExpressionToDeclaration(name, modifiers, exported); + case 203 /* ClassExpression */: + // `exports.C = class {}` --> `export class C {}` + return classExpressionToDeclaration(name, modifiers, exported); + default: + return exportConst(); + } + function exportConst() { + // `exports.x = 0;` --> `export const x = 0;` + return makeConst(modifiers, ts.createIdentifier(name), exported); + } + } + /** + * Converts `const <> = require("x");`. + * Returns nodes that will replace the variable declaration for the commonjs import. + * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. + */ + function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { + switch (name.kind) { + case 178 /* ObjectBindingPattern */: { + var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { + return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) + ? undefined + : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); + }); + if (importSpecifiers) { + return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier)]; + } + } + // falls through -- object destructuring has an interesting pattern and must be a variable declaration + case 179 /* ArrayBindingPattern */: { + /* + import x from "x"; + const [a, b, c] = x; + */ + var tmp = makeUniqueName(codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); + return [ + makeImport(ts.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), + makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), + ]; + } + case 71 /* Identifier */: + return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); + default: + ts.Debug.assertNever(name); + } + } + /** + * Convert `import x = require("x").` + * Also converts uses like `x.y()` to `y()` and uses a named import. + */ + function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { + var nameSymbol = checker.getSymbolAtLocation(name); + // Maps from module property name to name actually used. (The same if there isn't shadowing.) + var namedBindingsNames = ts.createMap(); + // True if there is some non-property use like `x()` or `f(x)`. + var needDefaultImport = false; + for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { + var use = _a[_i]; + if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { + // This was a use of a different symbol with the same name, due to shadowing. Ignore. + continue; + } + var parent = use.parent; + if (ts.isPropertyAccessExpression(parent)) { + var expression = parent.expression, propertyName = parent.name.text; + ts.Debug.assert(expression === use); // Else shouldn't have been in `collectIdentifiers` + var idName = namedBindingsNames.get(propertyName); + if (idName === undefined) { + idName = makeUniqueName(propertyName, identifiers); + namedBindingsNames.set(propertyName, idName); + } + changes.replaceNode(file, parent, ts.createIdentifier(idName)); + } + else { + needDefaultImport = true; + } + } + var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { + var propertyName = _a[0], idName = _a[1]; + return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); + })); + if (!namedBindings) { + // If it was unused, ensure that we at least import *something*. + needDefaultImport = true; + } + return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; + } + // Identifiers helpers + function makeUniqueName(name, identifiers) { + while (identifiers.original.has(name) || identifiers.additional.has(name)) { + name = "_" + name; + } + identifiers.additional.set(name, true); + return name; + } + function collectFreeIdentifiers(file) { + var map = ts.createMultiMap(); + file.forEachChild(function recur(node) { + if (ts.isIdentifier(node) && isFreeIdentifier(node)) { + map.add(node.text, node); + } + node.forEachChild(recur); + }); + return map; + } + function isFreeIdentifier(node) { + var parent = node.parent; + switch (parent.kind) { + case 183 /* PropertyAccessExpression */: + return parent.name !== node; + case 180 /* BindingElement */: + return parent.propertyName !== node; + default: + return true; + } + } + // Node helpers + function functionExpressionToDeclaration(name, additionalModifiers, fn) { + return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); + } + function classExpressionToDeclaration(name, additionalModifiers, cls) { + return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. + ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); + } + function makeSingleImport(localName, propertyName, moduleSpecifier) { + return propertyName === "default" + ? makeImport(ts.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier) + : makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); + } + function makeImport(name, namedImports, moduleSpecifier) { + return makeImportDeclaration(name, namedImports, ts.createLiteral(moduleSpecifier)); + } + function makeImportDeclaration(name, namedImports, moduleSpecifier) { + var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); + return ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, moduleSpecifier); + } + codefix.makeImportDeclaration = makeImportDeclaration; + function makeImportSpecifier(propertyName, name) { + return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); + } + function makeConst(modifiers, name, init) { + return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, /*type*/ undefined, init)], 2 /* Const */)); + } + function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { + return ts.createExportDeclaration( + /*decorators*/ undefined, + /*modifiers*/ undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; (function (ts) { var codefix; (function (codefix) { @@ -94967,9 +97831,7 @@ var ts; }, }); function getClass(sourceFile, pos) { - var classDeclaration = ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false)); - ts.Debug.assert(!!classDeclaration); - return classDeclaration; + return ts.Debug.assertDefined(ts.getContainingClass(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false))); } function addMissingDeclarations(checker, implementedTypeNode, sourceFile, classDeclaration, changeTracker) { // Note that this is ultimately derived from a map indexed by symbol names, @@ -95080,7 +97942,7 @@ var ts; else { var leftExpressionType = checker.getTypeAtLocation(parent.expression); var symbol = leftExpressionType.symbol; - if (!(leftExpressionType.flags & 65536 /* Object */ && symbol.flags & 32 /* Class */)) { + if (!(symbol && leftExpressionType.flags & 65536 /* Object */ && symbol.flags & 32 /* Class */)) { return undefined; } var classDeclaration = ts.cast(ts.first(symbol.declarations), ts.isClassLike); @@ -95097,7 +97959,7 @@ var ts; } function addMissingMemberInJs(changeTracker, classDeclarationSourceFile, classDeclaration, tokenName, makeStatic) { if (makeStatic) { - if (classDeclaration.kind === 200 /* ClassExpression */) { + if (classDeclaration.kind === 203 /* ClassExpression */) { return; } var className = classDeclaration.name.getText(); @@ -95123,7 +97985,7 @@ var ts; } function getTypeNode(checker, classDeclaration, token) { var typeNode; - if (token.parent.parent.kind === 195 /* BinaryExpression */) { + if (token.parent.parent.kind === 198 /* BinaryExpression */) { var binaryExpression = token.parent.parent; var otherExpression = token.parent === binaryExpression.left ? binaryExpression.right : binaryExpression.left; var widenedType = checker.getWidenedType(checker.getBaseTypeOfLiteralType(checker.getTypeAtLocation(otherExpression))); @@ -95146,7 +98008,7 @@ var ts; } function createAddIndexSignatureAction(context, classDeclarationSourceFile, classDeclaration, tokenName, typeNode) { // Index signatures cannot have the static modifier. - var stringTypeNode = ts.createKeywordTypeNode(136 /* StringKeyword */); + var stringTypeNode = ts.createKeywordTypeNode(137 /* StringKeyword */); var indexingParameter = ts.createParameter( /*decorators*/ undefined, /*modifiers*/ undefined, @@ -95228,10 +98090,10 @@ var ts; flags |= 1920 /* Namespace */; } if (meaning & 2 /* Type */) { - flags |= 793064 /* Type */; + flags |= 67901928 /* Type */; } if (meaning & 1 /* Value */) { - flags |= 107455 /* Value */; + flags |= 67216319 /* Value */; } return flags; } @@ -95277,7 +98139,6 @@ var ts; commands: [getCommand(fileName, packageName)], }; } - codefix.tryGetCodeActionForInstallPackageTypes = tryGetCodeActionForInstallPackageTypes; })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); /* @internal */ @@ -95300,17 +98161,21 @@ var ts; return changes.length === 0 ? undefined : [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Implement_inherited_abstract_class), changes: changes, fixId: fixId }]; }, fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { - addMissingMembers(getClass(diag.file, diag.start), context.sourceFile, context.program.getTypeChecker(), changes); - }); }, + getAllCodeActions: function (context) { + var seenClassDeclarations = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var classDeclaration = getClass(diag.file, diag.start); + if (ts.addToSeen(seenClassDeclarations, ts.getNodeId(classDeclaration))) { + addMissingMembers(classDeclaration, context.sourceFile, context.program.getTypeChecker(), changes); + } + }); + }, }); function getClass(sourceFile, pos) { - // This is the identifier in the case of a class declaration + // Token is the identifier in the case of a class declaration // or the class keyword token in the case of a class expression. var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); - var classDeclaration = token.parent; - ts.Debug.assert(ts.isClassLike(classDeclaration)); - return classDeclaration; + return ts.cast(token.parent, ts.isClassLike); } function addMissingMembers(classDeclaration, sourceFile, checker, changeTracker) { var extendsNode = ts.getClassExtendsHeritageClauseElement(classDeclaration); @@ -95367,7 +98232,8 @@ var ts; } function getNodes(sourceFile, pos) { var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); - ts.Debug.assert(token.kind === 99 /* ThisKeyword */); + if (token.kind !== 99 /* ThisKeyword */) + return undefined; var constructor = ts.getContainingFunction(token); var superCall = findSuperCall(constructor.body); // figure out if the `this` access is actually inside the supercall @@ -95446,7 +98312,7 @@ var ts; return extendsToken.kind === 85 /* ExtendsKeyword */ ? { extendsToken: extendsToken, heritageClauses: heritageClauses } : undefined; } function doChanges(changes, sourceFile, extendsToken, heritageClauses) { - changes.replaceRange(sourceFile, { pos: extendsToken.getStart(), end: extendsToken.end }, ts.createToken(108 /* ImplementsKeyword */)); + changes.replaceNode(sourceFile, extendsToken, ts.createToken(108 /* ImplementsKeyword */), ts.textChanges.useNonAdjustedPositions); // If there is already an implements clause, replace the implements keyword with a comma. if (heritageClauses.length === 2 && heritageClauses[0].token === 85 /* ExtendsKeyword */ && @@ -95478,6 +98344,9 @@ var ts; getCodeActions: function (context) { var sourceFile = context.sourceFile; var token = getNode(sourceFile, context.span.start); + if (!token) { + return undefined; + } var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, token); }); return [{ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Add_this_to_unresolved_variable), changes: changes, fixId: fixId }]; }, @@ -95487,10 +98356,16 @@ var ts; }); }, }); function getNode(sourceFile, pos) { - return ts.cast(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), ts.isIdentifier); + var node = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return ts.isIdentifier(node) ? node : undefined; } function doChange(changes, sourceFile, token) { - changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token)); + if (!token) { + return; + } + // TODO (https://github.com/Microsoft/TypeScript/issues/21246): use shared helper + ts.suppressLeadingAndTrailingTrivia(token); + changes.replaceNode(sourceFile, token, ts.createPropertyAccess(ts.createThis(), token), ts.textChanges.useNonAdjustedPositions); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -95504,19 +98379,26 @@ var ts; var errorCodes = [ ts.Diagnostics._0_is_declared_but_its_value_is_never_read.code, ts.Diagnostics.Property_0_is_declared_but_its_value_is_never_read.code, + ts.Diagnostics.All_imports_in_import_declaration_are_unused.code, ]; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile; - var token = getToken(sourceFile, context.span.start); + var errorCode = context.errorCode, sourceFile = context.sourceFile; + var importDecl = tryGetFullImport(sourceFile, context.span.start); + if (importDecl) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_import_from_0), [ts.showModuleSpecifier(importDecl)]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.deleteNode(sourceFile, importDecl); }); + return [{ description: description, changes: changes, fixId: fixIdDelete }]; + } + var token = getToken(sourceFile, ts.textSpanEnd(context.span)); var result = []; var deletion = ts.textChanges.ChangeTracker.with(context, function (t) { return tryDeleteDeclaration(t, sourceFile, token); }); if (deletion.length) { var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Remove_declaration_for_Colon_0), [token.getText()]); result.push({ description: description, changes: deletion, fixId: fixIdDelete }); } - var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, context.errorCode, sourceFile, token); }); + var prefix = ts.textChanges.ChangeTracker.with(context, function (t) { return tryPrefixDeclaration(t, errorCode, sourceFile, token); }); if (prefix.length) { var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Prefix_0_with_an_underscore), [token.getText()]); result.push({ description: description, changes: prefix, fixId: fixIdPrefix }); @@ -95526,7 +98408,7 @@ var ts; fixIds: [fixIdPrefix, fixIdDelete], getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { var sourceFile = context.sourceFile; - var token = getToken(diag.file, diag.start); + var token = ts.findPrecedingToken(ts.textSpanEnd(diag), diag.file); switch (context.fixId) { case fixIdPrefix: if (ts.isIdentifier(token) && canPrefix(token)) { @@ -95534,17 +98416,28 @@ var ts; } break; case fixIdDelete: - tryDeleteDeclaration(changes, sourceFile, token); + var importDecl = tryGetFullImport(diag.file, diag.start); + if (importDecl) { + changes.deleteNode(sourceFile, importDecl); + } + else { + tryDeleteDeclaration(changes, sourceFile, token); + } break; default: ts.Debug.fail(JSON.stringify(context.fixId)); } }); }, }); + // Sometimes the diagnostic span is an entire ImportDeclaration, so we should remove the whole thing. + function tryGetFullImport(sourceFile, pos) { + var startToken = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return startToken.kind === 91 /* ImportKeyword */ ? ts.tryCast(startToken.parent, ts.isImportDeclaration) : undefined; + } function getToken(sourceFile, pos) { - var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + var token = ts.findPrecedingToken(pos, sourceFile); // this handles var ["computed"] = 12; - return token.kind === 21 /* OpenBracketToken */ ? ts.getTokenAtPosition(sourceFile, pos + 1, /*includeJsDocComment*/ false) : token; + return token.kind === 22 /* CloseBracketToken */ ? ts.findPrecedingToken(pos - 1, sourceFile) : token; } function tryPrefixDeclaration(changes, errorCode, sourceFile, token) { // Don't offer to prefix a property. @@ -95554,13 +98447,13 @@ var ts; } function canPrefix(token) { switch (token.parent.kind) { - case 147 /* Parameter */: + case 148 /* Parameter */: return true; - case 227 /* VariableDeclaration */: { + case 230 /* VariableDeclaration */: { var varDecl = token.parent; switch (varDecl.parent.parent.kind) { - case 217 /* ForOfStatement */: - case 216 /* ForInStatement */: + case 220 /* ForOfStatement */: + case 219 /* ForInStatement */: return true; } } @@ -95572,8 +98465,8 @@ var ts; case 71 /* Identifier */: tryDeleteIdentifier(changes, sourceFile, token); break; - case 150 /* PropertyDeclaration */: - case 241 /* NamespaceImport */: + case 151 /* PropertyDeclaration */: + case 244 /* NamespaceImport */: changes.deleteNode(sourceFile, token.parent); break; default: @@ -95591,10 +98484,10 @@ var ts; function tryDeleteIdentifier(changes, sourceFile, identifier) { var parent = identifier.parent; switch (parent.kind) { - case 227 /* VariableDeclaration */: + case 230 /* VariableDeclaration */: tryDeleteVariableDeclaration(changes, sourceFile, parent); break; - case 146 /* TypeParameter */: + case 147 /* TypeParameter */: var typeParameters = parent.parent.typeParameters; if (typeParameters.length === 1) { var previousToken = ts.getTokenAtPosition(sourceFile, typeParameters.pos - 1, /*includeJsDocComment*/ false); @@ -95607,7 +98500,7 @@ var ts; changes.deleteNodeInList(sourceFile, parent); } break; - case 147 /* Parameter */: + case 148 /* Parameter */: var oldFunction = parent.parent; if (ts.isArrowFunction(oldFunction) && oldFunction.parameters.length === 1) { // Lambdas with exactly one parameter are special because, after removal, there @@ -95619,18 +98512,18 @@ var ts; // to replace the span (vs the full span) of the old function - the old leading // and trailing trivia will remain. ts.suppressLeadingAndTrailingTrivia(newFunction); - changes.replaceRange(sourceFile, { pos: oldFunction.getStart(), end: oldFunction.end }, newFunction); + changes.replaceNode(sourceFile, oldFunction, newFunction, ts.textChanges.useNonAdjustedPositions); } else { changes.deleteNodeInList(sourceFile, parent); } break; // handle case where 'import a = A;' - case 238 /* ImportEqualsDeclaration */: - var importEquals = ts.getAncestor(identifier, 238 /* ImportEqualsDeclaration */); + case 241 /* ImportEqualsDeclaration */: + var importEquals = ts.getAncestor(identifier, 241 /* ImportEqualsDeclaration */); changes.deleteNode(sourceFile, importEquals); break; - case 243 /* ImportSpecifier */: + case 246 /* ImportSpecifier */: var namedImports = parent.parent; if (namedImports.elements.length === 1) { tryDeleteNamedImportBinding(changes, sourceFile, namedImports); @@ -95640,10 +98533,10 @@ var ts; changes.deleteNodeInList(sourceFile, parent); } break; - case 240 /* ImportClause */:// this covers both 'import |d|' and 'import |d,| *' + case 243 /* ImportClause */: // this covers both 'import |d|' and 'import |d,| *' var importClause = parent; - if (!importClause.namedBindings) { - changes.deleteNode(sourceFile, ts.getAncestor(importClause, 239 /* ImportDeclaration */)); + if (!importClause.namedBindings) { // |import d from './file'| + changes.deleteNode(sourceFile, ts.getAncestor(importClause, 242 /* ImportDeclaration */)); } else { // import |d,| * as ns from './file' @@ -95659,7 +98552,7 @@ var ts; } } break; - case 241 /* NamespaceImport */: + case 244 /* NamespaceImport */: tryDeleteNamedImportBinding(changes, sourceFile, parent); break; default: @@ -95681,14 +98574,14 @@ var ts; // Delete the entire import declaration // |import * as ns from './file'| // |import { a } from './file'| - var importDecl = ts.getAncestor(namedBindings, 239 /* ImportDeclaration */); + var importDecl = ts.getAncestor(namedBindings, 242 /* ImportDeclaration */); changes.deleteNode(sourceFile, importDecl); } } // token.parent is a variableDeclaration function tryDeleteVariableDeclaration(changes, sourceFile, varDecl) { switch (varDecl.parent.parent.kind) { - case 215 /* ForStatement */: { + case 218 /* ForStatement */: { var forStatement = varDecl.parent.parent; var forInitializer = forStatement.initializer; if (forInitializer.declarations.length === 1) { @@ -95699,14 +98592,14 @@ var ts; } break; } - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: var forOfStatement = varDecl.parent.parent; - ts.Debug.assert(forOfStatement.initializer.kind === 228 /* VariableDeclarationList */); + ts.Debug.assert(forOfStatement.initializer.kind === 231 /* VariableDeclarationList */); var forOfInitializer = forOfStatement.initializer; changes.replaceNode(sourceFile, forOfInitializer.declarations[0], ts.createObjectLiteral()); break; - case 216 /* ForInStatement */: - case 225 /* TryStatement */: + case 219 /* ForInStatement */: + case 228 /* TryStatement */: break; default: var variableStatement = varDecl.parent.parent; @@ -95739,66 +98632,61 @@ var ts; var typeNode = info.typeNode, type = info.type; var original = typeNode.getText(sourceFile); var actions = [fix(type, fixIdPlain)]; - if (typeNode.kind === 274 /* JSDocNullableType */) { + if (typeNode.kind === 277 /* JSDocNullableType */) { // for nullable types, suggest the flow-compatible `T | null | undefined` // in addition to the jsdoc/closure-compatible `T | null` actions.push(fix(checker.getNullableType(type, 4096 /* Undefined */), fixIdNullable)); } return actions; function fix(type, fixId) { - var newText = typeString(type, checker); - return { - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]), - changes: [codefix.createFileTextChanges(sourceFile.fileName, [createChange(typeNode, sourceFile, newText)])], - fixId: fixId, - }; + var newText = checker.typeToString(type); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Change_0_to_1), [original, newText]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, typeNode, type, checker); }); + return { description: description, changes: changes, fixId: fixId }; } }, fixIds: [fixIdPlain, fixIdNullable], getAllCodeActions: function (context) { var fixId = context.fixId, program = context.program, sourceFile = context.sourceFile; var checker = program.getTypeChecker(); - return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { + return codefix.codeFixAll(context, errorCodes, function (changes, err) { var info = getInfo(err.file, err.start, checker); if (!info) return; var typeNode = info.typeNode, type = info.type; - var fixedType = typeNode.kind === 274 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 4096 /* Undefined */) : type; - changes.push(createChange(typeNode, sourceFile, typeString(fixedType, checker))); + var fixedType = typeNode.kind === 277 /* JSDocNullableType */ && fixId === fixIdNullable ? checker.getNullableType(type, 4096 /* Undefined */) : type; + doChange(changes, sourceFile, typeNode, fixedType, checker); }); } }); + function doChange(changes, sourceFile, oldTypeNode, newType, checker) { + changes.replaceNode(sourceFile, oldTypeNode, checker.typeToTypeNode(newType, /*enclosingDeclaration*/ oldTypeNode)); + } function getInfo(sourceFile, pos, checker) { var decl = ts.findAncestor(ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false), isTypeContainer); var typeNode = decl && decl.type; return typeNode && { typeNode: typeNode, type: checker.getTypeFromTypeNode(typeNode) }; } - function createChange(declaration, sourceFile, newText) { - return { span: ts.createTextSpanFromBounds(declaration.getStart(sourceFile), declaration.getEnd()), newText: newText }; - } - function typeString(type, checker) { - return checker.typeToString(type, /*enclosingDeclaration*/ undefined, 1 /* NoTruncation */); - } function isTypeContainer(node) { // NOTE: Some locations are not handled yet: // MappedTypeNode.typeParameters and SignatureDeclaration.typeParameters, as well as CallExpression.typeArguments switch (node.kind) { - case 203 /* AsExpression */: - case 156 /* CallSignature */: - case 157 /* ConstructSignature */: - case 229 /* FunctionDeclaration */: - case 154 /* GetAccessor */: - case 158 /* IndexSignature */: - case 173 /* MappedType */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 147 /* Parameter */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: - case 155 /* SetAccessor */: - case 232 /* TypeAliasDeclaration */: - case 185 /* TypeAssertionExpression */: - case 227 /* VariableDeclaration */: + case 206 /* AsExpression */: + case 157 /* CallSignature */: + case 158 /* ConstructSignature */: + case 232 /* FunctionDeclaration */: + case 155 /* GetAccessor */: + case 159 /* IndexSignature */: + case 176 /* MappedType */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 148 /* Parameter */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: + case 156 /* SetAccessor */: + case 235 /* TypeAliasDeclaration */: + case 188 /* TypeAssertionExpression */: + case 230 /* VariableDeclaration */: return true; default: return false; @@ -95849,14 +98737,14 @@ var ts; var containingFunction = ts.getContainingFunction(token); var insertBefore; switch (containingFunction.kind) { - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: insertBefore = containingFunction.name; break; - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: insertBefore = ts.findChildOfKind(containingFunction, 89 /* FunctionKeyword */, sourceFile); break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: insertBefore = ts.findChildOfKind(containingFunction, 19 /* OpenParenToken */, sourceFile) || ts.first(containingFunction.parameters); break; default: @@ -95897,116 +98785,15 @@ var ts; fixIds: [], getAllCodeActions: ts.notImplemented, }); - var ModuleSpecifierComparison; - (function (ModuleSpecifierComparison) { - ModuleSpecifierComparison[ModuleSpecifierComparison["Better"] = 0] = "Better"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Equal"] = 1] = "Equal"; - ModuleSpecifierComparison[ModuleSpecifierComparison["Worse"] = 2] = "Worse"; - })(ModuleSpecifierComparison || (ModuleSpecifierComparison = {})); - var ImportCodeActionMap = /** @class */ (function () { - function ImportCodeActionMap() { - this.symbolIdToActionMap = []; - } - ImportCodeActionMap.prototype.addAction = function (symbolId, newAction) { - var actions = this.symbolIdToActionMap[symbolId]; - if (!actions) { - this.symbolIdToActionMap[symbolId] = [newAction]; - return; - } - if (newAction.kind === "CodeChange") { - actions.push(newAction); - return; - } - var updatedNewImports = []; - for (var _i = 0, _a = this.symbolIdToActionMap[symbolId]; _i < _a.length; _i++) { - var existingAction = _a[_i]; - if (existingAction.kind === "CodeChange") { - // only import actions should compare - updatedNewImports.push(existingAction); - continue; - } - switch (this.compareModuleSpecifiers(existingAction.moduleSpecifier, newAction.moduleSpecifier)) { - case 0 /* Better */: - // the new one is not worth considering if it is a new import. - // However if it is instead a insertion into existing import, the user might want to use - // the module specifier even it is worse by our standards. So keep it. - if (newAction.kind === "NewImport") { - return; - } - // falls through - case 1 /* Equal */: - // the current one is safe. But it is still possible that the new one is worse - // than another existing one. For example, you may have new imports from "./foo/bar" - // and "bar", when the new one is "bar/bar2" and the current one is "./foo/bar". The new - // one and the current one are not comparable (one relative path and one absolute path), - // but the new one is worse than the other one, so should not add to the list. - updatedNewImports.push(existingAction); - break; - case 2 /* Worse */: - // the existing one is worse, remove from the list. - continue; - } - } - // if we reach here, it means the new one is better or equal to all of the existing ones. - updatedNewImports.push(newAction); - this.symbolIdToActionMap[symbolId] = updatedNewImports; - }; - ImportCodeActionMap.prototype.addActions = function (symbolId, newActions) { - for (var _i = 0, newActions_1 = newActions; _i < newActions_1.length; _i++) { - var newAction = newActions_1[_i]; - this.addAction(symbolId, newAction); - } - }; - ImportCodeActionMap.prototype.getAllActions = function () { - var result = []; - for (var key in this.symbolIdToActionMap) { - result = ts.concatenate(result, this.symbolIdToActionMap[key]); - } - return result; - }; - ImportCodeActionMap.prototype.compareModuleSpecifiers = function (moduleSpecifier1, moduleSpecifier2) { - if (moduleSpecifier1 === moduleSpecifier2) { - return 1 /* Equal */; - } - // if moduleSpecifier1 (ms1) is a substring of ms2, then it is better - if (moduleSpecifier2.indexOf(moduleSpecifier1) === 0) { - return 0 /* Better */; - } - if (moduleSpecifier1.indexOf(moduleSpecifier2) === 0) { - return 2 /* Worse */; - } - // if both are relative paths, and ms1 has fewer levels, then it is better - if (ts.isExternalModuleNameRelative(moduleSpecifier1) && ts.isExternalModuleNameRelative(moduleSpecifier2)) { - var regex = new RegExp(ts.directorySeparator, "g"); - var moduleSpecifier1LevelCount = (moduleSpecifier1.match(regex) || []).length; - var moduleSpecifier2LevelCount = (moduleSpecifier2.match(regex) || []).length; - return moduleSpecifier1LevelCount < moduleSpecifier2LevelCount - ? 0 /* Better */ - : moduleSpecifier1LevelCount === moduleSpecifier2LevelCount - ? 1 /* Equal */ - : 2 /* Worse */; - } - // the equal cases include when the two specifiers are not comparable. - return 1 /* Equal */; - }; - return ImportCodeActionMap; - }()); - function createCodeAction(description, diagnosticArgs, changes, kind, moduleSpecifier) { - return { - description: ts.formatMessage.apply(undefined, [undefined, description].concat(diagnosticArgs)), - changes: changes, - // TODO: GH#20315 - fixId: undefined, - kind: kind, - moduleSpecifier: moduleSpecifier - }; + function createCodeAction(descriptionDiagnostic, diagnosticArgs, changes) { + var description = ts.formatMessage.apply(undefined, [undefined, descriptionDiagnostic].concat(diagnosticArgs)); + // TODO: GH#20315 + return { description: description, changes: changes, fixId: undefined }; } - function convertToImportCodeFixContext(context) { + function convertToImportCodeFixContext(context, symbolToken, symbolName) { var useCaseSensitiveFileNames = context.host.useCaseSensitiveFileNames ? context.host.useCaseSensitiveFileNames() : false; var program = context.program; var checker = program.getTypeChecker(); - // This will always be an Identifier, since the diagnostics we fix only fail on identifiers. - var symbolToken = ts.cast(ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false), ts.isIdentifier); return { host: context.host, formatContext: context.formatContext, @@ -96016,8 +98803,8 @@ var ts; compilerOptions: program.getCompilerOptions(), cachedImportDeclarations: [], getCanonicalFileName: ts.createGetCanonicalFileName(useCaseSensitiveFileNames), - symbolName: symbolToken.getText(), - symbolToken: symbolToken, + symbolName: symbolName, + symbolToken: symbolToken }; } var ImportKind; @@ -96026,58 +98813,77 @@ var ts; ImportKind[ImportKind["Default"] = 1] = "Default"; ImportKind[ImportKind["Namespace"] = 2] = "Namespace"; ImportKind[ImportKind["Equals"] = 3] = "Equals"; - })(ImportKind = codefix.ImportKind || (codefix.ImportKind = {})); - function getCodeActionForImport(moduleSymbols, context) { - moduleSymbols = ts.toArray(moduleSymbols); - var declarations = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getImportDeclarations(moduleSymbol, context.checker, context.sourceFile, context.cachedImportDeclarations); - }); - var actions = []; - if (context.symbolToken) { - // It is possible that multiple import statements with the same specifier exist in the file. - // e.g. - // - // import * as ns from "foo"; - // import { member1, member2 } from "foo"; - // - // member3/**/ <-- cusor here - // - // in this case we should provie 2 actions: - // 1. change "member3" to "ns.member3" - // 2. add "member3" to the second import statement's import list - // and it is up to the user to decide which one fits best. - for (var _i = 0, declarations_13 = declarations; _i < declarations_13.length; _i++) { - var declaration = declarations_13[_i]; - var namespace = getNamespaceImportName(declaration); - if (namespace) { - var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); - if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { - actions.push(getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken)); - } + })(ImportKind || (ImportKind = {})); + function getImportCompletionAction(exportedSymbol, moduleSymbol, sourceFile, symbolName, host, program, checker, compilerOptions, allSourceFiles, formatContext, getCanonicalFileName, symbolToken) { + var exportInfos = getAllReExportingModules(exportedSymbol, checker, allSourceFiles); + ts.Debug.assert(exportInfos.some(function (info) { return info.moduleSymbol === moduleSymbol; })); + // We sort the best codefixes first, so taking `first` is best for completions. + var moduleSpecifier = ts.first(getNewImportInfos(program, sourceFile, exportInfos, compilerOptions, getCanonicalFileName, host)).moduleSpecifier; + var ctx = { host: host, program: program, checker: checker, compilerOptions: compilerOptions, sourceFile: sourceFile, formatContext: formatContext, symbolName: symbolName, getCanonicalFileName: getCanonicalFileName, symbolToken: symbolToken }; + return { moduleSpecifier: moduleSpecifier, codeAction: ts.first(getCodeActionsForImport(exportInfos, ctx)) }; + } + codefix.getImportCompletionAction = getImportCompletionAction; + function getAllReExportingModules(exportedSymbol, checker, allSourceFiles) { + var result = []; + forEachExternalModule(checker, allSourceFiles, function (moduleSymbol) { + for (var _i = 0, _a = checker.getExportsOfModule(moduleSymbol); _i < _a.length; _i++) { + var exported = _a[_i]; + if (ts.skipAlias(exported, checker) === exportedSymbol) { + var isDefaultExport = checker.tryGetMemberInModuleExports("default" /* Default */, moduleSymbol) === exported; + result.push({ moduleSymbol: moduleSymbol, importKind: isDefaultExport ? 1 /* Default */ : 0 /* Named */ }); } } - } - return actions.concat(getCodeActionsForAddImport(moduleSymbols, context, declarations)); + }); + return result; + } + function getCodeActionsForImport(exportInfos, context) { + var existingImports = ts.flatMap(exportInfos, function (info) { + return getImportDeclarations(info, context.checker, context.sourceFile, context.cachedImportDeclarations); + }); + // It is possible that multiple import statements with the same specifier exist in the file. + // e.g. + // + // import * as ns from "foo"; + // import { member1, member2 } from "foo"; + // + // member3/**/ <-- cusor here + // + // in this case we should provie 2 actions: + // 1. change "member3" to "ns.member3" + // 2. add "member3" to the second import statement's import list + // and it is up to the user to decide which one fits best. + var useExistingImportActions = !context.symbolToken || !ts.isIdentifier(context.symbolToken) ? ts.emptyArray : ts.mapDefined(existingImports, function (_a) { + var declaration = _a.declaration; + var namespace = getNamespaceImportName(declaration); + if (namespace) { + var moduleSymbol = context.checker.getAliasedSymbol(context.checker.getSymbolAtLocation(namespace)); + if (moduleSymbol && moduleSymbol.exports.has(ts.escapeLeadingUnderscores(context.symbolName))) { + return getCodeActionForUseExistingNamespaceImport(namespace.text, context, context.symbolToken); + } + } + }); + return useExistingImportActions.concat(getCodeActionsForAddImport(exportInfos, context, existingImports)); } - codefix.getCodeActionForImport = getCodeActionForImport; function getNamespaceImportName(declaration) { - if (declaration.kind === 239 /* ImportDeclaration */) { + if (declaration.kind === 242 /* ImportDeclaration */) { var namedBindings = declaration.importClause && ts.isImportClause(declaration.importClause) && declaration.importClause.namedBindings; - return namedBindings && namedBindings.kind === 241 /* NamespaceImport */ ? namedBindings.name : undefined; + return namedBindings && namedBindings.kind === 244 /* NamespaceImport */ ? namedBindings.name : undefined; } else { return declaration.name; } } // TODO(anhans): This doesn't seem important to cache... just use an iterator instead of creating a new array? - function getImportDeclarations(moduleSymbol, checker, _a, cachedImportDeclarations) { - var imports = _a.imports; + function getImportDeclarations(_a, checker, _b, cachedImportDeclarations) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var imports = _b.imports; if (cachedImportDeclarations === void 0) { cachedImportDeclarations = []; } var moduleSymbolId = ts.getUniqueSymbolId(moduleSymbol, checker); var cached = cachedImportDeclarations[moduleSymbolId]; if (!cached) { cached = cachedImportDeclarations[moduleSymbolId] = ts.mapDefined(imports, function (importModuleSpecifier) { - return checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + var declaration = checker.getSymbolAtLocation(importModuleSpecifier) === moduleSymbol ? getImportDeclaration(importModuleSpecifier) : undefined; + return declaration && { declaration: declaration, importKind: importKind }; }); } return cached; @@ -96085,27 +98891,28 @@ var ts; function getImportDeclaration(_a) { var parent = _a.parent; switch (parent.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: return parent; - case 249 /* ExternalModuleReference */: + case 252 /* ExternalModuleReference */: return parent.parent; - case 245 /* ExportDeclaration */: - case 182 /* CallExpression */:// For "require()" calls + case 248 /* ExportDeclaration */: + case 185 /* CallExpression */: // For "require()" calls // Ignore these, can't add imports to them. return undefined; default: ts.Debug.fail(); } } - function getCodeActionForNewImport(context, moduleSpecifier) { - var kind = context.kind, sourceFile = context.sourceFile, symbolName = context.symbolName; + function getCodeActionForNewImport(context, _a) { + var moduleSpecifier = _a.moduleSpecifier, importKind = _a.importKind; + var sourceFile = context.sourceFile, symbolName = context.symbolName; var lastImportDeclaration = ts.findLast(sourceFile.statements, ts.isAnyImportSyntax); var moduleSpecifierWithoutQuotes = ts.stripQuotes(moduleSpecifier); var quotedModuleSpecifier = createStringLiteralWithQuoteStyle(sourceFile, moduleSpecifierWithoutQuotes); - var importDecl = kind !== 3 /* Equals */ + var importDecl = importKind !== 3 /* Equals */ ? ts.createImportDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, createImportClauseOfKind(kind, symbolName), quotedModuleSpecifier) + /*modifiers*/ undefined, createImportClauseOfKind(importKind, symbolName), quotedModuleSpecifier) : ts.createImportEqualsDeclaration( /*decorators*/ undefined, /*modifiers*/ undefined, ts.createIdentifier(symbolName), ts.createExternalModuleReference(quotedModuleSpecifier)); @@ -96120,7 +98927,7 @@ var ts; // if this file doesn't have any import statements, insert an import statement and then insert a new line // between the only import statement and user code. Otherwise just insert the statement because chances // are there are already a new line seperating code and import statements. - return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes, "NewImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Import_0_from_module_1, [symbolName, moduleSpecifierWithoutQuotes], changes); } function createStringLiteralWithQuoteStyle(sourceFile, text) { var literal = ts.createLiteral(text); @@ -96147,11 +98954,12 @@ var ts; ts.Debug.assertNever(kind); } } - function getModuleSpecifiersForNewImport(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { + function getNewImportInfos(program, sourceFile, moduleSymbols, options, getCanonicalFileName, host) { var baseUrl = options.baseUrl, paths = options.paths, rootDirs = options.rootDirs; var addJsExtension = usesJsExtensionOnImports(sourceFile); - var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (moduleSymbol) { - return getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { + var choicesForEachExportingModule = ts.flatMap(moduleSymbols, function (_a) { + var moduleSymbol = _a.moduleSymbol, importKind = _a.importKind; + var modulePathsGroups = getAllModulePaths(program, moduleSymbol.valueDeclaration.getSourceFile()).map(function (moduleFileName) { var sourceDirectory = ts.getDirectoryPath(sourceFile.fileName); var global = tryGetModuleNameFromAmbientModule(moduleSymbol) || tryGetModuleNameFromTypeRoots(options, host, getCanonicalFileName, moduleFileName, addJsExtension) @@ -96209,11 +99017,11 @@ var ts; var relativeFirst = getRelativePathNParents(relativePath) < getRelativePathNParents(pathFromSourceToBaseUrl); return relativeFirst ? [relativePath, importRelativeToBaseUrl] : [importRelativeToBaseUrl, relativePath]; }); + return modulePathsGroups.map(function (group) { return group.map(function (moduleSpecifier) { return ({ moduleSpecifier: moduleSpecifier, importKind: importKind }); }); }); }); - // Only return results for the re-export with the shortest possible path (and also give the other path even if that's long.) - return ts.best(ts.arrayIterator(choicesForEachExportingModule), function (a, b) { return a[0].length < b[0].length; }); + // Sort to keep the shortest paths first, but keep [relativePath, importRelativeToBaseUrl] groups together + return ts.flatten(choicesForEachExportingModule.sort(function (a, b) { return ts.first(a).moduleSpecifier.length - ts.first(b).moduleSpecifier.length; })); } - codefix.getModuleSpecifiersForNewImport = getModuleSpecifiersForNewImport; /** * Looks for a existing imports that use symlinks to this module. * Only if no symlink is available, the real path will be used. @@ -96411,47 +99219,51 @@ var ts; var relativePath = ts.getRelativePathToDirectoryOrUrl(directoryPath, path, directoryPath, getCanonicalFileName, /*isAbsolutePathAnUrl*/ false); return !ts.pathIsRelative(relativePath) ? "./" + relativePath : relativePath; } - function getCodeActionsForAddImport(moduleSymbols, ctx, declarations) { - var fromExistingImport = ts.firstDefined(declarations, function (declaration) { - if (declaration.kind === 239 /* ImportDeclaration */ && declaration.importClause) { - var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined); + function getCodeActionsForAddImport(exportInfos, ctx, existingImports) { + var fromExistingImport = ts.firstDefined(existingImports, function (_a) { + var declaration = _a.declaration, importKind = _a.importKind; + if (declaration.kind === 242 /* ImportDeclaration */ && declaration.importClause) { + var changes = tryUpdateExistingImport(ctx, ts.isImportClause(declaration.importClause) && declaration.importClause || undefined, importKind); if (changes) { var moduleSpecifierWithoutQuotes = ts.stripQuotes(declaration.moduleSpecifier.getText()); - return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes, "InsertingIntoExistingImport", moduleSpecifierWithoutQuotes); + return createCodeAction(ts.Diagnostics.Add_0_to_existing_import_declaration_from_1, [ctx.symbolName, moduleSpecifierWithoutQuotes], changes); } } }); if (fromExistingImport) { return [fromExistingImport]; } - var existingDeclaration = ts.firstDefined(declarations, moduleSpecifierFromAnyImport); - var moduleSpecifiers = existingDeclaration ? [existingDeclaration] : getModuleSpecifiersForNewImport(ctx.program, ctx.sourceFile, moduleSymbols, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); - return moduleSpecifiers.map(function (spec) { return getCodeActionForNewImport(ctx, spec); }); + var existingDeclaration = ts.firstDefined(existingImports, newImportInfoFromExistingSpecifier); + var newImportInfos = existingDeclaration + ? [existingDeclaration] + : getNewImportInfos(ctx.program, ctx.sourceFile, exportInfos, ctx.compilerOptions, ctx.getCanonicalFileName, ctx.host); + return newImportInfos.map(function (info) { return getCodeActionForNewImport(ctx, info); }); } - function moduleSpecifierFromAnyImport(node) { - var expression = node.kind === 239 /* ImportDeclaration */ - ? node.moduleSpecifier - : node.moduleReference.kind === 249 /* ExternalModuleReference */ - ? node.moduleReference.expression + function newImportInfoFromExistingSpecifier(_a) { + var declaration = _a.declaration, importKind = _a.importKind; + var expression = declaration.kind === 242 /* ImportDeclaration */ + ? declaration.moduleSpecifier + : declaration.moduleReference.kind === 252 /* ExternalModuleReference */ + ? declaration.moduleReference.expression : undefined; - return expression && ts.isStringLiteral(expression) ? expression.text : undefined; + return expression && ts.isStringLiteral(expression) ? { moduleSpecifier: expression.text, importKind: importKind } : undefined; } - function tryUpdateExistingImport(context, importClause) { - var symbolName = context.symbolName, sourceFile = context.sourceFile, kind = context.kind; + function tryUpdateExistingImport(context, importClause, importKind) { + var symbolName = context.symbolName, sourceFile = context.sourceFile; var name = importClause.name; - var namedBindings = (importClause.kind !== 238 /* ImportEqualsDeclaration */ && importClause).namedBindings; - switch (kind) { + var namedBindings = (importClause.kind !== 241 /* ImportEqualsDeclaration */ && importClause).namedBindings; + switch (importKind) { case 1 /* Default */: return name ? undefined : ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(ts.createIdentifier(symbolName), namedBindings)); }); case 0 /* Named */: { var newImportSpecifier_1 = ts.createImportSpecifier(/*propertyName*/ undefined, ts.createIdentifier(symbolName)); - if (namedBindings && namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length !== 0) { + if (namedBindings && namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length !== 0) { // There are already named imports; add another. return ChangeTracker.with(context, function (t) { return t.insertNodeInListAfter(sourceFile, namedBindings.elements[namedBindings.elements.length - 1], newImportSpecifier_1); }); } - if (!namedBindings || namedBindings.kind === 242 /* NamedImports */ && namedBindings.elements.length === 0) { + if (!namedBindings || namedBindings.kind === 245 /* NamedImports */ && namedBindings.elements.length === 0) { return ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, importClause, ts.createImportClause(name, ts.createNamedImports([newImportSpecifier_1]))); }); @@ -96465,7 +99277,7 @@ var ts; case 3 /* Equals */: return undefined; default: - ts.Debug.assertNever(kind); + ts.Debug.assertNever(importKind); } } function getCodeActionForUseExistingNamespaceImport(namespacePrefix, context, symbolToken) { @@ -96480,36 +99292,39 @@ var ts; * namespace instead of altering the import declaration. For example, "foo" would * become "ns.foo" */ - // Prefix the node instead of it replacing it, because this may be used for import completions and we don't want the text changes to overlap with the identifier being completed. var changes = ChangeTracker.with(context, function (tracker) { - return tracker.changeIdentifierToPropertyAccess(sourceFile, namespacePrefix, symbolToken); + return tracker.replaceNode(sourceFile, symbolToken, ts.createPropertyAccess(ts.createIdentifier(namespacePrefix), symbolToken)); }); - return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes, "CodeChange", /*moduleSpecifier*/ undefined); + return createCodeAction(ts.Diagnostics.Change_0_to_1, [symbolName, namespacePrefix + "." + symbolName], changes); } function getImportCodeActions(context) { - var importFixContext = convertToImportCodeFixContext(context); return context.errorCode === ts.Diagnostics._0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead.code - ? getActionsForUMDImport(importFixContext) - : getActionsForNonUMDImport(importFixContext, context.program.getSourceFiles(), context.cancellationToken); + ? getActionsForUMDImport(context) + : getActionsForNonUMDImport(context); } function getActionsForUMDImport(context) { - var checker = context.checker, symbolToken = context.symbolToken, compilerOptions = context.compilerOptions; - var umdSymbol = checker.getSymbolAtLocation(symbolToken); - var symbol; - var symbolName; - if (umdSymbol.flags & 2097152 /* Alias */) { - symbol = checker.getAliasedSymbol(umdSymbol); - symbolName = context.symbolName; + var token = ts.getTokenAtPosition(context.sourceFile, context.span.start, /*includeJsDocComment*/ false); + var checker = context.program.getTypeChecker(); + var umdSymbol; + if (ts.isIdentifier(token)) { + // try the identifier to see if it is the umd symbol + umdSymbol = checker.getSymbolAtLocation(token); } - else if (ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken) { + if (!ts.isUMDExportSymbol(umdSymbol)) { // The error wasn't for the symbolAtLocation, it was for the JSX tag itself, which needs access to e.g. `React`. - symbol = checker.getAliasedSymbol(checker.resolveName(checker.getJsxNamespace(), symbolToken.parent.tagName, 107455 /* Value */, /*excludeGlobals*/ false)); - symbolName = symbol.name; + var parent = token.parent; + var isNodeOpeningLikeElement = ts.isJsxOpeningLikeElement(parent); + if ((ts.isJsxOpeningLikeElement && parent.tagName === token) || parent.kind === 258 /* JsxOpeningFragment */) { + umdSymbol = checker.resolveName(checker.getJsxNamespace(parent), isNodeOpeningLikeElement ? parent.tagName : parent, 67216319 /* Value */, /*excludeGlobals*/ false); + } } - else { - throw ts.Debug.fail("Either the symbol or the JSX namespace should be a UMD global if we got here"); + if (ts.isUMDExportSymbol(umdSymbol)) { + var symbol = checker.getAliasedSymbol(umdSymbol); + if (symbol) { + return getCodeActionsForImport([{ moduleSymbol: symbol, importKind: getUmdImportKind(context.program.getCompilerOptions()) }], convertToImportCodeFixContext(context, token, umdSymbol.name)); + } } - return getCodeActionForImport(symbol, __assign({}, context, { symbolName: symbolName, kind: getUmdImportKind(compilerOptions) })); + return undefined; } function getUmdImportKind(compilerOptions) { // Import a synthetic `default` if enabled. @@ -96530,15 +99345,30 @@ var ts; // Fall back to the `import * as ns` style import. return 2 /* Namespace */; default: - throw ts.Debug.assertNever(moduleKind); + return ts.Debug.assertNever(moduleKind); } } - function getActionsForNonUMDImport(context, allSourceFiles, cancellationToken) { - var sourceFile = context.sourceFile, checker = context.checker, symbolName = context.symbolName, symbolToken = context.symbolToken; + function getActionsForNonUMDImport(context) { + // This will always be an Identifier, since the diagnostics we fix only fail on identifiers. + var sourceFile = context.sourceFile, span = context.span, program = context.program, cancellationToken = context.cancellationToken; + var checker = program.getTypeChecker(); + var symbolToken = ts.getTokenAtPosition(sourceFile, span.start, /*includeJsDocComment*/ false); + var isJsxNamespace = ts.isJsxOpeningLikeElement(symbolToken.parent) && symbolToken.parent.tagName === symbolToken; + if (!isJsxNamespace && !ts.isIdentifier(symbolToken)) { + return undefined; + } + var symbolName = isJsxNamespace ? checker.getJsxNamespace() : symbolToken.text; + var allSourceFiles = program.getSourceFiles(); + var compilerOptions = program.getCompilerOptions(); // "default" is a keyword and not a legal identifier for the import, so we don't expect it here ts.Debug.assert(symbolName !== "default"); - var symbolIdActionMap = new ImportCodeActionMap(); var currentTokenMeaning = ts.getMeaningFromLocation(symbolToken); + // For each original symbol, keep all re-exports of that symbol together so we can call `getCodeActionsForImport` on the whole group at once. + // Maps symbol id to info for modules providing that symbol (original export + re-exports). + var originalSymbolToExportInfos = ts.createMultiMap(); + function addSymbol(moduleSymbol, exportedSymbol, importKind) { + originalSymbolToExportInfos.add(ts.getUniqueSymbolId(exportedSymbol, checker).toString(), { moduleSymbol: moduleSymbol, importKind: importKind }); + } forEachExternalModuleToImportFrom(checker, sourceFile, allSourceFiles, function (moduleSymbol) { cancellationToken.throwIfCancellationRequested(); // check the default export @@ -96547,17 +99377,14 @@ var ts; var localSymbol = ts.getLocalSymbolForExportDefault(defaultExport); if ((localSymbol && localSymbol.escapedName === symbolName || getEscapedNameForExportDefault(defaultExport) === symbolName || - moduleSymbolToValidIdentifier(moduleSymbol, context.compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { - // check if this symbol is already used - var symbolId = ts.getUniqueSymbolId(localSymbol || defaultExport, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 1 /* Default */ }))); + moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target) === symbolName) && checkSymbolHasMeaning(localSymbol || defaultExport, currentTokenMeaning)) { + addSymbol(moduleSymbol, localSymbol || defaultExport, 1 /* Default */); } } // check exports with the same name var exportSymbolWithIdenticalName = checker.tryGetMemberInModuleExportsAndProperties(symbolName, moduleSymbol); if (exportSymbolWithIdenticalName && checkSymbolHasMeaning(exportSymbolWithIdenticalName, currentTokenMeaning)) { - var symbolId = ts.getUniqueSymbolId(exportSymbolWithIdenticalName, checker); - symbolIdActionMap.addActions(symbolId, getCodeActionForImport(moduleSymbol, __assign({}, context, { kind: 0 /* Named */ }))); + addSymbol(moduleSymbol, exportSymbolWithIdenticalName, 0 /* Named */); } function getEscapedNameForExportDefault(symbol) { return ts.firstDefined(symbol.declarations, function (declaration) { @@ -96575,7 +99402,7 @@ var ts; }); } }); - return symbolIdActionMap.getAllActions(); + return ts.arrayFrom(ts.flatMapIterator(originalSymbolToExportInfos.values(), function (exportInfos) { return getCodeActionsForImport(exportInfos, convertToImportCodeFixContext(context, symbolToken, symbolName)); })); } function checkSymbolHasMeaning(_a, meaning) { var declarations = _a.declarations; @@ -96601,7 +99428,6 @@ var ts; } } } - codefix.forEachExternalModule = forEachExternalModule; /** * Don't include something from a `node_modules` that isn't actually reachable by a global import. * A relative import to node_modules is usually a bad idea. @@ -96656,59 +99482,61 @@ var ts; codefix.registerCodeFix({ errorCodes: errorCodes, getCodeActions: function (context) { - var sourceFile = context.sourceFile, program = context.program, span = context.span; + var sourceFile = context.sourceFile, program = context.program, span = context.span, host = context.host, formatContext = context.formatContext; if (!ts.isInJavaScriptFile(sourceFile) || !ts.isCheckJsEnabledForFile(sourceFile, program.getCompilerOptions())) { return undefined; } - var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); - return [{ - description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), - changes: [codefix.createFileTextChanges(sourceFile.fileName, [getIgnoreCommentLocationForLocation(sourceFile, span.start, newLineCharacter)])], - fixId: fixId, - }, + var fixes = [ { description: ts.getLocaleSpecificMessage(ts.Diagnostics.Disable_checking_for_this_file), - changes: [codefix.createFileTextChanges(sourceFile.fileName, [{ - span: { - start: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.pos : 0, - length: sourceFile.checkJsDirective ? sourceFile.checkJsDirective.end - sourceFile.checkJsDirective.pos : 0 - }, - newText: "// @ts-nocheck" + newLineCharacter - }])], + changes: [codefix.createFileTextChanges(sourceFile.fileName, [ + ts.createTextChange(sourceFile.checkJsDirective + ? ts.createTextSpanFromBounds(sourceFile.checkJsDirective.pos, sourceFile.checkJsDirective.end) + : ts.createTextSpan(0, 0), "// @ts-nocheck" + ts.getNewLineOrDefaultFromHost(host, formatContext.options)), + ])], // fixId unnecessary because adding `// @ts-nocheck` even once will ignore every error in the file. fixId: undefined, - }]; + } + ]; + if (isValidSuppressLocation(sourceFile, span.start)) { + fixes.unshift({ + description: ts.getLocaleSpecificMessage(ts.Diagnostics.Ignore_this_error_message), + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return makeChange(t, sourceFile, span.start); }), + fixId: fixId, + }); + } + return fixes; }, fixIds: [fixId], - getAllCodeActions: function (context) { return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { - if (err.start !== undefined) { - changes.push(getIgnoreCommentLocationForLocation(err.file, err.start, ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options))); - } - }); }, + getAllCodeActions: function (context) { + var seenLines = ts.createMap(); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + if (isValidSuppressLocation(diag.file, diag.start)) { + makeChange(changes, diag.file, diag.start, seenLines); + } + }); + }, }); - function getIgnoreCommentLocationForLocation(sourceFile, position, newLineCharacter) { - var line = ts.getLineAndCharacterOfPosition(sourceFile, position).line; - var lineStartPosition = ts.getStartPositionOfLine(line, sourceFile); + function isValidSuppressLocation(sourceFile, position) { + return !ts.isInComment(sourceFile, position) && !ts.isInString(sourceFile, position) && !ts.isInTemplateString(sourceFile, position); + } + function makeChange(changes, sourceFile, position, seenLines) { + var lineNumber = ts.getLineAndCharacterOfPosition(sourceFile, position).line; + // Only need to add `// @ts-ignore` for a line once. + if (seenLines && !ts.addToSeen(seenLines, lineNumber)) { + return; + } + var lineStartPosition = ts.getStartPositionOfLine(lineNumber, sourceFile); var startPosition = ts.getFirstNonSpaceCharacterPosition(sourceFile.text, lineStartPosition); // First try to see if we can put the '// @ts-ignore' on the previous line. // We need to make sure that we are not in the middle of a string literal or a comment. - // We also want to check if the previous line holds a comment for a node on the next line - // if so, we do not want to separate the node from its comment if we can. - if (!ts.isInComment(sourceFile, startPosition) && !ts.isInString(sourceFile, startPosition) && !ts.isInTemplateString(sourceFile, startPosition)) { - var token = ts.getTouchingToken(sourceFile, startPosition, /*includeJsDocComment*/ false); - var tokenLeadingCommnets = ts.getLeadingCommentRangesOfNode(token, sourceFile); - if (!tokenLeadingCommnets || !tokenLeadingCommnets.length || tokenLeadingCommnets[0].pos >= startPosition) { - return { - span: { start: startPosition, length: 0 }, - newText: "// @ts-ignore" + newLineCharacter - }; - } - } - // If all fails, add an extra new line immediately before the error span. - return { - span: { start: position, length: 0 }, - newText: (position === startPosition ? "" : newLineCharacter) + "// @ts-ignore" + newLineCharacter - }; + // If so, we do not want to separate the node from its comment if we can. + // Otherwise, add an extra new line immediately before the error span. + var insertAtLineStart = isValidSuppressLocation(sourceFile, startPosition); + var token = ts.getTouchingToken(sourceFile, insertAtLineStart ? startPosition : position, /*includeJsDocComment*/ false); + var clone = ts.setStartsOnNewLine(ts.getSynthesizedDeepClone(token), true); + ts.addSyntheticLeadingComment(clone, 2 /* SingleLineCommentTrivia */, " @ts-ignore"); + changes.replaceNode(sourceFile, token, clone, { preserveLeadingWhitespace: true, prefix: insertAtLineStart ? undefined : changes.newLineCharacter }); } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); @@ -96749,17 +99577,17 @@ var ts; var type = checker.getWidenedType(checker.getTypeOfSymbolAtLocation(symbol, enclosingDeclaration)); var optional = !!(symbol.flags & 16777216 /* Optional */); switch (declaration.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 149 /* PropertySignature */: - case 150 /* PropertyDeclaration */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 150 /* PropertySignature */: + case 151 /* PropertyDeclaration */: var typeNode = checker.typeToTypeNode(type, enclosingDeclaration); out(ts.createProperty( /*decorators*/ undefined, modifiers, name, optional ? ts.createToken(55 /* QuestionToken */) : undefined, typeNode, /*initializer*/ undefined)); break; - case 151 /* MethodSignature */: - case 152 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 153 /* MethodDeclaration */: // The signature for the implementation appears as an entry in `signatures` iff // there is only one signature. // If there are overloads and an implementation signature, it appears as an @@ -96799,7 +99627,7 @@ var ts; } } function signatureToMethodDeclaration(checker, signature, enclosingDeclaration, modifiers, name, optional, body) { - var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 152 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); + var signatureDeclaration = checker.signatureToSignatureDeclaration(signature, 153 /* MethodDeclaration */, enclosingDeclaration, 256 /* SuppressAnyReturnType */); if (!signatureDeclaration) { return undefined; } @@ -96921,28 +99749,26 @@ var ts; ]; codefix.registerCodeFix({ errorCodes: errorCodes, - getCodeActions: function (_a) { - var sourceFile = _a.sourceFile, program = _a.program, start = _a.span.start, errorCode = _a.errorCode, cancellationToken = _a.cancellationToken; + getCodeActions: function (context) { + var sourceFile = context.sourceFile, program = context.program, start = context.span.start, errorCode = context.errorCode, cancellationToken = context.cancellationToken; if (ts.isSourceFileJavaScript(sourceFile)) { return undefined; // TODO: GH#20113 } var token = ts.getTokenAtPosition(sourceFile, start, /*includeJsDocComment*/ false); - var fix = getFix(sourceFile, token, errorCode, program, cancellationToken); - if (!fix) + var declaration; + var changes = ts.textChanges.ChangeTracker.with(context, function (changes) { declaration = doChange(changes, sourceFile, token, errorCode, program, cancellationToken); }); + if (changes.length === 0) return undefined; - var declaration = fix.declaration, textChanges = fix.textChanges; - var name = ts.getNameOfDeclaration(declaration); - var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name.getText()]); - return [{ description: description, changes: [{ fileName: sourceFile.fileName, textChanges: textChanges }], fixId: fixId }]; + var name = ts.getNameOfDeclaration(declaration).getText(); + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(getDiagnostic(errorCode, token)), [name]); + return [{ description: description, changes: changes, fixId: fixId }]; }, fixIds: [fixId], getAllCodeActions: function (context) { var sourceFile = context.sourceFile, program = context.program, cancellationToken = context.cancellationToken; var seenFunctions = ts.createMap(); - return codefix.codeFixAllWithTextChanges(context, errorCodes, function (changes, err) { - var fix = getFix(sourceFile, ts.getTokenAtPosition(err.file, err.start, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions); - if (fix) - changes.push.apply(changes, fix.textChanges); + return codefix.codeFixAll(context, errorCodes, function (changes, err) { + doChange(changes, sourceFile, ts.getTokenAtPosition(err.file, err.start, /*includeJsDocComment*/ false), err.code, program, cancellationToken, seenFunctions); }); }, }); @@ -96956,7 +99782,7 @@ var ts; return ts.Diagnostics.Infer_type_of_0_from_usage; } } - function getFix(sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { + function doChange(changes, sourceFile, token, errorCode, program, cancellationToken, seenFunctions) { if (!isAllowedTokenKind(token.kind)) { return undefined; } @@ -96964,10 +99790,14 @@ var ts; // Variable and Property declarations case ts.Diagnostics.Member_0_implicitly_has_an_1_type.code: case ts.Diagnostics.Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined.code: - return getCodeActionForVariableDeclaration(token.parent, sourceFile, program, cancellationToken); + annotateVariableDeclaration(changes, sourceFile, token.parent, program, cancellationToken); + return token.parent; case ts.Diagnostics.Variable_0_implicitly_has_an_1_type.code: { var symbol = program.getTypeChecker().getSymbolAtLocation(token); - return symbol && symbol.valueDeclaration && getCodeActionForVariableDeclaration(symbol.valueDeclaration, sourceFile, program, cancellationToken); + if (symbol && symbol.valueDeclaration) { + annotateVariableDeclaration(changes, sourceFile, symbol.valueDeclaration, program, cancellationToken); + return symbol.valueDeclaration; + } } } var containingFunction = ts.getContainingFunction(token); @@ -96978,22 +99808,34 @@ var ts; // Parameter declarations case ts.Diagnostics.Parameter_0_implicitly_has_an_1_type.code: if (ts.isSetAccessor(containingFunction)) { - return getCodeActionForSetAccessor(containingFunction, sourceFile, program, cancellationToken); + annotateSetAccessor(changes, sourceFile, containingFunction, program, cancellationToken); + return containingFunction; } // falls through case ts.Diagnostics.Rest_parameter_0_implicitly_has_an_any_type.code: - return !seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction)) - ? getCodeActionForParameters(token.parent, containingFunction, sourceFile, program, cancellationToken) - : undefined; + if (!seenFunctions || ts.addToSeen(seenFunctions, ts.getNodeId(containingFunction))) { + var param = ts.cast(token.parent, ts.isParameter); + annotateParameters(changes, param, containingFunction, sourceFile, program, cancellationToken); + return param; + } + return undefined; // Get Accessor declarations case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation.code: case ts.Diagnostics._0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type.code: - return ts.isGetAccessor(containingFunction) ? getCodeActionForGetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + if (ts.isGetAccessor(containingFunction) && ts.isIdentifier(containingFunction.name)) { + annotate(changes, sourceFile, containingFunction, inferTypeForVariableFromUsage(containingFunction.name, program, cancellationToken), program); + return containingFunction; + } + return undefined; // Set Accessor declarations case ts.Diagnostics.Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation.code: - return ts.isSetAccessor(containingFunction) ? getCodeActionForSetAccessor(containingFunction, sourceFile, program, cancellationToken) : undefined; + if (ts.isSetAccessor(containingFunction)) { + annotateSetAccessor(changes, sourceFile, containingFunction, program, cancellationToken); + return containingFunction; + } + return undefined; default: - throw ts.Debug.fail(String(errorCode)); + return ts.Debug.fail(String(errorCode)); } } function isAllowedTokenKind(kind) { @@ -97003,138 +99845,94 @@ var ts; case 114 /* PublicKeyword */: case 112 /* PrivateKeyword */: case 113 /* ProtectedKeyword */: - case 131 /* ReadonlyKeyword */: + case 132 /* ReadonlyKeyword */: return true; default: return false; } } - function getCodeActionForVariableDeclaration(declaration, sourceFile, program, cancellationToken) { - if (!ts.isIdentifier(declaration.name)) - return undefined; - var type = inferTypeForVariableFromUsage(declaration.name, sourceFile, program, cancellationToken); - return makeFix(declaration, declaration.name.getEnd(), type, program); + function annotateVariableDeclaration(changes, sourceFile, declaration, program, cancellationToken) { + if (ts.isIdentifier(declaration.name)) { + annotate(changes, sourceFile, declaration, inferTypeForVariableFromUsage(declaration.name, program, cancellationToken), program); + } } function isApplicableFunctionForInference(declaration) { switch (declaration.kind) { - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 153 /* Constructor */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 154 /* Constructor */: return true; - case 187 /* FunctionExpression */: + case 190 /* FunctionExpression */: return !!declaration.name; } return false; } - function getCodeActionForParameters(parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { + function annotateParameters(changes, parameterDeclaration, containingFunction, sourceFile, program, cancellationToken) { if (!ts.isIdentifier(parameterDeclaration.name) || !isApplicableFunctionForInference(containingFunction)) { - return undefined; + return; } var types = inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) || - containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, sourceFile, program, cancellationToken) : undefined; }); - if (!types) - return undefined; + containingFunction.parameters.map(function (p) { return ts.isIdentifier(p.name) ? inferTypeForVariableFromUsage(p.name, program, cancellationToken) : undefined; }); // We didn't actually find a set of type inference positions matching each parameter position - if (containingFunction.parameters.length !== types.length) { - return undefined; + if (!types || containingFunction.parameters.length !== types.length) { + return; } - var textChanges = ts.arrayFrom(ts.mapDefinedIterator(ts.zipToIterator(containingFunction.parameters, types), function (_a) { - var parameter = _a[0], type = _a[1]; - return type && !parameter.type && !parameter.initializer ? makeChange(containingFunction, parameter.end, type, program) : undefined; - })); - return textChanges.length ? { declaration: parameterDeclaration, textChanges: textChanges } : undefined; + ts.zipWith(containingFunction.parameters, types, function (parameter, type) { + if (!parameter.type && !parameter.initializer) { + annotate(changes, sourceFile, parameter, type, program); + } + }); } - function getCodeActionForSetAccessor(setAccessorDeclaration, sourceFile, program, cancellationToken) { - var setAccessorParameter = setAccessorDeclaration.parameters[0]; - if (!setAccessorParameter || !ts.isIdentifier(setAccessorDeclaration.name) || !ts.isIdentifier(setAccessorParameter.name)) { - return undefined; + function annotateSetAccessor(changes, sourceFile, setAccessorDeclaration, program, cancellationToken) { + var param = ts.firstOrUndefined(setAccessorDeclaration.parameters); + if (param && ts.isIdentifier(setAccessorDeclaration.name) && ts.isIdentifier(param.name)) { + var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, program, cancellationToken) || + inferTypeForVariableFromUsage(param.name, program, cancellationToken); + annotate(changes, sourceFile, param, type, program); } - var type = inferTypeForVariableFromUsage(setAccessorDeclaration.name, sourceFile, program, cancellationToken) || - inferTypeForVariableFromUsage(setAccessorParameter.name, sourceFile, program, cancellationToken); - return makeFix(setAccessorParameter, setAccessorParameter.name.getEnd(), type, program); } - function getCodeActionForGetAccessor(getAccessorDeclaration, sourceFile, program, cancellationToken) { - if (!ts.isIdentifier(getAccessorDeclaration.name)) { - return undefined; - } - var type = inferTypeForVariableFromUsage(getAccessorDeclaration.name, sourceFile, program, cancellationToken); - var closeParenToken = ts.findChildOfKind(getAccessorDeclaration, 20 /* CloseParenToken */, sourceFile); - return makeFix(getAccessorDeclaration, closeParenToken.getEnd(), type, program); + function annotate(changes, sourceFile, declaration, type, program) { + var typeNode = type && getTypeNodeIfAccessible(type, declaration, program.getTypeChecker()); + if (typeNode) + changes.insertTypeAnnotation(sourceFile, declaration, typeNode); } - function makeFix(declaration, start, type, program) { - return type && { declaration: declaration, textChanges: [makeChange(declaration, start, type, program)] }; + function getTypeNodeIfAccessible(type, enclosingScope, checker) { + var typeIsAccessible = true; + var notAccessible = function () { typeIsAccessible = false; }; + var res = checker.typeToTypeNode(type, enclosingScope, /*flags*/ undefined, { + trackSymbol: function (symbol, declaration, meaning) { + typeIsAccessible = typeIsAccessible && checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility === 0 /* Accessible */; + }, + reportInaccessibleThisError: notAccessible, + reportPrivateInBaseOfClassExpression: notAccessible, + reportInaccessibleUniqueSymbolError: notAccessible, + }); + return typeIsAccessible ? res : undefined; } - function makeChange(declaration, start, type, program) { - var typeString = type && typeToString(type, declaration, program.getTypeChecker()); - return typeString === undefined ? undefined : { span: ts.createTextSpan(start, 0), newText: ": " + typeString }; + function getReferences(token, program, cancellationToken) { + // Position shouldn't matter since token is not a SourceFile. + return ts.mapDefined(ts.FindAllReferences.getReferenceEntriesForNode(-1, token, program, program.getSourceFiles(), cancellationToken), function (entry) { + return entry.type === "node" ? ts.tryCast(entry.node, ts.isIdentifier) : undefined; + }); } - function getReferences(token, sourceFile, program, cancellationToken) { - var references = ts.FindAllReferences.findReferencedSymbols(program, cancellationToken, program.getSourceFiles(), sourceFile, token.getStart(sourceFile)); - if (!references || references.length !== 1) { - return []; - } - return references[0].references.map(function (r) { return ts.getTokenAtPosition(program.getSourceFile(r.fileName), r.textSpan.start, /*includeJsDocComment*/ false); }); - } - function inferTypeForVariableFromUsage(token, sourceFile, program, cancellationToken) { - return InferFromReference.inferTypeFromReferences(getReferences(token, sourceFile, program, cancellationToken), program.getTypeChecker(), cancellationToken); + function inferTypeForVariableFromUsage(token, program, cancellationToken) { + return InferFromReference.inferTypeFromReferences(getReferences(token, program, cancellationToken), program.getTypeChecker(), cancellationToken); } function inferTypeForParametersFromUsage(containingFunction, sourceFile, program, cancellationToken) { switch (containingFunction.kind) { - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - var isConstructor = containingFunction.kind === 153 /* Constructor */; + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + var isConstructor = containingFunction.kind === 154 /* Constructor */; var searchToken = isConstructor ? ts.findChildOfKind(containingFunction, 123 /* ConstructorKeyword */, sourceFile) : containingFunction.name; if (searchToken) { - return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, sourceFile, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); + return InferFromReference.inferTypeForParametersFromReferences(getReferences(searchToken, program, cancellationToken), containingFunction, program.getTypeChecker(), cancellationToken); } } } - function getTypeAccessiblityWriter(checker) { - var str = ""; - var typeIsAccessible = true; - var writeText = function (text) { return str += text; }; - return { - getText: function () { return typeIsAccessible ? str : undefined; }, - writeKeyword: writeText, - writeOperator: writeText, - writePunctuation: writeText, - writeSpace: writeText, - writeStringLiteral: writeText, - writeParameter: writeText, - writeProperty: writeText, - writeSymbol: writeText, - write: writeText, - writeTextOfNode: writeText, - rawWrite: writeText, - writeLiteral: writeText, - getTextPos: function () { return 0; }, - getLine: function () { return 0; }, - getColumn: function () { return 0; }, - getIndent: function () { return 0; }, - isAtStartOfLine: function () { return false; }, - writeLine: function () { return writeText(" "); }, - increaseIndent: ts.noop, - decreaseIndent: ts.noop, - clear: function () { str = ""; typeIsAccessible = true; }, - trackSymbol: function (symbol, declaration, meaning) { - if (checker.isSymbolAccessible(symbol, declaration, meaning, /*shouldComputeAliasToMarkVisible*/ false).accessibility !== 0 /* Accessible */) { - typeIsAccessible = false; - } - }, - reportInaccessibleThisError: function () { typeIsAccessible = false; }, - reportPrivateInBaseOfClassExpression: function () { typeIsAccessible = false; }, - reportInaccessibleUniqueSymbolError: function () { typeIsAccessible = false; } - }; - } - function typeToString(type, enclosingDeclaration, checker) { - var writer = getTypeAccessiblityWriter(checker); - checker.writeType(type, enclosingDeclaration, /*flags*/ undefined, writer); - return writer.getText(); - } var InferFromReference; (function (InferFromReference) { function inferTypeFromReferences(references, checker, cancellationToken) { @@ -97151,40 +99949,40 @@ var ts; if (references.length === 0) { return undefined; } - if (declaration.parameters) { - var usageContext = {}; - for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { - var reference = references_2[_i]; - cancellationToken.throwIfCancellationRequested(); - inferTypeFromContext(reference, checker, usageContext); - } - var isConstructor = declaration.kind === 153 /* Constructor */; - var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; - if (callContexts) { - var paramTypes = []; - for (var parameterIndex = 0; parameterIndex < declaration.parameters.length; parameterIndex++) { - var types = []; - var isRestParameter_1 = ts.isRestParameter(declaration.parameters[parameterIndex]); - for (var _a = 0, callContexts_1 = callContexts; _a < callContexts_1.length; _a++) { - var callContext = callContexts_1[_a]; - if (callContext.argumentTypes.length > parameterIndex) { - if (isRestParameter_1) { - types = ts.concatenate(types, ts.map(callContext.argumentTypes.slice(parameterIndex), function (a) { return checker.getBaseTypeOfLiteralType(a); })); - } - else { - types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); - } - } - } - if (types.length) { - var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); - paramTypes[parameterIndex] = isRestParameter_1 ? checker.createArrayType(type) : type; + if (!declaration.parameters) { + return undefined; + } + var usageContext = {}; + for (var _i = 0, references_2 = references; _i < references_2.length; _i++) { + var reference = references_2[_i]; + cancellationToken.throwIfCancellationRequested(); + inferTypeFromContext(reference, checker, usageContext); + } + var isConstructor = declaration.kind === 154 /* Constructor */; + var callContexts = isConstructor ? usageContext.constructContexts : usageContext.callContexts; + return callContexts && declaration.parameters.map(function (parameter, parameterIndex) { + var types = []; + var isRest = ts.isRestParameter(parameter); + for (var _i = 0, callContexts_1 = callContexts; _i < callContexts_1.length; _i++) { + var callContext = callContexts_1[_i]; + if (callContext.argumentTypes.length <= parameterIndex) { + continue; + } + if (isRest) { + for (var i = parameterIndex; i < callContext.argumentTypes.length; i++) { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[i])); } } - return paramTypes; + else { + types.push(checker.getBaseTypeOfLiteralType(callContext.argumentTypes[parameterIndex])); + } } - } - return undefined; + if (!types.length) { + return undefined; + } + var type = checker.getWidenedType(checker.getUnionType(types, 2 /* Subtype */)); + return isRest ? checker.createArrayType(type) : type; + }); } InferFromReference.inferTypeForParametersFromReferences = inferTypeForParametersFromReferences; function inferTypeFromContext(node, checker, usageContext) { @@ -97192,21 +99990,21 @@ var ts; node = node.parent; } switch (node.parent.kind) { - case 194 /* PostfixUnaryExpression */: + case 197 /* PostfixUnaryExpression */: usageContext.isNumber = true; break; - case 193 /* PrefixUnaryExpression */: + case 196 /* PrefixUnaryExpression */: inferTypeFromPrefixUnaryExpressionContext(node.parent, usageContext); break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: inferTypeFromBinaryExpressionContext(node, node.parent, checker, usageContext); break; - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: inferTypeFromSwitchStatementLabelContext(node.parent, checker, usageContext); break; - case 182 /* CallExpression */: - case 183 /* NewExpression */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: if (node.parent.expression === node) { inferTypeFromCallExpressionContext(node.parent, checker, usageContext); } @@ -97214,10 +100012,10 @@ var ts; inferTypeFromContextualType(node, checker, usageContext); } break; - case 180 /* PropertyAccessExpression */: + case 183 /* PropertyAccessExpression */: inferTypeFromPropertyAccessExpressionContext(node.parent, checker, usageContext); break; - case 181 /* ElementAccessExpression */: + case 184 /* ElementAccessExpression */: inferTypeFromPropertyElementExpressionContext(node.parent, node, checker, usageContext); break; default: @@ -97240,6 +100038,8 @@ var ts; case 37 /* PlusToken */: usageContext.isNumberOrString = true; break; + // case SyntaxKind.ExclamationToken: + // no inferences here; } } function inferTypeFromBinaryExpressionContext(node, parent, checker, usageContext) { @@ -97317,7 +100117,7 @@ var ts; // LogicalOperator case 54 /* BarBarToken */: if (node === parent.left && - (node.parent.parent.kind === 227 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { + (node.parent.parent.kind === 230 /* VariableDeclaration */ || ts.isAssignmentExpression(node.parent.parent, /*excludeCompoundAssignment*/ true))) { // var x = x || {}; // TODO: use getFalsyflagsOfType addCandidateType(usageContext, checker.getTypeAtLocation(parent.right)); @@ -97345,7 +100145,7 @@ var ts; } } inferTypeFromContext(parent, checker, callContext.returnType); - if (parent.kind === 182 /* CallExpression */) { + if (parent.kind === 185 /* CallExpression */) { (usageContext.callContexts || (usageContext.callContexts = [])).push(callContext); } else { @@ -97505,31 +100305,23 @@ var ts; var opts = context.program.getCompilerOptions(); var variations = []; // import Bluebird from "bluebird"; - var replacement = ts.createImportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, ts.createImportClause(namespace.name, /*namedBindings*/ undefined), node.moduleSpecifier); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, node, replacement, { useNonAdjustedEndPosition: true }); - var changes = changeTracker.getChanges(); - variations.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), - changes: changes - }); + variations.push(createAction(context, sourceFile, node, codefix.makeImportDeclaration(namespace.name, /*namedImports*/ undefined, node.moduleSpecifier))); if (ts.getEmitModuleKind(opts) === ts.ModuleKind.CommonJS) { // import Bluebird = require("bluebird"); - var replacement_1 = ts.createImportEqualsDeclaration( + variations.push(createAction(context, sourceFile, node, ts.createImportEqualsDeclaration( /*decorators*/ undefined, - /*modifiers*/ undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)); - var changeTracker_1 = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker_1.replaceNode(sourceFile, node, replacement_1, { useNonAdjustedEndPosition: true }); - var changes_1 = changeTracker_1.getChanges(); - variations.push({ - description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes_1[0].textChanges[0].newText]), - changes: changes_1 - }); + /*modifiers*/ undefined, namespace.name, ts.createExternalModuleReference(node.moduleSpecifier)))); } return variations; } + function createAction(context, sourceFile, node, replacement) { + // TODO: GH#21246 Should be able to use `replaceNode`, but be sure to preserve comments (see `codeFixCalledES2015Import11.ts`) + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceRange(sourceFile, { pos: node.getStart(), end: node.end }, replacement); }); + return { + description: ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Replace_import_with_0), [changes[0].textChanges[0].newText]), + changes: changes, + }; + } codefix.registerCodeFix({ errorCodes: [ ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code, @@ -97539,7 +100331,7 @@ var ts; }); function getActionsForUsageOfInvalidImport(context) { var sourceFile = context.sourceFile; - var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 182 /* CallExpression */ : 183 /* NewExpression */; + var targetKind = ts.Diagnostics.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures.code === context.errorCode ? 185 /* CallExpression */ : 186 /* NewExpression */; var node = ts.findAncestor(ts.getTokenAtPosition(sourceFile, context.span.start, /*includeJsDocComment*/ false), function (a) { return a.kind === targetKind && a.getStart() === context.span.start && a.getEnd() === (context.span.start + context.span.length); }); if (!node) { return []; @@ -97554,19 +100346,179 @@ var ts; if (!ts.isImportCall(relatedImport)) { ts.addRange(fixes, getCodeFixesForImportDeclaration(context, relatedImport)); } - var propertyAccess = ts.createPropertyAccess(expr, "default"); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - changeTracker.replaceNode(sourceFile, expr, propertyAccess, {}); - var changes = changeTracker.getChanges(); fixes.push({ description: ts.getLocaleSpecificMessage(ts.Diagnostics.Use_synthetic_default_member), - changes: changes + changes: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(sourceFile, expr, ts.createPropertyAccess(expr, "default"), {}); }), }); return fixes; } })(codefix = ts.codefix || (ts.codefix = {})); })(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixIdAddDefiniteAssignmentAssertions = "addMissingPropertyDefiniteAssignmentAssertions"; + var fixIdAddUndefinedType = "addMissingPropertyUndefinedType"; + var fixIdAddInitializer = "addMissingPropertyInitializer"; + var errorCodes = [ts.Diagnostics.Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var propertyDeclaration = getPropertyDeclaration(context.sourceFile, context.span.start); + if (!propertyDeclaration) + return; + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + var result = [ + getActionForAddMissingUndefinedType(context, propertyDeclaration), + getActionForAddMissingDefiniteAssignmentAssertion(context, propertyDeclaration, newLineCharacter) + ]; + ts.append(result, getActionForAddMissingInitializer(context, propertyDeclaration, newLineCharacter)); + return result; + }, + fixIds: [fixIdAddDefiniteAssignmentAssertions, fixIdAddUndefinedType, fixIdAddInitializer], + getAllCodeActions: function (context) { + var newLineCharacter = ts.getNewLineOrDefaultFromHost(context.host, context.formatContext.options); + return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var propertyDeclaration = getPropertyDeclaration(diag.file, diag.start); + if (!propertyDeclaration) + return; + switch (context.fixId) { + case fixIdAddDefiniteAssignmentAssertions: + addDefiniteAssignmentAssertion(changes, diag.file, propertyDeclaration, newLineCharacter); + break; + case fixIdAddUndefinedType: + addUndefinedType(changes, diag.file, propertyDeclaration); + break; + case fixIdAddInitializer: + var checker = context.program.getTypeChecker(); + var initializer = getInitializer(checker, propertyDeclaration); + if (!initializer) + return; + addInitializer(changes, diag.file, propertyDeclaration, initializer, newLineCharacter); + break; + default: + ts.Debug.fail(JSON.stringify(context.fixId)); + } + }); + }, + }); + function getPropertyDeclaration(sourceFile, pos) { + var token = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + return ts.isIdentifier(token) ? ts.cast(token.parent, ts.isPropertyDeclaration) : undefined; + } + function getActionForAddMissingDefiniteAssignmentAssertion(context, propertyDeclaration, newLineCharacter) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_definite_assignment_assertion_to_property_0), [propertyDeclaration.getText()]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addDefiniteAssignmentAssertion(t, context.sourceFile, propertyDeclaration, newLineCharacter); }); + return { description: description, changes: changes, fixId: fixIdAddDefiniteAssignmentAssertions }; + } + function addDefiniteAssignmentAssertion(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, newLineCharacter) { + var property = ts.updateProperty(propertyDeclaration, propertyDeclaration.decorators, propertyDeclaration.modifiers, propertyDeclaration.name, ts.createToken(51 /* ExclamationToken */), propertyDeclaration.type, propertyDeclaration.initializer); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property, { suffix: newLineCharacter }); + } + function getActionForAddMissingUndefinedType(context, propertyDeclaration) { + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_undefined_type_to_property_0), [propertyDeclaration.name.getText()]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addUndefinedType(t, context.sourceFile, propertyDeclaration); }); + return { description: description, changes: changes, fixId: fixIdAddUndefinedType }; + } + function addUndefinedType(changeTracker, propertyDeclarationSourceFile, propertyDeclaration) { + var undefinedTypeNode = ts.createKeywordTypeNode(140 /* UndefinedKeyword */); + var types = ts.isUnionTypeNode(propertyDeclaration.type) ? propertyDeclaration.type.types.concat(undefinedTypeNode) : [propertyDeclaration.type, undefinedTypeNode]; + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration.type, ts.createUnionTypeNode(types)); + } + function getActionForAddMissingInitializer(context, propertyDeclaration, newLineCharacter) { + var checker = context.program.getTypeChecker(); + var initializer = getInitializer(checker, propertyDeclaration); + if (!initializer) + return undefined; + var description = ts.formatStringFromArgs(ts.getLocaleSpecificMessage(ts.Diagnostics.Add_initializer_to_property_0), [propertyDeclaration.name.getText()]); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return addInitializer(t, context.sourceFile, propertyDeclaration, initializer, newLineCharacter); }); + return { description: description, changes: changes, fixId: fixIdAddInitializer }; + } + function addInitializer(changeTracker, propertyDeclarationSourceFile, propertyDeclaration, initializer, newLineCharacter) { + var property = ts.updateProperty(propertyDeclaration, propertyDeclaration.decorators, propertyDeclaration.modifiers, propertyDeclaration.name, propertyDeclaration.questionToken, propertyDeclaration.type, initializer); + changeTracker.replaceNode(propertyDeclarationSourceFile, propertyDeclaration, property, { suffix: newLineCharacter }); + } + function getInitializer(checker, propertyDeclaration) { + return getDefaultValueFromType(checker, checker.getTypeFromTypeNode(propertyDeclaration.type)); + } + function getDefaultValueFromType(checker, type) { + if (type.flags & 2 /* String */) { + return ts.createLiteral(""); + } + else if (type.flags & 4 /* Number */) { + return ts.createNumericLiteral("0"); + } + else if (type.flags & 8 /* Boolean */) { + return ts.createFalse(); + } + else if (type.flags & 224 /* Literal */) { + return ts.createLiteral(type.value); + } + else if (type.flags & 131072 /* Union */) { + return ts.firstDefined(type.types, function (t) { return getDefaultValueFromType(checker, t); }); + } + else if (ts.getObjectFlags(type) & 1 /* Class */) { + var classDeclaration = ts.getClassLikeDeclarationOfSymbol(type.symbol); + if (!classDeclaration || ts.hasModifier(classDeclaration, 128 /* Abstract */)) + return undefined; + var constructorDeclaration = ts.find(classDeclaration.members, function (m) { return ts.isConstructorDeclaration(m) && !!m.body; }); + if (constructorDeclaration && constructorDeclaration.parameters.length) + return undefined; + return ts.createNew(ts.createIdentifier(type.symbol.name), /*typeArguments*/ undefined, /*argumentsArray*/ undefined); + } + return undefined; + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); +/* @internal */ +var ts; +(function (ts) { + var codefix; + (function (codefix) { + var fixId = "useDefaultImport"; + var errorCodes = [ts.Diagnostics.Import_may_be_converted_to_a_default_import.code]; + codefix.registerCodeFix({ + errorCodes: errorCodes, + getCodeActions: function (context) { + var sourceFile = context.sourceFile, start = context.span.start; + var info = getInfo(sourceFile, start); + if (!info) + return undefined; + var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); + var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, info); }); + return [{ description: description, changes: changes, fixId: fixId }]; + }, + fixIds: [fixId], + getAllCodeActions: function (context) { return codefix.codeFixAll(context, errorCodes, function (changes, diag) { + var info = getInfo(diag.file, diag.start); + if (info) + doChange(changes, diag.file, info); + }); }, + }); + function getInfo(sourceFile, pos) { + var name = ts.getTokenAtPosition(sourceFile, pos, /*includeJsDocComment*/ false); + if (!ts.isIdentifier(name)) + return undefined; // bad input + var parent = name.parent; + if (ts.isImportEqualsDeclaration(parent) && ts.isExternalModuleReference(parent.moduleReference)) { + return { importNode: parent, name: name, moduleSpecifier: parent.moduleReference.expression }; + } + else if (ts.isNamespaceImport(parent)) { + var importNode = parent.parent.parent; + return { importNode: importNode, name: name, moduleSpecifier: importNode.moduleSpecifier }; + } + } + function doChange(changes, sourceFile, info) { + changes.replaceNode(sourceFile, info.importNode, codefix.makeImportDeclaration(info.name, /*namedImports*/ undefined, info.moduleSpecifier)); + } + })(codefix = ts.codefix || (ts.codefix = {})); +})(ts || (ts = {})); /// +/// +/// +/// /// /// /// @@ -97585,953 +100537,8 @@ var ts; /// /// /// -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var annotateWithTypeFromJSDoc; - (function (annotateWithTypeFromJSDoc) { - var refactorName = "Annotate with type from JSDoc"; - var actionName = "annotate"; - var description = ts.Diagnostics.Annotate_with_type_from_JSDoc.message; - refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - if (ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var node = ts.getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false); - if (hasUsableJSDoc(ts.findAncestor(node, isDeclarationWithType))) { - return [{ - name: refactorName, - description: description, - actions: [ - { - description: description, - name: actionName - } - ] - }]; - } - } - function hasUsableJSDoc(decl) { - if (!decl) { - return false; - } - if (ts.isFunctionLikeDeclaration(decl)) { - return decl.parameters.some(hasUsableJSDoc) || (!decl.type && !!ts.getJSDocReturnType(decl)); - } - return !decl.type && !!ts.getJSDocType(decl); - } - function getEditsForAction(context, action) { - if (actionName !== action) { - return ts.Debug.fail("actionName !== action: " + actionName + " !== " + action); - } - var node = ts.getTokenAtPosition(context.file, context.startPosition, /*includeJsDocComment*/ false); - var decl = ts.findAncestor(node, isDeclarationWithType); - if (!decl || decl.type) { - return undefined; - } - var jsdocType = ts.getJSDocType(decl); - var isFunctionWithJSDoc = ts.isFunctionLikeDeclaration(decl) && (ts.getJSDocReturnType(decl) || decl.parameters.some(function (p) { return !!ts.getJSDocType(p); })); - if (isFunctionWithJSDoc || jsdocType && decl.kind === 147 /* Parameter */) { - return getEditsForFunctionAnnotation(context); - } - else if (jsdocType) { - return getEditsForAnnotation(context); - } - else { - ts.Debug.assert(!!refactor, "No applicable refactor found."); - } - } - function getEditsForAnnotation(context) { - var sourceFile = context.file; - var token = ts.getTokenAtPosition(sourceFile, context.startPosition, /*includeJsDocComment*/ false); - var decl = ts.findAncestor(token, isDeclarationWithType); - var jsdocType = ts.getJSDocType(decl); - if (!decl || !jsdocType || decl.type) { - return ts.Debug.fail("!decl || !jsdocType || decl.type: !" + decl + " || !" + jsdocType + " || " + decl.type); - } - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var declarationWithType = addType(decl, transformJSDocType(jsdocType)); - ts.suppressLeadingAndTrailingTrivia(declarationWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, declarationWithType); - return { - edits: changeTracker.getChanges(), - renameFilename: undefined, - renameLocation: undefined - }; - } - function getEditsForFunctionAnnotation(context) { - var sourceFile = context.file; - var token = ts.getTokenAtPosition(sourceFile, context.startPosition, /*includeJsDocComment*/ false); - var decl = ts.findAncestor(token, ts.isFunctionLikeDeclaration); - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var functionWithType = addTypesToFunctionLike(decl); - ts.suppressLeadingAndTrailingTrivia(functionWithType); - changeTracker.replaceRange(sourceFile, { pos: decl.getStart(), end: decl.end }, functionWithType); - return { - edits: changeTracker.getChanges(), - renameFilename: undefined, - renameLocation: undefined - }; - } - function isDeclarationWithType(node) { - return ts.isFunctionLikeDeclaration(node) || - node.kind === 227 /* VariableDeclaration */ || - node.kind === 147 /* Parameter */ || - node.kind === 149 /* PropertySignature */ || - node.kind === 150 /* PropertyDeclaration */; - } - function addTypesToFunctionLike(decl) { - var typeParameters = ts.getEffectiveTypeParameterDeclarations(decl, /*checkJSDoc*/ true); - var parameters = decl.parameters.map(function (p) { return ts.createParameter(p.decorators, p.modifiers, p.dotDotDotToken, p.name, p.questionToken, transformJSDocType(ts.getEffectiveTypeAnnotationNode(p, /*checkJSDoc*/ true)), p.initializer); }); - var returnType = transformJSDocType(ts.getEffectiveReturnTypeNode(decl, /*checkJSDoc*/ true)); - switch (decl.kind) { - case 229 /* FunctionDeclaration */: - return ts.createFunctionDeclaration(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 153 /* Constructor */: - return ts.createConstructor(decl.decorators, decl.modifiers, parameters, decl.body); - case 187 /* FunctionExpression */: - return ts.createFunctionExpression(decl.modifiers, decl.asteriskToken, decl.name, typeParameters, parameters, returnType, decl.body); - case 188 /* ArrowFunction */: - return ts.createArrowFunction(decl.modifiers, typeParameters, parameters, returnType, decl.equalsGreaterThanToken, decl.body); - case 152 /* MethodDeclaration */: - return ts.createMethod(decl.decorators, decl.modifiers, decl.asteriskToken, decl.name, decl.questionToken, typeParameters, parameters, returnType, decl.body); - case 154 /* GetAccessor */: - return ts.createGetAccessor(decl.decorators, decl.modifiers, decl.name, decl.parameters, returnType, decl.body); - case 155 /* SetAccessor */: - return ts.createSetAccessor(decl.decorators, decl.modifiers, decl.name, parameters, decl.body); - default: - return ts.Debug.assertNever(decl, "Unexpected SyntaxKind: " + decl.kind); - } - } - function addType(decl, jsdocType) { - switch (decl.kind) { - case 227 /* VariableDeclaration */: - return ts.createVariableDeclaration(decl.name, jsdocType, decl.initializer); - case 149 /* PropertySignature */: - return ts.createPropertySignature(decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); - case 150 /* PropertyDeclaration */: - return ts.createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer); - default: - return ts.Debug.fail("Unexpected SyntaxKind: " + decl.kind); - } - } - function transformJSDocType(node) { - if (node === undefined) { - return undefined; - } - switch (node.kind) { - case 272 /* JSDocAllType */: - case 273 /* JSDocUnknownType */: - return ts.createTypeReferenceNode("any", ts.emptyArray); - case 276 /* JSDocOptionalType */: - return transformJSDocOptionalType(node); - case 275 /* JSDocNonNullableType */: - return transformJSDocType(node.type); - case 274 /* JSDocNullableType */: - return transformJSDocNullableType(node); - case 278 /* JSDocVariadicType */: - return transformJSDocVariadicType(node); - case 277 /* JSDocFunctionType */: - return transformJSDocFunctionType(node); - case 147 /* Parameter */: - return transformJSDocParameter(node); - case 160 /* TypeReference */: - return transformJSDocTypeReference(node); - default: - var visited = ts.visitEachChild(node, transformJSDocType, /*context*/ undefined); - ts.setEmitFlags(visited, 1 /* SingleLine */); - return visited; - } - } - function transformJSDocOptionalType(node) { - return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("undefined", ts.emptyArray)]); - } - function transformJSDocNullableType(node) { - return ts.createUnionTypeNode([ts.visitNode(node.type, transformJSDocType), ts.createTypeReferenceNode("null", ts.emptyArray)]); - } - function transformJSDocVariadicType(node) { - return ts.createArrayTypeNode(ts.visitNode(node.type, transformJSDocType)); - } - function transformJSDocFunctionType(node) { - var parameters = node.parameters && node.parameters.map(transformJSDocType); - return ts.createFunctionTypeNode(ts.emptyArray, parameters, node.type); - } - function transformJSDocParameter(node) { - var index = node.parent.parameters.indexOf(node); - var isRest = node.type.kind === 278 /* JSDocVariadicType */ && index === node.parent.parameters.length - 1; - var name = node.name || (isRest ? "rest" : "arg" + index); - var dotdotdot = isRest ? ts.createToken(24 /* DotDotDotToken */) : node.dotDotDotToken; - return ts.createParameter(node.decorators, node.modifiers, dotdotdot, name, node.questionToken, ts.visitNode(node.type, transformJSDocType), node.initializer); - } - function transformJSDocTypeReference(node) { - var name = node.typeName; - var args = node.typeArguments; - if (ts.isIdentifier(node.typeName)) { - if (ts.isJSDocIndexSignature(node)) { - return transformJSDocIndexSignature(node); - } - var text = node.typeName.text; - switch (node.typeName.text) { - case "String": - case "Boolean": - case "Object": - case "Number": - text = text.toLowerCase(); - break; - case "array": - case "date": - case "promise": - text = text[0].toUpperCase() + text.slice(1); - break; - } - name = ts.createIdentifier(text); - if ((text === "Array" || text === "Promise") && !node.typeArguments) { - args = ts.createNodeArray([ts.createTypeReferenceNode("any", ts.emptyArray)]); - } - else { - args = ts.visitNodes(node.typeArguments, transformJSDocType); - } - } - return ts.createTypeReferenceNode(name, args); - } - function transformJSDocIndexSignature(node) { - var index = ts.createParameter( - /*decorators*/ undefined, - /*modifiers*/ undefined, - /*dotDotDotToken*/ undefined, node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "n" : "s", - /*questionToken*/ undefined, ts.createTypeReferenceNode(node.typeArguments[0].kind === 133 /* NumberKeyword */ ? "number" : "string", []), - /*initializer*/ undefined); - var indexSignature = ts.createTypeLiteralNode([ts.createIndexSignature(/*decorators*/ undefined, /*modifiers*/ undefined, [index], node.typeArguments[1])]); - ts.setEmitFlags(indexSignature, 1 /* SingleLine */); - return indexSignature; - } - })(annotateWithTypeFromJSDoc = refactor.annotateWithTypeFromJSDoc || (refactor.annotateWithTypeFromJSDoc = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var convertFunctionToES6Class; - (function (convertFunctionToES6Class) { - var refactorName = "Convert to ES2015 class"; - var actionName = "convert"; - var description = ts.Diagnostics.Convert_function_to_an_ES2015_class.message; - refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - if (!ts.isInJavaScriptFile(context.file)) { - return undefined; - } - var symbol = getConstructorSymbol(context); - if (!symbol) { - return undefined; - } - if (ts.isDeclarationOfFunctionOrClassExpression(symbol)) { - symbol = symbol.valueDeclaration.initializer.symbol; - } - if ((symbol.flags & 16 /* Function */) && symbol.members && (symbol.members.size > 0)) { - return [ - { - name: refactorName, - description: description, - actions: [ - { - description: description, - name: actionName - } - ] - } - ]; - } - } - function getEditsForAction(context, action) { - // Somehow wrong action got invoked? - if (actionName !== action) { - return undefined; - } - var sourceFile = context.file; - var ctorSymbol = getConstructorSymbol(context); - var deletedNodes = []; - var deletes = []; - if (!(ctorSymbol.flags & (16 /* Function */ | 3 /* Variable */))) { - return undefined; - } - var ctorDeclaration = ctorSymbol.valueDeclaration; - var changeTracker = ts.textChanges.ChangeTracker.fromContext(context); - var precedingNode; - var newClassDeclaration; - switch (ctorDeclaration.kind) { - case 229 /* FunctionDeclaration */: - precedingNode = ctorDeclaration; - deleteNode(ctorDeclaration); - newClassDeclaration = createClassFromFunctionDeclaration(ctorDeclaration); - break; - case 227 /* VariableDeclaration */: - precedingNode = ctorDeclaration.parent.parent; - if (ctorDeclaration.parent.declarations.length === 1) { - deleteNode(precedingNode); - } - else { - deleteNode(ctorDeclaration, /*inList*/ true); - } - newClassDeclaration = createClassFromVariableDeclaration(ctorDeclaration); - break; - } - if (!newClassDeclaration) { - return undefined; - } - // Because the preceding node could be touched, we need to insert nodes before delete nodes. - changeTracker.insertNodeAfter(sourceFile, precedingNode, newClassDeclaration); - for (var _i = 0, deletes_1 = deletes; _i < deletes_1.length; _i++) { - var deleteCallback = deletes_1[_i]; - deleteCallback(); - } - return { - edits: changeTracker.getChanges(), - renameFilename: undefined, - renameLocation: undefined, - }; - function deleteNode(node, inList) { - if (inList === void 0) { inList = false; } - if (deletedNodes.some(function (n) { return ts.isNodeDescendantOf(node, n); })) { - // Parent node has already been deleted; do nothing - return; - } - deletedNodes.push(node); - if (inList) { - deletes.push(function () { return changeTracker.deleteNodeInList(sourceFile, node); }); - } - else { - deletes.push(function () { return changeTracker.deleteNode(sourceFile, node); }); - } - } - function createClassElementsFromSymbol(symbol) { - var memberElements = []; - // all instance members are stored in the "member" array of symbol - if (symbol.members) { - symbol.members.forEach(function (member) { - var memberElement = createClassElement(member, /*modifiers*/ undefined); - if (memberElement) { - memberElements.push(memberElement); - } - }); - } - // all static members are stored in the "exports" array of symbol - if (symbol.exports) { - symbol.exports.forEach(function (member) { - var memberElement = createClassElement(member, [ts.createToken(115 /* StaticKeyword */)]); - if (memberElement) { - memberElements.push(memberElement); - } - }); - } - return memberElements; - function shouldConvertDeclaration(_target, source) { - // Right now the only thing we can convert are function expressions - other values shouldn't get - // transformed. We can update this once ES public class properties are available. - return ts.isFunctionLike(source); - } - function createClassElement(symbol, modifiers) { - // both properties and methods are bound as property symbols - if (!(symbol.flags & 4 /* Property */)) { - return; - } - var memberDeclaration = symbol.valueDeclaration; - var assignmentBinaryExpression = memberDeclaration.parent; - if (!shouldConvertDeclaration(memberDeclaration, assignmentBinaryExpression.right)) { - return; - } - // delete the entire statement if this expression is the sole expression to take care of the semicolon at the end - var nodeToDelete = assignmentBinaryExpression.parent && assignmentBinaryExpression.parent.kind === 211 /* ExpressionStatement */ - ? assignmentBinaryExpression.parent : assignmentBinaryExpression; - deleteNode(nodeToDelete); - if (!assignmentBinaryExpression.right) { - return ts.createProperty([], modifiers, symbol.name, /*questionToken*/ undefined, - /*type*/ undefined, /*initializer*/ undefined); - } - switch (assignmentBinaryExpression.right.kind) { - case 187 /* FunctionExpression */: { - var functionExpression = assignmentBinaryExpression.right; - var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(functionExpression, 120 /* AsyncKeyword */)); - var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, functionExpression.parameters, /*type*/ undefined, functionExpression.body); - copyComments(assignmentBinaryExpression, method); - return method; - } - case 188 /* ArrowFunction */: { - var arrowFunction = assignmentBinaryExpression.right; - var arrowFunctionBody = arrowFunction.body; - var bodyBlock = void 0; - // case 1: () => { return [1,2,3] } - if (arrowFunctionBody.kind === 208 /* Block */) { - bodyBlock = arrowFunctionBody; - } - else { - var expression = arrowFunctionBody; - bodyBlock = ts.createBlock([ts.createReturn(expression)]); - } - var fullModifiers = ts.concatenate(modifiers, getModifierKindFromSource(arrowFunction, 120 /* AsyncKeyword */)); - var method = ts.createMethod(/*decorators*/ undefined, fullModifiers, /*asteriskToken*/ undefined, memberDeclaration.name, /*questionToken*/ undefined, - /*typeParameters*/ undefined, arrowFunction.parameters, /*type*/ undefined, bodyBlock); - copyComments(assignmentBinaryExpression, method); - return method; - } - default: { - // Don't try to declare members in JavaScript files - if (ts.isSourceFileJavaScript(sourceFile)) { - return; - } - var prop = ts.createProperty(/*decorators*/ undefined, modifiers, memberDeclaration.name, /*questionToken*/ undefined, - /*type*/ undefined, assignmentBinaryExpression.right); - copyComments(assignmentBinaryExpression.parent, prop); - return prop; - } - } - } - } - function copyComments(sourceNode, targetNode) { - ts.forEachLeadingCommentRange(sourceFile.text, sourceNode.pos, function (pos, end, kind, htnl) { - if (kind === 3 /* MultiLineCommentTrivia */) { - // Remove leading /* - pos += 2; - // Remove trailing */ - end -= 2; - } - else { - // Remove leading // - pos += 2; - } - ts.addSyntheticLeadingComment(targetNode, kind, sourceFile.text.slice(pos, end), htnl); - }); - } - function createClassFromVariableDeclaration(node) { - var initializer = node.initializer; - if (!initializer || initializer.kind !== 187 /* FunctionExpression */) { - return undefined; - } - if (node.name.kind !== 71 /* Identifier */) { - return undefined; - } - var memberElements = createClassElementsFromSymbol(initializer.symbol); - if (initializer.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, initializer.parameters, initializer.body)); - } - var modifiers = getModifierKindFromSource(precedingNode, 84 /* ExportKeyword */); - var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; - } - function createClassFromFunctionDeclaration(node) { - var memberElements = createClassElementsFromSymbol(ctorSymbol); - if (node.body) { - memberElements.unshift(ts.createConstructor(/*decorators*/ undefined, /*modifiers*/ undefined, node.parameters, node.body)); - } - var modifiers = getModifierKindFromSource(node, 84 /* ExportKeyword */); - var cls = ts.createClassDeclaration(/*decorators*/ undefined, modifiers, node.name, - /*typeParameters*/ undefined, /*heritageClauses*/ undefined, memberElements); - // Don't call copyComments here because we'll already leave them in place - return cls; - } - function getModifierKindFromSource(source, kind) { - return ts.filter(source.modifiers, function (modifier) { return modifier.kind === kind; }); - } - } - function getConstructorSymbol(_a) { - var startPosition = _a.startPosition, file = _a.file, program = _a.program; - var checker = program.getTypeChecker(); - var token = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - return checker.getSymbolAtLocation(token); - } - })(convertFunctionToES6Class = refactor.convertFunctionToES6Class || (refactor.convertFunctionToES6Class = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var actionName = "Convert to ES6 module"; - var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_ES6_module); - refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - var file = context.file, startPosition = context.startPosition; - if (!ts.isSourceFileJavaScript(file) || !file.commonJsModuleIndicator) { - return undefined; - } - var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - return !isAtTriggerLocation(file, node) ? undefined : [ - { - name: actionName, - description: description, - actions: [ - { - description: description, - name: actionName, - }, - ], - }, - ]; - } - function isAtTriggerLocation(sourceFile, node, onSecondTry) { - if (onSecondTry === void 0) { onSecondTry = false; } - switch (node.kind) { - case 182 /* CallExpression */: - return isAtTopLevelRequire(node); - case 180 /* PropertyAccessExpression */: - return ts.isExportsOrModuleExportsOrAlias(sourceFile, node) - || ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression); - case 228 /* VariableDeclarationList */: - var decl = node.declarations[0]; - return ts.isExportsOrModuleExportsOrAlias(sourceFile, decl.initializer); - case 227 /* VariableDeclaration */: - return ts.isExportsOrModuleExportsOrAlias(sourceFile, node.initializer); - default: - return ts.isExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node) - || !onSecondTry && isAtTriggerLocation(sourceFile, node.parent, /*onSecondTry*/ true); - } - } - function isAtTopLevelRequire(call) { - if (!ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ true)) { - return false; - } - var propAccess = call.parent; - var varDecl = ts.isPropertyAccessExpression(propAccess) ? propAccess.parent : propAccess; - if (ts.isExpressionStatement(varDecl) && ts.isSourceFile(varDecl.parent)) { - return true; - } - if (!ts.isVariableDeclaration(varDecl)) { - return false; - } - var varDeclList = varDecl.parent; - if (varDeclList.kind !== 228 /* VariableDeclarationList */) { - return false; - } - var varStatement = varDeclList.parent; - return varStatement.kind === 209 /* VariableStatement */ && varStatement.parent.kind === 269 /* SourceFile */; - } - function getEditsForAction(context, _actionName) { - ts.Debug.assertEqual(actionName, _actionName); - var file = context.file, program = context.program; - ts.Debug.assert(ts.isSourceFileJavaScript(file)); - var edits = ts.textChanges.ChangeTracker.with(context, function (changes) { - var moduleExportsChangedToDefault = convertFileToEs6Module(file, program.getTypeChecker(), changes, program.getCompilerOptions().target); - if (moduleExportsChangedToDefault) { - for (var _i = 0, _a = program.getSourceFiles(); _i < _a.length; _i++) { - var importingFile = _a[_i]; - fixImportOfModuleExports(importingFile, file, changes); - } - } - }); - return { edits: edits, renameFilename: undefined, renameLocation: undefined }; - } - function fixImportOfModuleExports(importingFile, exportingFile, changes) { - for (var _i = 0, _a = importingFile.imports; _i < _a.length; _i++) { - var moduleSpecifier = _a[_i]; - var imported = ts.getResolvedModule(importingFile, moduleSpecifier.text); - if (!imported || imported.resolvedFileName !== exportingFile.fileName) { - continue; - } - var parent = moduleSpecifier.parent; - switch (parent.kind) { - case 249 /* ExternalModuleReference */: { - var importEq = parent.parent; - changes.replaceNode(importingFile, importEq, makeImport(importEq.name, /*namedImports*/ undefined, moduleSpecifier.text)); - break; - } - case 182 /* CallExpression */: { - var call = parent; - if (ts.isRequireCall(call, /*checkArgumentIsStringLiteral*/ false)) { - changes.replaceNode(importingFile, parent, ts.createPropertyAccess(ts.getSynthesizedDeepClone(call), "default")); - } - break; - } - } - } - } - /** @returns Whether we converted a `module.exports =` to a default export. */ - function convertFileToEs6Module(sourceFile, checker, changes, target) { - var identifiers = { original: collectFreeIdentifiers(sourceFile), additional: ts.createMap() }; - var exports = collectExportRenames(sourceFile, checker, identifiers); - convertExportsAccesses(sourceFile, exports, changes); - var moduleExportsChangedToDefault = false; - for (var _i = 0, _a = sourceFile.statements; _i < _a.length; _i++) { - var statement = _a[_i]; - var moduleExportsChanged = convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports); - moduleExportsChangedToDefault = moduleExportsChangedToDefault || moduleExportsChanged; - } - return moduleExportsChangedToDefault; - } - function collectExportRenames(sourceFile, checker, identifiers) { - var res = ts.createMap(); - forEachExportReference(sourceFile, function (node) { - var _a = node.name, text = _a.text, originalKeywordKind = _a.originalKeywordKind; - if (!res.has(text) && (originalKeywordKind !== undefined && ts.isNonContextualKeyword(originalKeywordKind) - || checker.resolveName(node.name.text, node, 107455 /* Value */, /*excludeGlobals*/ true))) { - // Unconditionally add an underscore in case `text` is a keyword. - res.set(text, makeUniqueName("_" + text, identifiers)); - } - }); - return res; - } - function convertExportsAccesses(sourceFile, exports, changes) { - forEachExportReference(sourceFile, function (node, isAssignmentLhs) { - if (isAssignmentLhs) { - return; - } - var text = node.name.text; - changes.replaceNode(sourceFile, node, ts.createIdentifier(exports.get(text) || text)); - }); - } - function forEachExportReference(sourceFile, cb) { - sourceFile.forEachChild(function recur(node) { - if (ts.isPropertyAccessExpression(node) && ts.isExportsOrModuleExportsOrAlias(sourceFile, node.expression)) { - var parent = node.parent; - cb(node, ts.isBinaryExpression(parent) && parent.left === node && parent.operatorToken.kind === 58 /* EqualsToken */); - } - node.forEachChild(recur); - }); - } - function convertStatement(sourceFile, statement, checker, changes, identifiers, target, exports) { - switch (statement.kind) { - case 209 /* VariableStatement */: - convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target); - return false; - case 211 /* ExpressionStatement */: { - var expression = statement.expression; - switch (expression.kind) { - case 182 /* CallExpression */: { - if (ts.isRequireCall(expression, /*checkArgumentIsStringLiteral*/ true)) { - // For side-effecting require() call, just make a side-effecting import. - changes.replaceNode(sourceFile, statement, makeImport(/*name*/ undefined, /*namedImports*/ undefined, expression.arguments[0].text)); - } - return false; - } - case 195 /* BinaryExpression */: { - var _a = expression, left = _a.left, operatorToken = _a.operatorToken, right = _a.right; - return operatorToken.kind === 58 /* EqualsToken */ && convertAssignment(sourceFile, checker, statement, left, right, changes, exports); - } - } - } - // falls through - default: - return false; - } - } - function convertVariableStatement(sourceFile, statement, changes, checker, identifiers, target) { - var declarationList = statement.declarationList; - var foundImport = false; - var newNodes = ts.flatMap(declarationList.declarations, function (decl) { - var name = decl.name, initializer = decl.initializer; - if (ts.isExportsOrModuleExportsOrAlias(sourceFile, initializer)) { - // `const alias = module.exports;` can be removed. - foundImport = true; - return []; - } - if (ts.isRequireCall(initializer, /*checkArgumentIsStringLiteral*/ true)) { - foundImport = true; - return convertSingleImport(sourceFile, name, initializer.arguments[0].text, changes, checker, identifiers, target); - } - else if (ts.isPropertyAccessExpression(initializer) && ts.isRequireCall(initializer.expression, /*checkArgumentIsStringLiteral*/ true)) { - foundImport = true; - return convertPropertyAccessImport(name, initializer.name.text, initializer.expression.arguments[0].text, identifiers); - } - else { - // Move it out to its own variable statement. - return ts.createVariableStatement(/*modifiers*/ undefined, ts.createVariableDeclarationList([decl], declarationList.flags)); - } - }); - if (foundImport) { - // useNonAdjustedEndPosition to ensure we don't eat the newline after the statement. - changes.replaceNodeWithNodes(sourceFile, statement, newNodes); - } - } - /** Converts `const name = require("moduleSpecifier").propertyName` */ - function convertPropertyAccessImport(name, propertyName, moduleSpecifier, identifiers) { - switch (name.kind) { - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: { - // `const [a, b] = require("c").d` --> `import { d } from "c"; const [a, b] = d;` - var tmp = makeUniqueName(propertyName, identifiers); - return [ - makeSingleImport(tmp, propertyName, moduleSpecifier), - makeConst(/*modifiers*/ undefined, name, ts.createIdentifier(tmp)), - ]; - } - case 71 /* Identifier */: - // `const a = require("b").c` --> `import { c as a } from "./b"; - return [makeSingleImport(name.text, propertyName, moduleSpecifier)]; - default: - ts.Debug.assertNever(name); - } - } - function convertAssignment(sourceFile, checker, statement, left, right, changes, exports) { - if (!ts.isPropertyAccessExpression(left)) { - return false; - } - if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left)) { - if (ts.isExportsOrModuleExportsOrAlias(sourceFile, right)) { - // `const alias = module.exports;` or `module.exports = alias;` can be removed. - changes.deleteNode(sourceFile, statement); - } - else { - var newNodes = ts.isObjectLiteralExpression(right) ? tryChangeModuleExportsObject(right) : undefined; - var changedToDefaultExport = false; - if (!newNodes) { - (_a = convertModuleExportsToExportDefault(right, checker), newNodes = _a[0], changedToDefaultExport = _a[1]); - } - changes.replaceNodeWithNodes(sourceFile, statement, newNodes); - return changedToDefaultExport; - } - } - else if (ts.isExportsOrModuleExportsOrAlias(sourceFile, left.expression)) { - convertNamedExport(sourceFile, statement, left.name, right, changes, exports); - } - return false; - var _a; - } - /** - * Convert `module.exports = { ... }` to individual exports.. - * We can't always do this if the module has interesting members -- then it will be a default export instead. - */ - function tryChangeModuleExportsObject(object) { - return ts.mapAllOrFail(object.properties, function (prop) { - switch (prop.kind) { - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - // TODO: Maybe we should handle this? See fourslash test `refactorConvertToEs6Module_export_object_shorthand.ts`. - case 266 /* ShorthandPropertyAssignment */: - case 267 /* SpreadAssignment */: - return undefined; - case 265 /* PropertyAssignment */: { - var _a = prop, name = _a.name, initializer = _a.initializer; - return !ts.isIdentifier(name) ? undefined : convertExportsDotXEquals(name.text, initializer); - } - case 152 /* MethodDeclaration */: { - var m = prop; - return !ts.isIdentifier(m.name) ? undefined : functionExpressionToDeclaration(m.name.text, [ts.createToken(84 /* ExportKeyword */)], m); - } - default: - ts.Debug.assertNever(prop); - } - }); - } - function convertNamedExport(sourceFile, statement, propertyName, right, changes, exports) { - // If "originalKeywordKind" was set, this is e.g. `exports. - var text = propertyName.text; - var rename = exports.get(text); - if (rename !== undefined) { - /* - const _class = 0; - export { _class as class }; - */ - var newNodes = [ - makeConst(/*modifiers*/ undefined, rename, right), - makeExportDeclaration([ts.createExportSpecifier(rename, text)]), - ]; - changes.replaceNodeWithNodes(sourceFile, statement, newNodes); - } - else { - changes.replaceNode(sourceFile, statement, convertExportsDotXEquals(text, right), { useNonAdjustedEndPosition: true }); - } - } - function convertModuleExportsToExportDefault(exported, checker) { - var modifiers = [ts.createToken(84 /* ExportKeyword */), ts.createToken(79 /* DefaultKeyword */)]; - switch (exported.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: { - // `module.exports = function f() {}` --> `export default function f() {}` - var fn = exported; - return [[functionExpressionToDeclaration(fn.name && fn.name.text, modifiers, fn)], true]; - } - case 200 /* ClassExpression */: { - // `module.exports = class C {}` --> `export default class C {}` - var cls = exported; - return [[classExpressionToDeclaration(cls.name && cls.name.text, modifiers, cls)], true]; - } - case 182 /* CallExpression */: - if (ts.isRequireCall(exported, /*checkArgumentIsStringLiteral*/ true)) { - return convertReExportAll(exported.arguments[0], checker); - } - // falls through - default: - // `module.exports = 0;` --> `export default 0;` - return [[ts.createExportAssignment(/*decorators*/ undefined, /*modifiers*/ undefined, /*isExportEquals*/ false, exported)], true]; - } - } - function convertReExportAll(reExported, checker) { - // `module.exports = require("x");` ==> `export * from "x"; export { default } from "x";` - var moduleSpecifier = reExported.text; - var moduleSymbol = checker.getSymbolAtLocation(reExported); - var exports = moduleSymbol ? moduleSymbol.exports : ts.emptyUnderscoreEscapedMap; - return exports.has("export=") - ? [[reExportDefault(moduleSpecifier)], true] - : !exports.has("default") - ? [[reExportStar(moduleSpecifier)], false] - // If there's some non-default export, must include both `export *` and `export default`. - : exports.size > 1 ? [[reExportStar(moduleSpecifier), reExportDefault(moduleSpecifier)], true] : [[reExportDefault(moduleSpecifier)], true]; - } - function reExportStar(moduleSpecifier) { - return makeExportDeclaration(/*exportClause*/ undefined, moduleSpecifier); - } - function reExportDefault(moduleSpecifier) { - return makeExportDeclaration([ts.createExportSpecifier(/*propertyName*/ undefined, "default")], moduleSpecifier); - } - function convertExportsDotXEquals(name, exported) { - var modifiers = [ts.createToken(84 /* ExportKeyword */)]; - switch (exported.kind) { - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: - // `exports.f = function() {}` --> `export function f() {}` - return functionExpressionToDeclaration(name, modifiers, exported); - case 200 /* ClassExpression */: - // `exports.C = class {}` --> `export class C {}` - return classExpressionToDeclaration(name, modifiers, exported); - default: - // `exports.x = 0;` --> `export const x = 0;` - return makeConst(modifiers, ts.createIdentifier(name), exported); - } - } - /** - * Converts `const <> = require("x");`. - * Returns nodes that will replace the variable declaration for the commonjs import. - * May also make use `changes` to remove qualifiers at the use sites of imports, to change `mod.x` to `x`. - */ - function convertSingleImport(file, name, moduleSpecifier, changes, checker, identifiers, target) { - switch (name.kind) { - case 175 /* ObjectBindingPattern */: { - var importSpecifiers = ts.mapAllOrFail(name.elements, function (e) { - return e.dotDotDotToken || e.initializer || e.propertyName && !ts.isIdentifier(e.propertyName) || !ts.isIdentifier(e.name) - ? undefined - : makeImportSpecifier(e.propertyName && e.propertyName.text, e.name.text); - }); - if (importSpecifiers) { - return [makeImport(/*name*/ undefined, importSpecifiers, moduleSpecifier)]; - } - } - // falls through -- object destructuring has an interesting pattern and must be a variable declaration - case 176 /* ArrayBindingPattern */: { - /* - import x from "x"; - const [a, b, c] = x; - */ - var tmp = makeUniqueName(ts.codefix.moduleSpecifierToValidIdentifier(moduleSpecifier, target), identifiers); - return [ - makeImport(ts.createIdentifier(tmp), /*namedImports*/ undefined, moduleSpecifier), - makeConst(/*modifiers*/ undefined, ts.getSynthesizedDeepClone(name), ts.createIdentifier(tmp)), - ]; - } - case 71 /* Identifier */: - return convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers); - default: - ts.Debug.assertNever(name); - } - } - /** - * Convert `import x = require("x").` - * Also converts uses like `x.y()` to `y()` and uses a named import. - */ - function convertSingleIdentifierImport(file, name, moduleSpecifier, changes, checker, identifiers) { - var nameSymbol = checker.getSymbolAtLocation(name); - // Maps from module property name to name actually used. (The same if there isn't shadowing.) - var namedBindingsNames = ts.createMap(); - // True if there is some non-property use like `x()` or `f(x)`. - var needDefaultImport = false; - for (var _i = 0, _a = identifiers.original.get(name.text); _i < _a.length; _i++) { - var use = _a[_i]; - if (checker.getSymbolAtLocation(use) !== nameSymbol || use === name) { - // This was a use of a different symbol with the same name, due to shadowing. Ignore. - continue; - } - var parent = use.parent; - if (ts.isPropertyAccessExpression(parent)) { - var expression = parent.expression, propertyName = parent.name.text; - ts.Debug.assert(expression === use); // Else shouldn't have been in `collectIdentifiers` - var idName = namedBindingsNames.get(propertyName); - if (idName === undefined) { - idName = makeUniqueName(propertyName, identifiers); - namedBindingsNames.set(propertyName, idName); - } - changes.replaceNode(file, parent, ts.createIdentifier(idName)); - } - else { - needDefaultImport = true; - } - } - var namedBindings = namedBindingsNames.size === 0 ? undefined : ts.arrayFrom(ts.mapIterator(namedBindingsNames.entries(), function (_a) { - var propertyName = _a[0], idName = _a[1]; - return ts.createImportSpecifier(propertyName === idName ? undefined : ts.createIdentifier(propertyName), ts.createIdentifier(idName)); - })); - if (!namedBindings) { - // If it was unused, ensure that we at least import *something*. - needDefaultImport = true; - } - return [makeImport(needDefaultImport ? ts.getSynthesizedDeepClone(name) : undefined, namedBindings, moduleSpecifier)]; - } - // Identifiers helpers - function makeUniqueName(name, identifiers) { - while (identifiers.original.has(name) || identifiers.additional.has(name)) { - name = "_" + name; - } - identifiers.additional.set(name, true); - return name; - } - function collectFreeIdentifiers(file) { - var map = ts.createMultiMap(); - file.forEachChild(function recur(node) { - if (ts.isIdentifier(node) && isFreeIdentifier(node)) { - map.add(node.text, node); - } - node.forEachChild(recur); - }); - return map; - } - function isFreeIdentifier(node) { - var parent = node.parent; - switch (parent.kind) { - case 180 /* PropertyAccessExpression */: - return parent.name !== node; - case 177 /* BindingElement */: - return parent.propertyName !== node; - default: - return true; - } - } - // Node helpers - function functionExpressionToDeclaration(name, additionalModifiers, fn) { - return ts.createFunctionDeclaration(ts.getSynthesizedDeepClones(fn.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(fn.modifiers)), ts.getSynthesizedDeepClone(fn.asteriskToken), name, ts.getSynthesizedDeepClones(fn.typeParameters), ts.getSynthesizedDeepClones(fn.parameters), ts.getSynthesizedDeepClone(fn.type), ts.convertToFunctionBody(ts.getSynthesizedDeepClone(fn.body))); - } - function classExpressionToDeclaration(name, additionalModifiers, cls) { - return ts.createClassDeclaration(ts.getSynthesizedDeepClones(cls.decorators), // TODO: GH#19915 Don't think this is even legal. - ts.concatenate(additionalModifiers, ts.getSynthesizedDeepClones(cls.modifiers)), name, ts.getSynthesizedDeepClones(cls.typeParameters), ts.getSynthesizedDeepClones(cls.heritageClauses), ts.getSynthesizedDeepClones(cls.members)); - } - function makeSingleImport(localName, propertyName, moduleSpecifier) { - return propertyName === "default" - ? makeImport(ts.createIdentifier(localName), /*namedImports*/ undefined, moduleSpecifier) - : makeImport(/*name*/ undefined, [makeImportSpecifier(propertyName, localName)], moduleSpecifier); - } - function makeImport(name, namedImports, moduleSpecifier) { - var importClause = (name || namedImports) && ts.createImportClause(name, namedImports && ts.createNamedImports(namedImports)); - return ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, importClause, ts.createLiteral(moduleSpecifier)); - } - function makeImportSpecifier(propertyName, name) { - return ts.createImportSpecifier(propertyName !== undefined && propertyName !== name ? ts.createIdentifier(propertyName) : undefined, ts.createIdentifier(name)); - } - function makeConst(modifiers, name, init) { - return ts.createVariableStatement(modifiers, ts.createVariableDeclarationList([ts.createVariableDeclaration(name, /*type*/ undefined, init)], 2 /* Const */)); - } - function makeExportDeclaration(exportSpecifiers, moduleSpecifier) { - return ts.createExportDeclaration( - /*decorators*/ undefined, - /*modifiers*/ undefined, exportSpecifiers && ts.createNamedExports(exportSpecifiers), moduleSpecifier === undefined ? undefined : ts.createLiteral(moduleSpecifier)); - } - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); +/// +/// /// /// /* @internal */ @@ -98756,7 +100763,7 @@ var ts; } else if (ts.isVariableStatement(node)) { var numInitializers = 0; - var lastInitializer = undefined; + var lastInitializer = void 0; for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) { var declaration = _a[_i]; if (declaration.initializer) { @@ -98785,20 +100792,20 @@ var ts; function checkForStaticContext(nodeToCheck, containingClass) { var current = nodeToCheck; while (current !== containingClass) { - if (current.kind === 150 /* PropertyDeclaration */) { + if (current.kind === 151 /* PropertyDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 147 /* Parameter */) { + else if (current.kind === 148 /* Parameter */) { var ctorOrMethod = ts.getContainingFunction(current); - if (ctorOrMethod.kind === 153 /* Constructor */) { + if (ctorOrMethod.kind === 154 /* Constructor */) { rangeFacts |= RangeFacts.InStaticRegion; } break; } - else if (current.kind === 152 /* MethodDeclaration */) { + else if (current.kind === 153 /* MethodDeclaration */) { if (ts.hasModifier(current, 32 /* Static */)) { rangeFacts |= RangeFacts.InStaticRegion; } @@ -98815,6 +100822,10 @@ var ts; PermittedJumps[PermittedJumps["Continue"] = 2] = "Continue"; PermittedJumps[PermittedJumps["Return"] = 4] = "Return"; })(PermittedJumps || (PermittedJumps = {})); + // We believe it's true because the node is from the (unmodified) tree. + ts.Debug.assert(nodeToCheck.pos <= nodeToCheck.end, "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); + // For understanding how skipTrivia functioned: + ts.Debug.assert(!ts.positionIsSynthesized(nodeToCheck.pos), "This failure could trigger https://github.com/Microsoft/TypeScript/issues/20809"); if (!ts.isStatement(nodeToCheck) && !(ts.isExpressionNode(nodeToCheck) && isExtractableExpression(nodeToCheck))) { return [ts.createDiagnosticForNode(nodeToCheck, Messages.statementOrExpressionExpected)]; } @@ -98837,7 +100848,7 @@ var ts; return true; } if (ts.isDeclaration(node)) { - var declaringNode = (node.kind === 227 /* VariableDeclaration */) ? node.parent.parent : node; + var declaringNode = (node.kind === 230 /* VariableDeclaration */) ? node.parent.parent : node; if (ts.hasModifier(declaringNode, 1 /* Export */)) { (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractExportedEntity)); return true; @@ -98846,13 +100857,13 @@ var ts; } // Some things can't be extracted in certain situations switch (node.kind) { - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractImport)); return true; case 97 /* SuperKeyword */: // For a super *constructor call*, we have to be extracting the entire class, // but a super *method call* simply implies a 'this' reference - if (node.parent.kind === 182 /* CallExpression */) { + if (node.parent.kind === 185 /* CallExpression */) { // Super constructor call var containingClass_1 = ts.getContainingClass(node); if (containingClass_1.pos < span.start || containingClass_1.end >= (span.start + span.length)) { @@ -98867,9 +100878,9 @@ var ts; } if (!node || ts.isFunctionLikeDeclaration(node) || ts.isClassLike(node)) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 230 /* ClassDeclaration */: - if (node.parent.kind === 269 /* SourceFile */ && node.parent.externalModuleIndicator === undefined) { + case 232 /* FunctionDeclaration */: + case 233 /* ClassDeclaration */: + if (ts.isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { // You cannot extract global declarations (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); } @@ -98880,20 +100891,20 @@ var ts; } var savedPermittedJumps = permittedJumps; switch (node.kind) { - case 212 /* IfStatement */: + case 215 /* IfStatement */: permittedJumps = 0 /* None */; break; - case 225 /* TryStatement */: + case 228 /* TryStatement */: // forbid all jumps inside try blocks permittedJumps = 0 /* None */; break; - case 208 /* Block */: - if (node.parent && node.parent.kind === 225 /* TryStatement */ && node.parent.finallyBlock === node) { + case 211 /* Block */: + if (node.parent && node.parent.kind === 228 /* TryStatement */ && node.parent.finallyBlock === node) { // allow unconditional returns from finally blocks permittedJumps = 4 /* Return */; } break; - case 261 /* CaseClause */: + case 264 /* CaseClause */: // allow unlabeled break inside case clauses permittedJumps |= 1 /* Break */; break; @@ -98905,11 +100916,11 @@ var ts; break; } switch (node.kind) { - case 170 /* ThisType */: + case 173 /* ThisType */: case 99 /* ThisKeyword */: rangeFacts |= RangeFacts.UsesThis; break; - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: { var label = node.label; (seenLabels || (seenLabels = [])).push(label.escapedText); @@ -98917,8 +100928,8 @@ var ts; seenLabels.pop(); break; } - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: { var label = node.label; if (label) { @@ -98928,20 +100939,20 @@ var ts; } } else { - if (!(permittedJumps & (node.kind === 219 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { + if (!(permittedJumps & (node.kind === 222 /* BreakStatement */ ? 1 /* Break */ : 2 /* Continue */))) { // attempt to break or continue in a forbidden context (errors || (errors = [])).push(ts.createDiagnosticForNode(node, Messages.cannotExtractRangeContainingConditionalBreakOrContinueStatements)); } } break; } - case 192 /* AwaitExpression */: + case 195 /* AwaitExpression */: rangeFacts |= RangeFacts.IsAsyncFunction; break; - case 198 /* YieldExpression */: + case 201 /* YieldExpression */: rangeFacts |= RangeFacts.IsGenerator; break; - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: if (permittedJumps & 4 /* Return */) { rangeFacts |= RangeFacts.HasReturn; } @@ -98995,7 +101006,7 @@ var ts; while (true) { current = current.parent; // A function parameter's initializer is actually in the outer scope, not the function declaration - if (current.kind === 147 /* Parameter */) { + if (current.kind === 148 /* Parameter */) { // Skip all the way to the outer scope of the function that declared this parameter current = ts.findAncestor(current, function (parent) { return ts.isFunctionLikeDeclaration(parent); }).parent; } @@ -99006,7 +101017,7 @@ var ts; // * Module/namespace or source file if (isScope(current)) { scopes.push(current); - if (current.kind === 269 /* SourceFile */) { + if (current.kind === 272 /* SourceFile */) { return scopes; } } @@ -99096,32 +101107,32 @@ var ts; } function getDescriptionForFunctionLikeDeclaration(scope) { switch (scope.kind) { - case 153 /* Constructor */: + case 154 /* Constructor */: return "constructor"; - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: return scope.name ? "function '" + scope.name.text + "'" : "anonymous function"; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: return "arrow function"; - case 152 /* MethodDeclaration */: + case 153 /* MethodDeclaration */: return "method '" + scope.name.getText(); - case 154 /* GetAccessor */: + case 155 /* GetAccessor */: return "'get " + scope.name.getText() + "'"; - case 155 /* SetAccessor */: + case 156 /* SetAccessor */: return "'set " + scope.name.getText() + "'"; default: ts.Debug.assertNever(scope); } } function getDescriptionForClassLikeDeclaration(scope) { - return scope.kind === 230 /* ClassDeclaration */ - ? "class '" + scope.name.text + "'" + return scope.kind === 233 /* ClassDeclaration */ + ? scope.name ? "class '" + scope.name.text + "'" : "anonymous class declaration" : scope.name ? "class expression '" + scope.name.text + "'" : "anonymous class expression"; } function getDescriptionForModuleLikeDeclaration(scope) { - return scope.kind === 235 /* ModuleBlock */ + return scope.kind === 238 /* ModuleBlock */ ? "namespace '" + scope.parent.name.getText() + "'" : scope.externalModuleIndicator ? 0 /* Module */ : 1 /* Global */; } @@ -99149,12 +101160,12 @@ var ts; var functionNameText = getUniqueName(ts.isClassLike(scope) ? "newMethod" : "newFunction", file.text); var isJS = ts.isInJavaScriptFile(scope); var functionName = ts.createIdentifier(functionNameText); - var returnType = undefined; + var returnType; var parameters = []; var callArguments = []; var writes; usagesInScope.forEach(function (usage, name) { - var typeNode = undefined; + var typeNode; if (!isJS) { var type = checker.getTypeOfSymbolAtLocation(usage.symbol, usage.node); // Widen the type so we don't emit nonsense annotations like "function fn(x: 3) {" @@ -99329,7 +101340,7 @@ var ts; } } if (isReadonlyArray(range.range)) { - changeTracker.replaceNodesWithNodes(context.file, range.range, newNodes); + changeTracker.replaceNodeRangeWithNodes(context.file, ts.first(range.range), ts.last(range.range), newNodes); } else { changeTracker.replaceNodeWithNodes(context.file, range.range, newNodes); @@ -99348,9 +101359,9 @@ var ts; while (ts.isParenthesizedTypeNode(withoutParens)) { withoutParens = withoutParens.type; } - return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 139 /* UndefinedKeyword */; }) + return ts.isUnionTypeNode(withoutParens) && ts.find(withoutParens.types, function (t) { return t.kind === 140 /* UndefinedKeyword */; }) ? clone - : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(139 /* UndefinedKeyword */)]); + : ts.createUnionTypeNode([clone, ts.createKeywordTypeNode(140 /* UndefinedKeyword */)]); } } /** @@ -99377,7 +101388,7 @@ var ts; if (rangeFacts & RangeFacts.InStaticRegion) { modifiers.push(ts.createToken(115 /* StaticKeyword */)); } - modifiers.push(ts.createToken(131 /* ReadonlyKeyword */)); + modifiers.push(ts.createToken(132 /* ReadonlyKeyword */)); var newVariable = ts.createProperty( /*decorators*/ undefined, modifiers, localNameText, /*questionToken*/ undefined, variableType, initializer); @@ -99389,7 +101400,7 @@ var ts; var nodeToInsertBefore = getNodeToInsertPropertyBefore(maxInsertionPos, scope); changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariable, /*blankLineBetween*/ true); // Consume - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } else { var newVariableDeclaration = ts.createVariableDeclaration(localNameText, variableType, initializer); @@ -99404,14 +101415,14 @@ var ts; changeTracker.insertNodeBefore(context.file, oldVariableDeclaration, newVariableDeclaration); // Consume var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } - else if (node.parent.kind === 211 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { + else if (node.parent.kind === 214 /* ExpressionStatement */ && scope === ts.findAncestor(node, isScope)) { // If the parent is an expression statement and the target scope is the immediately enclosing one, // replace the statement with the declaration. var newVariableStatement = ts.createVariableStatement( /*modifiers*/ undefined, ts.createVariableDeclarationList([newVariableDeclaration], 2 /* Const */)); - changeTracker.replaceRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }, newVariableStatement); + changeTracker.replaceNode(context.file, node.parent, newVariableStatement, ts.textChanges.useNonAdjustedPositions); } else { var newVariableStatement = ts.createVariableStatement( @@ -99425,13 +101436,13 @@ var ts; changeTracker.insertNodeBefore(context.file, nodeToInsertBefore, newVariableStatement, /*blankLineBetween*/ false); } // Consume - if (node.parent.kind === 211 /* ExpressionStatement */) { + if (node.parent.kind === 214 /* ExpressionStatement */) { // If the parent is an expression statement, delete it. - changeTracker.deleteRange(context.file, { pos: node.parent.getStart(), end: node.parent.end }); + changeTracker.deleteNode(context.file, node.parent, ts.textChanges.useNonAdjustedPositions); } else { var localReference = ts.createIdentifier(localNameText); - changeTracker.replaceRange(context.file, { pos: node.getStart(), end: node.end }, localReference); + changeTracker.replaceNode(context.file, node, localReference, ts.textChanges.useNonAdjustedPositions); } } } @@ -99441,7 +101452,7 @@ var ts; return { renameFilename: renameFilename, renameLocation: renameLocation, edits: edits }; } function getContainingVariableDeclarationIfInList(node, scope) { - var prevNode = undefined; + var prevNode; while (node !== undefined && node !== scope) { if (ts.isVariableDeclaration(node) && node.initializer === prevNode && @@ -99462,20 +101473,20 @@ var ts; var delta = 0; var lastPos = -1; for (var _i = 0, edits_1 = edits; _i < edits_1.length; _i++) { - var _a = edits_1[_i], fileName = _a.fileName, textChanges_1 = _a.textChanges; + var _a = edits_1[_i], fileName = _a.fileName, textChanges_2 = _a.textChanges; ts.Debug.assert(fileName === renameFilename); - for (var _b = 0, textChanges_2 = textChanges_1; _b < textChanges_2.length; _b++) { - var change = textChanges_2[_b]; - var span_15 = change.span, newText = change.newText; + for (var _b = 0, textChanges_3 = textChanges_2; _b < textChanges_3.length; _b++) { + var change = textChanges_3[_b]; + var span_14 = change.span, newText = change.newText; var index = newText.indexOf(functionNameText); if (index !== -1) { - lastPos = span_15.start + delta + index; + lastPos = span_14.start + delta + index; // If the reference comes first, return immediately. if (!isDeclaredBeforeUse) { return lastPos; } } - delta += newText.length - span_15.length; + delta += newText.length - span_14.length; } } // If the declaration comes first, return the position of the last occurrence. @@ -99484,7 +101495,7 @@ var ts; return lastPos; } function getFirstDeclaration(type) { - var firstDeclaration = undefined; + var firstDeclaration; var symbol = type.symbol; if (symbol && symbol.declarations) { for (var _i = 0, _a = symbol.declarations; _i < _a.length; _i++) { @@ -99542,7 +101553,7 @@ var ts; return { body: ts.createBlock(statements, /*multiLine*/ true), returnValueProperty: undefined }; } function visitor(node) { - if (!ignoreReturns && node.kind === 220 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { + if (!ignoreReturns && node.kind === 223 /* ReturnStatement */ && hasWritesOrVariableDeclarations) { var assignments = getPropertyAssignmentsForWritesAndVariableDeclarations(exposedVariableDeclarations, writes); if (node.expression) { if (!returnValueProperty) { @@ -99606,7 +101617,7 @@ var ts; function getNodeToInsertPropertyBefore(maxPos, scope) { var members = scope.members; ts.Debug.assert(members.length > 0); // There must be at least one child, since we extracted from one. - var prevMember = undefined; + var prevMember; var allProperties = true; for (var _i = 0, members_6 = members; _i < members_6.length; _i++) { var member = members_6[_i]; @@ -99628,7 +101639,7 @@ var ts; } function getNodeToInsertConstantBefore(node, scope) { ts.Debug.assert(!ts.isClassLike(scope)); - var prevScope = undefined; + var prevScope; for (var curr = node; curr !== scope; curr = curr.parent) { if (isScope(curr)) { prevScope = curr; @@ -99636,7 +101647,7 @@ var ts; } for (var curr = (prevScope || node).parent;; curr = curr.parent) { if (isBlockLike(curr)) { - var prevStatement = undefined; + var prevStatement = void 0; for (var _i = 0, _a = curr.statements; _i < _a.length; _i++) { var statement = _a[_i]; if (statement.pos > node.pos) { @@ -99644,6 +101655,11 @@ var ts; } prevStatement = statement; } + if (!prevStatement && ts.isCaseClause(curr)) { + // We must have been in the expression of the case clause. + ts.Debug.assert(ts.isSwitchStatement(curr.parent.parent)); + return curr.parent.parent; + } // There must be at least one statement since we started in one. ts.Debug.assert(prevStatement !== undefined); return prevStatement; @@ -99696,13 +101712,13 @@ var ts; var visibleDeclarationsInExtractedRange = []; var exposedVariableSymbolSet = ts.createMap(); // Key is symbol ID var exposedVariableDeclarations = []; - var firstExposedNonVariableDeclaration = undefined; + var firstExposedNonVariableDeclaration; var expression = !isReadonlyArray(targetRange.range) ? targetRange.range : targetRange.range.length === 1 && ts.isExpressionStatement(targetRange.range[0]) ? targetRange.range[0].expression : undefined; - var expressionDiagnostic = undefined; + var expressionDiagnostic; if (expression === undefined) { var statements = targetRange.range; var start = ts.first(statements).getStart(); @@ -99717,7 +101733,7 @@ var ts; var scope = scopes_1[_i]; usagesPerScope.push({ usages: ts.createMap(), typeParameterUsages: ts.createMap(), substitutions: ts.createMap() }); substitutionsPerScope.push(ts.createMap()); - functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 229 /* FunctionDeclaration */ + functionErrorsPerScope.push(ts.isFunctionLikeDeclaration(scope) && scope.kind !== 232 /* FunctionDeclaration */ ? [ts.createDiagnosticForNode(scope, Messages.cannotExtractToOtherFunctionLike)] : []); var constantErrors = []; @@ -99780,7 +101796,7 @@ var ts; : ts.getEnclosingBlockScopeContainer(scopes[0]); ts.forEachChild(containingLexicalScopeOfExtraction, checkForUsedDeclarations); } - var _loop_10 = function (i) { + var _loop_11 = function (i) { var scopeUsages = usagesPerScope[i]; // Special case: in the innermost scope, all usages are available. // (The computed value reflects the value at the top-level of the scope, but the @@ -99790,7 +101806,7 @@ var ts; constantErrorsPerScope[i].push(ts.createDiagnosticForNode(errorNode, Messages.cannotAccessVariablesFromNestedScopes)); } var hasWrite = false; - var readonlyClassPropertyWrite = undefined; + var readonlyClassPropertyWrite; usagesPerScope[i].usages.forEach(function (value) { if (value.usage === 2 /* Write */) { hasWrite = true; @@ -99820,7 +101836,7 @@ var ts; } }; for (var i = 0; i < scopes.length; i++) { - _loop_10(i); + _loop_11(i); } return { target: target, usagesPerScope: usagesPerScope, functionErrorsPerScope: functionErrorsPerScope, constantErrorsPerScope: constantErrorsPerScope, exposedVariableDeclarations: exposedVariableDeclarations }; function hasTypeParameters(node) { @@ -99929,7 +101945,8 @@ var ts; return symbolId; } // find first declaration in this file - var declInFile = ts.find(symbol.getDeclarations(), function (d) { return d.getSourceFile() === sourceFile; }); + var decls = symbol.getDeclarations(); + var declInFile = decls && ts.find(decls, function (d) { return d.getSourceFile() === sourceFile; }); if (!declInFile) { return undefined; } @@ -100019,7 +102036,8 @@ var ts; if (!symbol) { return undefined; } - if (symbol.getDeclarations().some(function (d) { return d.parent === scopeDecl; })) { + var decls = symbol.getDeclarations(); + if (decls && decls.some(function (d) { return d.parent === scopeDecl; })) { return ts.createIdentifier(symbol.name); } var prefix = tryReplaceWithQualifiedNameOrPropertyAccess(symbol.parent, scopeDecl, isTypeNode); @@ -100054,30 +102072,30 @@ var ts; */ function isExtractableExpression(node) { switch (node.parent.kind) { - case 268 /* EnumMember */: + case 271 /* EnumMember */: return false; } switch (node.kind) { case 9 /* StringLiteral */: - return node.parent.kind !== 239 /* ImportDeclaration */ && - node.parent.kind !== 243 /* ImportSpecifier */; - case 199 /* SpreadElement */: - case 175 /* ObjectBindingPattern */: - case 177 /* BindingElement */: + return node.parent.kind !== 242 /* ImportDeclaration */ && + node.parent.kind !== 246 /* ImportSpecifier */; + case 202 /* SpreadElement */: + case 178 /* ObjectBindingPattern */: + case 180 /* BindingElement */: return false; case 71 /* Identifier */: - return node.parent.kind !== 177 /* BindingElement */ && - node.parent.kind !== 243 /* ImportSpecifier */ && - node.parent.kind !== 247 /* ExportSpecifier */; + return node.parent.kind !== 180 /* BindingElement */ && + node.parent.kind !== 246 /* ImportSpecifier */ && + node.parent.kind !== 250 /* ExportSpecifier */; } return true; } function isBlockLike(node) { switch (node.kind) { - case 208 /* Block */: - case 269 /* SourceFile */: - case 235 /* ModuleBlock */: - case 261 /* CaseClause */: + case 211 /* Block */: + case 272 /* SourceFile */: + case 238 /* ModuleBlock */: + case 264 /* CaseClause */: return true; default: return false; @@ -100086,165 +102104,7 @@ var ts; })(extractSymbol = refactor.extractSymbol || (refactor.extractSymbol = {})); })(refactor = ts.refactor || (ts.refactor = {})); })(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var installTypesForPackage; - (function (installTypesForPackage) { - var refactorName = "Install missing types package"; - var actionName = "install"; - var description = "Install missing types package"; - refactor.registerRefactor(refactorName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - if (ts.getStrictOptionValue(context.program.getCompilerOptions(), "noImplicitAny")) { - // Then it will be available via `fixCannotFindModule`. - return undefined; - } - var action = getAction(context); - return action && [ - { - name: refactorName, - description: description, - actions: [ - { - description: action.description, - name: actionName, - }, - ], - }, - ]; - } - function getEditsForAction(context, _actionName) { - ts.Debug.assertEqual(actionName, _actionName); - var action = getAction(context); // Should be defined if we said there was an action available. - return { - edits: [], - renameFilename: undefined, - renameLocation: undefined, - commands: action.commands, - }; - } - function getAction(context) { - var file = context.file, startPosition = context.startPosition; - var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - if (!ts.isStringLiteral(node) || !isModuleIdentifier(node)) { - return undefined; - } - var resolvedTo = ts.getResolvedModule(file, node.text); - // Still offer to install types if it resolved to e.g. a ".js" file. - // `tryGetCodeActionForInstallPackageTypes` will verify that we're looking for a valid package name, - // so the fix won't trigger for imports of ".js" files that couldn't be better replaced by typings. - if (resolvedTo && ts.extensionIsTypeScript(resolvedTo.extension)) { - return undefined; - } - return ts.codefix.tryGetCodeActionForInstallPackageTypes(context.host, file.fileName, node.text); - } - function isModuleIdentifier(node) { - switch (node.parent.kind) { - case 239 /* ImportDeclaration */: - case 249 /* ExternalModuleReference */: - return true; - default: - return false; - } - } - })(installTypesForPackage = refactor.installTypesForPackage || (refactor.installTypesForPackage = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/* @internal */ -var ts; -(function (ts) { - var refactor; - (function (refactor) { - var installTypesForPackage; - (function (installTypesForPackage) { - var actionName = "Convert to default import"; - var description = ts.getLocaleSpecificMessage(ts.Diagnostics.Convert_to_default_import); - refactor.registerRefactor(actionName, { getEditsForAction: getEditsForAction, getAvailableActions: getAvailableActions }); - function getAvailableActions(context) { - var file = context.file, startPosition = context.startPosition, program = context.program; - if (!program.getCompilerOptions().allowSyntheticDefaultImports) { - return undefined; - } - var importInfo = getConvertibleImportAtPosition(file, startPosition); - if (!importInfo) { - return undefined; - } - var module = ts.getResolvedModule(file, importInfo.moduleSpecifier.text); - var resolvedFile = program.getSourceFile(module.resolvedFileName); - if (!(resolvedFile.externalModuleIndicator && ts.isExportAssignment(resolvedFile.externalModuleIndicator) && resolvedFile.externalModuleIndicator.isExportEquals)) { - return undefined; - } - return [ - { - name: actionName, - description: description, - actions: [ - { - description: description, - name: actionName, - }, - ], - }, - ]; - } - function getEditsForAction(context, _actionName) { - var file = context.file, startPosition = context.startPosition; - ts.Debug.assertEqual(actionName, _actionName); - var importInfo = getConvertibleImportAtPosition(file, startPosition); - if (!importInfo) { - return undefined; - } - var importStatement = importInfo.importStatement, name = importInfo.name, moduleSpecifier = importInfo.moduleSpecifier; - var newImportClause = ts.createImportClause(name, /*namedBindings*/ undefined); - var newImportStatement = ts.createImportDeclaration(/*decorators*/ undefined, /*modifiers*/ undefined, newImportClause, moduleSpecifier); - return { - edits: ts.textChanges.ChangeTracker.with(context, function (t) { return t.replaceNode(file, importStatement, newImportStatement); }), - renameFilename: undefined, - renameLocation: undefined, - }; - } - function getConvertibleImportAtPosition(file, startPosition) { - var node = ts.getTokenAtPosition(file, startPosition, /*includeJsDocComment*/ false); - while (true) { - switch (node.kind) { - case 238 /* ImportEqualsDeclaration */: - var eq = node; - var moduleReference = eq.moduleReference; - return moduleReference.kind === 249 /* ExternalModuleReference */ && ts.isStringLiteral(moduleReference.expression) - ? { importStatement: eq, name: eq.name, moduleSpecifier: moduleReference.expression } - : undefined; - case 239 /* ImportDeclaration */: - var d = node; - var importClause = d.importClause; - return !importClause.name && importClause.namedBindings.kind === 241 /* NamespaceImport */ && ts.isStringLiteral(d.moduleSpecifier) - ? { importStatement: d, name: importClause.namedBindings.name, moduleSpecifier: d.moduleSpecifier } - : undefined; - // For known child node kinds of convertible imports, try again with parent node. - case 241 /* NamespaceImport */: - case 249 /* ExternalModuleReference */: - case 91 /* ImportKeyword */: - case 71 /* Identifier */: - case 9 /* StringLiteral */: - case 39 /* AsteriskToken */: - break; - default: - return undefined; - } - node = node.parent; - } - } - })(installTypesForPackage = refactor.installTypesForPackage || (refactor.installTypesForPackage = {})); - })(refactor = ts.refactor || (ts.refactor = {})); -})(ts || (ts = {})); -/// -/// -/// /// -/// -/// /// /// /// @@ -100260,11 +102120,13 @@ var ts; /// /// /// +/// /// /// /// /// /// +/// /// /// /// @@ -100343,6 +102205,9 @@ var ts; var token = ts.scanner.scan(); var textPos = ts.scanner.getTextPos(); if (textPos <= end) { + if (token === 71 /* Identifier */) { + ts.Debug.fail("Did not expect " + ts.Debug.showSyntaxKind(this) + " to have an Identifier in its trivia"); + } nodes.push(createNode(token, pos, textPos, this)); } pos = textPos; @@ -100353,7 +102218,7 @@ var ts; return pos; }; NodeObject.prototype.createSyntaxList = function (nodes) { - var list = createNode(290 /* SyntaxList */, nodes.pos, nodes.end, this); + var list = createNode(293 /* SyntaxList */, nodes.pos, nodes.end, this); list._children = []; var pos = nodes.pos; for (var _i = 0, nodes_9 = nodes; _i < nodes_9.length; _i++) { @@ -100439,8 +102304,8 @@ var ts; if (!children.length) { return undefined; } - var child = ts.find(children, function (kid) { return kid.kind < 271 /* FirstJSDocNode */ || kid.kind > 289 /* LastJSDocNode */; }); - return child.kind < 144 /* FirstNode */ ? + var child = ts.find(children, function (kid) { return kid.kind < 274 /* FirstJSDocNode */ || kid.kind > 292 /* LastJSDocNode */; }); + return child.kind < 145 /* FirstNode */ ? child : child.getFirstToken(sourceFile); }; @@ -100451,7 +102316,7 @@ var ts; if (!child) { return undefined; } - return child.kind < 144 /* FirstNode */ ? child : child.getLastToken(sourceFile); + return child.kind < 145 /* FirstNode */ ? child : child.getLastToken(sourceFile); }; NodeObject.prototype.forEachChild = function (cbNode, cbNodeArray) { return ts.forEachChild(this, cbNode, cbNodeArray); @@ -100793,27 +102658,15 @@ var ts; } function getDeclarationName(declaration) { var name = ts.getNameOfDeclaration(declaration); - if (name) { - var result_6 = ts.getTextOfIdentifierOrLiteral(name); - if (result_6 !== undefined) { - return result_6; - } - if (name.kind === 145 /* ComputedPropertyName */) { - var expr = name.expression; - if (expr.kind === 180 /* PropertyAccessExpression */) { - return expr.name.text; - } - return ts.getTextOfIdentifierOrLiteral(expr); - } - } - return undefined; + return name && (ts.isPropertyNameLiteral(name) ? ts.getTextOfIdentifierOrLiteral(name) : + name.kind === 146 /* ComputedPropertyName */ && ts.isPropertyAccessExpression(name.expression) ? name.expression.name.text : undefined); } function visit(node) { switch (node.kind) { - case 229 /* FunctionDeclaration */: - case 187 /* FunctionExpression */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: + case 232 /* FunctionDeclaration */: + case 190 /* FunctionExpression */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: var functionDeclaration = node; var declarationName = getDeclarationName(functionDeclaration); if (declarationName) { @@ -100833,31 +102686,31 @@ var ts; } ts.forEachChild(node, visit); break; - case 230 /* ClassDeclaration */: - case 200 /* ClassExpression */: - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: - case 233 /* EnumDeclaration */: - case 234 /* ModuleDeclaration */: - case 238 /* ImportEqualsDeclaration */: - case 247 /* ExportSpecifier */: - case 243 /* ImportSpecifier */: - case 240 /* ImportClause */: - case 241 /* NamespaceImport */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 164 /* TypeLiteral */: + case 233 /* ClassDeclaration */: + case 203 /* ClassExpression */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: + case 236 /* EnumDeclaration */: + case 237 /* ModuleDeclaration */: + case 241 /* ImportEqualsDeclaration */: + case 250 /* ExportSpecifier */: + case 246 /* ImportSpecifier */: + case 243 /* ImportClause */: + case 244 /* NamespaceImport */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 165 /* TypeLiteral */: addDeclaration(node); ts.forEachChild(node, visit); break; - case 147 /* Parameter */: + case 148 /* Parameter */: // Only consider parameter properties if (!ts.hasModifier(node, 92 /* ParameterPropertyModifier */)) { break; } // falls through - case 227 /* VariableDeclaration */: - case 177 /* BindingElement */: { + case 230 /* VariableDeclaration */: + case 180 /* BindingElement */: { var decl = node; if (ts.isBindingPattern(decl.name)) { ts.forEachChild(decl.name, visit); @@ -100868,19 +102721,19 @@ var ts; } } // falls through - case 268 /* EnumMember */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 271 /* EnumMember */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: addDeclaration(node); break; - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // Handle named exports case e.g.: // export {a, b as B} from "mod"; if (node.exportClause) { ts.forEach(node.exportClause.elements, visit); } break; - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: var importClause = node.importClause; if (importClause) { // Handle default import case e.g.: @@ -100892,7 +102745,7 @@ var ts; // import * as NS from "mod"; // import {a, b as B} from "mod"; if (importClause.namedBindings) { - if (importClause.namedBindings.kind === 241 /* NamespaceImport */) { + if (importClause.namedBindings.kind === 244 /* NamespaceImport */) { addDeclaration(importClause.namedBindings); } else { @@ -100901,7 +102754,7 @@ var ts; } } break; - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (ts.getSpecialPropertyAssignmentKind(node) !== 0 /* None */) { addDeclaration(node); } @@ -101393,6 +103246,10 @@ var ts; var declarationDiagnostics = program.getDeclarationDiagnostics(targetSourceFile, cancellationToken); return semanticDiagnostics.concat(declarationDiagnostics); } + function getSuggestionDiagnostics(fileName) { + synchronizeHostData(); + return ts.computeSuggestionDiagnostics(getValidSourceFile(fileName), program); + } function getCompilerOptionsDiagnostics() { synchronizeHostData(); return program.getOptionsDiagnostics(cancellationToken).concat(program.getGlobalDiagnostics(cancellationToken)); @@ -101415,9 +103272,7 @@ var ts; var sourceFile = getValidSourceFile(fileName); var node = ts.getTouchingPropertyName(sourceFile, position, /*includeJsDocComment*/ true); if (node === sourceFile) { - return undefined; - } - if (ts.isLabelName(node)) { + // Avoid giving quickInfo for the sourceFile as a whole. return undefined; } var typeChecker = program.getTypeChecker(); @@ -101426,34 +103281,37 @@ var ts; // Try getting just type at this position and show switch (node.kind) { case 71 /* Identifier */: - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + if (ts.isLabelName(node)) { + // Type here will be 'any', avoid displaying this. + return undefined; + } + // falls through + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 97 /* SuperKeyword */: // For the identifiers/this/super etc get the type at position var type = typeChecker.getTypeAtLocation(node); - if (type) { - return { - kind: "" /* unknown */, - kindModifiers: "" /* none */, - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), - documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined, - tags: type.symbol ? type.symbol.getJsDocTags() : undefined - }; - } + return type && { + kind: "" /* unknown */, + kindModifiers: "" /* none */, + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: ts.typeToDisplayParts(typeChecker, type, ts.getContainerNode(node)), + documentation: type.symbol ? type.symbol.getDocumentationComment(typeChecker) : undefined, + tags: type.symbol ? type.symbol.getJsDocTags() : undefined + }; } return undefined; } - var displayPartsDocumentationsAndKind = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, ts.getContainerNode(node), node); + var _a = ts.SymbolDisplay.getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker, symbol, sourceFile, ts.getContainerNode(node), node), symbolKind = _a.symbolKind, displayParts = _a.displayParts, documentation = _a.documentation, tags = _a.tags; return { - kind: displayPartsDocumentationsAndKind.symbolKind, + kind: symbolKind, kindModifiers: ts.SymbolDisplay.getSymbolModifiers(symbol), - textSpan: ts.createTextSpan(node.getStart(), node.getWidth()), - displayParts: displayPartsDocumentationsAndKind.displayParts, - documentation: displayPartsDocumentationsAndKind.documentation, - tags: displayPartsDocumentationsAndKind.tags + textSpan: ts.createTextSpanFromNode(node, sourceFile), + displayParts: displayParts, + documentation: documentation, + tags: tags, }; } function getSymbolAtLocationForQuickInfo(node, checker) { @@ -101461,11 +103319,9 @@ var ts; && ts.isPropertyAssignment(node.parent) && node.parent.name === node) { var type = checker.getContextualType(node.parent.parent); - if (type) { - var property = checker.getPropertyOfType(type, ts.getTextOfIdentifierOrLiteral(node)); - if (property) { - return property; - } + var property = type && checker.getPropertyOfType(type, ts.getTextOfIdentifierOrLiteral(node)); + if (property) { + return property; } } return checker.getSymbolAtLocation(node); @@ -101490,44 +103346,24 @@ var ts; } /// References and Occurrences function getOccurrencesAtPosition(fileName, position) { - var results = getOccurrencesAtPositionCore(fileName, position); - if (results) { - var sourceFile_2 = getCanonicalFileName(ts.normalizeSlashes(fileName)); - // Get occurrences only supports reporting occurrences for the file queried. So - // filter down to that list. - results = ts.filter(results, function (r) { return getCanonicalFileName(ts.normalizeSlashes(r.fileName)) === sourceFile_2; }); - } - return results; + var canonicalFileName = getCanonicalFileName(ts.normalizeSlashes(fileName)); + return ts.flatMap(getDocumentHighlights(fileName, position, [fileName]), function (entry) { return entry.highlightSpans.map(function (highlightSpan) { + ts.Debug.assert(getCanonicalFileName(ts.normalizeSlashes(entry.fileName)) === canonicalFileName); // Get occurrences only supports reporting occurrences for the file queried. + return { + fileName: entry.fileName, + textSpan: highlightSpan.textSpan, + isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, + isDefinition: false, + isInString: highlightSpan.isInString, + }; + }); }); } function getDocumentHighlights(fileName, position, filesToSearch) { synchronizeHostData(); - var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return program.getSourceFile(f); }); + var sourceFilesToSearch = ts.map(filesToSearch, function (f) { return ts.Debug.assertDefined(program.getSourceFile(f)); }); var sourceFile = getValidSourceFile(fileName); return ts.DocumentHighlights.getDocumentHighlights(program, cancellationToken, sourceFile, position, sourceFilesToSearch); } - function getOccurrencesAtPositionCore(fileName, position) { - return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName])); - function convertDocumentHighlights(documentHighlights) { - if (!documentHighlights) { - return undefined; - } - var result = []; - for (var _i = 0, documentHighlights_1 = documentHighlights; _i < documentHighlights_1.length; _i++) { - var entry = documentHighlights_1[_i]; - for (var _a = 0, _b = entry.highlightSpans; _a < _b.length; _a++) { - var highlightSpan = _b[_a]; - result.push({ - fileName: entry.fileName, - textSpan: highlightSpan.textSpan, - isWriteAccess: highlightSpan.kind === "writtenReference" /* writtenReference */, - isDefinition: false, - isInString: highlightSpan.isInString, - }); - } - } - return result; - } - } function findRenameLocations(fileName, position, findInStrings, findInComments) { return getReferences(fileName, position, { findInStrings: findInStrings, findInComments: findInComments, isForRename: true }); } @@ -101591,15 +103427,15 @@ var ts; return; } switch (node.kind) { - case 180 /* PropertyAccessExpression */: - case 144 /* QualifiedName */: + case 183 /* PropertyAccessExpression */: + case 145 /* QualifiedName */: case 9 /* StringLiteral */: case 86 /* FalseKeyword */: case 101 /* TrueKeyword */: case 95 /* NullKeyword */: case 97 /* SuperKeyword */: case 99 /* ThisKeyword */: - case 170 /* ThisType */: + case 173 /* ThisType */: case 71 /* Identifier */: break; // Cant create the text span @@ -101616,7 +103452,7 @@ var ts; // If this is name of a module declarations, check if this is right side of dotted module name // If parent of the module declaration which is parent of this node is module declaration and its body is the module declaration that this node is name of // Then this name is name from dotted module - if (nodeForStartPos.parent.parent.kind === 234 /* ModuleDeclaration */ && + if (nodeForStartPos.parent.parent.kind === 237 /* ModuleDeclaration */ && nodeForStartPos.parent.parent.body === nodeForStartPos.parent) { // Use parent module declarations name for start pos nodeForStartPos = nodeForStartPos.parent.parent.name; @@ -101677,47 +103513,20 @@ var ts; var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); return ts.OutliningElementsCollector.collectElements(sourceFile, cancellationToken); } + var braceMatching = ts.createMapFromTemplate((_a = {}, + _a[17 /* OpenBraceToken */] = 18 /* CloseBraceToken */, + _a[19 /* OpenParenToken */] = 20 /* CloseParenToken */, + _a[21 /* OpenBracketToken */] = 22 /* CloseBracketToken */, + _a[29 /* GreaterThanToken */] = 27 /* LessThanToken */, + _a)); + braceMatching.forEach(function (value, key) { return braceMatching.set(value.toString(), Number(key)); }); function getBraceMatchingAtPosition(fileName, position) { var sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); - var result = []; var token = ts.getTouchingToken(sourceFile, position, /*includeJsDocComment*/ false); - if (token.getStart(sourceFile) === position) { - var matchKind = getMatchingTokenKind(token); - // Ensure that there is a corresponding token to match ours. - if (matchKind) { - var parentElement = token.parent; - var childNodes = parentElement.getChildren(sourceFile); - for (var _i = 0, childNodes_1 = childNodes; _i < childNodes_1.length; _i++) { - var current = childNodes_1[_i]; - if (current.kind === matchKind) { - var range1 = ts.createTextSpan(token.getStart(sourceFile), token.getWidth(sourceFile)); - var range2 = ts.createTextSpan(current.getStart(sourceFile), current.getWidth(sourceFile)); - // We want to order the braces when we return the result. - if (range1.start < range2.start) { - result.push(range1, range2); - } - else { - result.push(range2, range1); - } - break; - } - } - } - } - return result; - function getMatchingTokenKind(token) { - switch (token.kind) { - case 17 /* OpenBraceToken */: return 18 /* CloseBraceToken */; - case 19 /* OpenParenToken */: return 20 /* CloseParenToken */; - case 21 /* OpenBracketToken */: return 22 /* CloseBracketToken */; - case 27 /* LessThanToken */: return 29 /* GreaterThanToken */; - case 18 /* CloseBraceToken */: return 17 /* OpenBraceToken */; - case 20 /* CloseParenToken */: return 19 /* OpenParenToken */; - case 22 /* CloseBracketToken */: return 21 /* OpenBracketToken */; - case 29 /* GreaterThanToken */: return 27 /* LessThanToken */; - } - return undefined; - } + var matchKind = token.getStart(sourceFile) === position ? braceMatching.get(token.kind.toString()) : undefined; + var match = matchKind && ts.findChildOfKind(token.parent, matchKind, sourceFile); + // We want to order the braces when we return the result. + return match ? [ts.createTextSpanFromNode(token, sourceFile), ts.createTextSpanFromNode(match, sourceFile)].sort(function (a, b) { return a.start - b.start; }) : ts.emptyArray; } function getIndentationAtPosition(fileName, position, editorOptions) { var start = ts.timestamp(); @@ -101770,6 +103579,13 @@ var ts; var formatContext = ts.formatting.getFormatContext(formatOptions); return ts.codefix.getAllFixes({ fixId: fixId, sourceFile: sourceFile, program: program, host: host, cancellationToken: cancellationToken, formatContext: formatContext }); } + function organizeImports(scope, formatOptions) { + synchronizeHostData(); + ts.Debug.assert(scope.type === "file"); + var sourceFile = getValidSourceFile(scope.fileName); + var formatContext = ts.formatting.getFormatContext(formatOptions); + return ts.OrganizeImports.organizeImports(sourceFile, formatContext, host, program); + } function applyCodeActionCommand(fileName, actionOrUndefined) { var action = typeof fileName === "string" ? actionOrUndefined : fileName; return ts.isArray(action) ? Promise.all(action.map(applySingleCodeActionCommand)) : applySingleCodeActionCommand(action); @@ -101782,6 +103598,7 @@ var ts; : Promise.reject("Host does not implement `installPackage`"); default: ts.Debug.fail(); + // TODO: Debug.assertNever(action); will only work if there is more than one type. } } function getDocCommentTemplateAtPosition(fileName, position) { @@ -101865,7 +103682,7 @@ var ts; if (!ts.isInComment(sourceFile, matchPosition)) { continue; } - var descriptor = undefined; + var descriptor = void 0; for (var i = 0; i < descriptors.length; i++) { if (matchArray[i + firstDescriptorCaptureIndex]) { descriptor = descriptors[i]; @@ -101976,6 +103793,7 @@ var ts; cleanupSemanticCache: cleanupSemanticCache, getSyntacticDiagnostics: getSyntacticDiagnostics, getSemanticDiagnostics: getSemanticDiagnostics, + getSuggestionDiagnostics: getSuggestionDiagnostics, getCompilerOptionsDiagnostics: getCompilerOptionsDiagnostics, getSyntacticClassifications: getSyntacticClassifications, getSemanticClassifications: getSemanticClassifications, @@ -102014,6 +103832,7 @@ var ts; getCodeFixesAtPosition: getCodeFixesAtPosition, getCombinedCodeFix: getCombinedCodeFix, applyCodeActionCommand: applyCodeActionCommand, + organizeImports: organizeImports, getEmitOutput: getEmitOutput, getNonBoundSourceFile: getNonBoundSourceFile, getSourceFile: getSourceFile, @@ -102021,6 +103840,7 @@ var ts; getApplicableRefactors: getApplicableRefactors, getEditsForRefactor: getEditsForRefactor, }; + var _a; } ts.createLanguageService = createLanguageService; /* @internal */ @@ -102056,7 +103876,7 @@ var ts; */ function literalIsName(node) { return ts.isDeclarationName(node) || - node.parent.kind === 249 /* ExternalModuleReference */ || + node.parent.kind === 252 /* ExternalModuleReference */ || isArgumentOfElementAccessExpression(node) || ts.isLiteralComputedPropertyDeclarationName(node); } @@ -102068,13 +103888,13 @@ var ts; switch (node.kind) { case 9 /* StringLiteral */: case 8 /* NumericLiteral */: - if (node.parent.kind === 145 /* ComputedPropertyName */) { + if (node.parent.kind === 146 /* ComputedPropertyName */) { return ts.isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; } // falls through case 71 /* Identifier */: return ts.isObjectLiteralElement(node.parent) && - (node.parent.parent.kind === 179 /* ObjectLiteralExpression */ || node.parent.parent.kind === 258 /* JsxAttributes */) && + (node.parent.parent.kind === 182 /* ObjectLiteralExpression */ || node.parent.parent.kind === 261 /* JsxAttributes */) && node.parent.name === node ? node.parent : undefined; } return undefined; @@ -102091,20 +103911,20 @@ var ts; function getPropertySymbolsFromType(type, propName) { var name = ts.unescapeLeadingUnderscores(ts.getTextOfPropertyName(propName)); if (name && type) { - var result_7 = []; + var result_6 = []; var symbol = type.getProperty(name); if (type.flags & 131072 /* Union */) { ts.forEach(type.types, function (t) { var symbol = t.getProperty(name); if (symbol) { - result_7.push(symbol); + result_6.push(symbol); } }); - return result_7; + return result_6; } if (symbol) { - result_7.push(symbol); - return result_7; + result_6.push(symbol); + return result_6; } } return undefined; @@ -102113,7 +103933,7 @@ var ts; function isArgumentOfElementAccessExpression(node) { return node && node.parent && - node.parent.kind === 181 /* ElementAccessExpression */ && + node.parent.kind === 184 /* ElementAccessExpression */ && node.parent.argumentExpression === node; } /** @@ -102194,114 +104014,114 @@ var ts; function spanInNode(node) { if (node) { switch (node.kind) { - case 209 /* VariableStatement */: + case 212 /* VariableStatement */: // Span on first variable declaration return spanInVariableDeclaration(node.declarationList.declarations[0]); - case 227 /* VariableDeclaration */: - case 150 /* PropertyDeclaration */: - case 149 /* PropertySignature */: + case 230 /* VariableDeclaration */: + case 151 /* PropertyDeclaration */: + case 150 /* PropertySignature */: return spanInVariableDeclaration(node); - case 147 /* Parameter */: + case 148 /* Parameter */: return spanInParameterDeclaration(node); - case 229 /* FunctionDeclaration */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 187 /* FunctionExpression */: - case 188 /* ArrowFunction */: + case 232 /* FunctionDeclaration */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 190 /* FunctionExpression */: + case 191 /* ArrowFunction */: return spanInFunctionDeclaration(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node)) { return spanInFunctionBlock(node); } // falls through - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: return spanInBlock(node); - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInBlock(node.block); - case 211 /* ExpressionStatement */: + case 214 /* ExpressionStatement */: // span on the expression return textSpan(node.expression); - case 220 /* ReturnStatement */: + case 223 /* ReturnStatement */: // span on return keyword and expression if present return textSpan(node.getChildAt(0), node.expression); - case 214 /* WhileStatement */: + case 217 /* WhileStatement */: // Span on while(...) return textSpanEndingAtNextToken(node, node.expression); - case 213 /* DoStatement */: + case 216 /* DoStatement */: // span in statement of the do statement return spanInNode(node.statement); - case 226 /* DebuggerStatement */: + case 229 /* DebuggerStatement */: // span on debugger keyword return textSpan(node.getChildAt(0)); - case 212 /* IfStatement */: + case 215 /* IfStatement */: // set on if(..) span return textSpanEndingAtNextToken(node, node.expression); - case 223 /* LabeledStatement */: + case 226 /* LabeledStatement */: // span in statement return spanInNode(node.statement); - case 219 /* BreakStatement */: - case 218 /* ContinueStatement */: + case 222 /* BreakStatement */: + case 221 /* ContinueStatement */: // On break or continue keyword and label if present return textSpan(node.getChildAt(0), node.label); - case 215 /* ForStatement */: + case 218 /* ForStatement */: return spanInForStatement(node); - case 216 /* ForInStatement */: + case 219 /* ForInStatement */: // span of for (a in ...) return textSpanEndingAtNextToken(node, node.expression); - case 217 /* ForOfStatement */: + case 220 /* ForOfStatement */: // span in initializer return spanInInitializerOfForLike(node); - case 222 /* SwitchStatement */: + case 225 /* SwitchStatement */: // span on switch(...) return textSpanEndingAtNextToken(node, node.expression); - case 261 /* CaseClause */: - case 262 /* DefaultClause */: + case 264 /* CaseClause */: + case 265 /* DefaultClause */: // span in first statement of the clause return spanInNode(node.statements[0]); - case 225 /* TryStatement */: + case 228 /* TryStatement */: // span in try block return spanInBlock(node.tryBlock); - case 224 /* ThrowStatement */: + case 227 /* ThrowStatement */: // span in throw ... return textSpan(node, node.expression); - case 244 /* ExportAssignment */: + case 247 /* ExportAssignment */: // span on export = id return textSpan(node, node.expression); - case 238 /* ImportEqualsDeclaration */: + case 241 /* ImportEqualsDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleReference); - case 239 /* ImportDeclaration */: + case 242 /* ImportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 245 /* ExportDeclaration */: + case 248 /* ExportDeclaration */: // import statement without including semicolon return textSpan(node, node.moduleSpecifier); - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: // span on complete module if it is instantiated if (ts.getModuleInstanceState(node) !== 1 /* Instantiated */) { return undefined; } // falls through - case 230 /* ClassDeclaration */: - case 233 /* EnumDeclaration */: - case 268 /* EnumMember */: - case 177 /* BindingElement */: + case 233 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 271 /* EnumMember */: + case 180 /* BindingElement */: // span on complete node return textSpan(node); - case 221 /* WithStatement */: + case 224 /* WithStatement */: // span in statement return spanInNode(node.statement); - case 148 /* Decorator */: + case 149 /* Decorator */: return spanInNodeArray(node.parent.decorators); - case 175 /* ObjectBindingPattern */: - case 176 /* ArrayBindingPattern */: + case 178 /* ObjectBindingPattern */: + case 179 /* ArrayBindingPattern */: return spanInBindingPattern(node); // No breakpoint in interface, type alias - case 231 /* InterfaceDeclaration */: - case 232 /* TypeAliasDeclaration */: + case 234 /* InterfaceDeclaration */: + case 235 /* TypeAliasDeclaration */: return undefined; // Tokens: case 25 /* SemicolonToken */: @@ -102331,7 +104151,7 @@ var ts; case 74 /* CatchKeyword */: case 87 /* FinallyKeyword */: return spanInNextNode(node); - case 143 /* OfKeyword */: + case 144 /* OfKeyword */: return spanInOfKeyword(node); default: // Destructuring pattern in destructuring assignment @@ -102344,51 +104164,50 @@ var ts; // `a` or `...c` or `d: x` from // `[a, b, ...c]` or `{ a, b }` or `{ d: x }` from destructuring pattern if ((node.kind === 71 /* Identifier */ || - node.kind === 199 /* SpreadElement */ || - node.kind === 265 /* PropertyAssignment */ || - node.kind === 266 /* ShorthandPropertyAssignment */) && + node.kind === 202 /* SpreadElement */ || + node.kind === 268 /* PropertyAssignment */ || + node.kind === 269 /* ShorthandPropertyAssignment */) && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { return textSpan(node); } - if (node.kind === 195 /* BinaryExpression */) { - var binaryExpression = node; + if (node.kind === 198 /* BinaryExpression */) { + var _a = node, left = _a.left, operatorToken = _a.operatorToken; // Set breakpoint in destructuring pattern if its destructuring assignment // [a, b, c] or {a, b, c} of // [a, b, c] = expression or // {a, b, c} = expression - if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left)) { - return spanInArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left); + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left)) { + return spanInArrayLiteralOrObjectLiteralDestructuringPattern(left); } - if (binaryExpression.operatorToken.kind === 58 /* EqualsToken */ && - ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.parent)) { + if (operatorToken.kind === 58 /* EqualsToken */ && ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) { // Set breakpoint on assignment expression element of destructuring pattern // a = expression of // [a = expression, b, c] = someExpression or // { a = expression, b, c } = someExpression return textSpan(node); } - if (binaryExpression.operatorToken.kind === 26 /* CommaToken */) { - return spanInNode(binaryExpression.left); + if (operatorToken.kind === 26 /* CommaToken */) { + return spanInNode(left); } } if (ts.isExpressionNode(node)) { switch (node.parent.kind) { - case 213 /* DoStatement */: + case 216 /* DoStatement */: // Set span as if on while keyword return spanInPreviousNode(node); - case 148 /* Decorator */: + case 149 /* Decorator */: // Set breakpoint on the decorator emit return spanInNode(node.parent); - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return textSpan(node); - case 195 /* BinaryExpression */: + case 198 /* BinaryExpression */: if (node.parent.operatorToken.kind === 26 /* CommaToken */) { // If this is a comma expression, the breakpoint is possible in this expression return textSpan(node); } break; - case 188 /* ArrowFunction */: + case 191 /* ArrowFunction */: if (node.parent.body === node) { // If this is body of arrow function, it is allowed to have the breakpoint return textSpan(node); @@ -102396,46 +104215,49 @@ var ts; break; } } - // If this is name of property assignment, set breakpoint in the initializer - if (node.parent.kind === 265 /* PropertyAssignment */ && - node.parent.name === node && - !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { - return spanInNode(node.parent.initializer); - } - // Breakpoint in type assertion goes to its operand - if (node.parent.kind === 185 /* TypeAssertionExpression */ && node.parent.type === node) { - return spanInNextNode(node.parent.type); - } - // return type of function go to previous token - if (ts.isFunctionLike(node.parent) && node.parent.type === node) { - return spanInPreviousNode(node); - } - // initializer of variable/parameter declaration go to previous node - if ((node.parent.kind === 227 /* VariableDeclaration */ || - node.parent.kind === 147 /* Parameter */)) { - var paramOrVarDecl = node.parent; - if (paramOrVarDecl.initializer === node || - paramOrVarDecl.type === node || - ts.isAssignmentOperator(node.kind)) { - return spanInPreviousNode(node); + switch (node.parent.kind) { + case 268 /* PropertyAssignment */: + // If this is name of property assignment, set breakpoint in the initializer + if (node.parent.name === node && + !ts.isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent.parent)) { + return spanInNode(node.parent.initializer); + } + break; + case 188 /* TypeAssertionExpression */: + // Breakpoint in type assertion goes to its operand + if (node.parent.type === node) { + return spanInNextNode(node.parent.type); + } + break; + case 230 /* VariableDeclaration */: + case 148 /* Parameter */: { + // initializer of variable/parameter declaration go to previous node + var _b = node.parent, initializer = _b.initializer, type = _b.type; + if (initializer === node || type === node || ts.isAssignmentOperator(node.kind)) { + return spanInPreviousNode(node); + } + break; } - } - if (node.parent.kind === 195 /* BinaryExpression */) { - var binaryExpression = node.parent; - if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(binaryExpression.left) && - (binaryExpression.right === node || - binaryExpression.operatorToken === node)) { - // If initializer of destructuring assignment move to previous token - return spanInPreviousNode(node); + case 198 /* BinaryExpression */: { + var left = node.parent.left; + if (ts.isArrayLiteralOrObjectLiteralDestructuringPattern(left) && node !== left) { + // If initializer of destructuring assignment move to previous token + return spanInPreviousNode(node); + } + break; } + default: + // return type of function go to previous token + if (ts.isFunctionLike(node.parent) && node.parent.type === node) { + return spanInPreviousNode(node); + } } // Default go to parent to set the breakpoint return spanInNode(node.parent); } } function textSpanFromVariableDeclaration(variableDeclaration) { - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && - variableDeclaration.parent.declarations[0] === variableDeclaration) { + if (ts.isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] === variableDeclaration) { // First declaration - include let keyword return textSpan(ts.findPrecedingToken(variableDeclaration.pos, sourceFile, variableDeclaration.parent), variableDeclaration); } @@ -102446,7 +104268,7 @@ var ts; } function spanInVariableDeclaration(variableDeclaration) { // If declaration of for in statement, just set the span in parent - if (variableDeclaration.parent.parent.kind === 216 /* ForInStatement */) { + if (variableDeclaration.parent.parent.kind === 219 /* ForInStatement */) { return spanInNode(variableDeclaration.parent.parent); } // If this is a destructuring pattern, set breakpoint in binding pattern @@ -102457,10 +104279,10 @@ var ts; // or its declaration from 'for of' if (variableDeclaration.initializer || ts.hasModifier(variableDeclaration, 1 /* Export */) || - variableDeclaration.parent.parent.kind === 217 /* ForOfStatement */) { + variableDeclaration.parent.parent.kind === 220 /* ForOfStatement */) { return textSpanFromVariableDeclaration(variableDeclaration); } - if (variableDeclaration.parent.kind === 228 /* VariableDeclarationList */ && + if (ts.isVariableDeclarationList(variableDeclaration.parent) && variableDeclaration.parent.declarations[0] !== variableDeclaration) { // If we cannot set breakpoint on this declaration, set it on previous one // Because the variable declaration may be binding pattern and @@ -102498,7 +104320,7 @@ var ts; } function canFunctionHaveSpanInWholeDeclaration(functionDeclaration) { return ts.hasModifier(functionDeclaration, 1 /* Export */) || - (functionDeclaration.parent.kind === 230 /* ClassDeclaration */ && functionDeclaration.kind !== 153 /* Constructor */); + (functionDeclaration.parent.kind === 233 /* ClassDeclaration */ && functionDeclaration.kind !== 154 /* Constructor */); } function spanInFunctionDeclaration(functionDeclaration) { // No breakpoints in the function signature @@ -102521,26 +104343,26 @@ var ts; } function spanInBlock(block) { switch (block.parent.kind) { - case 234 /* ModuleDeclaration */: + case 237 /* ModuleDeclaration */: if (ts.getModuleInstanceState(block.parent) !== 1 /* Instantiated */) { return undefined; } // falls through // Set on parent if on same line otherwise on first statement - case 214 /* WhileStatement */: - case 212 /* IfStatement */: - case 216 /* ForInStatement */: + case 217 /* WhileStatement */: + case 215 /* IfStatement */: + case 219 /* ForInStatement */: return spanInNodeIfStartsOnSameLine(block.parent, block.statements[0]); // Set span on previous token if it starts on same line otherwise on the first statement of the block - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(block.pos, sourceFile, block.parent), block.statements[0]); } // Default action is to set on first statement return spanInNode(block.statements[0]); } function spanInInitializerOfForLike(forLikeStatement) { - if (forLikeStatement.initializer.kind === 228 /* VariableDeclarationList */) { + if (forLikeStatement.initializer.kind === 231 /* VariableDeclarationList */) { // Declaration list - set breakpoint in first declaration var variableDeclarationList = forLikeStatement.initializer; if (variableDeclarationList.declarations.length > 0) { @@ -102565,23 +104387,21 @@ var ts; } function spanInBindingPattern(bindingPattern) { // Set breakpoint in first binding element - var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + var firstBindingElement = ts.forEach(bindingPattern.elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } // Empty binding pattern of binding element, set breakpoint on binding element - if (bindingPattern.parent.kind === 177 /* BindingElement */) { + if (bindingPattern.parent.kind === 180 /* BindingElement */) { return textSpan(bindingPattern.parent); } // Variable declaration is used as the span return textSpanFromVariableDeclaration(bindingPattern.parent); } function spanInArrayLiteralOrObjectLiteralDestructuringPattern(node) { - ts.Debug.assert(node.kind !== 176 /* ArrayBindingPattern */ && node.kind !== 175 /* ObjectBindingPattern */); - var elements = node.kind === 178 /* ArrayLiteralExpression */ ? - node.elements : - node.properties; - var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 201 /* OmittedExpression */ ? element : undefined; }); + ts.Debug.assert(node.kind !== 179 /* ArrayBindingPattern */ && node.kind !== 178 /* ObjectBindingPattern */); + var elements = node.kind === 181 /* ArrayLiteralExpression */ ? node.elements : node.properties; + var firstBindingElement = ts.forEach(elements, function (element) { return element.kind !== 204 /* OmittedExpression */ ? element : undefined; }); if (firstBindingElement) { return spanInNode(firstBindingElement); } @@ -102589,18 +104409,18 @@ var ts; // just nested element in another destructuring assignment // set breakpoint on assignment when parent is destructuring assignment // Otherwise set breakpoint for this element - return textSpan(node.parent.kind === 195 /* BinaryExpression */ ? node.parent : node); + return textSpan(node.parent.kind === 198 /* BinaryExpression */ ? node.parent : node); } // Tokens: function spanInOpenBraceToken(node) { switch (node.parent.kind) { - case 233 /* EnumDeclaration */: + case 236 /* EnumDeclaration */: var enumDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), enumDeclaration.members.length ? enumDeclaration.members[0] : enumDeclaration.getLastToken(sourceFile)); - case 230 /* ClassDeclaration */: + case 233 /* ClassDeclaration */: var classDeclaration = node.parent; return spanInNodeIfStartsOnSameLine(ts.findPrecedingToken(node.pos, sourceFile, node.parent), classDeclaration.members.length ? classDeclaration.members[0] : classDeclaration.getLastToken(sourceFile)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: return spanInNodeIfStartsOnSameLine(node.parent.parent, node.parent.clauses[0]); } // Default to parent node @@ -102608,25 +104428,25 @@ var ts; } function spanInCloseBraceToken(node) { switch (node.parent.kind) { - case 235 /* ModuleBlock */: + case 238 /* ModuleBlock */: // If this is not an instantiated module block, no bp span if (ts.getModuleInstanceState(node.parent.parent) !== 1 /* Instantiated */) { return undefined; } // falls through - case 233 /* EnumDeclaration */: - case 230 /* ClassDeclaration */: + case 236 /* EnumDeclaration */: + case 233 /* ClassDeclaration */: // Span on close brace token return textSpan(node); - case 208 /* Block */: + case 211 /* Block */: if (ts.isFunctionBlock(node.parent)) { // Span on close brace token return textSpan(node); } // falls through - case 264 /* CatchClause */: + case 267 /* CatchClause */: return spanInNode(ts.lastOrUndefined(node.parent.statements)); - case 236 /* CaseBlock */: + case 239 /* CaseBlock */: // breakpoint in last statement of the last clause var caseBlock = node.parent; var lastClause = ts.lastOrUndefined(caseBlock.clauses); @@ -102634,7 +104454,7 @@ var ts; return spanInNode(ts.lastOrUndefined(lastClause.statements)); } return undefined; - case 175 /* ObjectBindingPattern */: + case 178 /* ObjectBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return spanInNode(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -102650,7 +104470,7 @@ var ts; } function spanInCloseBracketToken(node) { switch (node.parent.kind) { - case 176 /* ArrayBindingPattern */: + case 179 /* ArrayBindingPattern */: // Breakpoint in last binding element or binding pattern if it contains no elements var bindingPattern = node.parent; return textSpan(ts.lastOrUndefined(bindingPattern.elements) || bindingPattern); @@ -102665,12 +104485,12 @@ var ts; } } function spanInOpenParenToken(node) { - if (node.parent.kind === 213 /* DoStatement */ || // Go to while keyword and do action instead - node.parent.kind === 182 /* CallExpression */ || - node.parent.kind === 183 /* NewExpression */) { + if (node.parent.kind === 216 /* DoStatement */ || // Go to while keyword and do action instead + node.parent.kind === 185 /* CallExpression */ || + node.parent.kind === 186 /* NewExpression */) { return spanInPreviousNode(node); } - if (node.parent.kind === 186 /* ParenthesizedExpression */) { + if (node.parent.kind === 189 /* ParenthesizedExpression */) { return spanInNextNode(node); } // Default to parent node @@ -102679,21 +104499,21 @@ var ts; function spanInCloseParenToken(node) { // Is this close paren token of parameter list, set span in previous token switch (node.parent.kind) { - case 187 /* FunctionExpression */: - case 229 /* FunctionDeclaration */: - case 188 /* ArrowFunction */: - case 152 /* MethodDeclaration */: - case 151 /* MethodSignature */: - case 154 /* GetAccessor */: - case 155 /* SetAccessor */: - case 153 /* Constructor */: - case 214 /* WhileStatement */: - case 213 /* DoStatement */: - case 215 /* ForStatement */: - case 217 /* ForOfStatement */: - case 182 /* CallExpression */: - case 183 /* NewExpression */: - case 186 /* ParenthesizedExpression */: + case 190 /* FunctionExpression */: + case 232 /* FunctionDeclaration */: + case 191 /* ArrowFunction */: + case 153 /* MethodDeclaration */: + case 152 /* MethodSignature */: + case 155 /* GetAccessor */: + case 156 /* SetAccessor */: + case 154 /* Constructor */: + case 217 /* WhileStatement */: + case 216 /* DoStatement */: + case 218 /* ForStatement */: + case 220 /* ForOfStatement */: + case 185 /* CallExpression */: + case 186 /* NewExpression */: + case 189 /* ParenthesizedExpression */: return spanInPreviousNode(node); // Default to parent node default: @@ -102703,20 +104523,20 @@ var ts; function spanInColonToken(node) { // Is this : specifying return annotation of the function declaration if (ts.isFunctionLike(node.parent) || - node.parent.kind === 265 /* PropertyAssignment */ || - node.parent.kind === 147 /* Parameter */) { + node.parent.kind === 268 /* PropertyAssignment */ || + node.parent.kind === 148 /* Parameter */) { return spanInPreviousNode(node); } return spanInNode(node.parent); } function spanInGreaterThanOrLessThanToken(node) { - if (node.parent.kind === 185 /* TypeAssertionExpression */) { + if (node.parent.kind === 188 /* TypeAssertionExpression */) { return spanInNextNode(node); } return spanInNode(node.parent); } function spanInWhileKeyword(node) { - if (node.parent.kind === 213 /* DoStatement */) { + if (node.parent.kind === 216 /* DoStatement */) { // Set span on while expression return textSpanEndingAtNextToken(node, node.parent.expression); } @@ -102724,7 +104544,7 @@ var ts; return spanInNode(node.parent); } function spanInOfKeyword(node) { - if (node.parent.kind === 217 /* ForOfStatement */) { + if (node.parent.kind === 220 /* ForOfStatement */) { // Set using next token return spanInNextNode(node); } @@ -103020,8 +104840,7 @@ var ts; message: ts.flattenDiagnosticMessageText(diagnostic.messageText, newLine), start: diagnostic.start, length: diagnostic.length, - /// TODO: no need for the tolowerCase call - category: ts.DiagnosticCategory[diagnostic.category].toLowerCase(), + category: ts.diagnosticCategoryName(diagnostic), code: diagnostic.code }; } @@ -103071,7 +104890,7 @@ var ts; }; LanguageServiceShimObject.prototype.realizeDiagnostics = function (diagnostics) { var newLine = ts.getNewLineOrDefaultFromHost(this.host); - return ts.realizeDiagnostics(diagnostics, newLine); + return realizeDiagnostics(diagnostics, newLine); }; LanguageServiceShimObject.prototype.getSyntacticClassifications = function (fileName, start, length) { var _this = this; @@ -103109,6 +104928,10 @@ var ts; return _this.realizeDiagnostics(diagnostics); }); }; + LanguageServiceShimObject.prototype.getSuggestionDiagnostics = function (fileName) { + var _this = this; + return this.forwardJSONCall("getSuggestionDiagnostics('" + fileName + "')", function () { return _this.realizeDiagnostics(_this.languageService.getSuggestionDiagnostics(fileName)); }); + }; LanguageServiceShimObject.prototype.getCompilerOptionsDiagnostics = function () { var _this = this; return this.forwardJSONCall("getCompilerOptionsDiagnostics()", function () { @@ -103441,7 +105264,7 @@ var ts; if (_this.safeList === undefined) { _this.safeList = ts.JsTyping.loadSafeList(_this.host, ts.toPath(info.safeListPath, info.safeListPath, getCanonicalFileName)); } - return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports); + return ts.JsTyping.discoverTypings(_this.host, function (msg) { return _this.logger.log(msg); }, info.fileNames, ts.toPath(info.projectRootPath, info.projectRootPath, getCanonicalFileName), _this.safeList, info.packageNameToTypingLocation, info.typeAcquisition, info.unresolvedImports, info.typesRegistry); }); }; return CoreServicesShimObject;